GPU: read single-plane depth textures into guest buffers #3006
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!3006
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3006"
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?
@andrewpozdnakov7-jpg on GitHub · 2026-11-26 03:15 UTC · original
andrewpozdnakov7-jpg:codex2/depth-copy-readback→main· +122 −3 · 2 files · 2 commits · openThe guest CopyTextureRegion readback path discards copies from any depth resource. Allow whole, single-sampled D16 and D32 subresources with a compatible single-plane footprint. The depth case checks the source subresource, the destination origin and the whole-subresource rule before recording the copy. It uses the existing pitched row transfer into the guest buffer. CopyTextureRegion requirements
Verification
AI-assisted with Codex.
@steven-seagull27 on GitHub · 2026-11-26 03:28 UTC · original
Independent RTX 5080 and Windows built-in WARP readback on
7a11b21: 12,024/12,024 depth texels matched on each adapter, alongside the original clipped RGBA8 and depth cases. The new fixture uses D32_FLOAT, R32_TYPELESS, D16_UNORM and R16_TYPELESS. Each resource has two array slices and three mips (131×9, 65×4, 32×2).I filled each mip/slice with two distinct native DSV clears, then read all six through the guest command list in reverse order. Destination footprints begin at separate aligned offsets, have 256 extra bytes of row pitch, and end exactly after the final row's payload. All pitch and alignment padding retained its sentinel. On parent
63bcca4, all four depth formats failed the new check on both adapters. As a sensitivity check, deliberately taking each mip from the first array slice failed at subresource 3 (slice 1, mip 0) in all four formats on both adapters.The test-only commit
18fce85applies on your PR. Runcargo test --locked -p victory-gpu --features diagnostics --lib depth_mips_and_array_slices -- --nocapture, and repeat withVICTORY_D3D12_WARP=1for the software pass. Both adapters ran withVICTORY_D3D12_DEBUG=1.@Marvisak on GitHub · 2026-11-26 06:16 UTC · original · edited 2026-11-26 07:19 UTC
Automated triage for the maintainers.
Thanks, the test is now tidy. In
crates/victory-gpu/src/resource.rsthe branch diff only adds a separate depth test, and the RGBA8 test is untouched. Thelist.rs::read_backchecks are unchanged and still look consistent with the D3D12 copy rules.As you say, the main point is still open. In
main, refusing to read back a depth texture is a deliberate shortcut until a title is seen doing it. Lifting it needs evidence that GTA VI reads a depth texture back into a buffer, for example the "texture to buffer copy refused: a depth or stencil texture" warning firing in a diagnostics run. It also needs confirmation that the console's layout for these formats matches the host's single-plane rows on this path. With that, this would be a good candidate.CI: passing.
Generated by Claude Code
@andrewpozdnakov7-jpg on GitHub · 2026-11-26 06:41 UTC · original
Commit 34c28df restores the existing RGBA8 test verbatim and adds a separate synthetic test for D16 and D32, including their typeless counterparts. In the full branch diff,
resource.rsnow only adds the depth test.With that fixture on
63bcca43, all four destination buffers stay untouched. The same fixture with the fix returns the exact depth texels and preserves every padding byte. The original RGBA8 test passes. App-local WARP GPU suite 247 passed and 1 ignored. Strict GPU Clippy passed in both modes, and asset policy passed.The evidence here is for the synthetic guest copy and the host D3D12 layout. The requested title usage and console layout confirmation are still open.
Please retain the Git author when moving the test. If it is folded into another commit, please add
Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.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.