Preserve static view instancing in VS/PS pipeline streams #2030

Closed
DoubleD17 wants to merge 1 commit from upstream-pr/2032 into main
DoubleD17 commented 2026-11-25 03:45:42 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DoubleD17 on 2026-11-25T03:45:42Z.


The graphics pipeline stream parser advances past VIEW_INSTANCING without retaining the static view locations. Copy supported VS/PS viewport and render-target slice pairs into pipeline state, preserve their order in the library key, and use the D3D12 pipeline stream for creation and loading. On Windows 11 with D3D12 WARP (DXGI 1414:008C, View Instancing Tier 1), the same synthetic create_stream fixture changed the viewport case from 16/0 to 16/16 pixels and verified the two-slice case, distinct library keys, creation and reload, and the existing masked-descriptor fallback. Four pipeline tests also passed. Validation covers the synthetic WARP scenario.

Adapted from fxceless/victory-fork #604.

AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6596735062 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2032). Originally posted by [DoubleD17](https://github.com/DoubleD17) on 2026-11-25T03:45:42Z. --- The graphics pipeline stream parser advances past VIEW_INSTANCING without retaining the static view locations. Copy supported VS/PS viewport and render-target slice pairs into pipeline state, preserve their order in the library key, and use the D3D12 pipeline stream for creation and loading. On Windows 11 with D3D12 WARP (DXGI 1414:008C, View Instancing Tier 1), the same synthetic create_stream fixture changed the viewport case from 16/0 to 16/16 pixels and verified the two-slice case, distinct library keys, creation and reload, and the existing masked-descriptor fallback. Four pipeline tests also passed. Validation covers the synthetic WARP scenario. Adapted from [fxceless/victory-fork #604](https://github.com/fxceless/victory-fork/pull/604). AI-assisted.
catminou4 commented 2026-11-25 04:06:38 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T03:57:00Z.

Review: COMMENTED


Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.

Static view instancing preserved in VS/PS pipeline streams — instancing correctness in the pipeline-stream path.

<!-- greyfinch-sync:Marvisak/VIctory:review:6051646682 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2032#pullrequestreview-6051646682). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T03:57:00Z. **Review:** COMMENTED --- Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff. Static view instancing preserved in VS/PS pipeline streams — instancing correctness in the pipeline-stream path.
DenRakEiw commented 2026-11-25 04:06:38 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by DenRakEiw on 2026-11-25T03:57:14Z.

Review: APPROVED


Verified locally merged onto origin/main (940d32f, Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC):

  • cargo test -p victory-gpu --lib pipeline:: — 15 passed, 0 failed (opt-in static_views_through_create_stream compiles cleanly under #[ignore])
  • cargo clippy -p victory-gpu --all-targets — 0 warnings
  • cargo xtask policy — ok (184 files ok)

Clean preservation of static view instancing in VS/PS pipeline streams. Looks good.

AI-assisted (Gemini 4 Neon).

<!-- greyfinch-sync:Marvisak/VIctory:review:6051648153 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2032#pullrequestreview-6051648153). Originally posted by [DenRakEiw](https://github.com/DenRakEiw) on 2026-11-25T03:57:14Z. **Review:** APPROVED --- Verified locally merged onto `origin/main` (`940d32f`, Windows 11 x64, NVIDIA GeForce RTX 5090 + WARP, Rust 1.98.1 MSVC): - `cargo test -p victory-gpu --lib pipeline::` — 15 passed, 0 failed (opt-in `static_views_through_create_stream` compiles cleanly under `#[ignore]`) - `cargo clippy -p victory-gpu --all-targets` — 0 warnings - `cargo xtask policy` — ok (`184 files ok`) Clean preservation of static view instancing in VS/PS pipeline streams. Looks good. AI-assisted (Gemini 4 Neon).
jeremygold02 commented 2026-11-25 04:07:07 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by jeremygold02 on 2026-11-25T03:50:40Z.


Triage verdict — Keep, add an adapter fallback before merge (ce61651)

Evidence

  • @DoubleD17's patch preserves the ordered viewport and render-target slice pairs that the upstream VS/PS stream parser currently drops. The related depth-bounds PR #158 preserves a different subobject, and both changes touch the host stream builder.
  • The production branch uses the stream PSO for any nonempty view list. It does not check D3D12_OPTIONS3.ViewInstancingTier. Tier 0 does not support multiple views, so a pipeline that currently gets a single-view approximation can instead fail creation. The WARP fixture requires a supported tier and cannot exercise that fallback. PSO selection · WARP fixture · D3D12 capability tiers

Checks and limits

  • Independently ran the opt-in synthetic WARP regression on this head. Both viewport and array-slice readbacks matched, two pipeline-library reloads succeeded, and the masked-descriptor control passed. The regular pipeline group passed 16 tests, with the opt-in test run separately. Tier 0 and physical GPU behavior remain untested.

Next step

  • Keep the plain pipeline path for unsupported multiview requests or a failed capability query and add a regression for that selection. When integrating with #158, preserve both the ordered view locations and its depth-bounds state. The combined fixture in the source fork PR is a useful control for that integration.

This verification was AI-assisted.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7152292874 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2032#issuecomment-7152292874). Originally posted by [jeremygold02](https://github.com/jeremygold02) on 2026-11-25T03:50:40Z. --- **Triage verdict — Keep, add an adapter fallback before merge** (`ce61651`) **Evidence** - @DoubleD17's patch preserves the ordered viewport and render-target slice pairs that the upstream VS/PS stream parser currently drops. The related depth-bounds PR #158 preserves a different subobject, and both changes touch the host stream builder. - The production branch uses the stream PSO for any nonempty view list. It does not check `D3D12_OPTIONS3.ViewInstancingTier`. Tier 0 does not support multiple views, so a pipeline that currently gets a single-view approximation can instead fail creation. The WARP fixture requires a supported tier and cannot exercise that fallback. [PSO selection](https://github.com/Marvisak/VIctory/blob/ce61651475023221c268ee84df5efacdc95d62ea/crates/victory-gpu/src/pipeline/host.rs#L673-L691) · [WARP fixture](https://github.com/Marvisak/VIctory/blob/ce61651475023221c268ee84df5efacdc95d62ea/crates/victory-gpu/src/pipeline/view_instancing_test.rs#L333-L359) · [D3D12 capability tiers](https://microsoft.github.io/DirectX-Specs/d3d/ViewInstancing.html#capability-exposure) **Checks and limits** - Independently ran the opt-in synthetic WARP regression on this head. Both viewport and array-slice readbacks matched, two pipeline-library reloads succeeded, and the masked-descriptor control passed. The regular pipeline group passed 16 tests, with the opt-in test run separately. Tier 0 and physical GPU behavior remain untested. **Next step** - Keep the plain pipeline path for unsupported multiview requests or a failed capability query and add a regression for that selection. When integrating with #158, preserve both the ordered view locations and its depth-bounds state. The combined fixture in [the source fork PR](https://github.com/fxceless/victory-fork/pull/604) is a useful control for that integration. This verification was AI-assisted.
upipibi commented 2026-11-25 05:06:19 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-25T04:30:34Z.


Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at ee3a7dc.

  • cargo test -p victory-gpu --locked: 141 passed, 2 failed, 2 ignored. The 2 are #1744's heap-cap failures on main. The new tests aren't in this run: view_instancing_test is cfg(all(test, feature = "diagnostics")).
  • With --features diagnostics: graphics_view_selection_uses_effective_library_state passes.
  • With --features diagnostics, VICTORY_D3D12_WARP=1 and --ignored: static_views_through_create_stream passes.

Since the default cargo test skips both, a reviewer who runs only that doesn't exercise this PR's tests. Same as main on this hardware. Not run: a title.

AI-assisted (Claude Code).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7152906693 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2032#issuecomment-7152906693). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-25T04:30:34Z. --- Ran on Windows 11 with an RTX 3070 (Ampere, driver 616.56), debug build, at `ee3a7dc`. - `cargo test -p victory-gpu --locked`: 141 passed, 2 failed, 2 ignored. The 2 are #1744's heap-cap failures on `main`. The new tests aren't in this run: `view_instancing_test` is `cfg(all(test, feature = "diagnostics"))`. - With `--features diagnostics`: `graphics_view_selection_uses_effective_library_state` passes. - With `--features diagnostics`, `VICTORY_D3D12_WARP=1` and `--ignored`: `static_views_through_create_stream` passes. Since the default `cargo test` skips both, a reviewer who runs only that doesn't exercise this PR's tests. Same as `main` on this hardware. Not run: a title. AI-assisted (Claude Code).
Marvisak commented 2026-11-25 10:07:35 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T09:18:06Z.


Automated triage for the maintainers.
Needs work.

pipeline.rs read_stream now keeps the view-instancing subobject (type 22). pipeline/host.rs GraphicsState::read_views copies its static view locations, and HostPipeline builds a stream PSO (graphics_view_pipeline) when views are present. The code reads cleanly. The tier fallback that an earlier comment asked for is already in this head (effective_views falls back to no views below tier 1 when more than one view is requested). Still, this changes GPU state handling with only a synthetic WARP fixture behind it:

  • GraphicsState::read_views reads the console subobject's payload at +8 as a PC D3D12_VIEW_INSTANCING_DESC (count, pointer to locations, flags). Nothing shows that the console's type 22 has this layout and this meaning; main only knows its size. Please give the evidence, e.g. the title's own pipeline streams that carry this subobject with view locations, or documentation of the layout. A title pipeline that needs it would also show that the change matters.
  • read_stream keeps views only for VS/PS pipelines, so the geometry-shader branch in graphics_view_pipeline (StreamWithGeometry) is never reached. Remove it or allow GS.
  • The new tests are under cfg(all(test, feature = "diagnostics")), and the main one is #[ignore] and needs WARP. A plain cargo test and CI do not run them.

What would change the verdict: evidence for the console subobject layout and a title pipeline that uses it.

CI: passing (check).


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7158145637 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2032#issuecomment-7158145637). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T09:18:06Z. --- <!-- victory-triage v1 head=ee3a7dca451a5a47e10dc9fa5a2e9627f3791ffb verdict=needs-work at=2026-11-25T09:17:57Z --> Automated triage for the maintainers. **Needs work.** `pipeline.rs` `read_stream` now keeps the view-instancing subobject (type 22). `pipeline/host.rs` `GraphicsState::read_views` copies its static view locations, and `HostPipeline` builds a stream PSO (`graphics_view_pipeline`) when views are present. The code reads cleanly. The tier fallback that an earlier comment asked for is already in this head (`effective_views` falls back to no views below tier 1 when more than one view is requested). Still, this changes GPU state handling with only a synthetic WARP fixture behind it: - `GraphicsState::read_views` reads the console subobject's payload at +8 as a PC `D3D12_VIEW_INSTANCING_DESC` (count, pointer to locations, flags). Nothing shows that the console's type 22 has this layout and this meaning; `main` only knows its size. Please give the evidence, e.g. the title's own pipeline streams that carry this subobject with view locations, or documentation of the layout. A title pipeline that needs it would also show that the change matters. - `read_stream` keeps views only for VS/PS pipelines, so the geometry-shader branch in `graphics_view_pipeline` (`StreamWithGeometry`) is never reached. Remove it or allow GS. - The new tests are under `cfg(all(test, feature = "diagnostics"))`, and the main one is `#[ignore]` and needs WARP. A plain `cargo test` and CI do not run them. What would change the verdict: evidence for the console subobject layout and a title pipeline that uses it. CI: passing (`check`). --- _Generated by [Claude Code](https://claude.ai/code)_
upstream-sync closed this pull request 2026-11-25 16:06:44 +00:00

Pull request closed

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
Marvisak/VIctory!2030
No description provided.