Track host state of buffer copies so compute-written data can be drawn #479

Closed
cmyk-ux wants to merge 1 commit from upstream-pr/479 into main
cmyk-ux commented 2026-11-24 03:51:46 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by cmyk-ux on 2026-11-24T03:51:46Z.


A title buffer's host copy (shadow) is written by shaders through unordered access and read as vertex, index, constant, shader resource and indirect argument data. The host never moved it between those states: the title's own transitions on buffers are dropped (the copy is not the buffer the barrier names; only a UAV barrier is recorded), and every use relied on the copy being promoted from the common state.

When a compute pass wrote a copy and a later draw bound it as vertex data, the copy was still in UNORDERED_ACCESS and the debug layer reported IASetVertexBuffers on a resource in state 0x8 (expected VERTEX_AND_CONSTANT_BUFFER), followed on the 3070 by a device removal during a 32-list submission (issue #445).

HostList now tracks each copy's state per list:

  • vertex, index, root view and table (SRV/UAV/CBV) uses and indirect arguments move the copy to the state they need, with a transition barrier when it is in another one; read states combine, unordered access excludes them, and the uses of one draw or dispatch are settled together (a buffer both read and written by one dispatch ends in unordered access);
  • close() returns every copy to the common state, so each list starts with its copies there whatever an earlier list of the submission did and whatever order the lists were recorded in;
  • the indirect argument clamp uses the same tracking instead of assuming the copy is in unordered access.
<!-- greyfinch-sync:Marvisak/VIctory:issue:6574207528 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/479). Originally posted by [cmyk-ux](https://github.com/cmyk-ux) on 2026-11-24T03:51:46Z. --- A title buffer's host copy (shadow) is written by shaders through unordered access and read as vertex, index, constant, shader resource and indirect argument data. The host never moved it between those states: the title's own transitions on buffers are dropped (the copy is not the buffer the barrier names; only a UAV barrier is recorded), and every use relied on the copy being promoted from the common state. When a compute pass wrote a copy and a later draw bound it as vertex data, the copy was still in UNORDERED_ACCESS and the debug layer reported IASetVertexBuffers on a resource in state 0x8 (expected VERTEX_AND_CONSTANT_BUFFER), followed on the 3070 by a device removal during a 32-list submission (issue #445). HostList now tracks each copy's state per list: - vertex, index, root view and table (SRV/UAV/CBV) uses and indirect arguments move the copy to the state they need, with a transition barrier when it is in another one; read states combine, unordered access excludes them, and the uses of one draw or dispatch are settled together (a buffer both read and written by one dispatch ends in unordered access); - close() returns every copy to the common state, so each list starts with its copies there whatever an earlier list of the submission did and whatever order the lists were recorded in; - the indirect argument clamp uses the same tracking instead of assuming the copy is in unordered access.
upstream-sync closed this pull request 2026-11-24 06:53:17 +00:00

Pull request closed

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
Marvisak/VIctory!479
No description provided.