GPU: report IA_INDEX_BUFFER only for unsigned index formats #3780

Open
andrewpozdnakov7-jpg wants to merge 1 commit from upstream-pr/3780 into main
andrewpozdnakov7-jpg commented 2026-11-28 18:34:27 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T18:34:27Z.


The guest FORMAT_SUPPORT mask currently sets IA_INDEX_BUFFER for every format. Keep that flag for R16_UINT and R32_UINT, the input assembler's unsigned index formats. This corrects the capability query on the guest device. D3D12 format support for R16_UINT · R32_UINT

Compared the guest device query with the native D3D12 query on WARP 1.0.22 / Agility 1.620.2. Both valid index formats matched. The nine controls (including R8_UINT, R32_FLOAT, typeless, depth and block-compressed formats) all reported a false positive on main 63bcca4. All 11 responses matched with the change, with the debug layer off and on.

The committed regression uses the guest vtable and verifies the index flag and preserved format input. Both diagnostics GPU suites passed (247 passed, one ignored), both strict Clippy configurations passed, and the asset policy passed.

Please retain the Git author on cherry-pick or rebase. If folding the change into another commit, add Co-authored-by: andrewpozdnakov7-jpg <[email protected]>. AI-assisted with OpenAI Codex. Synthetic checks only.

<!-- greyfinch-sync:Marvisak/VIctory:issue:5543363370 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3780). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T18:34:27Z. --- The guest `FORMAT_SUPPORT` mask currently sets `IA_INDEX_BUFFER` for every format. Keep that flag for `R16_UINT` and `R32_UINT`, the input assembler's unsigned index formats. This corrects the capability query on the guest device. [D3D12 format support for R16_UINT](https://learn.microsoft.com/en-us/windows/win32/direct3ddxgi/hardware-support-for-direct3d-12-0-formats#dxgi_format_r16_uintfcs-57) · [R32_UINT](https://learn.microsoft.com/en-us/windows/win32/direct3ddxgi/hardware-support-for-direct3d-12-0-formats#dxgi_format_r32_uintfcs-42) Compared the guest device query with the native D3D12 query on WARP 1.0.22 / Agility 1.620.2. Both valid index formats matched. The nine controls (including R8_UINT, R32_FLOAT, typeless, depth and block-compressed formats) all reported a false positive on main `63bcca4`. All 11 responses matched with the change, with the debug layer off and on. The committed regression uses the guest vtable and verifies the index flag and preserved format input. Both diagnostics GPU suites passed (247 passed, one ignored), both strict Clippy configurations passed, and the asset policy passed. Please retain the Git author on cherry-pick or rebase. If folding the change into another commit, add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>`. AI-assisted with OpenAI Codex. Synthetic checks only.
andrewpozdnakov7-jpg commented 2026-11-28 18:37:28 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T18:37:28Z.


Windows CI passed on 92b59e1, including both Clippy configurations and the workspace tests.

On app-local WARP 1.0.22 with Agility 1.620.2, the guest index flag matched the native D3D12 result for 2 of 11 format queries on main and 11 of 11 with this fix. Both debug-layer settings gave the same comparison and 247 passing GPU diagnostics tests with one ignored.

I also checked the local combination with #3490, #3752, #3758 and #3771. After resolving the overlapping test placement in device.rs, all 13 device tests passed with each debug-layer setting. That includes the BC, depth, blending, unknown-format and index-format regressions.

Please retain the Git author on cherry-pick or rebase, or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> if folding this into another commit. AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7243931881 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3780#issuecomment-7243931881). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T18:37:28Z. --- [Windows CI](https://github.com/Marvisak/VIctory/actions/runs/46176596860/job/141076605937) passed on `92b59e1`, including both Clippy configurations and the workspace tests. On app-local WARP 1.0.22 with Agility 1.620.2, the guest index flag matched the native D3D12 result for 2 of 11 format queries on main and 11 of 11 with this fix. Both debug-layer settings gave the same comparison and 247 passing GPU diagnostics tests with one ignored. I also checked the local combination with #3490, #3752, #3758 and #3771. After resolving the overlapping test placement in `device.rs`, all 13 device tests passed with each debug-layer setting. That includes the BC, depth, blending, unknown-format and index-format regressions. Please retain the Git author on cherry-pick or rebase, or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` if folding this into another commit. AI-assisted with OpenAI Codex.
upipibi commented 2026-11-28 19:08:51 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by upipibi on 2026-11-28T19:08:51Z.


NVIDIA row for this PR: it passes on Ampere, and its test fails on this card without the fix. This card's driver sets IA_INDEX_BUFFER only for R32_UINT and R16_UINT among the 11 formats in the test, the same as WARP. With the PR the guest answer matches it for all 11. On main it matches for 2.

RTX 3070 (desktop), driver 616.56, Windows 11 Pro 10.0.26100, debug. Head 92b59e1 on main 63bcca4 (one commit, only crates/victory-gpu/src/device.rs, 34 insertions, clean).

The test checks the guest answer against a fixed table. device() is the static guest DEVICE, and the FORMAT_SUPPORT branch answers with constants, so the test opens no host device and the card plays no part in it. To check the table against this card, I also ran a temporary probe (see the third item).

  • cargo test --locked -p victory-gpu --lib -- device::tests::format_support_reports_only_unsigned_16_and_32_bit_indices --nocapture: 1 passed, 0 failed, 0 ignored, in 3 of 3 runs. The same with VICTORY_D3D12_WARP=1 and --features diagnostics, which is what selects WARP in host.rs: 1 passed, 0 failed, 0 ignored, in 3 of 3 runs. The test prints nothing of its own in either setup.

  • Negative control: main's code in check_feature_support, with the PR's 7 lines removed and the test kept. git diff --stat HEAD: 1 file, 7 deletions. git diff --stat 63bcca4: 27 insertions, one hunk (@@ -550,6 +550,33 @@ mod tests). Result: 0 passed, 1 failed, in 3 of 3 hardware runs and 3 of 3 WARP runs, each time assertion left == right failed: format 0, left: true, right: false (device.rs:576). Format 0 (UNKNOWN) is the first control format, so the assertion stops there.

  • Control values: a temporary test, appended to device.rs and then removed, queried each of the test's 11 formats twice. One query went to the guest vtable (slot 0x68, feature 3). The other was CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT) on the host device. I ran it with main's code and with the PR's, once on hardware (NVIDIA GeForce RTX 3070) and once with VICTORY_D3D12_WARP=1 --features diagnostics (Microsoft Basic Render Driver). Every query returned S_OK, and the guest kept the format in q[0].

    format 3070 native Support1 WARP native Support1 native index bit (both) guest, main guest, PR
    42 R32_UINT 0x027051ff 0x027051ff yes 0x7fffffff (yes) 0x7fffffff (yes)
    57 R16_UINT 0x027051f7 0x027051f7 yes 0x7fffffff (yes) 0x7fffffff (yes)
    0 UNKNOWN 0x00000001 0x00000001 no 0x7fffffff (yes) 0x7ffffffb (no)
    62 R8_UINT 0x027051f3 0x027051f3 no 0x7fffffff (yes) 0x7ffffffb (no)
    59 R16_SINT 0x027051f3 0x027051f3 no 0x7fffffff (yes) 0x7ffffffb (no)
    43 R32_SINT 0x027051fb 0x027051fb no 0x7fffffff (yes) 0x7ffffffb (no)
    41 R32_FLOAT 0x06f4d7fb 0x06f4d7fb no 0x7fffffff (yes) 0x7ffffffb (no)
    53 R16_TYPELESS 0x001010f0 0x001010f0 no 0x7fffffff (yes) 0x7ffffffb (no)
    28 R8G8B8A8_UNORM 0x33fcd3f3 0x03fcd3f3 no 0x7fffffff (yes) 0x7ffffffb (no)
    40 D32_FLOAT 0x003110b0 0x003110b0 no 0x7fffffff (yes) 0x7ffffffb (no)
    71 BC1_UNORM 0x009013e0 0x009013e0 no 0x7fffffff (yes) 0x7ffffffb (no)

    So the guest index bit matches this card's for 2 of 11 formats on main and 11 of 11 with the PR. That is what the description reports for WARP. The guest answers were the same on both adapters. The only native difference between the 3070 and WARP is R8G8B8A8_UNORM, where the 3070 also sets 0x30000000 (the video-processor input and output bits). That is not the index bit.

  • cargo test --locked -p victory-gpu --lib, three runs of each:

    • this PR: 230 passed, 2 failed, 1 ignored (3 of 3);
    • main 63bcca4: 228 passed, 3 failed, 1 ignored (2 runs) and 229 passed, 2 failed, 1 ignored (1 run).
  • The same with --features diagnostics, three runs of each:

    • this PR: 245 passed, 2 failed, 1 ignored (3 of 3);
    • main: 243 passed, 3 failed, 1 ignored (3 of 3).
  • VICTORY_D3D12_WARP=1 cargo test --locked -p victory-gpu --lib --features diagnostics, one run of each:

    • this PR: 247 passed, 0 failed, 1 ignored (the description's count);
    • main: 246 passed, 0 failed, 1 ignored.

    The PR adds one test. Two tests fail in every hardware run on both: descriptor::host::tests::dynamic_slots_are_held_until_released and memory::tests::lists_share_a_table_and_copies_keep_their_views. They also fail on main on this card.

    In 5 of the 6 hardware runs on main there was a third failure, which the PR's 6 runs did not have. Both tests that failed this way are in descriptor/host.rs, which the PR does not touch:

    • descriptor::host::tests::views_bound_while_another_slot_gets_its_texture_do_not_wait (4 runs, both made);
    • descriptor::host::tests::a_slot_rewritten_while_its_view_is_prepared_views_the_new_record (1 run, the slot views the record written last).

    I then ran those two tests on their own, 3 times on each commit. They failed on the PR too: one failure in 2 of 3 runs on the PR (a_slot_rewritten_...) and in 1 of 3 on main (views_bound_...). Both set the global WHILE_PREPARING hook, so I read this as flakiness in those two tests and not as an effect of the PR. I do not know why the full PR suite avoided them in 6 runs.

  • The PR does not touch victory-shader, so I did not run its lib suite.

Nothing NVIDIA-specific: for these 11 formats, the RTX 3070's native index-buffer answer is the same as WARP's, and the PR's guest answer matches both.

Not tested:

  • the other Support1 bits, which the PR leaves at the shortcut's 0x7fffffff. For example, the guest still reports depth-stencil and render-target use for BC1_UNORM, which this card does not. The same goes for Support2 (0xffff);
  • formats other than the test's 11;
  • the debug layer on (the description ran it on and off);
  • the combination with #3490, #3752, #3758 and #3771 that the author describes in the thread;
  • runs beyond 3 per setup (and 1 per suite on WARP), clippy, release, a title run.

AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7244324585 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3780#issuecomment-7244324585). Originally posted by [upipibi](https://github.com/upipibi) on 2026-11-28T19:08:51Z. --- NVIDIA row for this PR: it passes on Ampere, and its test fails on this card without the fix. This card's driver sets `IA_INDEX_BUFFER` only for `R32_UINT` and `R16_UINT` among the 11 formats in the test, the same as WARP. With the PR the guest answer matches it for all 11. On main it matches for 2. RTX 3070 (desktop), driver 616.56, Windows 11 Pro 10.0.26100, debug. Head `92b59e1` on main `63bcca4` (one commit, only `crates/victory-gpu/src/device.rs`, 34 insertions, clean). The test checks the guest answer against a fixed table. `device()` is the static guest `DEVICE`, and the `FORMAT_SUPPORT` branch answers with constants, so the test opens no host device and the card plays no part in it. To check the table against this card, I also ran a temporary probe (see the third item). - `cargo test --locked -p victory-gpu --lib -- device::tests::format_support_reports_only_unsigned_16_and_32_bit_indices --nocapture`: 1 passed, 0 failed, 0 ignored, in 3 of 3 runs. The same with `VICTORY_D3D12_WARP=1` and `--features diagnostics`, which is what selects WARP in `host.rs`: 1 passed, 0 failed, 0 ignored, in 3 of 3 runs. The test prints nothing of its own in either setup. - Negative control: main's code in `check_feature_support`, with the PR's 7 lines removed and the test kept. `git diff --stat HEAD`: 1 file, 7 deletions. `git diff --stat 63bcca4`: 27 insertions, one hunk (`@@ -550,6 +550,33 @@ mod tests`). Result: 0 passed, 1 failed, in 3 of 3 hardware runs and 3 of 3 WARP runs, each time `assertion left == right failed: format 0`, `left: true`, `right: false` (device.rs:576). Format 0 (`UNKNOWN`) is the first control format, so the assertion stops there. - Control values: a temporary test, appended to `device.rs` and then removed, queried each of the test's 11 formats twice. One query went to the guest vtable (slot `0x68`, feature 3). The other was `CheckFeatureSupport(D3D12_FEATURE_FORMAT_SUPPORT)` on the host device. I ran it with main's code and with the PR's, once on hardware (`NVIDIA GeForce RTX 3070`) and once with `VICTORY_D3D12_WARP=1 --features diagnostics` (`Microsoft Basic Render Driver`). Every query returned `S_OK`, and the guest kept the format in `q[0]`. | format | 3070 native `Support1` | WARP native `Support1` | native index bit (both) | guest, main | guest, PR | |---|---|---|---|---|---| | 42 `R32_UINT` | `0x027051ff` | `0x027051ff` | yes | `0x7fffffff` (yes) | `0x7fffffff` (yes) | | 57 `R16_UINT` | `0x027051f7` | `0x027051f7` | yes | `0x7fffffff` (yes) | `0x7fffffff` (yes) | | 0 `UNKNOWN` | `0x00000001` | `0x00000001` | no | `0x7fffffff` (yes) | `0x7ffffffb` (no) | | 62 `R8_UINT` | `0x027051f3` | `0x027051f3` | no | `0x7fffffff` (yes) | `0x7ffffffb` (no) | | 59 `R16_SINT` | `0x027051f3` | `0x027051f3` | no | `0x7fffffff` (yes) | `0x7ffffffb` (no) | | 43 `R32_SINT` | `0x027051fb` | `0x027051fb` | no | `0x7fffffff` (yes) | `0x7ffffffb` (no) | | 41 `R32_FLOAT` | `0x06f4d7fb` | `0x06f4d7fb` | no | `0x7fffffff` (yes) | `0x7ffffffb` (no) | | 53 `R16_TYPELESS` | `0x001010f0` | `0x001010f0` | no | `0x7fffffff` (yes) | `0x7ffffffb` (no) | | 28 `R8G8B8A8_UNORM` | `0x33fcd3f3` | `0x03fcd3f3` | no | `0x7fffffff` (yes) | `0x7ffffffb` (no) | | 40 `D32_FLOAT` | `0x003110b0` | `0x003110b0` | no | `0x7fffffff` (yes) | `0x7ffffffb` (no) | | 71 `BC1_UNORM` | `0x009013e0` | `0x009013e0` | no | `0x7fffffff` (yes) | `0x7ffffffb` (no) | So the guest index bit matches this card's for 2 of 11 formats on main and 11 of 11 with the PR. That is what the description reports for WARP. The guest answers were the same on both adapters. The only native difference between the 3070 and WARP is `R8G8B8A8_UNORM`, where the 3070 also sets `0x30000000` (the video-processor input and output bits). That is not the index bit. - `cargo test --locked -p victory-gpu --lib`, three runs of each: - this PR: 230 passed, 2 failed, 1 ignored (3 of 3); - main `63bcca4`: 228 passed, 3 failed, 1 ignored (2 runs) and 229 passed, 2 failed, 1 ignored (1 run). - The same with `--features diagnostics`, three runs of each: - this PR: 245 passed, 2 failed, 1 ignored (3 of 3); - main: 243 passed, 3 failed, 1 ignored (3 of 3). - `VICTORY_D3D12_WARP=1 cargo test --locked -p victory-gpu --lib --features diagnostics`, one run of each: - this PR: 247 passed, 0 failed, 1 ignored (the description's count); - main: 246 passed, 0 failed, 1 ignored. The PR adds one test. Two tests fail in every hardware run on both: `descriptor::host::tests::dynamic_slots_are_held_until_released` and `memory::tests::lists_share_a_table_and_copies_keep_their_views`. They also fail on main on this card. In 5 of the 6 hardware runs on main there was a third failure, which the PR's 6 runs did not have. Both tests that failed this way are in `descriptor/host.rs`, which the PR does not touch: - `descriptor::host::tests::views_bound_while_another_slot_gets_its_texture_do_not_wait` (4 runs, `both made`); - `descriptor::host::tests::a_slot_rewritten_while_its_view_is_prepared_views_the_new_record` (1 run, `the slot views the record written last`). I then ran those two tests on their own, 3 times on each commit. They failed on the PR too: one failure in 2 of 3 runs on the PR (`a_slot_rewritten_...`) and in 1 of 3 on main (`views_bound_...`). Both set the global `WHILE_PREPARING` hook, so I read this as flakiness in those two tests and not as an effect of the PR. I do not know why the full PR suite avoided them in 6 runs. - The PR does not touch `victory-shader`, so I did not run its lib suite. Nothing NVIDIA-specific: for these 11 formats, the RTX 3070's native index-buffer answer is the same as WARP's, and the PR's guest answer matches both. Not tested: - the other `Support1` bits, which the PR leaves at the shortcut's `0x7fffffff`. For example, the guest still reports depth-stencil and render-target use for `BC1_UNORM`, which this card does not. The same goes for `Support2` (`0xffff`); - formats other than the test's 11; - the debug layer on (the description ran it on and off); - the combination with #3490, #3752, #3758 and #3771 that the author describes in the thread; - runs beyond 3 per setup (and 1 per suite on WARP), clippy, release, a title run. AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report.
cloph-dsp commented 2026-11-28 22:58:36 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by cloph-dsp on 2026-11-28T22:58:36Z.


Independent local verification (Windows, Rust 1.100.0/MSVC, no game data):

  • PR #3780 at head 92b59e17cea39df426bcbc035ca3735cbcbfe57a, base/parent 63bcca43c6a00a758510398fa43096ce7e4f7df0.
  • cargo test --locked -p victory-gpu --lib -- device::tests::format_support_reports_only_unsigned_16_and_32_bit_indices --exact --test-threads=1 --quiet → 1 passed, 0 failed, 232 filtered, exit 0 (2 pre-existing warnings in the victory-gpu lib test build).
  • git grep -F for the test name on the base returned no match (test is new on this PR); git diff --check HEAD^ HEAD clean (1 file, +34/-0).
  • Used a per-worktree CARGO_TARGET_DIR (never shared) with CARGO_BUILD_JOBS=2.
  • Only the named synthetic test was replayed; full workspace suite and clippy were not run locally.
  • GPU/driver: N/A (CPU-only device format-support test). No game data, assets, extracted shaders, DRM or decrypt involved.

AI-assisted (Hy4 flash).

<!-- greyfinch-sync:Marvisak/VIctory:comment:7247112091 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3780#issuecomment-7247112091). Originally posted by [cloph-dsp](https://github.com/cloph-dsp) on 2026-11-28T22:58:36Z. --- Independent local verification (Windows, Rust 1.100.0/MSVC, no game data): - PR #3780 at head `92b59e17cea39df426bcbc035ca3735cbcbfe57a`, base/parent `63bcca43c6a00a758510398fa43096ce7e4f7df0`. - `cargo test --locked -p victory-gpu --lib -- device::tests::format_support_reports_only_unsigned_16_and_32_bit_indices --exact --test-threads=1 --quiet` → 1 passed, 0 failed, 232 filtered, exit 0 (2 pre-existing warnings in the victory-gpu lib test build). - `git grep -F` for the test name on the base returned no match (test is new on this PR); `git diff --check HEAD^ HEAD` clean (1 file, +34/-0). - Used a per-worktree `CARGO_TARGET_DIR` (never shared) with `CARGO_BUILD_JOBS=2`. - Only the named synthetic test was replayed; full workspace suite and clippy were not run locally. - GPU/driver: N/A (CPU-only device format-support test). No game data, assets, extracted shaders, DRM or decrypt involved. AI-assisted (Hy4 flash).
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3780:upstream-pr/3780'
git switch 'upstream-pr/3780'

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.

git switch 'main'
git merge --no-ff 'upstream-pr/3780'
git switch 'upstream-pr/3780'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3780'
git switch 'upstream-pr/3780'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3780'
git switch 'main'
git merge --squash 'upstream-pr/3780'
git switch 'main'
git merge --ff-only 'upstream-pr/3780'
git switch 'main'
git merge 'upstream-pr/3780'
git push origin 'main'
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
Marvisak/VIctory!3780
No description provided.