Repository navigation
GPU: handle typed D16/D32 and multisample depth twins - #2173
fuzeofficlal wants to merge 1 commit into
Conversation
DenRakEiw
left a comment
There was a problem hiding this comment.
Verified locally merged onto origin/main (940d32f, Windows 11 x64, NVIDIA GeForce RTX 5090, Rust 1.98.1 MSVC):
cargo test -p victory-gpu --lib a_typed_depth_texture_shares_its_bytes_with_its_twin— passed on RTX 5090cargo clippy -p victory-gpu --all-targets— 0 warningscargo xtask policy— ok (183 files ok)
Clean handling of typed D16/D32 and multisample depth twins with end-to-end GPU test coverage. Looks good.
AI-assisted (Gemini 4 Neon).
|
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 AI-assisted (Claude Code); no game data. |
|
Automated triage for the maintainers. Merge candidate (a recommendation to look, not an approval). The new head is a single commit on current The branch merges cleanly. CI: Generated by Claude Code |
A multisample depth texture got a twin created with its sample count and only ALLOW_UNORDERED_ACCESS, which D3D12 rejects (a multisample resource needs the render target or depth stencil flag) and the debug layer reports as an error. Such a texture now gets no twin: make() logs it once and returns before creating anything. A 16- or 32-bit depth texture that denies shader reads stays in its typed format on the host (D16_UNORM, D32_FLOAT), so its copyable footprint format no longer equalled the twin plane's typeless one (R16_TYPELESS, R32_TYPELESS) and the twin was refused as needing a conversion. The bytes are the same, so the footprint now names the typeless format and the plane is copied straight through. Formats with stencil keep their per-plane footprints and are unaffected.
cdd11bd to
ec7d678
Compare
…ample depth twins
Problem
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.