CD3DX12_RESOURCE_DESC 结构
帮助程序结构,用于轻松初始化 D3D12_RESOURCE_DESC 结构。
语法
struct CD3DX12_RESOURCE_DESC : public D3D12_RESOURCE_DESC{
CD3DX12_RESOURCE_DESC();
explicit CD3DX12_RESOURCE_DESC(const D3D12_RESOURCE_DESC& o);
CD3DX12_RESOURCE_DESC(D3D12_RESOURCE_DIMENSION dimension, UINT64 alignment, UINT64 width, UINT height, UINT16 depthOrArraySize, UINT16 mipLevels, DXGI_FORMAT format, UINT sampleCount, UINT sampleQuality, D3D12_TEXTURE_LAYOUT layout, D3D12_RESOURCE_FLAGS flags);
CD3DX12_RESOURCE_DESC static inline Buffer(const D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo, D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE);
CD3DX12_RESOURCE_DESC static inline Buffer(UINT64 width, D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE, UINT64 alignment = 0);
CD3DX12_RESOURCE_DESC static inline Tex1D(DXGI_FORMAT format, UINT64 width, UINT16 arraySize = 1, UINT16 mipLevels = 0, D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE, D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN, UINT64 alignment = 0);
CD3DX12_RESOURCE_DESC static inline Tex2D(DXGI_FORMAT format, UINT64 width, UINT height, UINT16 arraySize = 1, UINT16 mipLevels = 0, UINT sampleCount = 1, UINT sampleQuality = 0, D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE, D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN, UINT64 alignment = 0);
CD3DX12_RESOURCE_DESC static inline Tex3D(DXGI_FORMAT format, UINT64 width, UINT height, UINT16 depth, UINT16 mipLevels = 0, D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE, D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN, UINT64 alignment = 0);
UINT16 inline Depth() const;
UINT16 inline ArraySize() const;
UINT8 inline PlaneCount(ID3D12Device* pDevice) const;
UINT inline Subresources(ID3D12Device* pDevice) const;
UINT inline CalcSubresource(UINT MipSlice, UINT ArraySlice, UINT PlaneSlice);
operator const D3D12_RESOURCE_DESC&() const;
operator == (const D3D12_RESOURCE_DESC& l, const D3D12_RESOURCE_DESC& r);
operator != (const D3D12_RESOURCE_DESC& l, const D3D12_RESOURCE_DESC& r);
};
成员
-
CD3DX12_RESOURCE_DESC ()
-
创建CD3DX12_RESOURCE_DESC的未初始化的新实例。
-
explicit CD3DX12_RESOURCE_DESC (const D3D12_RESOURCE_DESC& o)
-
创建CD3DX12_RESOURCE_DESC的新实例,该实例使用另一个 D3D12_RESOURCE_DESC 结构的内容进行初始化。
-
CD3DX12_RESOURCE_DESC (D3D12_RESOURCE_DIMENSION尺寸、UINT64 对齐方式、UINT64 宽度、UINT 高度、UINT16 depthOrArraySize、UINT16 mipLevels、DXGI_FORMAT格式、UINT sampleCount、UINT sampleQuality、D3D12_TEXTURE_LAYOUT布局、D3D12_RESOURCE_FLAGS标志)
-
创建CD3DX12_RESOURCE_DESC的新实例,初始化以下参数:
UINT64 对齐方式
UINT64 宽度
UINT 高度
UINT16 depthOrArraySize
UINT16 mipLevels
DXGI_FORMAT 格式
UINT sampleCount
UINT sampleQuality
-
static inline Buffer (const D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo, D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE)
-
指定初始化以下参数的函数:
D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo
(选择) D3D12_RESOURCE_FLAGS 标志 = D3D12_RESOURCE_FLAG_NONE
-
静态内联缓冲区 (UINT64 宽度,D3D12_RESOURCE_FLAGS标志 = D3D12_RESOURCE_FLAG_NONE,UINT64 对齐方式 = 0)
-
指定初始化以下参数的函数:
UINT64 宽度
(选择) D3D12_RESOURCE_FLAGS 标志 = D3D12_RESOURCE_FLAG_NONE
(选择) UINT64 对齐方式 = 0
-
static inline Tex1D (DXGI_FORMAT format, UINT64 width, UINT16 arraySize = 1, UINT16 mipLevels = 0, D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE, D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN, UINT64 alignment = 0)
-
指定初始化以下参数的函数:
DXGI_FORMAT 格式
UINT64 宽度
(opt) UINT16 arraySize = 1
(opt) UINT16 mipLevels = 0
(选择) D3D12_RESOURCE_FLAGS 标志 = D3D12_RESOURCE_FLAG_NONE
(选择) D3D12_TEXTURE_LAYOUT 布局 = D3D12_TEXTURE_LAYOUT_UNKNOWN
(选择) UINT64 对齐方式 = 0
-
static inline Tex2D (DXGI_FORMAT format, UINT64 width, UINT height, UINT16 arraySize = 1, UINT16 mipLevels = 0, UINT sampleCount = 1, UINT sampleQuality = 0, D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE, D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN, UINT64 alignment = 0)
-
指定初始化以下参数的函数:
DXGI_FORMAT 格式
UINT64 宽度
UINT 高度
(opt) UINT16 arraySize = 1
(opt) UINT16 mipLevels = 0
(选择) UINT sampleCount = 1
(opt) UINT sampleQuality = 0
(选择) D3D12_RESOURCE_FLAGS 标志 = D3D12_RESOURCE_FLAG_NONE
(选择) D3D12_TEXTURE_LAYOUT 布局 = D3D12_TEXTURE_LAYOUT_UNKNOWN
(选择) UINT64 对齐方式 = 0
-
静态内联 Tex3D (DXGI_FORMAT格式、UINT64 宽度、UINT 高度、UINT16 深度、UINT16 mipLevels = 0、D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE、D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN、UINT64 对齐方式 = 0)
-
指定初始化以下参数的函数:
DXGI_FORMAT 格式
UINT64 宽度
UINT 高度
UINT16 深度
(opt) UINT16 mipLevels = 0
(选择) D3D12_RESOURCE_FLAGS 标志 = D3D12_RESOURCE_FLAG_NONE
(选择) D3D12_TEXTURE_LAYOUT 布局 = D3D12_TEXTURE_LAYOUT_UNKNOWN
(选择) UINT64 对齐方式 = 0
-
内联深度 () const
-
如果 Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D,则返回 DepthOrArraySize。 如果 Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE3D,则返回 1。
-
inline ArraySize () const
-
如果 Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE3D,则返回 DepthOrArraySize。 如果 Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D,则返回 1。 请参阅 D3D12_RESOURCE_DIMENSION_TEXTURE3D。
-
inline PlaneCount (ID3D12Device* pDevice) const
-
返回 D3D12GetFormatPlaneCount (pDevice,Format) 。 请参阅 D3D12GetFormatPlaneCount 和 ID3D12Device。
-
inline Subresources (ID3D12Device* pDevice) const
-
返回子资源的数目,计算方式为 MipLevels * ArraySize () * PlaneCount (pDevice) 。
-
内联 CalcSubresource (UINT MipSlice、UINT ArraySlice、UINT PlaneSlice)
-
使用 D3D12CalcSubresource 计算子资源索引。
-
operator const D3D12_RESOURCE_DESC& () const
-
定义 & 父结构类型的传递引用运算符。
-
operator == (const D3D12_RESOURCE_DESC& l, const D3D12_RESOURCE_DESC& r)
-
如果每个结构的所有成员都相同,则返回 true。
-
operator != (const D3D12_RESOURCE_DESC& l, const D3D12_RESOURCE_DESC& r)
-
如果每个结构的所有成员都相同,则返回 false。
要求
要求 | 值 |
---|---|
标头 |
|