shader: accept idxen offen raw loads through a reflected table record #3705
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3705"
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 lukaslw-lab on 2026-12-01T06:38:56Z.
Change
Graphics raw buffer loads (
buffer_load_dword*) accepted IDXEN or OFFEN, not both. With both set, the second address VGPR is a byte offset inside the indexed record:The stride comes from the reflected table SRV, as it already does for IDXEN alone. The offset is dword-aligned like the unindexed raw path. A load reads zero when the index is past the view or the access does not end inside the record, as a structured-buffer read does.
The mesh lowerer now passes its reflected container stage to the shared ALU (
alu.graphics_interface), which VS and PS already do. Without it, a mesh IDXEN load always stopped atindexed raw load needs a reflected table SRV. Nothing else reads that field.This is item 3 of #3703. On the 6 captured slot 86 requests that stopped at
raw buffer load needs offen with zero scalar offset and no modifiers, with #3702 and #3704 also applied, all 6 now pass the load. Their next refusal is a lane-mask block,s_xor_b64 s[20:21], vcc, -1followed bys_and_saveexec_b64. Refs #3703, #3641.Not in this PR: binding the view in the slot 86 runtime.
native_mesh86.inlaccepts onlybuffer_srv,raw_vector_srv,byte_window_srvandroot_buffer_srvfor a mesh SRV. A pipeline that usesindexed_raw_srvwould still be refused at creation (unsupported native Mesh86 SRV shape).d3d12_draw.inl,expected_stride). The slot 86 binder needs the same check.Verification
Build
releaseat this branch (Windows 10 19045, MSVC 2022, DXC 1.9.2609):42 of the 43 also fail on this host with
main's sources (Windows 10 without the Agility SDK; NVIDIA RTX 3080 Ti, driver 32.0.16.1047, debug layer on;pixel_aot_*use the local LLVM tools). The 43rd,pixel_aot_core_vector_warp, failed once in the parallel run and passed 3 of 3 alone with this change; it does not use the native lowerer.New cases in
native_direct_container_check.py, next toindexed-pixel-record-*:indexed-offset-pixel-record-16: record 1, byte 8, immediate 4. Checks the dword mask, theule 8in-record bound (16 − 4 − 4) and the added offset.indexed-offset-pixel-record-4and-0: refused,outside a verified dword-aligned record.Controls:
raw buffer load needs offen with zero scalar offset and no modifiers.Evidence and follow-up
Source-built words only. The counts on captured requests are local and offline (
compile_dxil ... gfx1013-container-ms-texture-heap).Checklist
AI-assisted.
🤖 Generated with Claude Code
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-01T08:43:35Z.
Review: APPROVED
Reviewed reflected record stride validation and the within-record byte offset guard. The native_direct_container and native_direct_mesh fixtures passed in the integration. Slot 86 runtime view binding remains a follow-up.