Shaders: Translate single-stream triangle geometry shaders #2801

Open
rastapasta wants to merge 1 commit from upstream-pr/2801 into main
rastapasta commented 2026-11-29 17:29:42 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by rastapasta on 2026-11-29T17:29:42Z.


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

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5553246102 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/2801). Originally posted by [rastapasta](https://github.com/rastapasta) on 2026-11-29T17:29:42Z. --- 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://github.com/trustno1-coder/VIctory-NVIDIA/pull/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://github.com/trustno1-coder/VIctory-NVIDIA/pull/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)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/2801:upstream-pr/2801'
git switch 'upstream-pr/2801'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/2801'
git switch 'upstream-pr/2801'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2801'
git switch 'upstream-pr/2801'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2801'
git switch 'main'
git merge --squash 'upstream-pr/2801'
git switch 'main'
git merge --ff-only 'upstream-pr/2801'
git switch 'main'
git merge 'upstream-pr/2801'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
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.

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