GPU: ignore depth-stencil clears whose host flags mask to zero #2395
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2395"
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-29T12:40:57Z.
Summary
Ported from
Marvisak/VIctory#3150(9b3d0f4363), also coveringlist::thin::clear_dsv(VICTORY_THIN=1).list::clear_dsvmasks incomingClearDepthStencilViewflags with& 3to strip console-only bits aboveD3D12_CLEAR_FLAG_DEPTH | D3D12_CLEAR_FLAG_STENCIL, but still marked the list as writing, transitioned the depth target, allocated a host DSV, and recordedClearDepthStencilView(..., D3D12_CLEAR_FLAGS(0), ...)when the masked value was0(e.g.flags == 0or console-only flags like0x4). D3D12 rejectsClearFlags == 0(Invalid ClearFlags value (0x0)).Changes
flagswith& 3at the top oflist::clear_dsvand return early when0, beforestate.wrote(), state transitions, or recording the clear.flags & 3 == 0inlist::thin::clear_dsvas well soVICTORY_THIN=1does not serialize no-op clears.list::tests::clear_dsv_skips_empty_masked_flagsverifying thatflags == 0and0x4emit no clear, transition, or D3D12 debug layer error, while1 | 0x4clears aD32_FLOATtarget to0.25(verified via GPU readback).Verification
cargo test --locked -p victory-gpu --lib list::tests::clear_dsv_skips_empty_masked_flagson RTX 5090 (VICTORY_ADAPTER=NVIDIA,VICTORY_D3D12_DEBUG=1) and WARP (VICTORY_D3D12_WARP=1,VICTORY_D3D12_DEBUG=1): passed.cargo test --locked -p victory-gpu --lib list::tests: all passing.cargo clippy --locked -p victory-gpu --all-targets: 0 new warnings.cargo xtask policy --staged: passed.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Dukestar69 on 2026-11-29T12:47:54Z.
Review: APPROVED
Tested locally merged onto
main(829188e9).crates/victory-gpu/src/list.rsandlist/thin.rs.cargo test -p victory-gpu --lib list::passed (21 passed; 0 failed, including the newlist::tests::clear_dsv_skips_empty_masked_flagstest) with 0 new warnings.Clean guard avoiding invalid zero-flag
ClearDepthStencilViewcalls on host D3D12. LGTM.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).