Repository navigation
shader: add a compute fallback for indexed mesh draws - #606
Conversation
|
Independent verification on the submitted head ctest --test-dir out/build/followup --no-tests=error -R '^mesh_(indexed_fallback|indexed_draw|attribute_draw)_(warp|hardware)$' -V
ctest --preset release --no-tests=error -R '^mesh_(indexed_fallback|indexed_draw|attribute_draw)_(warp|hardware)$' -VAll six tests passed in Debug and all six passed in Release (/O2), with zero skips. In both configurations, the negative controls detected the wrong guard at byte 76 with zero pixel differences, the collapsed index at byte 72 with 276 pixel differences, and the stale palette with 992 pixel differences and matching mesh exports. I also tested the same six positive inputs through AI-assisted. |
|
Independent AMD (RDNA4) result on Environment
Clean worktree of the PR head CommandsObserved — hardware, 9 cases, all as expectedObserved — WARP in the same buildSame nine cases, ConclusionOn RDNA4 the compute + vertex fallback draws the source-built indexed triangle and matches the CPU reference on all 1,024 pixels in each of the four positive cases. The three negative controls reproduce exactly the byte offsets (76, 72) and pixel counts (0, 276, 992) reported on the GTX 1060, on a different vendor — so they detect the same faults rather than an adapter-specific artefact. The run went through AI-assisted. |
951194c to
42d1b3d
Compare
MarlomMedeiros
left a comment
There was a problem hiding this comment.
Community review + independent run on a newer adapter and OS than the reported GTX 1060 / Windows 10 setup.
Environment
- Commit under test:
42d1b3don base8f57366(current main at review time) - Windows 11 build 26300.10075, VS 2026 MSVC 19.52, Ninja, DXC from SDK 10.0.26100
ctest --preset dev --no-tests=error -R '^mesh_(indexed_fallback|indexed_draw|descriptor_swap)_(warp|hardware)$' -V: 6/6 passed- Hardware: NVIDIA GeForce RTX 5070 (vendor=10de device=2f04), driver 32.0.16.2135, D3D12 debug layer enabled,
debug_errors=0 debug_warnings=0 mesh_indexed_fallback_hardware:mesh_exports bytes=128 matched=1,pixels=1024 mismatches=0on every positive draw; wrong-guard, collapsed-index and stale-palette controls reported their expected mismatches- WARP: Microsoft Basic Render Driver, driver 10.0.26100.10068
Review notes
emit_compute_drawkeeps the same expression lowering and cbuffer bindings as the mesh path (b0/b1,float4deduplicated between both emitters); the compute stage reproduces the native trace layout at stride 128 with optional PARAM0 attributes after byte 80, and the vertex shader replays the generated index buffer via SV_VertexID.- The harness plumbing is honest about fallback: a separate compute PSO dispatches 1x1x1, the draw PSO binds the generated buffer as
t1, and the capability probe printsmesh_fallback_shader_model=unsupportedrather than silently succeeding. - Negative controls pin the interesting failure modes: a corrupted guard byte reports the exact export offset (byte 76) with zero pixel differences, collapsing the primitive to (0,1,1) reports byte 72 plus 276 pixel differences, and the stale-palette case separates export-exact from draw-wrong. Negative draws also assert a clean debug layer, matching the PR's claim.
- The indexed_program splice ordering (loads before first wait, dereference before first buffer load, adds before export) is exercised end-to-end by the b0/b1 rebinding cases.
No blockers found. This lands on a clean base and does not overlap the exec-masked-region work in #651.
AI-assisted: yes. All reported checks ran locally on the adapter and driver listed.
42d1b3d to
7477928
Compare
|
Rebased onto |
|
Independent run on the rebased head cmake --preset dev "-DINTAKE_PYTHON=$((Get-Command python).Source)" "-DDXC_EXECUTABLE=$dxc" -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebug
cmake --build --preset dev --parallel 4 --target offscreen_check
$env:XBOX2WINDOWS_ADAPTER = 'RTX 3060 Ti'
ctest --preset dev --no-tests=error -V -R '^mesh_(indexed_fallback|indexed_draw)_(hardware|warp)$'
On both adapters the fallback matched all 128 export bytes and 1,024 pixels in each of the six positive cases. Controls gave the expected results: wrong guard at byte 76 with zero pixel mismatches, collapsed index at byte 72 with 276 pixel mismatches, and stale palette with 992 pixel mismatches and matching exports. I also used AI-assisted. All reported tests ran locally. |
7477928 to
28bbc42
Compare
Change
Add
--compute-fallbackto the bounded mesh translator. An SM 6.0 compute dispatch writes positions, primitive indices and optional PARAM0 to a buffer. A vertex shader follows the generated indices and passes interpolated attributes to the translated pixel shader. This lets the source-built single-triangle fixture run on adapters without Mesh Shader Tier 1. Refs #498 and #546.Verification
Tested
7477928overf1f95cfon Windows 10 22H2 build 19045.6456 with MSVC 19.44.35230, SDK 10.0.26100.0 and DXC 1.9.2602.17. On GTX 1060 6 GB (32.0.15.6094) and in-box WARP (10.0.19041.5794), all six positive cases matched all 128 export bytes and all 1,024 pixels in Debug and Release, including independent changes to compute b0 and b1. The controls found a wrong guard at byte 76 with zero pixel differences, a collapsed index at byte 72 with 276 pixel differences, and a stale palette with 992 pixel differences and exact exports. The fallback reported zero D3D12 debug warnings and errors.Each preset had 8 passes and 18 native-mesh capability skips. The existing partial pixel-output checks each reported one D3D12 warning. With app-local Agility SDK 1.620.2 and WARP 1.0.22, all ten selected tests passed. The compute-produced texture fixture from #658 matched both palettes and caught the stale SRV at 276 pixels. The native depth fixture also passed its color and depth controls.
The RTX 5070 and WARP review covers the pre-rebase commit
42d1b3d. On the original submission951194c, freezing either compute binding caused the corresponding depth check to fail. The assembled indexed input produced identical fallback HLSL with the Windows LLVM disassembler, and DXC built it for an exact partial draw on both adapters.Evidence and follow-up
The fixture uses existing source-built MIT-licensed inputs and validates the bounded one-group, one-triangle specialization. It compares full pixel and geometry readbacks with the existing CPU references.
Checklist
AI-assisted implementation and verification.