shader: draw a sampled texture through translated indexed mesh UVs #627
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/633"
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 descent81 on 2026-11-22T16:51:55Z.
Change
Connect the translated indexed mesh and its PARAM0 UVs to a translated
image_sample_lzpixel shader in a single D3D12 draw. The fixture uploads a source-built 2×2 RGBA8 texture, binds a point-clamp sampler and compares all four output channels at every pixel against a CPU reference.Both shader stages use
t0. The root signature gives the mesh stage a root SRV for indexed vertex data and the pixel stage a texture SRV table using separate stage visibility. The initial pipeline creation failed on both backends with D3D12 message 662: the mesh exported four TEXCOORD0 components while the sampling pixel entry declared two. The pixel lowerer now accepts the required TEXCOORD width at this call site and still samples with xy. Existing callers retain the default.Left to right: baseline, texture contents changed, and horizontal UV reflection. These are CPU reference images verified byte-for-byte against GPU readbacks.
Verification
Tested
751b954on base1947e97with RTX 4060 (32.0.16.1088), Microsoft WARP (10.0.26100.9818) and Windows SDK DXC 1.8.2502.11.Evidence and follow-up
The source-written programs, texels and CPU reference are under the repository's MIT license. Refs #546 for indexed PARAM0 and #544 for the linked pipeline. This fixture validates one point-clamped single-mip texture with a source-built mesh.
AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by thepatrickworld on 2026-11-22T17:34:38Z.
@descent81 Independent AMD (RDNA4) result on
751b954. Measurements only, no code change.Environment
debug_layer=unavailable(Tools.Graphics.DirectXisNotPresent), so no validation-layer evidence here — your report had a clean debug layer, mine does not.751b954on base14daa49f10.Commands
Observed
Six draws per backend (three cases × mesh trace instrumentation enabled and disabled), each
pixels=1024 mismatches=0across all four channels, against the CPU reference.Negative controls, both stale references:
276 on each — the same count as your 32×32 reference, on a different vendor.
What this adds
The pipeline-creation failure you document (D3D12 message 662: the mesh stage exporting four
TEXCOORD0components while the sampling pixel entry declared two) does not reproduce here — the draw runs end to end on RDNA 4. That is the observable consequence of accepting the requiredTEXCOORDwidth at this call site; I did not instrument how many pipeline-creation attempts were made, so I cannot say whether the first attempt succeeded.The 2×2 RGBA8 upload with a point-clamp sampler reads back identically to the CPU reference in all three cases (baseline, changed texels, horizontal UV reflection), so the UV path from indexed mesh PARAM0 through interpolation to the sampler is correct on this adapter as well.
AI-assisted; runs executed locally.