GPU: ignore depth-stencil clears whose host flags mask to zero #2395
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!2395
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@fuzeofficlal on GitHub · 2026-11-29 12:40 UTC · original
fuzeofficlal:fix/gpu-clear-dsv-empty-flags→main· +192 −4 · 2 files · 1 commits · merged 2026-11-30 14:12 UTCSummary
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.@Dukestar69 on GitHub · 2026-11-29 12:47 UTC · original · approved these changes
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).