共用方式為


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的新實例,初始化下列參數:

D3D12_RESOURCE_DIMENSION維度

UINT64 對齊方式

UINT64 寬度

UINT 高度

UINT16 depthOrArraySize

UINT16 mipLevels

DXGI_FORMAT格式

UINT sampleCount

UINT 範例Quality

D3D12_TEXTURE_LAYOUT版面 配置

D3D12_RESOURCE_FLAGS旗標

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 寬度

(選擇)UINT16 arraySize = 1

(選擇)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 高度

(選擇)UINT16 arraySize = 1

(選擇)UINT16 mipLevels = 0

(選擇)UINT sampleCount = 1

(選擇)UINT sampleQuality = 0

(選擇) D3D12_RESOURCE_FLAGS旗標 = D3D12_RESOURCE_FLAG_NONE

(選擇) D3D12_TEXTURE_LAYOUT版面配置 = D3D12_TEXTURE_LAYOUT_UNKNOWN

(選擇)UINT64 對齊 = 0

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 對齊 = 0)

指定初始化下列參數的函式:

DXGI_FORMAT格式

UINT64 寬度

UINT 高度

UINT16 深度

(選擇)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)。

inline 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。

需求

需求
頁首
D3dx12.h

另請參閱

D3D12_RESOURCE_DESC

D3D12 的協助程序結構