GPU: disable implicit stream depth test without a DSV format #2950
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2952"
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?
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T01:24:27Z.
Summary
When a
D3D12_PIPELINE_STATE_STREAM_DESComits both depth-stencil subobjects (DEPTH_STENCILkind11andDEPTH_STENCIL1kind21), D3D12's stream parser defaultsDepthEnabletoTRUEonly when aDSVFormatis present (!= DXGI_FORMAT_UNKNOWN) and toFALSEwhenDSVFormat == DXGI_FORMAT_UNKNOWN.Previously
GraphicsState::default()leftDepthEnable = TRUEunconditionally, soHostPipeline::newemitted an explicit depth-stencil state withDepthEnable = TRUEeven for color-only pipeline streams that omitted depth-stencil state and hadDXGI_FORMAT_UNKNOWN. On host D3D12 (for example, color-only streams usingForcedSampleCount > 0),CreateGraphicsPipelineState/CreatePipelineStaterefuses that explicitDepthEnable = TRUEstate withE_INVALIDARG(0x80070057), causing draws using the pipeline to be dropped.Changes
kind 11 | 21) inread_stream(crates/victory-gpu/src/pipeline.rs) and callGraphicsState::apply_stream_defaults(has_depth_stencil)once all subobjects are parsed (so subobject order relative toDSVFormatkind16does not matter, and both runtimecreate_streamand offlinePrebuildstay identical).GraphicsState::apply_stream_defaults(crates/victory-gpu/src/pipeline/host.rs), setDepthEnable = FALSEwhen!has_depth_stencil && self.depth_format == DXGI_FORMAT_UNKNOWN.DXGI_FORMAT_UNKNOWNvsDXGI_FORMAT_D32_FLOAT, explicit kind11/21overrides, and live D3D12 host PSO creation for a color-only stream withForcedSampleCount = 1.Testing (Windows 11, Rust 1.98.1)
cargo test --locked -p victory-gpu --lib -- pipeline::(RTX 5090,VICTORY_D3D12_DEBUG=1): 26/26 passedcargo test --locked -p victory-gpu --features diagnostics --lib -- pipeline::(RTX 5090,VICTORY_D3D12_DEBUG=1): 29/29 passedcargo test --locked -p victory-gpu --features diagnostics --lib -- pipeline::(WARP,VICTORY_D3D12_WARP=1,VICTORY_D3D12_DEBUG=1): 29/29 passedcargo clippy --locked -p victory-gpu --tests -- -D warnings(default and--features diagnostics): 0 warningscargo xtask policy:191 files okImported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T02:03:08Z.
Review: APPROVED
Tested merged onto
origin/main(63bcca4) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + WARP):cargo test -p victory-gpu --lib pipeline::: 26 passed, 0 failed (RTX 5090 hardware, including all 3 new tests:omitted_stream_depth_defaults_to_dsv_format,explicit_stream_depth_overrides_dsv_default, andomitted_stream_depth_builds_forced_sample_count_pipeline).VICTORY_WARP=1 cargo test -p victory-gpu --lib pipeline::host::tests: 7 passed, 0 failed.cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Defaulting
DepthEnabletofalsewhen a pipeline stream omits both a depth-stencil subobject (11 | 21) and a DSV format (DXGI_FORMAT_UNKNOWN) matches D3D12 stream defaults and unblocksForcedSampleCount > 0pipelines cleanly.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Imported from Marvisak/VIctory. Originally posted by oni-swr on 2026-11-26T01:51:00Z.
Independent test report for
2cdb5e396f24b8cdf1baf27b3f24a8b29cfae404, with the exact parent63bcca43c6a00a758510398fa43096ce7e4f7df0as the control. Claim: #1633.Setup: Windows 11 Pro 10.0.26200, Rust 1.98.1. Built with
--features diagnosticsandVICTORY_D3D12_WARP=1. A probe confirmed that the device the pipelines were made on isMicrosoft Basic Render Driver(vendor 0x1414, device 0x8c,DXGI_ADAPTER_FLAG_SOFTWARE, no dedicated memory). Nothing ran on a physical GPU. All inputs were synthetic: FXC-compiled trivial VS/PS and hand-built streams. No game files were used.PR tests:
cargo test -j 4 --locked -p victory-gpu --features diagnostics --lib -- pipeline:: --test-threads=1omitted_stream_depth_defaults_to_dsv_formatfails because DepthEnable is true without a DSV format.omitted_stream_depth_builds_forced_sample_count_pipelinefails because WARP refuses the PSO.explicit_stream_depth_overrides_dsv_defaultpasses on both revisions.Live WARP matrix (local, uncommitted probe): RTV R8G8B8A8,
HostPipeline::new. Each cell is DepthEnable / PSO built.The change only affects streams with no depth-stencil subobject and no DSV format. A depth-stencil subobject is still honored when explicitly present, in either order relative to the DSV format. That includes an explicit DepthEnable=TRUE with FSC=1, which WARP refuses on both revisions. A DSV format with no depth-stencil subobject still enables depth. The plain color-only pipeline builds on both revisions.
Broader checks at head:
cargo test -j 4 --locked -p victory-gpu --features diagnostics --lib: 249 passed, 0 failed, 1 ignored.cargo clippy -j 4 --locked -p victory-gpu --features diagnostics --tests -- -D warnings: clean.cargo xtask policy: 191 files ok.Limits:
a_prebuild_is_the_pipeline_the_title_creates.This is an independent test only, not a review. Prepared with Claude Code (Claude Opus 5.5).
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-26T02:26:31Z.
Review: COMMENTED
Verified: a pipeline-state stream without a DEPTH_STENCIL subobject left DepthEnable at the default true, which fails CreateGraphicsPipelineState when no DSV format is present — the ForcedSampleCount test hits exactly that. The fix preserves D3D12 stream semantics: explicit depth subobject still wins (kind 11/21 for DESC/DESC1), a DSV format alone keeps DepthEnable=true.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T05:32:17Z.
Automated triage for the maintainers.
Merge candidate.
read_streaminvictory-gpu/src/pipeline.rsnow records whether a stream has a depth-stencil subobject (kind 11 or 21, the only twoGraphicsState::readhandles). After parsing,GraphicsState::apply_stream_defaultsinpipeline/host.rsturns depth testing off when a stream has neither that subobject nor a DSV format. As far as I know, this is also how the public d3dx12 stream parse helper (DirectX-Headers) sets up a stream's default depth-stencil state. It runs after parsing, so subobject order does not matter, and the runtime and prebuild paths share it. The tests cover both defaults, an explicit 11/21 overriding them in either order, and a live PSO build withForcedSampleCount = 1(the case the host refused before). An independent WARP run in the comments shows the same before/after matrix.CI: passing. Recommending a look, not approving.
Generated by Claude Code
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.