D3D12_HEAP_TYPE enumeration (d3d12.h)
Specifies the type of heap. When resident, heaps reside in a particular physical memory pool with certain CPU cache properties.
Syntax
typedef enum D3D12_HEAP_TYPE {
D3D12_HEAP_TYPE_DEFAULT = 1,
D3D12_HEAP_TYPE_UPLOAD = 2,
D3D12_HEAP_TYPE_READBACK = 3,
D3D12_HEAP_TYPE_CUSTOM = 4,
D3D12_HEAP_TYPE_GPU_UPLOAD
} ;
Constants
D3D12_HEAP_TYPE_DEFAULT Value: 1 Specifies the default heap. This heap type experiences the most bandwidth for the GPU, but cannot provide CPU access. The GPU can read and write to the memory from this pool, and resource transition barriers may be changed. The majority of heaps and resources are expected to be located here, and are typically populated through resources in upload heaps. |
D3D12_HEAP_TYPE_UPLOAD Value: 2 Specifies a heap used for uploading. This heap type has CPU access optimized for uploading to the GPU, but does not experience the maximum amount of bandwidth for the GPU. This heap type is best for CPU-write-once, GPU-read-once data; but GPU-read-once is stricter than necessary. GPU-read-once-or-from-cache is an acceptable use-case for the data; but such usages are hard to judge due to differing GPU cache designs and sizes. If in doubt, stick to the GPU-read-once definition or profile the difference on many GPUs between copying the data to a _DEFAULT heap vs. reading the data from an _UPLOAD heap. Resources in this heap must be created with D3D12_RESOURCE_STATE_GENERIC_READ and cannot be changed away from this. The CPU address for such heaps is commonly not efficient for CPU reads. The following are typical usages for _UPLOAD heaps:
The following are likely not good usages for _UPLOAD heaps:
|
D3D12_HEAP_TYPE_READBACK Value: 3 Specifies a heap used for reading back. This heap type has CPU access optimized for reading data back from the GPU, but does not experience the maximum amount of bandwidth for the GPU. This heap type is best for GPU-write-once, CPU-readable data. The CPU cache behavior is write-back, which is conducive for multiple sub-cache-line CPU reads. Resources in this heap must be created with D3D12_RESOURCE_STATE_COPY_DEST, and cannot be changed away from this. |
D3D12_HEAP_TYPE_CUSTOM Value: 4 Specifies a custom heap. The application may specify the memory pool and CPU cache properties directly, which can be useful for UMA optimizations, multi-engine, multi-adapter, or other special cases. To do so, the application is expected to understand the adapter architecture to make the right choice. For more details, see D3D12_FEATURE_ARCHITECTURE, D3D12_FEATURE_DATA_ARCHITECTURE, and GetCustomHeapProperties. |
Remarks
This enum is used by the following API items:
The heap types fall into two categories: abstracted heap types, and custom heap types.The following are abstracted heap types:
- D3D12_HEAP_TYPE_DEFAULT
- D3D12_HEAP_TYPE_UPLOAD
- D3D12_HEAP_TYPE_READBACK
- D3D12_HEAP_TYPE_CUSTOM
Note that textures (unlike buffers) can't be heap type UPLOAD or READBACK.
Requirements
Requirement | Value |
---|---|
Header | d3d12.h |