shader: raw buffer loads with an SGPR offset or without a VGPR address in the direct compute path #3145
Labels
No labels
accessibility
awaiting author
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
priority: P0
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/R0Y00--Xbox2Windows#3145
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@JB2WIN on GitHub · 2026-11-27 18:17 UTC · original
Part of #2935 (instruction coverage of the direct compute path).
Problem. The direct C++ compute frontend accepts raw MUBUF loads (
buffer_load_dword,_dwordx2,_dwordx3,_dwordx4) only withoffenand a zeroSOFFSET(src/gfx1013_compute_native.cpp, "raw buffer load needs offen with zero scalar offset and no modifiers"). Loads addressed by the scalar offset alone (off) or with a nonzeroSOFFSETare refused, although the direct lowering already addsinst_offsetandSOFFSET(and the VGPR offset whenoffenis set), as it does for raw stores, which the decoder already accepts in that form.On a local start-up capture (counts only,
compile_dxil --refusals, 2,689 slot 67 requests), this refusal is the first one for 80 requests; most areoffor nonzero-SOFFSETloads without cache modifiers.Semantics. RDNA 2 ISA (30.11.2020), 8.1.5 Buffer Addressing and Range Checking (PDF page 61): address = base + SGPR offset + (inst_offset + VGPR offset); for raw buffers (OOB_SELECT 3)
num_recordsis reduced by the SGPR offset, so a byte address of SGPR offset + offset checked against the view's size gives the same result while the SGPR offset does not exceednum_records.Plan. In the direct path only, accept raw loads with
offoroffenand any numericSOFFSET(an SGPR, M0 or an inline constant), under the same addressing rules as raw stores.idxen,glc,dlc,slc,ldsandtfestay refused, and so does the HLSL path. Test: source-built requests throughnative_store_replayon hardware (offwith an SGPR offset,offenwith an SGPR offset,dwordx2/x4), plus refusal controls.I'm taking it; a PR follows. Environment: Windows 11 build 26200, NVIDIA GeForce RTX 3080.
AI-assisted.
@Leyukaka on GitHub · 2026-11-27 20:17 UTC · original
Taking this over since there has been no activity for 2 h; will hand back if you resume. Credit to @JB2WIN for the issue and the plan.
The PR keeps
m0refused assoffset, as well asglc/dlc,slc,idxenand inline floats. The direct emitter already addsoffen, the immediate offset andsoffset, so the change is in the shared decoder, for direct compute only. On a local capture of 2,689 compute requests onmaina5dad843, 403 compile before and 409 after, with none lost. PR to follow.AI-assisted.