D3D12.X: clear bindings.index_title when IASetIndexBuffer is called with NULL #1324

Open
b3IKK wants to merge 1 commit from upstream-pr/1334 into main
b3IKK commented 2026-11-24 14:54:47 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by b3IKK on 2026-11-24T14:54:47Z.


ia_set_index_buffer_x(list, NULL) cleared s.index_buffer = None but left s.bindings.index_title set to the previously bound index buffer's title address and size, causing subsequent sync_title_buffers and geometry_summary calls to keep referencing the unbound buffer.

This clears s.bindings.index_title = None alongside s.index_buffer = None.

What is in it

  • crates/xcl/src/hle/d3d12x/list_x.rs: clear s.bindings.index_title = None when view.is_null() in ia_set_index_buffer_x; add unit test ia_set_index_buffer_null_clears_index_title (verified failing before the fix).

Tested

  • hardware (GPU + driver, CPU), Windows build, Rust version, debug / release: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (stable-x86_64-pc-windows-msvc), DXC 1.9.2609.5, debug (scripts/test.ps1) and release (scripts/smoke.ps1)
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4): 752 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2 no wave64 — gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask, gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware)
  • cargo test -p xcl --lib ia_set_index_buffer_null_clears_index_title: 1 passed, 0 failed (failed before the fix)

Regression run

main:

xcl-smoke v1
commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1226 (PresentX 1226)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 15341 MB

PR:

xcl-smoke v1
commit: f421439dccf9c17de85b6b16f49c8b018b9bbb2c
gpu: NVIDIA GeForce RTX 5080
title: 9cc6a39e
seconds: 60
exit: 0x0
frames shown: 1641 (PresentX 1642)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 14602 MB

Not tested

  • AMD GPUs and native wave64 hardware
  • other titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant) and Linux / Wine

AI use

  • OpenCode, Gemini 4 Neon: audited list_x.rs, wrote the fix and unit test, ran the test suite and scripts/smoke.ps1 regression runs, and drafted this PR description.
