Repository navigation
shader: set the 64-UAV-slot DXIL flag when a module declares more than 8 UAVs - #3270
Merged
Merged
Conversation
…n 8 UAVs
DXC sets shader flag 0x8000 when the declared UAV ranges add up to more
than 8 slots, and the validator refuses a module whose declared flags
differ ("Flags must match usage"). DxilModule::finish_compute now sums the
UAV range sizes of its resource records and sets the flag, so it covers
every direct compute and graphics module.
New test native_uav_slots_controls: two source-built compute containers
store to 8 and 9 buffer descriptors from one table. Both must compile and
validate, and compile_dxil must report 8 and 9 UAV bindings. The 8-UAV
case is the negative control (the flag must stay clear); the 9-UAV case
fails validation before this change (declared 0x80010, actual 0x88010).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
R0Y00
approved these changes
Nov 28, 2026
R0Y00
left a comment
Owner
There was a problem hiding this comment.
Independently reviewed 95ee41a7, integration tree 42153a0d on main a166a753. The emitter declares validator 1.6 or later. Summing UAV range sizes at that validator boundary agrees with DXC's module flag collector.
Debug and Release /O2 each passed the eight-versus-nine individual-UAV validation fixture:
ctest --test-dir <build> --no-tests=error -R '^native_uav_slots_controls$' --output-on-failureA temporary source-built emitter probe also checked a single declared array range. Eight elements left flag 0x8000 clear and nine set it. Windows 11 26200.9974, MSVC x64, SDK/DXC 10.0.26100.0. This verification covers DXIL validation and flag emission. The existing eight-UAV runtime manifest limit still applies to the cohort.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #3224
DXC sets shader flag
0x8000(64 UAV slots) when a module's declared UAV ranges add up to more than 8 slots, and the DXIL validator refuses a module whose declared flags differ:The direct emitter never set that bit.
DxilModule::finish_compute(src/dxil_module.h) now sums the UAV range sizes of its resource records and sets the flag above 8. Every direct compute and graphics module goes through this function, so the fix is in one place.Test
New
native_uav_slots_controls(tests/native_uav_slots_check.py): two source-built compute containers store to 8 and 9 buffer descriptors read from one descriptor table. Both must compile and validate, andcompile_dxilmust report 8 and 9 UAV bindings.compile_dxilatc827d8ba+3ea1a79f): 8 UAVs compile; 9 UAVs fail withFlags must match usage,declared=524304, actual=557072(0x80010vs0x88010).Result at
5b0bfdc0(onmain0fe4cebc), Windows 11 build 26300, DXC from Windows SDK 10.0.26100:1/1 Passed(8 UAVs: compiled and validated,9 UAVs: compiled and validated). The branch was then rebased ontomain5033d2d3without conflicts (no upstream change tosrc/dxil_module.h). The test and census were not rerun after the rebase.The fixture declares only single-slot UAVs, so the range-size sum for UAV arrays has no fixture of its own.
Start-up cohort (counts only)
compile_dxil gfx1013-direct-cs@36 --requestsover the 878 untranslated compute requests from #3224, Release build:c827d8ba+3ea1a79f(Debug)5b0bfdc0(Release)Flags must match usagenow compile. That error appears 0 times in the new run.src/direct_compute_cache.cpp). This change gives them valid DXIL but no dispatchable translation.No GPU was used. This is a validation-only change.
AI-assisted (Claude Code).
🤖 Generated with Claude Code