Repository navigation
Tests: a compute dispatch that samples through set 0 (d3d12_set0_compute_test) - #1698
Conversation
…ute_test) Since ItsNotRexed#1489 the layer binds the device's bindless set at every dispatch as well as at every draw, but only the draw has a test (d3d12_m2_textured_test): d3d12_compute_test takes the binding-free index entry on purpose, and d3d12_descriptor_test samples through set 0 with a Vulkan pipeline of its own. This test covers the compute bind point through D3D12 alone: a compute PSO whose index entry lists set-0 bindings, two SRVs, bytes no view was made for, and a wrapping and a clamping sampler. Four dispatches of test/glsl/cs_set0_sample.comp (GLSL written to the translator's contract) load the T# and the S# from the descriptor tables, find them in the hash table and sample: the two textures texel for texel, the fallback image for the unknown bytes, and the right edge with the clamping sampler. A device without the bindless set refuses the PSO. Registered with ctest like its neighbours (exit 77 is a skip). With the vkCmdBindDescriptorSets call of the compute bind point removed from replay, this test fails (VUID-vkCmdDispatch-None-08600, on llvmpipe). Checked with a mingw-w64 build under Wine on llvmpipe, an RDNA2 integrated GPU and an RX 7900 XTX (RADV), with the validation layer: exact, no validation errors. Not built with MSVC. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
|
Independent native Windows verification (AI-assisted). I checked the open head The stock For GPU verification I used a disposable valid-only fixture with the same production runtime, byte-identical shader module, ordinary D3D12 compute PSO and four dispatches through the Xbox-ABI device proxy. I omitted the deliberate PSO refusal and did not run any missing-bind mutation. Before submission I checked that both SRV keys and both ordinary sampler keys resolved to distinct nonzero indices, and the eight initialized dwords in the third view slot resolved to index 0. The fallback is a bound 1x1 RGBA8_UNORM view in GENERAL, cleared to zero and made visible before replay. That dispatch uses the registered wrapping sampler. The clamp case uses the second ordinary sampler and the first SRV.
Both exited 0 with 256/256 exact texels and zero validation errors. Readback also confirmed that changing only the SRV or only the sampler changed the output. Runs were serial, each with one process-local ICD and an empty implicit-layer directory. |
|
Independently verified commit
AI Assisted. |
|
Tested
Synthetic inputs only. AI-assisted testing. |
|
Tested
AI-assisted (ZCode agent): builds and runs executed by a coding agent on this machine. |
|
Tested on Windows 11 with two GPUs on one machine (runtime built from this PR's head, MSVC 14.51): pass. |
Claimed in the coordination issue as: finding + claim (no item ID yet)
What and why
Since #1489 the layer binds the bindless set 0 at dispatches as well as at draws, but no test runs a D3D12 compute dispatch through set 0:
d3d12_compute_testtakes the binding-free index entry on purpose.d3d12_descriptor_testsamples through set 0 with a Vulkan pipeline of its own, not throughCreateComputePipelineStateandDispatch.d3d12_m2_textured_testcovers the bind at draws only.So the bind at dispatches can be removed without any test noticing (measured, see "Mutation" below).
This adds
d3d12_set0_compute_test. No layer code changes: the test passes onmainas it is.test/glsl/cs_set0_sample.comp, GLSL written to the translator's contract.runtime/README.mdanddocs/d3d12_vulkan.md.Why it matters: 2,255 of the 2,689 compute shaders in the corpus declare set-0 bindings. That is a count over my own copy, from the translator's
index.json.Tested
Commit
705a40bonmaina0acd33. Linux 7.3.5, Mesa 26.3.1 (RADV; llvmpipe on LLVM 23.1.5), Vulkan 1.4.363, GCC 16.2.1. The Windows-only tests are cross-built with mingw-w64 (GCC 16.2.0) and run under Wine 11.22 with the Khronos validation layer on the host side.d3d12_set0_compute_testd3d12_m2_textured_test,d3d12_translated_draw_test,d3d12_compute_test,d3d12_draw_testctestd3d12_clear_test,d3d12_descriptor_test(line 477),d3d12_fence_timing_testandd3d12_present_test(line 414, the GDI screen pixel). They are limits of mingw and Wine: this PR touches neither them nor the layer, and the same four failed onmain99f9989here.d3d12_copy_xfmt_test,d3d12_m3_frame_testandd3d12_vulkan_device_test.scripts/run_gpu_tests.pywas not run: the change touches neither the translator nor the test tools.tests/test_ctest_registration.py: pass.Mutation (llvmpipe only, because an unbound set is invalid GPU work), on this commit:
vulkan_replay.hd3d12_set0_compute_testd3d12_m2_textured_testVUID-vkCmdDispatch-None-08600orVUID-vkCmdDrawIndexed-None-08600and the test process crashes in llvmpipe.Not tested
/W4 /permissive-); CI'swindowsjob is its first such build.Checklist
docs/design.md, with how it was confirmed. (No translator change.)AI-assisted (Claude Code, Claude Fable 5.2).
🤖 Generated with Claude Code