GPU: disable implicit stream depth test without a DSV format #2952
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2952
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@fuzeofficlal on GitHub · 2026-11-26 01:24 UTC · original
fuzeofficlal:fix/gpu-stream-omitted-depth-default→main· +169 −4 · 2 files · 1 commits · openSummary
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 ok@oni-swr on GitHub · 2026-11-26 01:51 UTC · original
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).
@Marvisak on GitHub · 2026-11-26 05:32 UTC · original
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.