Repository navigation
recomp: support wave32 split execution for console mesh shaders - #39
Conversation
|
Thanks for this! The wiring is clean, it mirrors One blocker though: the split geometry path only runs on programs that pass In split mode the two halves can't see each other: So on a 32-lane adapter all of them would now create a pipeline but compute wrong results (culling / compaction, vertex and primitive counts), and where the halves branch differently around an What it needs:
With (1) and (2) this would be safe to merge. Actually running these programs on NVIDIA needs real cross-half emulation (ballot / readlane / permlane / DPP and the mask branches across both halves) rather than a split; that's what the mesh dispatcher work ( |
|
Tested on an RTX 3080 (D3D12 wave range 32..32, mesh tier 1, driver 610.88), merged onto current
There was no device removal or TDR, but these tests only create the pipelines and never dispatch the 7 programs. On a Radeon RDNA2 iGPU (native wave64, no mesh shaders) nothing changes: 355 passed, and the mesh parts skip. On @ivall's point that a split computes wrong results: #44 shows it concretely for the geometry split, which uses the same prelude. A I've pushed the two requested changes on top of this branch as a suggestion. @wrxqed, feel free to take them, or ignore them if you're already on it: wrxqed/xcl@fix/mesh-wave32...grahamster2:xcl:mesh-wave32-hazards (one commit, +34 / -8):
With it, the RTX 3080 is back to 0 / 7 and fails cleanly with the hazard error (cross-half lane exchange, branch on a whole-wave mask, branch on a half-local scalar condition), with no device removal. The background stand-in test then fails as it does on |
recomp: support wave32 split execution for console mesh shaders – with grahamster2's check that refuses split mesh programs needing cross-half wave64 semantics (as split geometry does)
|
Merged, together with @grahamster2's hazard check (798ff0d) on top, which is what I asked for above. Thanks to both of you! On an adapter with wave64 nothing changes: all tests pass on an RX 9070, |
Summary
On adapters without native wave64 support (
WaveLaneCountMax < 64, e.g. NVIDIA GPUs),console_meshpreviously emitted[WaveSize(64)]unconditionally, causingCreateComputePipelineStateto fail withE_INVALIDARG(0x80070057):This adds a
mesh_wave32option (mirroringgeometry_wave32) and wires it fromgeometry_wave32_required(this)intranslated_mesh_stream.Changes
crates/xcl/src/gpu/recomp/mod.rs: addOptions::mesh_wave32(defaultfalse).crates/xcl/src/gpu/recomp/emit.rs: inMode::Mesh, whenwave64 && mesh_wave32, emit[WaveSize(32)]and setxcl_half = (gi >> 5) & 1u,xcl_logical_wave64 = true,lane_id = WaveGetLaneIndex() + 32u * xcl_halfwhile preserving[numthreads(t, 1, 1)].crates/xcl/src/gpu/recomp/pso.rs&crates/xcl/src/hle/d3d12x/real.rs: passgeometry_wave32_required(this)intoconsole_mesh.crates/xcl/src/gpu/recomp/tests.rs: add unit testmesh_wave32_emits_wave32_logical_wave64.Note: Like
geometry_wave32, this usesxcl_logical_wave64split-half emulation (cross-half lane ops remain half-local).Verification (NVIDIA GeForce RTX 5050, 7911 MiB VRAM)
cargo test --release --lib mesh_wave32_emits_wave32_logical_wave64: 1 passed, 0 failedcargo test --release --test gpu_pso_e2e -- --test-threads=1(withXCL_SAMPLE_RPF/XCL_SAMPLE_DLLS): 6 passed, 0 failed (retail_mesh_pipelines_through_the_hook: 7 / 7 MS+PS pipelines; previously 0 / 7).