SHADER-257 (@Vonsek's finding, claimed in #1380).
What and why
FORMATS in tools/rdna2spirv.py had 20 / 62 / 75 (32-bit UINT x1 / x2 / x4) but none of their SINT twins 21 / 63 / 76. It also lacked 72 / 73 (32_32_32 UINT / SINT), although 74 (32_32_32_FLOAT) is there. So a buffer_load_format, buffer_store_format or tbuffer_* going through one of these formats raised format N (not in FORMATS).
A 32-bit SINT component holds the same bits as UINT: no conversion, and nothing to clamp at full width. So all five use the existing raw-dword u32 path. Codes are from tools/gfx10_formats.json (Mesa's GFX10_FORMAT): 21 32_SINT, 63 32_32_SINT, 72 32_32_32_UINT, 73 32_32_32_SINT, 76 32_32_32_32_SINT.
Tests
test_int32_buffer_formats_load_and_store_raw_bits runs each UINT/SINT pair for 1–4 components through a load and a store, with negative and NaN-like words, under spirv-val and the mini interpreter.
- On a load, missing channels repeat the format's own, as SHADER-86 measured.
- On
main, the four SINT cases fail as unsupported. tests/test_translate.py+test_gfx10_descriptors.py+test_mem_diff.py: 440 passed, 2 skipped.
Corpus note
On my 1.0.2.1 copy (counts only), the 26,503 disassembled shaders name only five tbuffer formats statically: 16_16_SNORM, 8_8_8_8_UNORM, 8_8_8_8_UINT, 2_10_10_10_UNORM and 16_16_16_16_UINT. These five new codes can only arrive through a runtime V#, so this closes a gap rather than fixing a shader that fails today.
Windows 11 Pro 26200, Python 3.14, LLVM 23.1.3 llvm-mc, spirv-val from SPIRV-Tools; CPU only (mini interpreter), not run on a GPU. No game data in the PR.
By @rafaelpssz, with Claude Code (AI-assisted).
Activity
132Closing in favour of @tylerstraub's #1549. That PR claimed SHADER-257 first (I missed the overlap note), and it also handles signed D16 loads and stores, which this PR leaves zero-extended, as @tylerstraub's RTX 5090 run here shows. Thanks for testing it. Format 72 is covered by #1529.
Tested
b5025e8450f5c7903015b03b553811e4047bb035on NVIDIA GeForce RTX 5090, 595.99.02 (Linux).I assembled the synthetic
cs_fmt_sint32fixture from #1549 at6f634749with this PR's translator and ran it with this PR's Vulkan harness. The module passedspirv-val.0xffffffff, 0x0011fffffor signed expectations of0x7fff8000, 0x0011fffd.0x0000fffd, 0x00008000; the fixture expects0xfffffffd, 0xffff8000.This is the same D16 difference observed on #1547. The rebased #1549 run matched all 64 words. This fixture covers the signed formats. Format 72 (32_32_32_UINT) also has a separate implementation and fixture in #1529.
Tools were llvm-mc 21.1.8 and SPIRV-Tools 2026.1 on Linux 7.0.0-43-generic. This compares translated SPIR-V on NVIDIA against the synthetic fixture's expectations. Native RDNA2 D16 behavior remains unverified by this run.
AI-assisted verification.