Decode packed 16-bit BGR targets in diagnostic captures #909
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/910"
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 fxceless/victory-fork. Originally posted by Yoshi-233 on 2026-11-25T12:27:04Z.
The diagnostic target dumper skips a readback when its host format is B5G6R5_UNORM, B5G5R5A1_UNORM, or B4G4R4A4_UNORM. Decode the packed little-endian words into the RGB dump's 8-bit channels, including the sixth green bit in B5G6R5. The dump uses opaque output like the existing byte-color path.
Verification
The Windows diagnostics test reproduced the skipped dump on main. On this branch all three capture tests passed in the native Windows
victory-gputest binary with thediagnosticsfeature.The new test uses a synthetic 2×2 target in each format. It checks red, green, blue and a mixed color, sets the alpha bits differently across pixels, and puts an extra word between rows. The repository asset-policy check passed.
After main advanced to
a253706, the same three Windows tests and the full asset-policy check also passed on GitHub's test mergef098a10.Windows D3D12 capture comparison
I uploaded synthetic textures, read them back, and decoded the resulting PNGs. For each of the three formats, the large fixture sampled every one of the 65,536 packed words once. Two smaller fixtures (129×5 and 1×1) exercised padded and short rows. All nine PNGs were byte-identical on the RTX 4070 Ti SUPER at
9bf4a0fand on NVIDIA, Intel UHD 770, and WARP at the tested mergef098a10. Every decoded RGB pixel matched nearest-integer UNORM expansion.A separate typed-shader readback using
round(Texture2D.Load(...) * 255)exposed a hardware rounding detail. On both physical GPUs, up to one 8-bit step differed from the PNG in 23,200 of 65,536 B5G6R5 pixels and 21,632 of 65,536 B5G5R5A1 pixels. A 5-bit channel value of 3 gave 24 on those GPUs and 25 in the PNG. WARP matched the PNG for all three formats, and every adapter matched it for B4G4R4A4. These comparisons cover RGB. The diagnostic PNG uses opaque alpha.Imported from fxceless/victory-fork. Originally posted by avt0m4t48 on 2026-11-25T12:39:42Z.
I independently checked the packed-color conversion at
9bf4a0fand GitHub's test mergef098a10ona253706.f85101b) and current base returnedNonefor all three packed formats while passing the existing CRC and UNORM/XR-bias tests and the byte-format controls. The PR head and test merge each passed all seven tests.cargo check --locked --offline --target x86_64-pc-windows-msvc -p victory-gpu --all-targets --features diagnostics,blake3/purewith Rust 1.98.1 on Linux.The fixture stores the little-endian word
(25173 * i + 13849) mod 65536at each raster indexi. This check used synthetic data throughout. Native Windows linking and D3D12 texture readback remain outside this verification.Imported from fxceless/victory-fork. Originally posted by Yoshi-233 on 2026-11-26T01:21:13Z.
Updated this PR to current main (
c9092ec) ateebfc93. The new frame-shot code callscapture::to_rgbafrom another module. I kept its upstream visibility and added formats 85, 86 and 115 toshot::shows. Resolving only the textual conflict would have left all three formats silently filtered out before readback.I checked the change on Linux with Rust 1.98.1 and synthetic data:
cargo check --locked --target x86_64-pc-windows-gnu -p victory-gpu --all-targets --features diagnostics,blake3/purepassed. The full repository asset check reports the same 11 violations on main and this revision. This rerun did not exercise live Windows D3D12 readback through the new shot entry point.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.