共用方式為


CD3DX12_RESOURCE_DESC1結構

協助程式結構,可讓您輕鬆初始化 D3D12_RESOURCE_DESC1 結構。

語法

struct CD3DX12_RESOURCE_DESC1 : public D3D12_RESOURCE_DESC1
{
    CD3DX12_RESOURCE_DESC1();
    explicit CD3DX12_RESOURCE_DESC1(const D3D12_RESOURCE_DESC1& o) noexcept;
    CD3DX12_RESOURCE_DESC1(
        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,
        UINT samplerFeedbackMipRegionWidth = 0,
        UINT samplerFeedbackMipRegionHeight = 0,
        UINT samplerFeedbackMipRegionDepth = 0) noexcept;
    static inline CD3DX12_RESOURCE_DESC1 Buffer(
        const D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo,
        D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE) noexcept;
    static inline CD3DX12_RESOURCE_DESC1 Buffer(
        UINT64 width,
        D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE,
        UINT64 alignment = 0) noexcept;
    static inline CD3DX12_RESOURCE_DESC1 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) noexcept;
    static inline CD3DX12_RESOURCE_DESC1 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,
        UINT samplerFeedbackMipRegionWidth = 0,
        UINT samplerFeedbackMipRegionHeight = 0,
        UINT samplerFeedbackMipRegionDepth = 0) noexcept;
    static inline CD3DX12_RESOURCE_DESC1 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) noexcept;
    inline UINT16 Depth() const noexcept;
    inline UINT16 ArraySize() const noexcept;
    inline UINT8 PlaneCount(_In_ ID3D12Device* pDevice) const noexcept;
    inline UINT Subresources(_In_ ID3D12Device* pDevice) const noexcept;
    inline UINT CalcSubresource(UINT MipSlice, UINT ArraySlice, UINT PlaneSlice) noexcept;
};
inline bool operator==(const D3D12_RESOURCE_DESC1& l, const D3D12_RESOURCE_DESC1& r) noexcept;
inline bool operator!=(const D3D12_RESOURCE_DESC1& l, const D3D12_RESOURCE_DESC1& r) noexcept;

成員

CD3DX12_RESOURCE_DESC1

預設建構函式。 建立CD3DX12_RESOURCE_DESC1的新未初始化實例。

CD3DX12_RESOURCE_DESC1(const D3D12_RESOURCE_DESC1&)

建構函式,這個建構函式會使用D3D12_RESOURCE_DESC1結構的內容初始化CD3DX12_RESOURCE_DESC1的新實例。

CD3DX12_RESOURCE_DESC1(D3D12_RESOURCE_DIMENSION, UINT64, UINT64, UINT, UINT16, UINT16, DXGI_FORMAT, UINT, UINT, D3D12_TEXTURE_LAYOUT, D3D12_RESOURCE_FLAGS, UINT = 0, UINT = 0, UINT = 0)

建構函式,這個建構函式會使用傳遞給它的參數初始化 CD3DX12_RESOURCE_DESC1 的新實例。

Buffer(const D3D12_RESOURCE_ALLOCATION_INFO&, D3D12_RESOURCE_FLAGS = D3D12_RESOURCE_FLAG_NONE)

靜態函式,會建構並傳回以這些值初始化 CD3DX12_RESOURCE_DESC1 的新實例。

資料成員 value
尺寸 D3D12_RESOURCE_DIMENSION_BUFFER
Alignment resAllocInfo。對準
寬度 resAllocInfo。SizeInBytes
高度 1
DepthOrArraySize 1
MipLevels 1
格式 DXGI_FORMAT_UNKNOWN
SampleDesc.Count 1
SampleDesc.Quality 0
Layout D3D12_TEXTURE_LAYOUT_ROW_MAJOR
Flags flags
SamplerFeedbackMipRegion.Width 0
SamplerFeedbackMipRegion.Height 0
SamplerFeedbackMipRegion.Depth 0

Buffer(UINT64, D3D12_RESOURCE_FLAGS = D3D12_RESOURCE_FLAG_NONE, UINT64 = 0)

靜態函式,會建構並傳回以這些值初始化 CD3DX12_RESOURCE_DESC1 的新實例。

