shader: translate mesh image_load through a full table descriptor #3760
No reviewers
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!3760
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3758"
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?
@lambirou on GitHub · 2026-12-01 16:26 UTC · original
lambirou:codex/mesh-image-load→main· +330 −10 · 4 files · 4 commits · openThe slot 57 capture
req_72e1909e13df6f66.m57containsimage_load v[19:21], v11, s[56:63] dmask:0x7 dim:SQ_RSRC_IMG_1D unormat+0x700, fed by the eight-dword resource-heap fetch at+0x614. That is a complete guest V#, not a texture heap slot-map record, so the slot-map branch refuses it.This adds a mesh image branch for the full-V# form when
!layout.texture_heap_slot_map: op 0, 1D, dmask 0x7, UNORM, no LWE/TFE/R128/reserved bits, eight contiguous descriptor words sharing one fetch pc and a destination inside the VGPR range. The words stay symbolic; the fetch is identified byheap_fetchesorheap_descriptor_slots.createHandleFromHeap(slot)is annotated Texture1D{ 1, 1033 }andtextureLoad.f32reads mip 0 at the VGPR coordinate. Four channels, other dimensions, missing UNORM and an overwritten word keep refusing.Boundary. On the real capture, #3756's corrected head refuses at
+0x69c: unbound numeric SGPR s57:s_bfe_u32 s22, s57, 0x2001ereads descriptor word 1 to build the image coordinate. The full-V# branch is covered by source-built fixtures with a constant coordinate; reaching+0x700needs a contract that supplies the real V# field bits. The earlier+0x7c0observation belonged to the slot-materialising draft and no longer applies.Tests:
mesh-image-full-descriptor(root selector),mesh-image-full-descriptor-root,-gpu,mesh-image-four-channel-without-mapandmesh-image-unsupported-dimension; the descriptor-word reads still refuse asunbound numeric SGPR s33/s37.Validation on
b4c5697a(based on #37566102db88):cmake --build --preset release --target compile_dxilpython -B tests/native_direct_mesh_check.py ...— pass.ctest --preset release --no-tests=error -R '^native_direct'— 2/2 passed.+0x69c: unbound numeric SGPR s57.Refs #3499
Another MSVC version resolves std::begin({...}) to the array overload and rejects it (C2664), which failed the Windows build on CI. Co-Authored-By: Claude Opus 5.5 <[email protected]>e1161e435e2c0d5660The slot 57 capture req_72e1909e13df6f66.m57 reaches image_load v[19:21], v11, s[56:63] dmask:0x7 dim:SQ_RSRC_IMG_1D unorm at +0x700. The descriptor is a complete guest V# read from the resource heap by the eight-dword load at +0x614, not a texture heap slot-map record, so the slot-map branch refused it. - A mesh image branch now handles the full-V# form when !layout.texture_heap_slot_map: image_load (op 0), dim 1D, dmask 0x7, UNORM, no LWE/TFE/R128/reserved bits, eight contiguous descriptor words carrying projected_numeric and a destination inside the VGPR range. - The slot comes from the fetch: a root-proven selector reuses the typed path's heap_fetches guard, records mesh_heap_reads and takes and(root, mask); a GPU-selected fetch uses the bytes >> 5 slot recorded by the eight-dword load. - createHandleFromHeap(slot) is annotated Texture1D { 1, 1033 } and textureLoad.f32 reads mip 0 at the VGPR coordinate, writing the three integer channels. - Four-channel loads, other dimensions, missing UNORM or an unmatched descriptor keep refusing. Observed on the captured MS with the exact profile layout: - before: native compute +0x700: unsupported mesh instruction or EXEC state: image_load - now: native compute +0x7c0: unproven mesh entry register 287 The next refusal is v_fma_mixlo_f16 reading its own destination to keep the high half; that mixed-precision form stays outside this change. tests/native_direct_mesh_check.py adds mesh-image-full-descriptor (x8 heap fetch, masked root selector, 1D UNORM load, IR checks for createHandleFromHeap, textureLoad.f32 and the three channels) and mesh-image-unsupported-dimension (2D refused). The dmask-15 without-map fixture now doubles as the four-channel control. Verified: - cmake --build --preset release --target compile_dxil d3d12_xs_shim startup_indirect_draw_indexed (linked) - python -B tests/native_direct_mesh_check.py <compile_dxil.exe> <dxc dir>: exit 0, "mesh allocation, indexed outputs, group exchange and negative controls passed" - ctest --preset release --no-tests=error -R '^native_direct': 2/2 passed (native_direct_container 14.92 s, native_direct_mesh 13.52 s) - ctest --preset release --no-tests=error -R '^native_fixed_mesh57_warp$': 1/1 passed (1.41 s) Refs #3497@R0Y00 on GitHub · 2026-12-01 17:05 UTC · original
The current head's Windows build/test job failed in
Configure, build and run PC tests, while both Linux jobs passed. This also depends on #3756. Please refresh the branch after the descriptor-load change is resolved and rerun Windows CI.s_bitset1_b32, then stop at a scalar loop #3705964d3121c4tob4c5697aa1@lambirou on GitHub · 2026-12-01 22:44 UTC · original
Rebased onto #3756's corrected head
6102db88.The descriptor words stay symbolic: #3756 records only
bytes >> 5for an op 3 fetch, and this branch identifies the fetch throughheap_fetches(root-proven) orheap_descriptor_slots(GPU-selected). The image branch no longer requiresprojected_numeric, and the eight-word equality check keeps offsets 0, 4, ..., 28 without inventing field bits.The dmask-0x7 root and GPU-selected forms now lower (
mesh-image-full-descriptor,-root,-gpu); four channels, 2D and an overwritten word keep refusing. Descriptor-word reads still refuse asunbound numeric SGPR s33/s37.Validation on
92b0a153:python -B tests/native_direct_mesh_check.py ...— pass.ctest --preset release --no-tests=error -R '^native_direct'— 2/2 passed.6102db88, not the old4dd116c4.The Windows job should now run against the corrected stack; I'll check the result.
AI-assisted.
github-bot referenced this pull request2026-12-01 23:59:38 +00:00
@R0Y00 on GitHub · 2026-12-02 01:51 UTC · original
Current CI is green. Before merging this stack, please add a runtime binding control for the unmapped
createHandleFromHeappath. The GPU-derived selector path records nomesh_heap_reads; slot 57's direct-heap path currently requires a nonempty guard list. The root-derived path records a slot guard, but the fixture needs to establish that the runtime supplies a compatible Texture1D descriptor rather than only validating offline DXIL.@lambirou on GitHub · 2026-12-02 14:45 UTC · original · reviewed
Reviewed
b4c5697aagainst #3756; read the mesh image branch and its source-built controls, not built here.Verdict: approve. The full-V# branch is deliberately narrow: 1D, UNORM, dmask 0x7, no modifiers, eight contiguous symbolic descriptor words from one fetch, a destination inside the VGPR range, and either a root-proven or GPU-selected heap slot. The four-channel and 2D controls still refuse, and the symbolic descriptor-word refusals are preserved.
Texture1D { 1, 1033 }without inspecting the guest V# format words. The branch accepts any symbolic eight-word descriptor with the right fetch shape, so a different UNORM 1D format would get the wrong DXIL annotation. Either check the descriptor format words once the contract supplies them, or name the exact format as a precondition of this profile and refuse the rest.i.dst <= 252for three channels, which is correct; make the comment say three destination VGPRs so a later four-channel extension does not copy the wrong bound.heap_fetchesorheap_descriptor_slots; a root selector requires an unmasked root value and a GPU selector uses the stored slot;textureLoad.f32reads mip 0 at the coordinate and writes three integer channels. The controls cover root, GPU-selected, four-channel and 2D refusals.The PR is stacked on #3756 and currently conflicts with main; the translation itself remains a slice with the stated descriptor-contract limit.
b4c5697aa1toab48e1cfe0ab48e1cfe0to1e9872ad2b@R0Y00 on GitHub · 2026-12-02 15:49 UTC · original · reviewed
#3756 has landed. Merging the current stacked branch into main conflicts in
tests/native_direct_mesh_check.py. I applied only the #3760 delta (3fc816da..1587d78a) tof09547cdin an isolated checkout. It applied cleanly across the three owned files andctest --preset dev --no-tests=error -j 1 -R '^native_direct_mesh$' --output-on-failurepassed 1/1 on MSVC Debug. Please update this PR with only the two #3760 commits on current main and remove the extra blank line at the end ofdocs/experiments/native-mesh-image-load.md. The tested tree was local; the PR branch is unchanged.View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.