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) #2881

Open
opened 2026-11-26 05:16:36 +00:00 by github-bot · 1 comment
Owner

@⁠BastienRodz on GitHub · 2026-11-25 23:00 UTC · original

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.

**@⁠BastienRodz** on GitHub · 2026-11-25 23:00 UTC · [original](https://github.com/Marvisak/VIctory/issues/2881) 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:16:36 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-26 00:42 UTC · original

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

**@⁠Marvisak** on GitHub · 2026-11-26 00:42 UTC · [original](https://github.com/Marvisak/VIctory/issues/2881#issuecomment-7179037369) <!-- 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)_
This discussion has been locked. Commenting is limited to contributors.
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#2881
No description provided.