shader: bind a single directly indexed heap flag as a descriptor table #3442
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3442"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by Leyukaka on 2026-11-29T09:09:37Z.
Replaces #3221. Branch
compute-single-heap-table(66c3aec0,214ebfa6), based on main212d4b5f.git merge-treewith main184b15dbis clean. The first commit is @tedin7's commit from #3221 (3114bb15there,66c3aec0here), cherry-picked with the same changes and tedin7 as author. The second answers the open review items there.What changes
src/gfx1013_compute_native.cpp(tedin7): the directly indexed heaps were bound as descriptor tables only when both root flags were set (0xc00) and exactly two user SGPRs were left. Each flag now binds its heap on its own:0x400binds the resource heap atnext,0x800binds the sampler heap there, and0xc00binds both, resource heap first. The heaps bind only whennext + heap_count == user. In any other case the heap stays unbound and the load is refused with "direct descriptor address outside bound table", as before.tests/native_wave_request_check.py(tedin7): the heap-slot stride program also runs withRootFlags(CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED)and 11 user SGPRs. The same words with 12 user SGPRs must be refused and write no.cso.tests/native_sampler_heap_check.py(tedin7): a sampler-only root (SAMPLER_HEAP_DIRECTLY_INDEXED, 6 user SGPRs) runs the sampler fixture.tests/native_sampler_heap_check.py(this PR): a sampler-only root with 5 user SGPRs (user == next, no SGPR left for the heap) must be refused with "direct descriptor address outside bound table" and write no.cso. This is the case for==changed to>=, which the #3221 cases do not catch (by reading; that mutation was not run). The check is placed before the first fixture call, so an adapter that later skips with 77 still evaluates it (by reading).docs/experiments/native-sampler-heap.md(this PR): describes the0x400,0x800and0xc00forms and thenext + heap_count == userrule, removes the line saying0x800-only roots are not covered, and adds the reproduction command.Evidence
Tests covering the change:
native_wave_request_hardware(CMakeLists.txt), andnative_sampler_heap_warp/native_sampler_heap_hardware(tests/cmake/native_sampler_heap.cmake).Release build of the branch head (base
212d4b5f), one run: 2 passed, 1 skipped.native_wave_request_hardware: Passed.native_sampler_heap_hardware: Passed.native_sampler_heap_warp: Skipped, exit 77.Not covered
184b15db. After212d4b5f, main changedsrc/gfx1013_compute_native.cpp; the merge is textually clean.nextis inferred fromtools/startup/gfx2hlsl.pyStage.setup_entry, not from a documented ABI. The fixtures read where the translator binds, so the GPU runs check D3D12 behaviour, not the guest layout.tests/native_wave_request_check.pyruns after the GPU fixture, so it is not reached when the fixture returns 77 first.CI
On main
184b15dbtheprCTest preset filter matches none of the three tests, soBuild and test on Windowsdoes not run them.