資料成員 value
尺寸 D3D12_RESOURCE_DIMENSION_BUFFER
Alignment 對準
寬度 寬度
高度 1
DepthOrArraySize 1
MipLevels 1
格式 DXGI_FORMAT_UNKNOWN
SampleDesc.Count 1
SampleDesc.Quality 0
Layout D3D12_TEXTURE_LAYOUT_ROW_MAJOR
Flags flags
SamplerFeedbackMipRegion.Width 0
SamplerFeedbackMipRegion.Height 0
SamplerFeedbackMipRegion.Depth 0

Tex1D(DXGI_FORMAT, UINT64, UINT16 = 1, UINT16 = 0, D3D12_RESOURCE_FLAGS D3D12_RESOURCE_FLAG_NONE, D3D12_TEXTURE_LAYOUT = D3D12_TEXTURE_LAYOUT_UNKNOWN, UINT64 = 0)

靜態函式,會建構並傳回以這些值初始化 CD3DX12_RESOURCE_DESC1 的新實例。

資料成員 value
尺寸 D3D12_RESOURCE_DIMENSION_TEXTURE1D
Alignment 對準
寬度 寬度
高度 1
DepthOrArraySize arraySize
MipLevels mipLevels
格式 format
SampleDesc.Count 1
SampleDesc.Quality 0
Layout 佈局
Flags flags
SamplerFeedbackMipRegion.Width 0
SamplerFeedbackMipRegion.Height 0
SamplerFeedbackMipRegion.Depth 0

Tex2D(DXGI_FORMAT, UINT64, UINT, UINT16 = 1, UINT16 = 0, UINT = 1, UINT = 0, D3D12_RESOURCE_FLAGS = D3D12_RESOURCE_FLAG_NONE, D3D12_TEXTURE_LAYOUT = D3D12_TEXTURE_LAYOUT_UNKNOWN, UINT64 = 0, UINT = 0, UINT = 0, UINT = 0)

靜態函式,會建構並傳回以這些值初始化 之CD3DX12_RESOURCE_DESC1 的新實例。

資料成員 value
尺寸 D3D12_RESOURCE_DIMENSION_TEXTURE2D
Alignment 對準
寬度 寬度
高度 height (高度)
DepthOrArraySize arraySize
MipLevels mipLevels
格式 format
SampleDesc.Count sampleCount
SampleDesc.Quality sampleQuality
Layout 佈局
Flags flags
SamplerFeedbackMipRegion.Width samplerFeedbackMipRegionWidth
SamplerFeedbackMipRegion.Height samplerFeedbackMipRegionHeight
SamplerFeedbackMipRegion.Depth samplerFeedbackMipRegionDepth

Tex3D(DXGI_FORMAT, UINT64, UINT, UINT16, UINT16 = 0, D3D12_RESOURCE_FLAGS = D3D12_RESOURCE_FLAG_NONE, D3D12_TEXTURE_LAYOUT = D3D12_TEXTURE_LAYOUT_UNKNOWN, UINT64 = 0)

靜態函式,會建構並傳回以這些值初始化 之CD3DX12_RESOURCE_DESC1 的新實例。

資料成員 value
尺寸 D3D12_RESOURCE_DIMENSION_TEXTURE3D
Alignment 對準
寬度 寬度
高度 height (高度)
DepthOrArraySize 深度
MipLevels mipLevels
格式 format
SampleDesc.Count 1
SampleDesc.Quality 0
Layout 佈局
Flags flags
SamplerFeedbackMipRegion.Width 0
SamplerFeedbackMipRegion.Height 0
SamplerFeedbackMipRegion.Depth 0

Depth

傳回包含資源深度的 UINT16

ArraySize

傳回包含資源陣列大小的 UINT16

PlaneCount(ID3D12Device*)

傳回 UINT8 ,其中包含資源格式的平面計數。

Subresources(ID3D12Device*)

傳回 UINT ,其中包含資源中的子資源數目。

CalcSubresource(UINT, UINT, UINT)

根據傳遞給資源的參數,計算並傳回包含資源的子資源索引的 UINT

operator==(const D3D12_RESOURCE_DESC1&, const D3D12_RESOURCE_DESC1&)

如果兩個參數相等,則傳回 true 的免費函式,否則 false 為 。

operator!=(const D3D12_RESOURCE_DESC1&, const D3D12_RESOURCE_DESC1&)

如果兩個參數不相等,則傳回 true 的免費函式,否則 false 為 。

規格需求

需求
標頭 D3dx12.h

另請參閱