Shaders: Translate single-stream triangle geometry shaders #2801

Open
github-bot wants to merge 1 commit from github-bot/gh-2801 into main AGit
Owner

@⁠rastapasta on GitHub · 2026-11-29 17:29 UTC · original
rastapasta:codex/port-geometry-shaders-1315 → main · +1443 −133 · 15 files · 1 commits · open

Addresses #659. Ports r4tedx and ryotdev’s geometry translation at 0d45a59 to NVIDIA main at 55d06914. Marvisak/VIctory#1315

What it changes

  • Translate triangle-input, triangle-strip-output geometry shaders on stream 0. Recover each output component from the embedded copy vertex shader. Refuse unsupported stream state, untraceable exports and missing signature rows.
  • Bind the native GS in graphics pipelines and include it in root-signature visibility and the pipeline-library key. Only the generated rectangle shader enables rectangle handling and fallback.
  • Validate geometry in the offline translator and exercise interleaved and batched vertex writes with rendered regression tests.

How it was tested

Full victory shaders <dump> precompile on the same 1.0.2.1 dump, with a fresh cache for each build.

NVIDIA build Cached Refused
Main at 55d06914 25,789 200
This branch 25,984 5

The port took 52 seconds cold and reproduced the count in 3 seconds warm. All 25,789 baseline cache records matched byte-for-byte, including duplicate payloads. The remaining refusals are one Wave32 adaptive-shadow shader and four PC shaders in D3D12Core.dll (two desktop DXIL and two legacy containers without a DXIL part). Wave32 PR #2220

  • 195/195 geometry shaders emitted, validated and created hardware pipelines with victory translate --validate --pipelines --list. These are distinct native Wave64 GS containers from shaders.rpf. The pipeline check supplies synthetic VS/PS companions. Windows 11 build 26200, RTX PRO 6000 Blackwell, driver 621.14, Windows SDK validator 10.0.26100.0, host wave limit 32.
  • All eight geometry tests passed. Interleaved and batched stores matched the full DXC reference image on both RTX and WARP, with 44 of 256 pixels covered, for position-only and user-parameter outputs.
  • A separate hardware check linked 15 of 16 candidate VS/GS signature combinations across 13 techniques. The rejected cross-pair in 912dfba0 combines groups of 2 and 33. An upstream tester checked the effect-pass IDs, found that technique's rejected combinations outside the declared passes, and linked all 195 declared VS/GS pairs and all 294 declared VS/GS/PS triples on the original patch. Testing here was offline. Upstream effect-pass verification
  • All tests in the affected crates passed, including 471 shader and 915 GPU library tests. The release build and staged asset-policy check passed. Four workspace failures reproduced on clean main (three BCPack oracle tests and the repository-wide policy check on victory-loader/src/heap_sites/frame_users.rs). Both strict Clippy configurations also failed with the same diagnostics on main and the port.

Checked for overlap

