GPU: disable implicit stream depth test without a DSV format #2535
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2535"
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 trustno1-coder/VIctory-NVIDIA. Originally posted by fuzeofficlal on 2026-11-29T13:56:43Z.
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) increate_stream(crates/victory-gpu/src/pipeline.rs) and callGraphicsState::apply_stream_defaults(has_depth_stencil)once all subobjects are parsed (independent of subobject order relative toDSVFormatkind16).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 color-only streams withForcedSampleCount = 1.Verification
cargo test --locked -p victory-gpu --lib pipeline::host::tests::omitted_stream_depth&explicit_stream_depth_overrides_dsv_default— pass on RTX 5090 (VICTORY_ADAPTER=NVIDIA,VICTORY_D3D12_DEBUG=1) and WARP (VICTORY_D3D12_WARP=1,VICTORY_D3D12_DEBUG=1).cargo clippy --locked -p victory-gpu --tests— 0 new warnings in touched files.cargo run --quiet --locked -p xtask -- policy --staged— pass.