<!-- greyfinch-sync:ivall/xcl:issue:5474553634 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1334). Originally posted by [b3IKK](https://github.com/b3IKK) on 2026-11-24T14:54:47Z. --- `ia_set_index_buffer_x(list, NULL)` cleared `s.index_buffer = None` but left `s.bindings.index_title` set to the previously bound index buffer's title address and size, causing subsequent `sync_title_buffers` and `geometry_summary` calls to keep referencing the unbound buffer. This clears `s.bindings.index_title = None` alongside `s.index_buffer = None`. **What is in it** - `crates/xcl/src/hle/d3d12x/list_x.rs`: clear `s.bindings.index_title = None` when `view.is_null()` in `ia_set_index_buffer_x`; add unit test `ia_set_index_buffer_null_clears_index_title` (verified failing before the fix). **Tested** - hardware (GPU + driver, CPU), Windows build, Rust version, debug / release: NVIDIA GeForce RTX 5080 (driver 32.0.16.1088), AMD Ryzen 9 9950X3D, Windows 11 10.0.26300, Rust 1.100.0 (`stable-x86_64-pc-windows-msvc`), DXC 1.9.2609.5, debug (`scripts/test.ps1`) and release (`scripts/smoke.ps1`) - `.\scripts\test.ps1` (`cargo build --workspace` + `cargo test --workspace -- --test-threads=4`): 752 passed, 0 failed, 41 ignored (SKIPPED GPU tests: 2 `no wave64` — `gpu::recomp::tests::gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu::recomp::tests::gpu_wave32_program_in_wave64_hardware`) - `cargo test -p xcl --lib ia_set_index_buffer_null_clears_index_title`: 1 passed, 0 failed (failed before the fix) **Regression run** main: ``` xcl-smoke v1 commit: 47efa2ecea0a12934719ae69b81930cf02a4b1c3 gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1226 (PresentX 1226) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 15341 MB ``` PR: ``` xcl-smoke v1 commit: f421439dccf9c17de85b6b16f49c8b018b9bbb2c gpu: NVIDIA GeForce RTX 5080 title: 9cc6a39e seconds: 60 exit: 0x0 frames shown: 1641 (PresentX 1642) presents per 2 s (last 3): 60 60 60 device removals: 0 crashes: 0 peak commit: 14602 MB ``` **Not tested** - AMD GPUs and native wave64 hardware - other titles (Minecraft Preview, Unicorn Overlord, Fortnite, XDefiant) and Linux / Wine **AI use** - OpenCode, Gemini 4 Neon: audited `list_x.rs`, wrote the fix and unit test, ran the test suite and `scripts/smoke.ps1` regression runs, and drafted this PR description.
futurepro62 commented 2026-11-24 15:06:13 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by futurepro62 on 2026-11-24T15:04:16Z.


Full-suite run, since this PR has no test report yet. Tested exact head f421439 (on its base 930e8b4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • The new tests ran and passed: ia_set_index_buffer_null_clears_index_title.
  • Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 752 passed, 0 failed, 41 ignored, no skips.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:ivall/xcl:comment:7135409285 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1334#issuecomment-7135409285). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-24T15:04:16Z. --- Full-suite run, since this PR has no test report yet. Tested exact head `f421439` (on its base `930e8b4`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed. - `cargo build --workspace`, then `XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4`: **752 passed, 0 failed, 41 ignored**. SKIPPED (no wave64): `gpu_geometry_wave32_prefix_count_over_a_mask`, `gpu_wave32_program_in_wave64_hardware`. - The new tests ran and passed: `ia_set_index_buffer_null_clears_index_title`. - Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, `XCL_ADAPTER=radeon`), `cargo test --workspace -- --test-threads=4`: **752 passed, 0 failed, 41 ignored**, no skips. **Not tested** - a release build, a game (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
DavidM1911 commented 2026-11-24 16:06:55 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T15:10:04Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: 708 passed, 0 failed, 21 ignored.

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7135569060 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1334#issuecomment-7135569060). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T15:10:04Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib`: 708 passed, 0 failed, 21 ignored. Thanks!
DavidM1911 commented 2026-11-24 16:07:21 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-24T15:56:04Z.


Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib -- --test-threads=1: all passed, 0 failed, 21 ignored. (Parallel runs intermittently abort with 0xc0000005 — same harness flake seen on unmodified main.)

Thanks!

<!-- greyfinch-sync:ivall/xcl:comment:7136855628 --> Imported from [ivall/xcl](https://github.com/ivall/xcl/pull/1334#issuecomment-7136855628). Originally posted by [DavidM1911](https://github.com/DavidM1911) on 2026-11-24T15:56:04Z. --- Verification on RTX 3060 Ti (Windows 11), branch merged with current `main`: - `cargo test -p xcl --lib -- --test-threads=1`: all passed, 0 failed, 21 ignored. (Parallel runs intermittently abort with 0xc0000005 — same harness flake seen on unmodified `main`.) Thanks!
xpatfussy69x commented 2026-11-25 12:06:26 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by xpatfussy69x on 2026-11-25T11:41:22Z.


Test report for head f421439 as pushed (not merged onto current main) – NVIDIA, wave32.

Tested

  • NVIDIA GeForce RTX 3060 12 GB (Ampere, 32-lane waves only), driver 32.0.16.2124; AMD Ryzen 5 7500F; 32 GB RAM; Windows NT 10.0.26300; Rust 1.100.0 (stable-x86_64-pc-windows-msvc); debug; DXC 1.9.2609.5
  • .\scripts\test.ps1 (cargo build --workspace + cargo test --workspace -- --test-threads=4): 752 passed, 0 failed, 41 ignored
  • SKIPPED GPU tests on this adapter: 2 (no wave64)
  • this PR's tests: ia_set_index_buffer_null_clears_index_title ran and passed
  • no XCL_SAMPLE_* data set (game-data tests not run)

Not tested

  • a smoke run on a title; AMD / native wave64; release build; the head merged onto current main

AI use

  • Claude (Claude Opus 5.5) wrote the script that ran the suite on my PC, read the log and wrote and posted this report with my approval; the run is mine.
<!-- greyfinch-sync:ivall/xcl:comment:7161371023 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1334#issuecomment-7161371023). Originally posted by [xpatfussy69x](https://github.com/xpatfussy69x) on 2026-11-25T11:41:22Z. --- Test report for head `f421439` as pushed (not merged onto current `main`) – NVIDIA, wave32. **Tested** - NVIDIA GeForce RTX 3060 12 GB (Ampere, 32-lane waves only), driver 32.0.16.2124; AMD Ryzen 5 7500F; 32 GB RAM; Windows NT 10.0.26300; Rust 1.100.0 (stable-x86_64-pc-windows-msvc); debug; DXC 1.9.2609.5 - `.\scripts\test.ps1` (`cargo build --workspace` + `cargo test --workspace -- --test-threads=4`): 752 passed, 0 failed, 41 ignored - SKIPPED GPU tests on this adapter: 2 (no wave64) - this PR's tests: `ia_set_index_buffer_null_clears_index_title` ran and passed - no `XCL_SAMPLE_*` data set (game-data tests not run) **Not tested** - a smoke run on a title; AMD / native wave64; release build; the head merged onto current `main` **AI use** - Claude (Claude Opus 5.5) wrote the script that ran the suite on my PC, read the log and wrote and posted this report with my approval; the run is mine.
github-actions[bot] commented 2026-11-29 07:41:54 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-11-29T07:41:54Z.


Nothing has happened on this PR for 3 days, so it is marked stale and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto main if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.

<!-- greyfinch-sync:ivall/xcl:comment:7252634204 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1334#issuecomment-7252634204). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-29T07:41:54Z. --- Nothing has happened on this PR for 3 days, so it is marked `stale` and will be closed in 4 days. A push or a comment takes the mark off: rebase it onto `main` if it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.
Foniass commented 2026-12-01 05:27:39 +00:00 (Migrated from github.com)

Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T05:27:39Z.


Triage (#1607) – head f421439

#3366 makes the same one-line change in list_x.rs ia_set_index_buffer_x: it clears bindings.index_title when the view is NULL. Its test unbinding_viewports_scissors_and_index_buffer_clears_tracked_state checks the same thing as ia_set_index_buffer_null_clears_index_title. #3366 also clears the tracked viewports and scissors on unbind, and it is green and mergeable. Main still lacks the fix. No problems found in this diff.
Recommendation: close (superseded by #3366).

AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.

<!-- greyfinch-sync:ivall/xcl:comment:7301793540 --> Imported from [ivall/xcl](https://github.com/xcl-dev/xcl/pull/1334#issuecomment-7301793540). Originally posted by [Foniass](https://github.com/Foniass) on 2026-12-01T05:27:39Z. --- **Triage (#1607)** – head f421439 #3366 makes the same one-line change in `list_x.rs` `ia_set_index_buffer_x`: it clears `bindings.index_title` when the view is NULL. Its test `unbinding_viewports_scissors_and_index_buffer_clears_tracked_state` checks the same thing as `ia_set_index_buffer_null_clears_index_title`. #3366 also clears the tracked viewports and scissors on unbind, and it is green and mergeable. Main still lacks the fix. No problems found in this diff. Recommendation: close (superseded by #3366). AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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/1334:upstream-pr/1334'
git switch 'upstream-pr/1334'

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/1334'
git switch 'upstream-pr/1334'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1334'
git switch 'upstream-pr/1334'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1334'
git switch 'main'
git merge --squash 'upstream-pr/1334'
git switch 'main'
git merge --ff-only 'upstream-pr/1334'
git switch 'main'
git merge 'upstream-pr/1334'
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
xcl-dev/xcl!1324
No description provided.