GPU: return NV12 and P010 luma and chroma copy footprints #1982
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1984"
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?
Imported from Marvisak/VIctory. Originally posted by yuniskh on 2026-11-25T02:19:36Z.
On
ccfb029,GetCopyableFootprintsreturned zero widths and heights for a valid two-slice NV12 array. This change returns full-size luma footprints and chroma footprints at half the width and height for NV12 and P010. It uses each plane’s native copy format and aligns row pitches to 512 bytes. The regression checks the plane order for two array slices and a query starting at the first chroma slice.Original hardware testing and measurements by YUNISKH (@yuniskh). On my RTX 5090 and integrated AMD Radeon, VIctory matched native D3D12 on all 1,224 queries and all 2,880 plane entries per GPU. I tested six image sizes from 2×2 to 3840×2160, one to three array slices, and base offsets of 0, 512 and 4096 bytes.
The focused regression failed on
ccfb029and passed on this branch. The WARP diagnostics suite passed 145 tests with 2 ignored. On default hardware, 140 passed, 2 failed and 2 were ignored. Both failing descriptor-heap tests also failed on the baseline. Clippy passed forvictory-gpuwith default and all features, and the asset-policy check passed.This builds on @broccolize’s depth/stencil work in #504. @ToxicmaggotRP’s #409 covers unaligned base offsets. I used Codex to prepare and verify the change.
Original measurements · Test logs and reproduction steps
Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T02:48:40Z.
Review: COMMENTED
Static review only: victory-gpu is Windows-only (D3D12/windows_sys) — nothing compiles or runs on macOS; source review of the diff.
NV12/P010 luma+chroma copy footprints — YUV copy path completeness; pairs with #1954's texture-to-buffer copies.
Imported from Marvisak/VIctory. Originally posted by DesertGamer on 2026-11-25T02:28:01Z.
VIctory V2: community PRs, merged and tested
Open PRs sitting in the queue? V2 pulls them into one build, screens each one (binaries, build scripts, hooks, new deps) and runs tests after every batch.
Where it stands today: launches, runs the menu at 30 fps, plays the intro video, reaches the start screen and loads the world (~50 s). Entering the world is the current blocker: rendering fails with a GPU "device removed" error (tracked in issue #1).
⚠️ Entering the world on a real GPU can hang it and make Windows reset the driver. Try it at your own risk.
Not playable yet, but every batch of merged fixes moves it closer. If you have a PR that's stuck, or a GPU to test on, I'd love your help:
https://DesertGamer/VIctory-V2
Unofficial community fork of Marvisak/VIctory, GPL-3.0.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T08:26:47Z.
Automated triage for the maintainers.
Merge candidate.
resource::subresourceincrates/victory-gpu/src/resource.rsnow gives NV12 (103) and P010 (104) two planes. Each plane gets its own copy format: R8 and R8G8 for NV12, R16 and R16G16 for P010. The chroma plane is half size, and row pitches are 512-aligned. Descriptions that are not valid for these formats getNone: not 2D, more than one mip, MSAA, or odd sizes.On
main,element()has no entry for 103/104, so these queries returnedNO_FOOTPRINTand an all-ones total. I checked the following:plane = index / mips / slices), the same convention as the existing depth/stencil path.element().copyable_footprints' 512-byte placement.The evidence is a comparison against native D3D12 on NVIDIA and AMD hardware, with sizes, slices and base offsets varied. That follows the reference
mainalready uses for depth/stencil.Note for the maintainer: nothing else on
mainhandles NV12/P010 yet, so it is not shown that the title makes this query. The change is self-contained and does not affect other formats.CI:
checkpassing.Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T01:37:16Z.
Code review and live RTX 5090 + WARP native
GetCopyableFootprintsparity verification at head0477a4b6472emerged cleanly ontomain(63bcca43c6a0):crates/victory-gpu/src/resource.rs:373-440):TEXTURE_2D,mip_levels == 1,sample_count == 1,depth_or_array_size in 1..=2048, and even dimensions>= 2forNV12(103) andP010(104) so plane 1'sextent_shift = 1halves cleanly.ID3D12Device::GetCopyableFootprintson both NVIDIA RTX 5090 and WARP (514x258,array_size = 2,base = 512): native D3D12 uses 512-byte row pitch alignment and 512-byte offset alignment for both planar video formats, matching#1984field-for-field with 0 differences:NV12 (103):total = 792066, offsets[512, 264704, 528896, 660992],RowPitch = 1024, rows[258, 258, 129, 129], row sizes[514, 514, 514, 514]P010 (104):total = 1188356, offsets[512, 396800, 793088, 991232],RowPitch = 1536, rows[258, 258, 129, 129], row sizes[1028, 1028, 1028, 1028].VICTORY_D3D12_DEBUG=1, Rust 1.98.1):cargo xtask policy:191 files ok;cargo clippy --locked -p victory-gpu --tests -- -D warnings: 0 warningsvictory-gpu -- resource::: 19/19 passed on both RTX 5090 and WARP (includingplanar_video_copy_footprints).Exact match with native D3D12 on both backends; LGTM.
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T13:09:28Z.
Review: APPROVED
Reviewed and verified
0477a4b6merged locally ontoorigin/main(63bcca43) on Windows 11 x64 (NVIDIA GeForce RTX 5090 and WARP, Rust1.98.1MSVC, Windows SDK10.0.26100.0dxil.dll; synthetic tests only, no game files).Verification
git merge-treeagainstorigin/main(63bcca43): clean.cargo xtask policy(PR head):182 files ok.cargo clippy --locked -p victory-gpu --all-targets -- -D warnings(default and--all-features, PR head and merged): 0 warnings.VICTORY_D3D12_DEBUG=1,--features diagnostics):resource::tests— 19 passed, 0 failed on both adapters (includingplanar_video_copy_footprints).ID3D12Device::GetCopyableFootprintsdifferential parity matrix (RTX 5090 and WARP):copyable_footprintsagainst live nativeID3D12Device::GetCopyableFootprintsacrossNV12(103) andP010(104) x 8 sizes (2x2,4x4,64x64,130x66,256x128,514x258,1920x1080,3840x2160) x 1-3 array slices x every valid(first, count)subrange x base offsets0,512,4096:Offset,Format,Width,Height,Depth,RowPitch,NumRows,RowSizeInBytes, andTotalBytes.odd_w,odd_h,mip_levels = 0,mip_levels = 2,sample_count = 4) for both103and104: 10/10 matched nativeu64::MAX(0xffffffffffffffff) on both RTX 5090 and WARP.Review Notes
crates/victory-gpu/src/resource.rs:349-362) enforces 2D, single mip, single sample, valid array slice count (1..=2048), and even dimensions>= 2before applying the plane 0/1 copy formats (R8/R8G8forNV12,R16/R16G16forP010), 512-byte row-pitch alignment, and half-extent shift (crates/victory-gpu/src/resource.rs:383-395).Looks good to merge.
Imported from Marvisak/VIctory. Originally posted by Dukestar69 on 2026-11-26T23:09:18Z.
Review: APPROVED
LGTM — verified on RTX 5090 (Windows / D3D12) against
origin/main(63bcca4).cargo test -p victory-gpu --lib resource:: -- --test-threads=1: all passed.cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.