GPU: Keep RGB9E5 placed texture views format compatible #3537

Open
github-bot wants to merge 1 commit from github-bot/gh-3537 into main AGit
Owner

@⁠GaussianGuaicai on GitHub · 2026-11-27 15:29 UTC · original
GaussianGuaicai:fix/rgb9e5-placed-views → main · +46 −15 · 2 files · 1 commits · open

Keep RGB9E5 and R32_UINT placed aliases on distinct host textures to avoid an unsupported cross-format SRV. Do not inherit usage flags between the two formats, so the separate RGB9E5 read texture does not inherit UAV usage and fail creation.

The regression verifies distinct SRV/UAV resources and successful alias-copy pixel readback.

Windows validation: three D3D12 placed-view tests with diagnostics, one format-list test, and strict Clippy for victory-gpu with all targets and diagnostics. No game or BSOD validation.

**@⁠GaussianGuaicai** on GitHub · 2026-11-27 15:29 UTC · [original](https://github.com/Marvisak/VIctory/pull/3537) `GaussianGuaicai:fix/rgb9e5-placed-views` → `main` · +46 −15 · 2 files · 1 commits · open Keep RGB9E5 and R32_UINT placed aliases on distinct host textures to avoid an unsupported cross-format SRV. Do not inherit usage flags between the two formats, so the separate RGB9E5 read texture does not inherit UAV usage and fail creation. The regression verifies distinct SRV/UAV resources and successful alias-copy pixel readback. Windows validation: three D3D12 placed-view tests with diagnostics, one format-list test, and strict Clippy for `victory-gpu` with all targets and diagnostics. No game or BSOD validation.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 15:32:28 +00:00
Author
Owner

@⁠oni-swr on GitHub · 2026-11-27 16:20 UTC · original

Independent verification of #3537 at 7197120e, base main 63bcca43. Verification only, no code pushed, no game data. AI-assisted (Claude Sonnet 5.5).

Setup: Windows 11 26200, WARP (VICTORY_WARP=1, VICTORY_D3D12_WARP=1), Windows SDK 26100 dxil.dll, cargo test -p victory-gpu --lib --features diagnostics, cargo clippy -p victory-gpu --all-targets -- -D warnings (with and without diagnostics).

Run base 63bcca43 head 7197120e
WARP lib 246 passed, 0 failed, 1 ignored 247 passed, 0 failed, 1 ignored
clippy -D warnings clean clean

The new an_rgb9e5_placed_view_reads_through_distinct_host_textures passes on WARP and asserts a D3D12 host exists, so it ran rather than skipped. Not run on a physical GPU.

Diff reading: the usage-flag change only skips inheriting flags between the 42/67 pair, so I saw no regression for other formats.

Non-blocking question (unproven): takes() changed from family(c) == family(d.format) to t.castable.contains(&d.format). That reaches beyond the RGB9E5/R32_UINT pair. A typeless d.format, which castable excludes, matched through its family before and no longer does, so such a texture would get its own host texture instead of sharing. Is that intended? No test fails on it and I did not construct a case.

**@⁠oni-swr** on GitHub · 2026-11-27 16:20 UTC · [original](https://github.com/Marvisak/VIctory/pull/3537#issuecomment-7223152340) Independent verification of #3537 at 7197120e, base main 63bcca43. Verification only, no code pushed, no game data. AI-assisted (Claude Sonnet 5.5). **Setup:** Windows 11 26200, WARP (`VICTORY_WARP=1`, `VICTORY_D3D12_WARP=1`), Windows SDK 26100 `dxil.dll`, `cargo test -p victory-gpu --lib --features diagnostics`, `cargo clippy -p victory-gpu --all-targets -- -D warnings` (with and without `diagnostics`). | Run | base 63bcca43 | head 7197120e | |---|---|---| | WARP lib | 246 passed, 0 failed, 1 ignored | 247 passed, 0 failed, 1 ignored | | clippy `-D warnings` | clean | clean | The new `an_rgb9e5_placed_view_reads_through_distinct_host_textures` passes on WARP and asserts a D3D12 host exists, so it ran rather than skipped. Not run on a physical GPU. **Diff reading:** the usage-flag change only skips inheriting flags between the 42/67 pair, so I saw no regression for other formats. **Non-blocking question (unproven):** `takes()` changed from `family(c) == family(d.format)` to `t.castable.contains(&d.format)`. That reaches beyond the RGB9E5/R32_UINT pair. A typeless `d.format`, which `castable` excludes, matched through its family before and no longer does, so such a texture would get its own host texture instead of sharing. Is that intended? No test fails on it and I did not construct a case.
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-27 16:41 UTC · original

I reproduced the sharing change from the review on 7197120 using synthetic placed textures. With unordered access enabled, host_desc makes an R8G8B8A8_UNORM_SRGB texture typeless. An existing R32_UINT host texture can already list both its typed view formats, but that typeless description still caused a second allocation. Review question

The proposed follow-up uses the original sRGB format when checking that case. It reuses the host texture only when the cast list contains both the sRGB read format and the linear UAV format. Commit 72883f2

  • The allocation regression failed on 7197120 and passed with the follow-up.
  • A separate synthetic compute fixture wrote through the linear UAV and read four expected pixels through the sRGB SRV on the same host texture.
  • With Agility 1.620.2 and WARP 1.0.22, 248 repository tests passed and 1 was ignored. The RGB9E5/R32_UINT test still verified separate textures and correct readback. A temporary test confirmed both app-local modules. Strict GPU Clippy passed with default and all features, and the asset policy passed.

The next step is for the PR author to decide whether to take the follow-up. If reusing it, please retain the Git author on cherry-pick or rebase. If folding it into another commit, please use Co-authored-by: andrewpozdnakov7-jpg <[email protected]>.

AI-assisted with OpenAI Codex.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-27 16:41 UTC · [original](https://github.com/Marvisak/VIctory/pull/3537#issuecomment-7223552352) I reproduced the sharing change from the review on `7197120` using synthetic placed textures. With unordered access enabled, `host_desc` makes an `R8G8B8A8_UNORM_SRGB` texture typeless. An existing `R32_UINT` host texture can already list both its typed view formats, but that typeless description still caused a second allocation. [Review question](https://git.gtahub.st/github/Marvisak--VIctory/pulls/3537) The proposed follow-up uses the original sRGB format when checking that case. It reuses the host texture only when the cast list contains both the sRGB read format and the linear UAV format. [Commit `72883f2`](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/72883f2e69467c761e625409dbd0aa222470f5c8) - The allocation regression failed on `7197120` and passed with the follow-up. - A separate synthetic compute fixture wrote through the linear UAV and read four expected pixels through the sRGB SRV on the same host texture. - With Agility 1.620.2 and WARP 1.0.22, 248 repository tests passed and 1 was ignored. The RGB9E5/R32_UINT test still verified separate textures and correct readback. A temporary test confirmed both app-local modules. Strict GPU Clippy passed with default and all features, and the asset policy passed. The next step is for the PR author to decide whether to take the follow-up. If reusing it, please retain the Git author on cherry-pick or rebase. If folding it into another commit, please use `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>`. AI-assisted with OpenAI Codex.
Author
Owner

@⁠futurepro62 on GitHub · 2026-11-27 20:49 UTC · original

NVIDIA full-suite run, to go with the reports above by oni-swr, since none of them names a GPU run. Tested exact head 7197120 (on its base 63bcca4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), dxil.dll from Windows SDK 10.0.26100 (the loader's default), debug.
  • cargo build --workspace --locked, then cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 867 passed, 0 failed, 10 ignored.
  • The new tests ran and passed: an_rgb9e5_placed_view_reads_through_distinct_host_textures.
  • --skip leaves out tests that fail on main 63bcca4 on this card too, not because of this PR: heap_direct_texture_reads_mark_their_heap_index ends the victory-shader test process with 0xc0000005 (#2571), so without the skip the rest of that crate never reports; dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views and the two stride_tests hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); gathers_at_a_level_match_the_hardware fails on lane 0 (#1744).

Not tested

  • AMD (the tests take the default adapter), a release build, the title (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
**@⁠futurepro62** on GitHub · 2026-11-27 20:49 UTC · [original](https://github.com/Marvisak/VIctory/pull/3537#issuecomment-7227873428) NVIDIA full-suite run, to go with the reports above by oni-swr, since none of them names a GPU run. Tested exact head `7197120` (on its base `63bcca4`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), `dxil.dll` from Windows SDK 10.0.26100 (the loader's default), debug. - `cargo build --workspace --locked`, then `cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware`: **867 passed, 0 failed, 10 ignored**. - The new tests ran and passed: `an_rgb9e5_placed_view_reads_through_distinct_host_textures`. - `--skip` leaves out tests that fail on main `63bcca4` on this card too, not because of this PR: `heap_direct_texture_reads_mark_their_heap_index` ends the `victory-shader` test process with `0xc0000005` (#2571), so without the skip the rest of that crate never reports; `dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views` and the two `stride_tests` hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); `gathers_at_a_level_match_the_hardware` fails on lane 0 (#1744). **Not tested** - AMD (the tests take the default adapter), a release build, the title (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
This pull request can be merged automatically.
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/3537/head:github-bot/gh-3537'
git switch 'github-bot/gh-3537'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-3537'
git switch 'github-bot/gh-3537'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-3537'
git switch 'github-bot/gh-3537'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-3537'
git switch 'main'
git merge --squash 'github-bot/gh-3537'
git switch 'main'
git merge --ff-only 'github-bot/gh-3537'
git switch 'main'
git merge 'github-bot/gh-3537'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!3537
No description provided.