ID3D12GraphicsCommandList::DiscardResource method
Discards a resource.
Syntax
void DiscardResource( [in] ID3D12Resource *pResource, [in, optional] const D3D12_DISCARD_REGION *pRegion );
Parameters
- pResource [in]
-
Type: ID3D12Resource*
A pointer to the ID3D12Resource interface for the resource to discard.
- pRegion [in, optional]
-
Type: const D3D12_DISCARD_REGION*
A pointer to a D3D12_DISCARD_REGION structure that describes details for the discard-resource operation.
Return value
This method does not return a value.
Remarks
The semantics of DiscardResource change based on the command list type.
For D3D12_COMMAND_LIST_TYPE_DIRECT, the following two rules apply:
- When a resource has the D3D12_RESOURCE_FLAG_ALLOW_RENDER_TARGET flag, DiscardResource must be called when the discarded subresource regions are in the D3D12_RESOURCE_STATE_RENDER_TARGET resource barrier state.
- When a resource has the D3D12_RESOURCE_FLAG _ALLOW_DEPTH_STENCIL flag, DiscardResource must be called when the discarded subresource regions are in the D3D12_RESOURCE_STATE_DEPTH_WRITE.
For D3D12_COMMAND_LIST_TYPE_COMPUTE, the following rule applies:
- The resource must have the D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS flag, and DiscardResource must be called when the discarded subresource regions are in the D3D12_RESOURCE_STATE_UNORDERED_ACCESS resource barrier state.
DiscardResource is not supported on command lists with either D3D12_COMMAND_LIST_TYPE_BUNDLE nor D3D12_COMMAND_LIST_TYPE_COPY.
Requirements
|
Header |
|
|---|---|
|
Library |
|
|
DLL |
|
See also
Show: