Skip to content

Commit f625c91

Browse files
committed
D3D12: Enhanced Barriers: Clarify TEXTURE_BARRIER_FLAG_DISCARD details
1 parent 9723562 commit f625c91

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

d3d/D3D12EnhancedBarriers.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2263,6 +2263,8 @@ enum D3D12_TEXTURE_BARRIER_FLAGS
22632263

22642264
Can only be used when `LayoutBefore` is `D3D12_BARRIER_LAYOUT_UNDEFINED`. Typically, this is used to initialize compression metadata as part of a barrier that activates an aliased resource.
22652265

2266+
When `D3D12_TEXTURE_BARRIER_FLAG_DISCARD` is specified, `LayoutAfter` may be any valid layout appropriate for the resource and barrier command list type. This is more flexible than the legacy `DiscardResource` API, which requires subresources to be in `D3D12_RESOURCE_STATE_RENDER_TARGET` if the resource was created with `D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET`, or `D3D12_RESOURCE_STATE_DEPTH_WRITE` if created with `D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL`. As such, applications can discard-initialize a subresource directly into the layout needed for subsequent access, without barrier layout restriction.
2267+
22662268
### D3D12_TEXTURE_BARRIER
22672269

22682270
```c++

0 commit comments

Comments
 (0)