GPU: after a cut, a list using our view heap and our sampler heap never binds them again (SAMPLERS_OURS equals the lost-state marker) #2879

Open
opened 2026-11-25 23:00:55 +00:00 by BastienRodz · 1 comment
BastienRodz commented 2026-11-25 23:00:55 +00:00 (Migrated from github.com)
Contributor

Imported from Marvisak/VIctory. Originally posted by BastienRodz on 2026-11-25T23:00:55Z.


Since #1778, draw::SAMPLERS_OURS (the sampler heap we bind when the title binds none) is usize::MAX. MEMORY_HEAP (memory::OURS, our view heap for title memory) is usize::MAX too, and so is the marker State::host_state_lost leaves in host_heaps so that the next draw or dispatch binds its heaps again ([usize::MAX; 2]).

Input. A list that binds no sampler heap and whose shader reads title memory or root views. memory_heap is true, so State::wanted([.., 0], true) is [MEMORY_HEAP, SAMPLERS_OURS], which is [usize::MAX, usize::MAX]. Compute lists that only read views are the case #1778 names. The host state is then lost:

  • by a cut at Wait32BitValueX/Wait64BitValueX (list.rs → State::cut → host_state_lost; the code notes 0-21 cuts per world frame), or
  • by external::record (FidelityFX).

What happens on main 842b0cb. bind_heaps compares want with host_heaps, finds them equal, and calls nothing:

  • After a cut, the new host list starts with no heaps bound. Its next root signature indexes both heaps directly with none bound, which is the debug layer's id 1419, the device removal on NVIDIA that #1778 was written to prevent (#1754).
  • After external::record, the other recorder's heaps stay bound instead of ours.

Before #1778, that list wanted [usize::MAX, 0], which differs from the marker, so it always bound its heaps again.

DirectX-Specs, SM 6.6 Dynamic Resources: "SetDescriptorHeaps must be called, passing the corresponding heaps, before a call to SetGraphicsRootSignature or SetComputeRootSignature that uses either CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED or SAMPLER_HEAP_DIRECTLY_INDEXED flags."

Found by reading the code and checked with a unit test; I have no in-game observation of this particular removal. No game data. Analysis assisted by Claude Code.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6615506935 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/2881). Originally posted by [BastienRodz](https://github.com/BastienRodz) on 2026-11-25T23:00:55Z. --- Since #1778, `draw::SAMPLERS_OURS` (the sampler heap we bind when the title binds none) is `usize::MAX`. `MEMORY_HEAP` (`memory::OURS`, our view heap for title memory) is `usize::MAX` too, and so is the marker `State::host_state_lost` leaves in `host_heaps` so that the next draw or dispatch binds its heaps again (`[usize::MAX; 2]`). **Input.** A list that binds no sampler heap and whose shader reads title memory or root views. `memory_heap` is true, so `State::wanted([.., 0], true)` is `[MEMORY_HEAP, SAMPLERS_OURS]`, which is `[usize::MAX, usize::MAX]`. Compute lists that only read views are the case #1778 names. The host state is then lost: - by a cut at `Wait32BitValueX`/`Wait64BitValueX` (`list.rs` → `State::cut` → `host_state_lost`; the code notes 0-21 cuts per world frame), or - by `external::record` (FidelityFX). **What happens on main 842b0cb.** `bind_heaps` compares `want` with `host_heaps`, finds them equal, and calls nothing: - After a cut, the new host list starts with no heaps bound. Its next root signature indexes both heaps directly with none bound, which is the debug layer's id 1419, the device removal on NVIDIA that #1778 was written to prevent (#1754). - After `external::record`, the other recorder's heaps stay bound instead of ours. **Before #1778**, that list wanted `[usize::MAX, 0]`, which differs from the marker, so it always bound its heaps again. DirectX-Specs, SM 6.6 Dynamic Resources: "SetDescriptorHeaps must be called, passing the corresponding heaps, before a call to SetGraphicsRootSignature or SetComputeRootSignature that uses either CBV_SRV_UAV_HEAP_DIRECTLY_INDEXED or SAMPLER_HEAP_DIRECTLY_INDEXED flags." Found by reading the code and checked with a unit test; I have no in-game observation of this particular removal. No game data. Analysis assisted by Claude Code.
Marvisak commented 2026-11-26 01:04:11 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T00:42:42Z.


Automated triage for the maintainers.

Confirmed on main (63bcca4). In crates/victory-gpu/src/draw.rs, MEMORY_HEAP (memory::OURS) and SAMPLERS_OURS are both usize::MAX, and State::host_state_lost sets host_heaps to [usize::MAX; 2]. So when State::wanted returns [MEMORY_HEAP, SAMPLERS_OURS], bind_heaps sees host_heaps == want after a cut or external::record and binds nothing.

Open pull request #2882 addresses this.


Generated by Claude Code

<!-- greyfinch-sync:Marvisak/VIctory:comment:7179037369 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/2881#issuecomment-7179037369). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-26T00:42:42Z. --- <!-- victory-issue-triage v1 verdict=confirmed seen=2026-11-25T23:00:55Z at=2026-11-26T00:52:00Z --> Automated triage for the maintainers. Confirmed on `main` (63bcca4). In `crates/victory-gpu/src/draw.rs`, `MEMORY_HEAP` (`memory::OURS`) and `SAMPLERS_OURS` are both `usize::MAX`, and `State::host_state_lost` sets `host_heaps` to `[usize::MAX; 2]`. So when `State::wanted` returns `[MEMORY_HEAP, SAMPLERS_OURS]`, `bind_heaps` sees `host_heaps == want` after a cut or `external::record` and binds nothing. Open pull request #2882 addresses this. --- _Generated by [Claude Code](https://claude.ai/code)_
Sign in to join this conversation.
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#2879
No description provided.