shader: translate mesh image_load through a full table descriptor #3758
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/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?
Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-12-01T16:26:46Z.
The 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, #3754'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 #37546102db88):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 #3497
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-01T17:05:20Z.
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 #3754. Please refresh the branch after the descriptor-load change is resolved and rerun Windows CI.Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-12-01T22:44:33Z.
Rebased onto #3754's corrected head
6102db88.The descriptor words stay symbolic: #3754 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.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-02T01:51:10Z.
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.Imported from R0Y00/Xbox2Windows. Originally posted by lambirou on 2026-12-02T14:45:11Z.
Review: COMMENTED
Reviewed
b4c5697aagainst #3754; 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 #3754 and currently conflicts with main; the translation itself remains a slice with the stated descriptor-contract limit.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-02T15:49:18Z.
Review: COMMENTED
#3754 has landed. Merging the current stacked branch into main conflicts in
tests/native_direct_mesh_check.py. I applied only the #3758 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 #3758 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.Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-12-02T18:43:05Z.
Review: APPROVED
Re-reviewed
12e869e6after the main update. The three-file change keeps the full-descriptor path restricted to the proven 1D UNORM dmask 0x7 case and preserves the selected-descriptor refusal control with the updated diagnostic. Independent Windows/MSVC Debugcmake --build --preset dev --target compile_dxilandctest --preset dev --no-tests=error --output-on-failure -j 1 -R '^native_direct_mesh$'passed (1/1, source-built compiler checks). The trial merge into78cee9cbwas clean.