Shaders & GPU: support HwStage::Gs geometry shader translation and pipelines #433
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Belobug--VIctory-Belobug-AMD!433
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-433"
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?
@R1kkku on GitHub · 2026-11-27 01:08 UTC · original
R1kkku:pr/geometry-shader-support→a-publier· +1835 −125 · 14 files · 1 commits · openSummary
Adds translation and host pipeline support for
HwStage::Gs(Xbox/RDNA merged ES-GS) shaders, covering the remaining 195GS_VoxelizeGeneric_*programs inshaders.rpfso all 25,889 of 25,889 shaders in the title archive translate, passdxil.dllvalidation, and build D3D12 PSOs.Changes
crates/victory-shader/src/structure.rs):s_bfm_b64 exec, bfe(s3), 0) toBool::TRUEonly whens_bfe_i32/s_bfe_u32extracts the 8-bit lane count fields from entrys3(0x0008_0008or0x0008_0000).crates/victory-shader/src/resource.rs,crates/victory-shader/src/io.rs):s[8:9]GS ring base loads (Resources::gs_ring_loads) so scalar ring loads do not fail resource resolution.Io::gs_loads) and GS-VS output ring writes (Io::gs_stores) withGsAddr.crates/victory-shader/src/emit/):mod.rs/container.rs/rect.rs/shader.rs: AcceptHwStage::Gs, extract and validateGeometrymetadata (input_primitivein1..=3,output_topologyin{1, 3, 5},stream_mask == 1,max_vertices > 0) fromPSV0, normalize GS inputs and outputs viapsv_interpolation, and emit DXIL geometry shader metadata.lower.rs: ThreadGeometryvialower_with_geometry, mapInput::MergedWaveInfoactive thread count, validate GS load vertex< input_primitive, GS store/emit vertex< max_vertices,stream == 0, no loop/cross-block output staging, implementload_input_atfor ES-GSds_read, flush staged outputs ons_sendmsg(storeOutput,emitStream,cutStream), zero GS ring descriptorsmemloads, and gate test-onlylower/lower_countedbehind#[cfg(test)].host.rs/gs_tests.rs: AddHost::geometry_pipelinehelper plus unit/DXIL/D3D12 PSO/draw tests covering both 2-row and 5-row sparse0xf0layouts and unsupported-configuration refusal cases.crates/victory-gpu/,apps/victory/src/translate.rs):HwStage::GsinTablePlan(pipeline.rs),stores_picked(picked.rs), andHostPipeline(pipeline/host.rs:"geometry"visibility, GS bytecode lookup, separate"graphics geometry"pipeline library key, and rect-GS fallback separation).victory translate.Verification
cargo test --locked -p xtask(9 passed, includingrepository_passes_policy)cargo clippy --workspace --all-targets --locked -- -D warnings(passed)cargo clippy --workspace --all-targets --all-features --locked -- -D warnings(passed)cargo test --workspace --locked(passed;victory-shader: 311 passed, 4 ignored;victory-gpu:watch::tests::what_the_kernel_writes_through_is_not_guarded_for_another_viewpassed isolated and on rerun)cargo test --workspace --all-features --locked -- --test-threads=1(all workspace test targets passed with 0 failures).\target\diag\victory.exe translate --validate --pipelineson all 195GS_VoxelizeGeneric_*containers fromshaders.rpfon AMD Radeon RX 6600 (195 emitted of 195 geometry programs; 195 validated, 195 pipelines)@MamaLeVrai on GitHub · 2026-11-27 02:22 UTC · original
Tested on an RX 6950 XT (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release. At
5807bca:cargo test --release -p victory-gpu --lib396 passed, 0 failed, 34 ignored;cargo test --release -p victory-shader --lib311 passed, 0 failed, 4 ignored.AI-assisted (Claude Code); no game data.
@adrianmjim on GitHub · 2026-11-27 12:31 UTC · original
Tested on an RX 7900 XT (RDNA 3), driver 32.0.32029.2010, Windows 11 26300, Rust 1.98.1, release. Head
5807bcaagainst base4eb6cfd(currenta-publier).Whole
shaders.rpf,translate --validate --list, default wave andVICTORY_HOST_WAVE=32(same results), head vs base:GS_VoxelizeGeneric) are now emitted and validated. They give 4 distinct host shaders (153/36/5/1).dxil.dll. They still get pipelines.vertinload_input_atis built before theargsarray). It is now checked by translation on this head. Building it as the last array element again makes all non-GS output byte-identical to4eb6cfdat both waves. The 195 GS outputs do not change:s_bfmexec fold instructure.rsis not gated on GS. Thestructuredsummary line changes (guarded 790411 -> 764087, on opaque masks 28029 -> 1705). With the patch above, no non-GS output changes.translate --validate --pipelines, whole archive, on the 7900 XT:WARP (
VICTORY_WARP=1),--pipelines: the 195 GS plus 300 sampled changed VS/PS, 495/495 pipelines.Tests,
--test-threads=1:a_voxelization_geometry_shader_compiles_on_the_hostanda_five_row_sparse_geometry_shader_compiles_and_drawspassed 3/3 each. The voxelization test printed no skip message.let Ok(host) = Host::new(warp) else { continue; }), so a pass does not show that a device was used.4eb6cfd: victory-shader 303 passed, 0 failed, 4 ignored; victory-gpu 396 passed, 0 failed, 34 ignored.Not tested: in game (these GS are not dispatched), debug builds, a draw with the five-row layout.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.