GPU: preserve compatible read states for read-only depth targets #485
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!485
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-485"
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-24 03:57 UTC · original
fuzeofficlal:fix/read-only-depth-state→main· +264 −21 · 1 files · 1 commits · openA graphics draw can read a depth texture through a read-only DSV and an SRV at the same time. The host table path requests shader-resource state, then draw preparation requests DEPTH_WRITE and replaces it. This change preserves DEPTH_READ and adds the shader-resource bits when the same draw references the depth texture through an SRV table. Unsampled read-only depth uses DEPTH_READ alone. A depth/stencil view with a writable plane keeps the existing whole-resource behavior.
The synthetic D32 test uses an actual read-only DSV and an R32_FLOAT SRV on the same texture. On
d2a4bae, table preparation recorded0xc0instead of0xe0. On5805f73, the test observes0x20before sampling and0xe0after table and depth preparation. The writable DSV control ends in DEPTH_WRITE. These checks cover recorded resource states through the ordinary descriptor table; pixel output and mixed depth/stencil planes are outside the fixture.Windows 11 Pro build 26200, Rust 1.98.1 MSVC. With
VICTORY_D3D12_DEBUG=1,cargo test --locked --offline -p victory-gpu --features diagnostics -- --test-threads=1passed with 46 tests and one ignored benchmark. The focusedshader_table_keeps_read_only_depth_statetest also passed withVICTORY_D3D12_WARP=1. The staged asset policy check passed.D3D12 resource states
@DaviTostes on GitHub · 2026-11-24 04:02 UTC · original
Verified
5805f73on Arch Linux x86_64, Windows MSVC release build under Wine 11.22 (victory-gpu,--test-threads=1): 44 passed, 0 failed, 1 ignored (one more thanmain, presumably the new read-state case).Not covered: read-only depth targets in the title's world passes (no game data here).
@fuzeofficlal on GitHub · 2026-11-24 04:04 UTC · original
Pixel readback follow-up for
5805f73on Windows 11 build 26200, Rust 1.98.1 MSVC. The same synthetic 4×4 D32 texture was bound through VIctory's read-only DSV and R32_FLOAT SRV table paths. A native test PSO draws through the recorded state, with depth initially cleared to 0.25.The local synthetic extension ran with
VICTORY_D3D12_DEBUG=1andcargo test --locked --offline -p victory-gpu --features diagnostics shader_table_keeps_read_only_depth_state -- --nocapture --test-threads=1. WARP usedVICTORY_D3D12_WARP=1. Coverage is the host raster path with VIctory's target and descriptor state preparation.@Marvisak on GitHub · 2026-11-25 00:20 UTC · original · edited 2026-11-26 01:23 UTC
Automated triage for the maintainers.
Merge candidate (re-reviewed after the push). The new head
d2052d5is a rebase of the earlier782b7afonto842b0cb. The range-diff shows only context changes (the newdepth_boundsfield, thealias_sourcecopy inreadable), and the PR merges cleanly. The logic incrates/victory-gpu/src/draw.rsis the same.set_targetsrecords the read-only DSV state (depth_state, which also needs the stencil plane read-only for stencil formats).readable_for_drawandensure_depth_staterequestDEPTH_READ | shader-resourcewhen the same draw samples that texture, anddepth_sampledis reset per draw and per target change. Writable DSVs and compute keep the old behaviour.CI: passing (
check).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.