Commit 3bf61f2
committed
fix: D3D12 skip upload/readback resources by heap type, not state
TransitionDescriptorResources skipped resources whose NativeResourceState
was GenericRead or CopyDest, treating those states as upload/readback
heap markers. That conflates heap type (a lifetime property of Upload/
Readback heaps) with transient state (a Default-heap resource can be in
CopyDest after a Copy/Resolve/UpdateSubresource). The skip silently
dropped the binding-time transition and left stale layouts leaking into
the next SRV/Present — D3D12 GPU validation 'Incompatible texture
barrier layout', SRV sampling in LEGACY_COPY_DEST, WARP 1.0.18 missing
glyphs in dynamic sprite font tests, back-buffer Present failing in
COPY_SOURCE on RenderToWindow.
Track heap type explicitly: add IsHostVisibleHeap on GraphicsResource,
set at resource creation (Upload/Readback → true, Default → false). Draw
prep skips on that flag, not on state. Default-heap resources in
CopyDest/CopySource/GenericRead after a copy go through the normal
transition to ShaderResource at next bind — single barrier, no reliance
on a post-copy Common transition and on barrier coalescing to merge it.1 parent 29409a3 commit 3bf61f2
4 files changed
Lines changed: 20 additions & 3 deletions
File tree
- sources/engine/Stride.Graphics/Direct3D12
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
176 | 176 | | |
177 | 177 | | |
178 | 178 | | |
| 179 | + | |
179 | 180 | | |
180 | 181 | | |
181 | 182 | | |
| |||
184 | 185 | | |
185 | 186 | | |
186 | 187 | | |
| 188 | + | |
187 | 189 | | |
188 | 190 | | |
189 | 191 | | |
190 | 192 | | |
191 | 193 | | |
| 194 | + | |
192 | 195 | | |
193 | 196 | | |
194 | 197 | | |
| |||
Lines changed: 5 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
433 | | - | |
434 | | - | |
435 | | - | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
436 | 438 | | |
437 | 439 | | |
438 | 440 | | |
| |||
Lines changed: 11 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
36 | 36 | | |
37 | 37 | | |
38 | 38 | | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
39 | 49 | | |
40 | 50 | | |
41 | 51 | | |
| |||
75 | 85 | | |
76 | 86 | | |
77 | 87 | | |
| 88 | + | |
78 | 89 | | |
79 | 90 | | |
80 | 91 | | |
| |||
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
228 | 228 | | |
229 | 229 | | |
230 | 230 | | |
| 231 | + | |
231 | 232 | | |
232 | 233 | | |
233 | 234 | | |
| |||
0 commit comments