GPU: handle typed D16/D32 and multisample depth twins #2173
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!2173
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2173"
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-25 06:59 UTC · original
fuzeofficlal:fix/gpu-depth-twin-d16-and-msaa→main· +143 −2 · 2 files · 1 commits · openProblem
ALLOW_UNORDERED_ACCESS. D3D12 rejects that (a multisample resource needs the render target or depth stencil flag), and the debug layer reports it as an error.D16_UNORM/D32_FLOAT). Its copyable footprint format then did not match the twin plane's typeless format (R16_TYPELESS/R32_TYPELESS), so the twin was refused as needing a conversion and the unordered writes were dropped.Changes
twin::makereturns early for multisample depth textures, logging it once, before creating anything.D16_UNORM,D32_FLOAT) are renamed to their typeless plane format, so the same bytes are copied straight through. Formats with stencil keep their per-plane footprints.Verification
cargo test -p victory-gpu --lockedon hardware: the 2 failures already on main are unrelated. WithVICTORY_D3D12_WARP=1: all pass. The new test also passes withVICTORY_D3D12_DEBUG=1, and fails without either fix.-D warnings(default anddiagnostics), rustfmt on the changed hunks, andcargo xtask policyall pass.@MamaLeVrai on GitHub · 2026-11-25 07:58 UTC · original
Test report on real hardware: AMD RX 6950 XT (RDNA2), Windows 11, Rust 1.98.1, with a GPU present, so the hardware-only shader checks run. I merged this PR's head
cdd11bd2intomain940d32fin a throwaway tree (no conflict).cargo clippy --workspace --all-targets --locked -- -D warnings: clean; the same with--all-features: clean.cargo test --workspace --locked: 702 passed, 0 failed, 10 ignored, two runs (mainalone on the same machine: 701 passed, 0 failed, 10 ignored). The title was not run, so this says nothing about in-game effect. No game data.AI-assisted (Claude Code); no game data.
@Marvisak on GitHub · 2026-11-25 12:37 UTC · original · edited 2026-11-26 01:21 UTC
Automated triage for the maintainers.
Merge candidate (a recommendation to look, not an approval). The new head is a single commit on current
mainwith the same change as before. Incrates/victory-gpu/src/twin.rs,makerefuses multisample depth textures with a one-time log before creating anything. For depth textures the host keeps typed, it renames theD16_UNORM/D32_FLOATcopy footprints to the plane's typeless format, so the bytes copy through without a conversion. Formats with stencil keep their per-plane footprints. The GPU testa_typed_depth_texture_shares_its_bytes_with_its_twin(draw.rs) checks both formats in both directions and checks that a multisample texture gets no twin and raises no debug-layer error.The branch merges cleanly. CI:
checkpassing.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.