Texture alias: test that a direct R32 to R9G9B9E5 copy reads back the same bits as the copy through a buffer #1826
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1826"
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 trustno1-coder/VIctory-NVIDIA. Originally posted by 101Leafy on 2026-11-29T00:32:31Z.
There is no test yet that a copy straight across between the R32 and R9G9B9E5 alias formats leaves the same bits as the copy through a buffer. A wrong answer here would show up only as off colors in a title.
The new test fills a texture with words that are all different. The first few sit at the edges of the shared exponent format. It copies the texture straight across and through a buffer in both directions. Then it reads every level and layer back. It also covers a texture the host writes as a render target or with a shader.
Off by default: it is a test only and changes nothing at run time.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by upipibi on 2026-11-29T02:36:12Z.
Test report for #1826, tested at head
7f594f01merged--no-ffonto maind585f883. The PR has since been restacked to3e047fef; its test commit is the same patch. Synthetic tests only: no title run, no game files.Setup: RTX 3070, driver 616.56, Windows 11 (10.0.26100), rustc 1.98.1. WARP runs use
VICTORY_D3D12_WARP=1with
--features diagnostics.texture::alias_copy_tests::a_direct_alias_copy_keeps_every_bit: 3/3 pass on hardware, 3/3 on WARP.The test reaches the device. It makes the textures and buffers on the host device and copies and reads them back on
the card. I added a temporary print (not committed) of the adapter
host()chose:Negative control: the PR changes only test code, and the test does not call
texture::alias(it is named onlyin a doc comment), so there is no fix to revert. Instead I skipped the straight-across copy, so the destination
keeps what it was created with. The test fails on hardware and on WARP at the first texel that differs:
straight across, (DXGI_FORMAT(42), D3D12_RESOURCE_FLAGS(4)) to (DXGI_FORMAT(67), D3D12_RESOURCE_FLAGS(0)), part 0 texel 1.So its checks catch a copy that does not keep the bits.
What it covers is the D3D12 runtime and driver: a direct R32_UINT/SINT and R9G9B9E5_SHAREDEXP copy gives the same
bits as a copy through a buffer, in both directions, on every level and layer. That holds on the RTX 3070 and on WARP.
It does not run victory's own alias path. A test that calls
texture::aliaswithVICTORY_ALIAS_DIRECT=1(#1730)would cover that code.
cargo test -p victory-gpu --lib --lockedd585f883--features diagnosticsNot tested: the effect in a title.
Tested with the help of Claude Code (Claude Opus 5.5).