Skip to content

Preserve static view instancing in VS/PS pipeline streams - #2032

Closed
DoubleD17 wants to merge 1 commit into
Marvisak:mainfrom
DoubleD17:port/fxceless-604
Closed

DoubleD17 wants to merge 1 commit into
Marvisak:mainfrom
DoubleD17:port/fxceless-604

Conversation

@DoubleD17

Copy link
Copy Markdown
Contributor

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.

@jeremygold02

Copy link
Copy Markdown
Contributor

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 GPU: the depth bounds test reaches the host #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 GPU: the depth bounds test reaches the host #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.

@catminou4 catminou4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 DenRakEiw left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Adapt the static view handling and synthetic fixture from fxceless/victory-fork#604.
@upipibi

upipibi commented Nov 25, 2026

Copy link
Copy Markdown

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

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).

Copy link
Copy Markdown
Owner

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

@DoubleD17
DoubleD17 marked this pull request as draft November 25, 2026 09:57
@DoubleD17 DoubleD17 closed this Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants