GPU: report IA_INDEX_BUFFER only for unsigned index formats #3780
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3780"
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 Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T18:34:27Z.
The guest
FORMAT_SUPPORTmask currently setsIA_INDEX_BUFFERfor every format. Keep that flag forR16_UINTandR32_UINT, the input assembler's unsigned index formats. This corrects the capability query on the guest device. D3D12 format support for R16_UINT · R32_UINTCompared 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.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.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_BUFFERonly forR32_UINTandR16_UINTamong 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
92b59e1on main63bcca4(one commit, onlycrates/victory-gpu/src/device.rs, 34 insertions, clean).The test checks the guest answer against a fixed table.
device()is the static guestDEVICE, and theFORMAT_SUPPORTbranch 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 withVICTORY_D3D12_WARP=1and--features diagnostics, which is what selects WARP inhost.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 timeassertion 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.rsand then removed, queried each of the test's 11 formats twice. One query went to the guest vtable (slot0x68, feature 3). The other wasCheckFeatureSupport(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 withVICTORY_D3D12_WARP=1 --features diagnostics(Microsoft Basic Render Driver). Every query returnedS_OK, and the guest kept the format inq[0].Support1Support1R32_UINT0x027051ff0x027051ff0x7fffffff(yes)0x7fffffff(yes)R16_UINT0x027051f70x027051f70x7fffffff(yes)0x7fffffff(yes)UNKNOWN0x000000010x000000010x7fffffff(yes)0x7ffffffb(no)R8_UINT0x027051f30x027051f30x7fffffff(yes)0x7ffffffb(no)R16_SINT0x027051f30x027051f30x7fffffff(yes)0x7ffffffb(no)R32_SINT0x027051fb0x027051fb0x7fffffff(yes)0x7ffffffb(no)R32_FLOAT0x06f4d7fb0x06f4d7fb0x7fffffff(yes)0x7ffffffb(no)R16_TYPELESS0x001010f00x001010f00x7fffffff(yes)0x7ffffffb(no)R8G8B8A8_UNORM0x33fcd3f30x03fcd3f30x7fffffff(yes)0x7ffffffb(no)D32_FLOAT0x003110b00x003110b00x7fffffff(yes)0x7ffffffb(no)BC1_UNORM0x009013e00x009013e00x7fffffff(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 sets0x30000000(the video-processor input and output bits). That is not the index bit.cargo test --locked -p victory-gpu --lib, three runs of each: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:VICTORY_D3D12_WARP=1 cargo test --locked -p victory-gpu --lib --features diagnostics, one run of each:The PR adds one test. Two tests fail in every hardware run on both:
descriptor::host::tests::dynamic_slots_are_held_until_releasedandmemory::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 globalWHILE_PREPARINGhook, 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:
Support1bits, which the PR leaves at the shortcut's0x7fffffff. For example, the guest still reports depth-stencil and render-target use forBC1_UNORM, which this card does not. The same goes forSupport2(0xffff);AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report.
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):
92b59e17cea39df426bcbc035ca3735cbcbfe57a, base/parent63bcca43c6a00a758510398fa43096ce7e4f7df0.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 -Ffor the test name on the base returned no match (test is new on this PR);git diff --check HEAD^ HEADclean (1 file, +34/-0).CARGO_TARGET_DIR(never shared) withCARGO_BUILD_JOBS=2.AI-assisted (Hy4 flash).
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.