shader: lower unsigned 16-bit pair vertex fetches (BUF_FMT_16_16_UINT) #2305
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2313"
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 denn0x on 2026-11-25T11:56:56Z.
What
tbuffer_load_format_*with gfx10 format 27 was refused as an unknown buffer format intools/startup/gfx2hlsl.py. LLVM 15 defines the format asBUF_DATA_FORMAT_16_16withBUF_NUM_FORMAT_UINT(ufmt).It now reads two unsigned 16-bit fields through
ldu(), the low half into X. Z = 0 and W = 1, like the other integer rows. Only the tbuffer table row is added. The DXGI stream-layout mapping is unchanged.Test
tests/startup_vertex_fetch_formats_check.pygains the format and three mutated translations:The format uses stride 6 and offset 2, so half of the 16 elements cross a dword.
These are the commands behind
startup_vertex_fetch_formats_(controls|warp|hardware).On
main,controlsfails withgfx2hlsl.Unsupported: buffer format BUF_FMT_16_16_UINT.Environment
allbuilds (Ninja Release, MSVC Build Tools 18).Other checks:
startup_stream_fetch_check.py,startup_gfx2hlsl_tbuffer_16f_check.pyanddocs_links_check.pypass.docs/experiments.mdlists the new format and the device result.Refs #2023 (item G)
Imported from R0Y00/Xbox2Windows. Originally posted by tedin7 on 2026-11-25T12:00:15Z.
Review: COMMENTED
Review of head
34ff4a6b1de4f5f45b1ba7032d5a2063dcc5156b(comment only, no approval).Result: P1=0, P2=0. One nit.
What I checked
BUF_FMT_16_16_UINTmatches the gfx10 unified table: 23 UNORM, 24 SNORM, 27 UINT, 29 FLOAT. The sibling rows already inFETCH_FORMATSand the test table agree with that numbering.tools/startup/gfx2hlsl.py:138:ldu()thenw & 65535u(X),w >> 16(Y),0u,1u. Right for unsigned 16-bit pairs. W=1 as an integer matches8_UINTand8_8_8_8_UINT. Thew >> 16is a logical shift becausewis uint, so no sign issue.ldu()path is exercised.FETCH_DXGImapping is unchanged, and the PR says so.Commands run locally (worktree at the head SHA)
python3 -B tests/startup_vertex_fetch_formats_check.py controls->vertex fetch format controls passedpython3 tests/docs_links_check.py->Checked 18 Markdown files and 447 links.python3 tests/bidi_controls_check.py->no bidirectional controls.git diff --check origin/main...HEAD-> cleangh pr checks: Linux Python checks pass. Windows build/test and gfx1013 fixtures were still pending when I looked.Mutation on the new logic
['w >> 16', 'w & 65535u', ...]).controlsdid not fail on this. It only checks that the mutation anchors still exist in the generated source, so the swap is only caught by the GPU readback run (warp/hardware). The PR reports those as passing. Once the Windows jobs finish, they are the real evidence for this change.controlsfail withAssertionError: ('BUF_FMT_16_16_UINT', 'normalized low half'). So the three new mutation entries are tied to the row text, which is fine.git checkout -- ..Not run: I did not run the Windows WARP job. The change is one table row, and the PR's own Windows CI covers it. Please wait for those jobs to go green before merging.
Nit
AI-assisted; commands listed were executed locally.
upstream-sync referenced this pull request2026-11-25 12:01:50 +00:00