**@⁠rastapasta** on GitHub · 2026-11-29 17:29 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2801) `rastapasta:codex/port-geometry-shaders-1315` → `main` · +1443 −133 · 15 files · 1 commits · open Addresses #659. Ports r4tedx and ryotdev’s geometry translation at `0d45a59` to NVIDIA `main` at `55d06914`. [Marvisak/VIctory#1315](https://github.com/Marvisak/VIctory/pull/1315) ## What it changes - Translate triangle-input, triangle-strip-output geometry shaders on stream 0. Recover each output component from the embedded copy vertex shader. Refuse unsupported stream state, untraceable exports and missing signature rows. - Bind the native GS in graphics pipelines and include it in root-signature visibility and the pipeline-library key. Only the generated rectangle shader enables rectangle handling and fallback. - Validate geometry in the offline translator and exercise interleaved and batched vertex writes with rendered regression tests. ## How it was tested Full `victory shaders <dump>` precompile on the same 1.0.2.1 dump, with a fresh cache for each build. | NVIDIA build | Cached | Refused | | --- | ---: | ---: | | Main at `55d06914` | 25,789 | 200 | | This branch | 25,984 | 5 | The port took 52 seconds cold and reproduced the count in 3 seconds warm. All 25,789 baseline cache records matched byte-for-byte, including duplicate payloads. The remaining refusals are one Wave32 adaptive-shadow shader and four PC shaders in `D3D12Core.dll` (two desktop DXIL and two legacy containers without a DXIL part). [Wave32 PR #2220](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/2220) - **195/195 geometry shaders emitted, validated and created hardware pipelines** with `victory translate --validate --pipelines --list`. These are distinct native Wave64 GS containers from `shaders.rpf`. The pipeline check supplies synthetic VS/PS companions. Windows 11 build 26200, RTX PRO 6000 Blackwell, driver 621.14, Windows SDK validator 10.0.26100.0, host wave limit 32. - All eight geometry tests passed. Interleaved and batched stores matched the full DXC reference image on both RTX and WARP, with 44 of 256 pixels covered, for position-only and user-parameter outputs. - A separate hardware check linked 15 of 16 candidate VS/GS signature combinations across 13 techniques. The rejected cross-pair in `912dfba0` combines groups of 2 and 33. An upstream tester checked the effect-pass IDs, found that technique's rejected combinations outside the declared passes, and linked all 195 declared VS/GS pairs and all 294 declared VS/GS/PS triples on the original patch. Testing here was offline. [Upstream effect-pass verification](https://github.com/Marvisak/VIctory/pull/1315#issuecomment-7195744334) - All tests in the affected crates passed, including 471 shader and 915 GPU library tests. The release build and staged asset-policy check passed. Four workspace failures reproduced on clean main (three BCPack oracle tests and the repository-wide policy check on `victory-loader/src/heap_sites/frame_users.rs`). Both strict Clippy configurations also failed with the same diagnostics on main and the port. ## Checked for overlap - [x] Searched NVIDIA's open PRs for geometry translation. Merged #716 handles the raw user-data address in resource tracking. This port adds GS emission and host pipeline support. [NVIDIA #716](https://git.gtahub.st/github/trustno1-coder--VIctory-NVIDIA/pulls/716) - Marvisak/VIctory#1924 rebases Marvisak/VIctory#1399 and fixes its batched-write bug. Its reported **+390 programs** comprise the same **195 GS** and **195 export-stage programs** emitted as separate vertex modules. This port uses the existing VS in those ES+VS companion containers. [Program counts](https://github.com/Marvisak/VIctory/pull/1924#issuecomment-7174530756) · [Batched-write reproduction](https://github.com/Marvisak/VIctory/pull/1399#issuecomment-7146657503) · [Export-stage census](https://github.com/neonbyte1/VIctory/issues/75) - The upstream comparison also credits that alternative with 20 VfxVBuffer vertex validations. Those concern UAV flags, a separate issue. A third geometry implementation is tracked in Marvisak/VIctory#877. [Side-by-side comparison](https://github.com/Marvisak/VIctory/pull/1315#issuecomment-7153094143) · [UAV flags #1989](https://github.com/Marvisak/VIctory/pull/1989) · [UAV flags #2016](https://github.com/Marvisak/VIctory/pull/2016) - Geometry-only lowering lives in its own module, as discussed on the upstream rebase. The Mexrs port also identified the rectangle-flag distinction covered here. [Lowerer file split](https://github.com/Marvisak/VIctory/pull/1924#issuecomment-7246183444) · [Mexrs/VIctory#1](https://github.com/Mexrs/VIctory/pull/1)
Port Marvisak/VIctory#1315 at 0d45a59 to the NVIDIA native-program decoder,
DXIL emitter and graphics pipeline. Use the copy vertex shader to recover
which values each geometry vertex exports. Keep the guest geometry stage
in the pipeline key and reserve rectangle fallback for the generated stage.

Exercise batched and interleaved ring writes against the same reference
draw, and reject copy exports whose signature row is absent.

Co-authored-by: r4. <[email protected]>
Co-authored-by: ryotdev <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-29 17:33:25 +00:00
github-bot changed title from Translate single-stream triangle geometry shaders to Shaders: Translate single-stream triangle geometry shaders 2026-11-29 18:40:29 +00:00
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/pipeline/host.rs
  • crates/victory-shader/src/emit/lower.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2801/head:github-bot/gh-2801'
git switch 'github-bot/gh-2801'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2801'
git switch 'github-bot/gh-2801'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2801'
git switch 'github-bot/gh-2801'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2801'
git switch 'main'
git merge --squash 'github-bot/gh-2801'
git switch 'main'
git merge --ff-only 'github-bot/gh-2801'
git switch 'main'
git merge 'github-bot/gh-2801'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!2801
No description provided.