GPU/Resource: support 2-plane D16_UNORM_S8_UINT formats (118..=120) in GetCopyableFootprints #3057
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!3057
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-3057"
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?
@RVZO6 on GitHub · 2026-11-26 05:43 UTC · original
RVZO6:rvzo/d16-s8-footprints→main· +55 −5 · 1 files · 1 commits · openProblem
In
crates/victory-gpu/src/resource.rs,subresource()(used byGetCopyableFootprints) only recognizes 2-plane depth-stencil formats19..=22(D32_FLOAT_S8X24_UINTfamily) and44..=47(D24_UNORM_S8_UINTfamily), omitting console 2-plane 16-bit depth + 8-bit stencil formats118..=120(DXGI_FORMAT_D16_UNORM_S8_UINT,R16_UNORM_X8_TYPELESS,X16_TYPELESS_G8_UINT— already treated as 2-plane[R16, R8]intwin.rs:101andvictory-formats/src/texture.rs:766).On
main:(desc.format, 256), returning raw console format118..=120withelement == (3, 1)(1.5xwrongrow_size, 256-byte row alignment instead of 512).None, causingcopyable_footprintsto emitNO_FOOTPRINT(u64::MAX) andtotal = u64::MAX.Fix
Handle
(118..=120, 0) => (53, 512)(DXGI_FORMAT_R16_TYPELESS, 2 B/texel) and(118..=120, 1) => (60, 512)(DXGI_FORMAT_R8_TYPELESS, 1 B/texel) insubresource(). Disjoint from #1543 (which adds checked arithmetic overflow guards).Verification
resource::tests::d16_s8_depth_stencil_footprints_follow_the_pc_plane_order(2 mips × 2 slices × 2 planes across formats118..=120).format 118with plane-0(512, 118, ...)/256-aligned offsets and plane-1u64::MAX; passes 2/2 after fix.windows-latestMSVC + WARP SM 6.6 CI (cargo clippy --workspace --all-targets --locked -- -D warnings,--all-features,xtask policy, full workspace tests): https://github.com/RVZO6/VIctory/actions/runs/45762903919AI-assisted: T3 Code (Antigravity, gemini-4-neon)
@Marvisak on GitHub · 2026-11-26 06:16 UTC · original
Automated triage for the maintainers.
Merge candidate.
subresource()incrates/victory-gpu/src/resource.rs(behindGetCopyableFootprints) treated only formats 19..=22 and 44..=47 as two-plane depth-stencil, so the 16-bit depth + stencil formats 118..=120 got the raw format with a 256-byte pitch for plane 0 andNO_FOOTPRINTfor plane 1. The PR maps them to R16_TYPELESS (53) and R8_TYPELESS (60) with 512-byte row alignment, which matches how the rest of the repo already splits these formats (twin.rsplane_formats:[R16, R8];victory-formatstexture::format: 2 bytes with stencil). I checked the new test's expected offsets, row sizes and total by hand.These footprints follow the PC plane-copy rules by analogy with the D32S8/D24S8 cases. Nobody has confirmed them against the console runtime, but on
mainplane 1 has no footprint at all.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.