startup: buffer_load_format_* needs the descriptor DATA_FORMAT, which the translator does not track #1809
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#1809
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?
@triggered02 on GitHub · 2026-11-24 19:02 UTC · original
Census group at 1 refused shader (#870). Recorded because it looks like a small missing handler but is blocked on state the translator does not have — the same shape as #1802 (gather4).
Problem
tools/startup/gfx2hlsl.pyhasop_tbuffer_load_format_*(MTBUF) andop_buffer_load_dword*(MUBUF dwords), but no MUBUF typed-format load.Stage.buffer_address()already handles theoffaddress form correctly (address = offset, no index/offset enable), so the address path is not the blocker.Why it is not a small handler
MTBUF and MUBUF differ exactly where it matters:
tbuffer_load_format_*carries the format in the instruction (format:[BUF_FMT_…], whichStage.tbuffer()reads and maps through its table), whilebuffer_load_format_*has no format field — the format comes from the resource descriptor'sDATA_FORMATbits (WORD0[11:8]… per the RDNA 2 resource descriptor), which is loaded at run time.Stage.descriptor()only tracks symbolic keys —('desc', source, byte offset, dword index)— never the descriptor's contents:So at translation time the format of
s[32:35]is unknown. Picking one (for example assumingBUF_FMT_32_32_32_FLOATbecause the destination is three dwords) would emit a load whose interpretation is a guess, and a wrong typed load is silently wrong data — worse than a refusal, and exactly the class of defect the reviews have been catching.Deliverable
Lower
buffer_load_format_{x,xy,xyz,xyzw}in a slice that first establishes how the descriptor's DATA_FORMAT becomes known, one of:DATA_FORMATand reuse theStage.tbuffer()format table — but note the MUBUF rules differ from MTBUF for some formats and the table must be extended deliberately, with refusals for the rest);descriptor().Either way:
docs/experiments.md.Done when
AI-assisted (Claude Code).
@triggered02 on GitHub · 2026-11-26 03:21 UTC · original
Closing as implemented on main. This was the MUBUF typed-format load gap, and it landed via #2138 (31f70a1 startup: lower buffer_load_format_x/xy/xyz with the format from the buffer descriptor) plus the compute-side follow-up
1e4e1451shader: lower startup compute formatted buffer reads.What main does now, instead of refusing:
Verified just now on current main (
7967c5af) in a clean worktree:cmake --build --preset dev --target startup_buffer_format_word3_check # exit 0 ctest --preset dev --no-tests=error -R '^startup_buffer_format_word3' 1/2 startup_buffer_format_word3 ................... Passed 2/2 startup_buffer_format_word3_mapping_control ... Passed 100% tests passed, 0 tests failed out of 2 python -B tests/startup_buffer_format_word3_table_check.py buffer format word 3 table: 14 DXGI formats match the translationThe mapping_control variant is a WILL_FAIL control, so the mapping assertion is pinned rather than incidental. If a specific BUF_FMT* still refuses in a census run, that is the word-3 decode refusing a format it cannot represent � please reopen with the form and the descriptor format, not with the generic MUBUF gap.