Texture alias: test that a direct R32 to R9G9B9E5 copy reads back the same bits as the copy through a buffer #1826

Merged
101Leafy merged 4 commits from upstream-pr/1826 into main 2026-11-29 08:16:53 +00:00
101Leafy commented 2026-11-29 00:32:31 +00:00 (Migrated from github.com)

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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5546061163 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1826). Originally posted by [101Leafy](https://github.com/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.
upipibi commented 2026-11-29 02:36:12 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by upipibi on 2026-11-29T02:36:12Z.


Test report for #1826, tested at head 7f594f01 merged --no-ff onto main d585f883. The PR has since been restacked to 3e047fef; 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=1
with --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:

  • hardware runs: "NVIDIA GeForce RTX 3070" every time;
  • WARP runs: "Microsoft Basic Render Driver" every time.

Negative control: the PR changes only test code, and the test does not call texture::alias (it is named only
in 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::alias with VICTORY_ALIAS_DIRECT=1 (#1730)
would cover that code.

cargo test -p victory-gpu --lib --locked

Run PR Main d585f883
default 590 passed, 0 failed, 44 ignored 589 passed, 0 failed, 44 ignored
--features diagnostics 644 passed, 0 failed, 44 ignored 643 passed, 0 failed, 44 ignored

Not tested: the effect in a title.

Tested with the help of Claude Code (Claude Opus 5.5).

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7249531221 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/1826#issuecomment-7249531221). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-29T02:36:12Z. --- Test report for #1826, tested at head 7f594f01 merged `--no-ff` onto main d585f883. The PR has since been restacked to 3e047fef; 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=1` with `--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: - hardware runs: "NVIDIA GeForce RTX 3070" every time; - WARP runs: "Microsoft Basic Render Driver" every time. **Negative control:** the PR changes only test code, and the test does not call `texture::alias` (it is named only in 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::alias` with `VICTORY_ALIAS_DIRECT=1` (#1730) would cover that code. **`cargo test -p victory-gpu --lib --locked`** | Run | PR | Main d585f883 | |---|---|---| | default | 590 passed, 0 failed, 44 ignored | 589 passed, 0 failed, 44 ignored | | `--features diagnostics` | 644 passed, 0 failed, 44 ignored | 643 passed, 0 failed, 44 ignored | Not tested: the effect in a title. *Tested with the help of Claude Code (Claude Opus 5.5).*
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
trustno1-coder/VIctory-NVIDIA!1826
No description provided.