// d3d12umddi.h
typedef enum D3D12DDI_BARRIER_LAYOUT {
D3D12DDI_BARRIER_LAYOUT_UNDEFINED,
D3D12DDI_BARRIER_LAYOUT_COMMON,
D3D12DDI_BARRIER_LAYOUT_PRESENT,
D3D12DDI_BARRIER_LAYOUT_GENERIC_READ,
D3D12DDI_BARRIER_LAYOUT_RENDER_TARGET,
D3D12DDI_BARRIER_LAYOUT_UNORDERED_ACCESS,
D3D12DDI_BARRIER_LAYOUT_DEPTH_STENCIL_WRITE,
D3D12DDI_BARRIER_LAYOUT_DEPTH_STENCIL_READ,
D3D12DDI_BARRIER_LAYOUT_SHADER_RESOURCE,
D3D12DDI_BARRIER_LAYOUT_COPY_SOURCE,
D3D12DDI_BARRIER_LAYOUT_COPY_DEST,
D3D12DDI_BARRIER_LAYOUT_RESOLVE_SOURCE,
D3D12DDI_BARRIER_LAYOUT_RESOLVE_DEST,
D3D12DDI_BARRIER_LAYOUT_SHADING_RATE_SOURCE,
D3D12DDI_BARRIER_LAYOUT_VIDEO_DECODE_READ,
D3D12DDI_BARRIER_LAYOUT_VIDEO_DECODE_WRITE,
D3D12DDI_BARRIER_LAYOUT_VIDEO_PROCESS_READ,
D3D12DDI_BARRIER_LAYOUT_VIDEO_PROCESS_WRITE,
D3D12DDI_BARRIER_LAYOUT_VIDEO_ENCODE_READ,
D3D12DDI_BARRIER_LAYOUT_VIDEO_ENCODE_WRITE,
D3D12DDI_BARRIER_LAYOUT_DIRECT_QUEUE_COMMON,
D3D12DDI_BARRIER_LAYOUT_DIRECT_QUEUE_GENERIC_READ,
D3D12DDI_BARRIER_LAYOUT_DIRECT_QUEUE_UNORDERED_ACCESS,
D3D12DDI_BARRIER_LAYOUT_DIRECT_QUEUE_SHADER_RESOURCE,
D3D12DDI_BARRIER_LAYOUT_DIRECT_QUEUE_COPY_SOURCE,
D3D12DDI_BARRIER_LAYOUT_DIRECT_QUEUE_COPY_DEST,
D3D12DDI_BARRIER_LAYOUT_COMPUTE_QUEUE_COMMON,
D3D12DDI_BARRIER_LAYOUT_COMPUTE_QUEUE_GENERIC_READ,
D3D12DDI_BARRIER_LAYOUT_COMPUTE_QUEUE_UNORDERED_ACCESS,
D3D12DDI_BARRIER_LAYOUT_COMPUTE_QUEUE_SHADER_RESOURCE,
D3D12DDI_BARRIER_LAYOUT_COMPUTE_QUEUE_COPY_SOURCE,
D3D12DDI_BARRIER_LAYOUT_COMPUTE_QUEUE_COPY_DEST,
D3D12DDI_BARRIER_LAYOUT_VIDEO_QUEUE_COMMON,
D3D12DDI_BARRIER_LAYOUT_LEGACY_DIRECT_QUEUE_GENERIC_READ_COMPUTE_QUEUE_ACCESSIBLE,
D3D12DDI_BARRIER_LAYOUT_LEGACY_COPY_SOURCE,
D3D12DDI_BARRIER_LAYOUT_LEGACY_COPY_DEST,
D3D12DDI_BARRIER_LAYOUT_LEGACY_SHADER_RESOURCE,
D3D12DDI_BARRIER_LAYOUT_LEGACY_PIXEL_SHADER_RESOURCE
} ;
View the official Windows Driver Kit DDI referenceNo description available.
A D3D12DDI_BARRIER_LAYOUT value describes the possible layouts used by D3D12 subresources with respect to texture barriers. Layouts apply only to texture resources.
D3D12DDI_BARRIER_LAYOUT_UNDEFINEDProvides support for subresource layout changes where the previous layout is irrelevant or undefined. Typically, this is used for full-subresource or full-resource Clear, Discard, and Copy commands.
A layout transition with both LayoutBefore and LayoutAfter set to D3D12_BARRIER_LAYOUT_UNDEFINED indicates a memory-access-only barrier. Many read/write operations support D3D12_BARRIER_LAYOUT_COMMON. In particular, Copy commands can write to textures using either the D3D12_BARRIER_LAYOUT_COMMON or D3D12_BARRIER_LAYOUT_COPY. A memory-access-only barrier can be used to flush copy writes to a texture without changing the texture layout.
D3D12DDI_BARRIER_LAYOUT_COMMONThis is the layout used by D3D12_RESOURCE_STATE_COMMON. Subresources with this layout are readable in any queue type without requiring a layout change. They are also writeable as a copy destination in any queue type.
Swap chain presentation requires that the back buffer is using D3D12_BARRIER_LAYOUT_COMMON.
D3D12DDI_BARRIER_LAYOUT_PRESENTAlias for D3D12_BARRIER_LAYOUT_COMMON.
D3D12DDI_BARRIER_LAYOUT_GENERIC_READProvides support for any read-only access (for example: SHADER_RESOURCE, COPY_SOURCE). This value should only be used for textures that require multiple, concurrent read accesses since this might not be as optimal as a more specific read layout.
D3D12DDI_BARRIER_LAYOUT_RENDER_TARGETMatches the layout used by D3D12_RESOURCE_STATE_RENDER_TARGET.
D3D12DDI_BARRIER_LAYOUT_UNORDERED_ACCESSMatches the layout used by D3D12_RESOURCE_STATE_UNORDERED_ACCESS.
D3D12DDI_BARRIER_LAYOUT_DEPTH_STENCIL_WRITEMatches the layout used by D3D12_RESOURCE_STATE_DEPTH_WRITE.
D3D12DDI_BARRIER_LAYOUT_DEPTH_STENCIL_READMatches the layout used by D3D12_RESOURCE_STATE_DEPTH_READ.
D3D12DDI_BARRIER_LAYOUT_SHADER_RESOURCEMatches the layout used by D3D12_RESOURCE_STATE_PIXEL_SHADER_RESOURCE and D3D12_RESOURCE_STATE_NON_PIXEL_SHADER_RESOURCE.
D3D12DDI_BARRIER_LAYOUT_COPY_SOURCEMatches the layout used by D3D12_RESOURCE_STATE_COPY_SOURCE.
D3D12DDI_BARRIER_LAYOUT_COPY_DESTMatches the layout used by D3D12_RESOURCE_STATE_COPY_DEST.
D3D12DDI_BARRIER_LAYOUT_RESOLVE_SOURCEMatches the layout used by D3D12DDI_RESOURCE_STATE_RESOLVE_SOURCE.
D3D12DDI_BARRIER_LAYOUT_RESOLVE_DESTMatches the layout used by D3D12DDI_RESOURCE_STATE_RESOLVE_DEST.
D3D12DDI_BARRIER_LAYOUT_SHADING_RATE_SOURCEMatches the layout used by D3D12DDI_RESOURCE_STATE_0062_SHADING_RATE_SOURCE.
D3D12DDI_BARRIER_LAYOUT_VIDEO_DECODE_READMatches the layout used by D3D12_RESOURCE_STATE_VIDEO_DECODE_READ.
D3D12DDI_BARRIER_LAYOUT_VIDEO_DECODE_WRITEMatches the layout used by D3D12_RESOURCE_STATE_VIDEO_DECODE_WRITE.
D3D12DDI_BARRIER_LAYOUT_VIDEO_PROCESS_READMatches the layout used by D3D12_RESOURCE_STATE_VIDEO_PROCESS_READ.
D3D12DDI_BARRIER_LAYOUT_VIDEO_PROCESS_WRITEMatches the layout used by D3D12_RESOURCE_STATE_VIDEO_PROCESS_WRITE.
D3D12DDI_BARRIER_LAYOUT_VIDEO_ENCODE_READMatches the layout used by D3D12_RESOURCE_STATE_VIDEO_ENCODE_READ.
D3D12DDI_BARRIER_LAYOUT_VIDEO_ENCODE_WRITEMatches the layout used by D3D12_RESOURCE_STATE_VIDEO_ENCODE_WRITE.
D3D12DDI_BARRIER_LAYOUT_DIRECT_QUEUE_COMMONSupports common (barrier free) usage on direct queues only. This value be more optimal than the more general D3D12DDI_BARRIER_LAYOUT_COMMON. Can only be used in barriers on direct queues.
Note that this cannot be used for Present. D3D12_BARRIER_LAYOUT_COMMON (also known as D3D12_BARRIER_LAYOUT_PRESENT) is still the required layout for Presentation.
D3D12DDI_BARRIER_LAYOUT_DIRECT_QUEUE_GENERIC_READSame as D3D12_BARRIER_LAYOUT_GENERIC_READ except with optimizations specific for direct queues. Can only be used in barriers on direct queues.
In addition, D3D12_BARRIER_LAYOUT_DIRECT_QUEUE_GENERIC_READ includes support for read-only depth, shading-rate source, and resolve source accesses on direct queues.
D3D12DDI_BARRIER_LAYOUT_DIRECT_QUEUE_UNORDERED_ACCESSSame as D3D12_BARRIER_LAYOUT_UNORDERED_ACCESS except with optimizations specific for direct queues. Can only be used in barriers on direct queues.
D3D12DDI_BARRIER_LAYOUT_DIRECT_QUEUE_SHADER_RESOURCESame as D3D12_BARRIER_LAYOUT_SHADER_RESOURCE except with optimizations specific for direct queues. Can only be used in barriers on direct queues.
D3D12DDI_BARRIER_LAYOUT_DIRECT_QUEUE_COPY_SOURCESame as D3D12_BARRIER_LAYOUT_COPY_SOURCE except with optimizations specific for direct queues. Can only be used in barriers on direct queues.
D3D12DDI_BARRIER_LAYOUT_DIRECT_QUEUE_COPY_DESTSame as D3D12_BARRIER_LAYOUT_COPY_DEST except with optimizations specific for direct queues. Can only be used in barriers on direct queues. Can prevent costly and unnecessary decompression on some layout transitions on resources with next access in a Direct queue.
D3D12DDI_BARRIER_LAYOUT_COMPUTE_QUEUE_COMMONSupports common (barrier free) usage on compute queues only. May be more optimal than the more general D3D12_BARRIER_LAYOUT_COMMON. Can only be used in barriers on compute queues.
D3D12DDI_BARRIER_LAYOUT_COMPUTE_QUEUE_GENERIC_READSame as D3D12_BARRIER_LAYOUT_GENERIC_READ except with optimizations specific for compute queues. Can only be used in barriers on compute queues.
D3D12DDI_BARRIER_LAYOUT_COMPUTE_QUEUE_UNORDERED_ACCESSSame as D3D12_BARRIER_LAYOUT_UNORDERED_ACCESS except with optimizations specific for compute queues. Can only be used in barriers on compute queues.
D3D12DDI_BARRIER_LAYOUT_COMPUTE_QUEUE_SHADER_RESOURCESame as D3D12_BARRIER_LAYOUT_SHADER_RESOURCE except with optimizations specific for compute queues. Can only be used in barriers on compute queues.
D3D12DDI_BARRIER_LAYOUT_COMPUTE_QUEUE_COPY_SOURCESame as D3D12_BARRIER_LAYOUT_COPY_SOURCE except with optimizations specific for compute queues. Can only be used in barriers on compute queues.
D3D12DDI_BARRIER_LAYOUT_COMPUTE_QUEUE_COPY_DESTSame as D3D12_BARRIER_LAYOUT_COPY_DEST except with optimizations specific for compute queues. Can only be used in barriers on compute queues.
D3D12DDI_BARRIER_LAYOUT_VIDEO_QUEUE_COMMONSupports common (barrier free) usage on video queues only. May be more optimal than the more general D3D12_BARRIER_LAYOUT_COMMON. Can only be used in barriers on video queues.
D3D12DDI_BARRIER_LAYOUT_LEGACY_DIRECT_QUEUE_GENERIC_READ_COMPUTE_QUEUE_ACCESSIBLESupports an internally-translated legacy resource state. No enhanced barrier APIs map to this value.
D3D12DDI_BARRIER_LAYOUT_LEGACY_COPY_SOURCESupports an internally-translated legacy resource state. No enhanced barrier APIs map to this value.
D3D12DDI_BARRIER_LAYOUT_LEGACY_COPY_DESTSupports an internally-translated legacy resource state. No enhanced barrier APIs map to this value.
D3D12DDI_BARRIER_LAYOUT_LEGACY_SHADER_RESOURCESupports an internally-translated legacy resource state. No enhanced barrier APIs map to this value.
D3D12DDI_BARRIER_LAYOUT_LEGACY_PIXEL_SHADER_RESOURCESupports an internally-translated legacy resource state. No enhanced barrier APIs map to this value.
Buffer resources have only a linear layout, regardless of access type.
Resource layouts must be compatible with the type of queue performing the layout transition.