GPU: a slot's read in the submission right after its texture is placed or given up is wiped, so the view stays null #2572
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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 BastienRodz on 2026-11-25T16:08:13Z.
What happens
Since
52d14b1("placed textures made when shaders read their heap slots"), a heap slot whose texture view is left null is forgotten withshadow::forget_read, so that its next read marks it again andtake_reads, run after the submission, has its view made. That covers a placed texture written into the heap (HostHeap::mirrorfromsync_heaps) and, since69d1e8e, a texture given up (HostHeap::evictfromresource::evict_unused). Both run inHost::executebeforeExecuteCommandLists. The forgotten marks are only cleared insidetake_reads, after the submission has run. So the mark a shader of that very submission set on the slot is wiped together with the old one, and the slot is not made.The slot gets its view only after a later submission reads it again, which means at least one more frame of a null (black) view. If nothing reads it again, it never does.
Expected
52d14b1's message: "After each submission the host takes the newly set marks and makes the views of those slots that were left null, so the next submission reads the texture; a slot made null again is forgotten so its next read marks it again."
HostHeap::evict's comment: "the next draw reading it through a table or shader reading it through the heap (its read mark, cleared) makes it again." The marks of slots forgotten before a submission should be cleared before it runs, so that its reads count.Where
crates/victory-gpu/src/shadow.rs(READS,forget_read,take_reads) andcrates/victory-gpu/src/host.rs(Host::execute:evict_unusedandsync_heapsbeforeExecuteCommandLists,take_readsafter).AI-assisted (Gemini 4 Neon found it, Claude Code reviewed and verified it); synthetic test only, no game data.
Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T18:45:38Z.
Automated triage for the maintainers.
Confirmed in main (
13f91ca). Incrates/victory-gpu/src/shadow.rs,forget_readonly queues the slot, andtake_readsclears the queued slots' bits in both bitmaps when it next runs. InHost::execute(crates/victory-gpu/src/host.rs),evict_unusedandsync_heaps(which forget slots) run beforeExecuteCommandLists, andtake_readsruns after it. So a mark the same submission's shaders set on a forgotten slot is cleared before it is taken, and the view stays null until a later read.Open PR #2576 addresses this.
Generated by Claude Code