Repository navigation
Shaders: avoid overwriting mesh indices when every slot is exported - #3299
andrewpozdnakov7-jpg wants to merge 1 commit into
Conversation
|
I merged exact #3299 head The separate fresh-process series in #2997 still establishes intermittent divergence in its 19-active-lane case. These two full runs confirm the mesh change composes with the gather and permute changes on this host. Intermittent case AI-assisted with Codex. |
Dukestar69
left a comment
There was a problem hiding this comment.
Reviewed the diff and verified locally on Windows 11 x64 (RTX 5090 + WARP):
- Skipping the preliminary degenerate-triangle index write when
threads == mesh.max_primitivesand a single-block mesh shader ([LaneExit::End]) has one unguardedTarget::Primitiveexport is tight and sound, avoiding WARP 1.0.22 keeping the preliminary write. cargo test -p victory-shader --lib emit::tests:: -- --test-threads=1: 17 passed, 0 failed (includingedge_flagged_triangles_draw_as_unflagged_onesandprimitive_export_indices_drop_the_edge_flags).cargo clippy -p victory-shader --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
|
The edge-flag fix also composes with the direct mesh group-index candidate from #2624. On the exact integration, the edge-flag draw passed on app-local WARP 1.0.22 in three fresh runs. Each 24-group test still visited every index once, and GPU diagnostics passed with 249 tests, 0 failed and 1 ignored. Integration details in #2624. AI-assisted with Codex. |
On app-local WARP 1.0.22, the existing mesh edge-flag test renders 0 of 256 texels even for its unflagged triangle. The generated DXIL writes a degenerate primitive at entry and later writes the exported indices to the same slot.
I confirmed the API behavior with a native HLSL control. Using the same pipeline and DXC
-Od, oneEmitIndices(0,1,2)per slot draws the expected frame. Adding an earlierEmitIndices(0,0,0)per slot yields a blank frame. DXC disassembly shows one and two writes respectively. The DirectX mesh shader spec says the last write defines the indices. DirectX mesh shader specificationSkip the preliminary write only for a straight-line shader with one unguarded primitive export and exactly one primitive slot per thread. The export overwrites every slot in that case, so the initialization is redundant. Task claim
Verification
63bcca4and this revision. With the patch, the two visible variants match all 256 expected colors and the culled variant lights zero texels.All fixtures are synthetic. AI-assisted with Codex.