Textures and buffers read through ResourceDescriptorHeap are never refreshed or transitioned #754

Closed
opened 2026-11-24 09:36:21 +00:00 by Conrage · 1 comment
Conrage commented 2026-11-24 09:36:21 +00:00 (Migrated from github.com)
Contributor

Imported from Marvisak/VIctory. Originally posted by Conrage on 2026-11-24T09:36:21Z.


Only resources a shader reads through a descriptor table get their contents brought up to date before a draw.

  • tables() keeps only u.root == RootType::Table (crates/victory-gpu/src/draw.rs:649), and only those entries reach readable() (draw.rs:1105).
  • readable() is the only draw-time caller of texture::upload and shadow.refresh. The only other upload path is copies (list.rs:449, list.rs:543).
  • So a resource reached through RootType::ResourceHeap keeps what its host copy held when it was created (a texture) or when it was first used (a buffer), and it is never moved to a shader-resource state (see also host.rs:149 and shadow.rs:13-16).

Possible effect: if world shaders use bindless access, their textures read black and their buffers read stale data. This would fit the dark world in the README. I have not confirmed this in-game.

Suggestion: at submission, upload and transition the title-written resources named by the views in the bound heap. A first step could be a diagnostics counter of heap-indexed views never uploaded, to confirm the impact.

AI use: found and written with Claude from reading the code at 8e79c80; not run on hardware.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6578837253 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/754). Originally posted by [Conrage](https://github.com/Conrage) on 2026-11-24T09:36:21Z. --- Only resources a shader reads through a descriptor **table** get their contents brought up to date before a draw. - `tables()` keeps only `u.root == RootType::Table` (`crates/victory-gpu/src/draw.rs:649`), and only those entries reach `readable()` (`draw.rs:1105`). - `readable()` is the only draw-time caller of `texture::upload` and `shadow.refresh`. The only other upload path is copies (`list.rs:449`, `list.rs:543`). - So a resource reached through `RootType::ResourceHeap` keeps what its host copy held when it was created (a texture) or when it was first used (a buffer), and it is never moved to a shader-resource state (see also `host.rs:149` and `shadow.rs:13-16`). **Possible effect:** if world shaders use bindless access, their textures read black and their buffers read stale data. This would fit the dark world in the README. I have not confirmed this in-game. **Suggestion:** at submission, upload and transition the title-written resources named by the views in the bound heap. A first step could be a diagnostics counter of heap-indexed views never uploaded, to confirm the impact. _AI use: found and written with Claude from reading the code at `8e79c80`; not run on hardware._
Conrage commented 2026-11-24 10:03:52 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by Conrage on 2026-11-24T09:52:28Z.


Already addressed by open PR #413 (materializes bindless ResourceDescriptorHeap views and refreshes them), with #185 covering buffer coherency for directly indexed SRVs. Closing in favour of those.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7128006476 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/754#issuecomment-7128006476). Originally posted by [Conrage](https://github.com/Conrage) on 2026-11-24T09:52:28Z. --- Already addressed by open PR #413 (materializes bindless `ResourceDescriptorHeap` views and refreshes them), with #185 covering buffer coherency for directly indexed SRVs. Closing in favour of those.
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#754
No description provided.