Capture: save packed R10G10B10A2 presentation frames #2827
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!2827
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2827"
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-25 21:35 UTC · original
andrewpozdnakov7-jpg:codex2/capture-rgb10-frame→main· +124 −28 · 1 files · 2 commits · openThe presenter already copies R10G10B10A2 textures into an UNORM swap chain, but the frame PNG path discards their readback. Decode the packed RGB fields while sampling pixels for the existing 8-bit PNG. UINT and TYPELESS use the displayed UNORM interpretation of the same packed colors. DXGI format documentation
The committed test encodes padded synthetic rows in-process through the same format selection and PNG encoder used by readback. It decodes the PNG and checks the dimensions and sampled RGB values for RGBA8, BGRA8, RGB10 UNORM, TYPELESS and UINT.
The original D3D12 fixture on inbox and Agility WARP produced the RGBA8 control PNG and skipped the 10-bit frame on the original base. With this change the same fixture produces the expected PNG for the control, the UNORM target and the TYPELESS target with an UNORM view. I reran the fixture on Agility WARP after the test refactor. Full GPU diagnostics passed (247 tests, one ignored), along with strict GPU Clippy in both builds and asset policy.
Coordination claim
AI-assisted with Codex.
@fuzeofficlal on GitHub · 2026-11-25 22:47 UTC · original
Verified
8e7fd059on Windows 11 (RTX 5090 + WARP) againstmain(f3578e3):cargo xtask policy(190 files ok),cargo clippy --locked -p victory-gpu --all-targets(default &--features diagnostics, 0 warnings).--features diagnostics):capture::tests3/3 passed (includingpacked_10_bit_frames_are_saved_as_rgb_pngs).R=[9:0],G=[19:10],B=[29:20]) and rounded scaling((c * 255 + 511) / 1023) as u8are exact (0->0,511->127,512->128,1023->255, max intermediate261,376), and switchingsave_read_back's mapped slice length tobuffer.GetDesc().Width as usizecleanly fixes the potential last-rowRowPitch * Heightover-read.Looks clean and ready to merge.
@Marvisak on GitHub · 2026-11-26 02:22 UTC · original · edited 2026-11-26 03:19 UTC
Automated triage for the maintainers.
Verdict: merge candidate. Re-reviewed at
ce361dc, which merges cleanly intomain. The test no longer starts a child process.packed_10_bit_frames_are_saved_as_rgb_pngsnow callsencode_rgb_pngon synthetic padded rows in-process and inflates the PNG to check the sampled pixels for five formats.PngPixel::for_present_formatincrates/victory-gpu/src/capture.rshandles the same R10G10B10A2 formats (TYPELESS/UNORM/UINT) thatswap_formatinhost.rscopies into a UNORM swap chain, and a comment now explains the UINT case. The 10-bit to 8-bit scaling rounds correctly. Sizing the mapped slice from the buffer's own width also avoids reading past the end on the last row.CI: passing. Recommending a look, not approving.
Generated by Claude Code
@andrewpozdnakov7-jpg on GitHub · 2026-11-26 02:33 UTC · original
ce361dc replaces the self-spawned fixture with an in-process test of the production PNG encoder. The test decodes the resulting image for five source formats and checks the dimensions, pixel order, 10-bit rounding and padded-row sampling. The format selection documents the UNORM swap-chain interpretation for UINT sources.
The new regression passes. I also reran the original 4x2 D3D12 readback fixture privately on Agility WARP with this production code, and all three PNGs matched. Full GPU diagnostics passed (247 tests, one ignored), along with both strict Clippy builds and asset policy.
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.