Repository navigation
Shader: translate fixed-format D16 buffer loads - #1302
Conversation
|
Tested 761c532 on Linux (WSL2 Ubuntu), Python 3.12, CPU only: pass. |
|
Code review of 761c532: looks correct, no changes requested. The change only adds the four names to the MTBUF dispatch, which already forwards to
The last row repeats x into y/z/w. That matches SHADER-86 ( On 761c532 (Windows, Python 3.12): AI-assisted review (Claude Code). |
|
The Windows Runtime job on 761c532 and the same job on the base commit both failed only |
|
Correction to my 32_FLOAT draw control in the description. The recorded GPU image was real, but its expected repeat-X result modeled the old translator, not native MTBUF. I have now run the instructions on gfx1036 in wave32 and wave64 with distinct channel selectors, plus ordinary MUBUF as a control. MTBUF ignores the descriptor selectors and returns X000 for a one-component instruction format and XY00 for two. The four-component path should likewise ignore non-identity V# selectors. I'm correcting this shared path and will rerun the draw and regressions on this PR. AI-assisted. |
|
Tested Independent Linux measurement at A synthetic wave fixture read the word
This confirms the descriptor-selector problem in your correction for the packed RGBA8 path too. Changing only the selector bits still swaps the bytes on this head. The native behavior you reported predicts the identity columns for both descriptors. The three synthetic shaders passed AI-assisted verification. |
Native RDNA2 ignores descriptor selectors for MTBUF and supplies zero for absent components. Preserve runtime descriptor swizzles for MUBUF and cover both paths with the same conflicting selectors.
|
@tylerstraub, I pushed 7adce0d with the selector correction. Could you rerun your four-width X/Y-swap fixture on the RTX 5090? Both descriptors should now produce the four words/pairs in your identity column. On RTX 5080 and Radeon gfx1036 I reran the source-built guest with an identity and a WXYZ descriptor. With a four-component format the rotated descriptor previously gave 2,544 incorrect pixels on each GPU. With a one-component format, both descriptors previously disagreed with native X000 at those same 2,544 pixels. All eight 64×64 images now match their CPU expectations, with zero Vulkan validation messages carrying a VUID. The 16 assembled RGBA8 packed compute fixtures also matched all 2,048 words per GPU. I corrected the draw description in the PR. AI-assisted. |
|
Tested 761c532 on NVIDIA GeForce RTX 3090 (Ampere, subgroup 32..32), driver 610.88 (Vulkan 1.4.341), Windows 11 Pro 26300: pass, no change on the GPU. The PR's diff applied cleanly to
No game files. |
|
Tested 761c532 on NVIDIA RTX 4070 SUPER, 621.24, Windows 11 (26300), MSVC BuildTools 2022, Vulkan SDK 1.4.363.0: pass
AI-assisted run. |
|
Tested I reran the four-width X/Y-swap fixture on the corrected head at your request. All 24 checked words matched on Linux 7.0.0-43-generic with RTX 5090, NVIDIA 595.99.02, llvm-mc 21.1.8 and SPIRV-Tools 2026.1. The format-44 identity, format-50 identity and format-44 swapped X/Y descriptors each produced the same pairs for the RGBA8_UINT instruction:
This confirms the corrected translator ignores the swapped descriptor selectors for these MTBUF instructions and preserves the seeded high halves and adjacent register where applicable. All three modules passed SPIR-V validation, and the 25 formatted-load semantic tests passed. The GPU check covered the synthetic wave32 RGBA8_UINT fixture. AI-assisted verification. |
Claimed in the coordination issue as packed MTBUF loads.
Depends on: #1275 (merged).
What and why
A vertex shader can encode its fetch format in
tbuffer_load_format_d16_{x,xy,xyz,xyzw}. All four instructions previously producedUnsupported. Route them through the existing fixed-format decoder and packed register writer. This keeps the instruction's format authoritative even when the V# declares a different format. The default when LLVM omits the modifier is 8_UNORM.Tested
Unsupportederrors before this change. The selector regression additionally failed six fixed-format subcases on 761c532. All 25 buffer-format tests passed on 7adce0d, including ordinary MUBUF as a descriptor-controlled comparison. The full semantic suite ran 1,174 tests with one skip, and the translator suite passed 365 with two skips.gta6rt --run, and the guest copied a 64×64 target back after a fence. The CPU image matched all 4,096 pixels on both GPUs. On native gfx1036, fixed-format MTBUF returned X000, XY00, XYZ0 or XYZW according to the format. This held for packed and regular FLOAT loads with identity and WXYZ descriptors at both wave sizes. In the guest, changing only the instruction to 32_FLOAT now writes X000: exactly 2,544 geometric pixels changed and 1,552 clear pixels stayed identical. Rotating the V# selectors to WXYZ left both predicted images unchanged. On 761c532 the rotated descriptor disagreed with the CPU image at 2,544 pixels for either format on each GPU. On 7adce0d all four combinations matched all 4,096 pixels on each GPU. Vulkan validation reported no VUID.Checklist
docs/design.md.AI-assisted.