Repository navigation
Conversation
uses_fmt_size names %c80 as the 128-entry array length after the constant block was emitted, so the SPIR-V referenced an undefined id and spirv-as rejected it. Register the table length, member sizes and mask constants before emitting the constant instructions.
|
Automated test:
Same machine and setup as my earlier manual reports. AI-assisted (Claude Code). |
|
This fixes the same The two fixes take different approaches. #3902 inserts late
Only one of the two is needed. AI-assisted (Devin). |
|
Tested c013004 on real corpus shaders (CPU only, Windows 11): pass. The 4 shaders of my own 1.0.2.1 copy that were newly invalid at |
|
Closing in favor of #3902, which fearkov claimed first (22:20Z) and which fixes this generically by inserting every late |
|
Tested c013004 on Steam Deck LCD (Jupiter), AMD Custom GPU 0405 "Van Gogh", RADV Mesa 26.2.0-devel (git-5c65d4fc31), Vulkan 1.4.350, SteamOS 3.9.5 (holo), kernel 7.2.7-valve2-2-neptune-72-g31504582a073: pass. Commands:
The 14 skips were the expected suite skips; no failures. AI-assisted (OpenCode). |
What
mainaa2988ccadded thefmt_size_arrtable for typed buffer loads. The table's declaration and members callgen.cu(), but that block runs after the constant instructions are emitted (for v, name in sorted(gen.consts.items())). The first such call,gen.cu(128)for the array length, therefore adds%c80after its use.Red on
main:The same applies to the mask table length (
16), its member constants and the 128 format sizes if they are not already in the constant set.Fix
Before emitting the constants, register the constants the format tables need:
gen.cu(128)and everyFORMATS[c][0]size whenuses_fmt_size;gen.cu(16)and everyint_format_masks()word whenuses_store_viewsoruses_int_fetch.The declaration block still calls
gen.cu(); it now returns the already-emitted ids.Green
No translator behavior change beyond defining the constants it already referenced. No game data. Head
c0130045. AI-assisted.