Repository navigation
TEST-599: give d3d12_subgroup_test a --pc-tail-ubo variant - #3279
1TrickOmen wants to merge 9 commits into
Conversation
…ush-constant devices A device whose maxPushConstantsSize is 128 (AMD Windows driver on RDNA2 iGPUs, some Intel Arc drivers; D3D-14's push_constants_need_fallback) cannot hold the 144-byte ShaderUserData push-constant block, so previously every D3D12 PSO was refused there with E_NOTIMPL. With --pc-tail-ubo (PR ItsNotRexed#2046), translated shaders keep s0..s31 in 128 push-constant bytes and move the 16-byte tail (heap base, code base) to a uniform block at set 1, binding 0 when a stage reads it. This wires that path through the D3D12 -> Vulkan layer: - runtime/src/shader_library.h: ShaderEntry parses pc_tail.bytes into pc_tail_bytes (tested in shader_library_test). - runtime/src/vulkan_replay.h: ComputePipeline and GraphicsPipeline carry push_bytes, tail_set and tail_offset; detail::bind_user_data binds set 0 (if present), set 1 with dynamic offset (if present), and pushes push_bytes at all three push sites (ExecuteIndirect dispatch, Dispatch, Draw); the three unsupported checks cover tail_set. - runtime/shims/d3d12_vulkan_device.cpp: DeviceState::pc_tail creates one UNIFORM_BUFFER_DYNAMIC descriptor over the arena (range 16) plus an empty set-0 layout once per device. PipelineState::user_data_layout sizes the push-constant range from each stage's push_constant_bytes / pc_tail_bytes (so a --pc-tail-ubo stage that reads neither heap nor code base still fits 128 bytes), adds set 1 when any stage has pc_tail, writes the 16-byte tail once into the arena, and releases it on destruction. 144-byte shaders remain refused on <144-byte devices with a log pointing to --pc-tail-ubo. - Tests: d3d12_compute_test and d3d12_draw_test verify 144-byte refusal and --pc-tail-ubo dispatch/draw (including VS without pc_tail + PS with set-1 tail) on both simulated 128-byte devices and the host GPU, and skip the 144-byte passes when run on a real 128-byte device. - Docs: docs/d3d12_vulkan.md (sections 3.2, 5.2, Q13) and d3d12_com.h comment updated. Step 3 of the uniform-buffer tail claimed in ItsNotRexed#1902. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Co-Authored-By: Gemini 4 Neon <noreply@google.com>
# Conflicts: # docs/design.md # runtime/shims/d3d12_vulkan_device.cpp
|
Tested 0a3df64 under Wine 11.21 (Fedora 45) on AMD Radeon 610M iGPU (RDNA2 gfx1036, RADV Mesa 26.2.6, subgroup 32..64) and NVIDIA RTX 4070 Ti (615.78.08, subgroup 32..32): fail,
Full ctest (cross-built with clang-cl + xwin, MSVC 14.44 / SDK 10.0.26100):
Bisect:
Cause: #2109 made the graphics PSO stages - if (!user_data_layout({stages[0].entry, stages[1].entry}, user)) return E_NOTIMPL;
+ if (!user_data_layout({stages[0].entry, stages[1].entry, stages[2].entry}, user)) return E_NOTIMPL;With that line changed locally (not pushed): Not run: AI-assisted (Claude Code); numbers copied from the run logs. |
|
Applied, thanks — the one-line fix is in (commit f431351). Verified on Windows 11, RX 9070 (Adrenalin 26.11.1) and Ryzen 7 7700X iGPU (26.10.1), validation on: d3d12_draw passes on both (tail VS+PS PSO 4096/4096 matched, plus the rest of the draw suite), d3d12_subgroup passes on both (9070: 4 judged exact, iGPU: 3 judged exact). |
|
Tested on Windows 11 with two GPUs on one machine (runtime built from this PR's head merged with main f847748, MSVC 14.51; the head still carries #2046 and #2402):
Only these four tests were built and run, not the full ctest. |
|
Tested f431351 under Wine 11.21 (Fedora 45) on AMD Radeon 610M iGPU (RDNA2 gfx1036, RADV Mesa 26.2.6, subgroup 32..64) and NVIDIA RTX 4070 Ti (615.78.08, subgroup 32..32): pass. The fix resolves the
Full ctest:
Not run, as before: AI-assisted (Claude Code); numbers copied from the run logs. |
|
Windows + GPU check: AMD Radeon RX 9070 (RDNA4), Windows 11, MSVC Release, Vulkan SDK 1.4.363. Tested head 0a3df64 merged onto
So the failures look like load-related flakiness in the parallel run, not this PR, but I'm reporting the parallel result as it was. AI-assisted (Claude Code); runs on my machine. |
|
Tested
This GPU has 256 bytes of push constants, so the UBO-tail path runs here because the test forces it, not because the device needs it. AI-assisted (Claude Code). No game files. |
# Conflicts: # docs/d3d12_vulkan.md # docs/design.md # runtime/shims/d3d12_vulkan_device.cpp # runtime/src/vulkan_replay.h # runtime/test/d3d12_compute_test.cpp # runtime/test/d3d12_draw_test.cpp
|
Tested 7473165 on Windows 11 (MSVC BuildTools 2022, Ninja, RelWithDebInfo, -j 4; no Vulkan validation layer installed), one GPU at a time, device line confirmed: AMD Radeon RDNA2 iGPU (driver 26.10.1) and NVIDIA RTX 5080 (driver 616.92). Ran AI-assisted. |
|
Tested The merge Words constants = at(uvec2(table.w[0], table.w[1]));
Words code = at(CODE_BASE);
result.w[i] = pc.s[4] + pc.s[5] * i + constants.w[i % 4] + code.w[1];At |
|
Tested on NVIDIA GeForce RTX 5080, driver 621.24, Windows 11: could not run (build failed) Checked out PR head Same failure for Likely a truncated or conflicted |
TEST-599: give d3d12_subgroup_test a --pc-tail-ubo variant
Claimed as TEST-599 in #3047.
This branch is stacked on #2046's head bf1c90e and #2402's head d230040, so the PR diff still shows those commits until they land; it will be rebased once they merge.
Depends on: #2046
Depends on: #2402
What and why
d3d12_subgroup_test built 144-byte push-constant shaders, so it failed on devices limited to Vulkan's 128-byte minimum with
pipelines need 144 bytes of push constants. It now uses --pc-tail-ubo modules throughout, the same path #2402 proved for d3d12_compute and d3d12_draw:Only synthetic GLSL and index metadata changed. No game data, keys or decryption.
Tested
AI-assisted. Windows 11, RX 9070 (Adrenalin 26.11.1) and Ryzen 7 7700X iGPU (26.10.1), LEONIDA_VK_VALIDATION=1: d3d12_subgroup exits 0 on both, all three cases exact, fragment probe 64, ps 4096/4096 exact; iGPU 3 shaders judged exact, 9070 4 shaders judged exact (the pixel readlane is judged on the 9070, which can require 64 for a wave64 pixel shader). Full ctest: 100% passed out of 129 (7 skipped/disabled, no failures).