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&)

用于创建 CD3DX12_RESOURCE_DESC1使用 D3D12_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
对齐方式 resAllocInfo。对准
宽度 resAllocInfo。SizeInBytes
高度 1
DepthOrArraySize 1
MipLevels 1
格式 DXGI_FORMAT_UNKNOWN
SampleDesc.Count 1
SampleDesc.Quality 0
Layout D3D12_TEXTURE_LAYOUT_ROW_MAJOR
Flags flag
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
宽度 width
高度 1
DepthOrArraySize 1
MipLevels 1
格式 DXGI_FORMAT_UNKNOWN
SampleDesc.Count 1
SampleDesc.Quality 0
Layout D3D12_TEXTURE_LAYOUT_ROW_MAJOR
Flags flag
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
宽度 width
高度 1
DepthOrArraySize arraySize
MipLevels mipLevels
格式 format
SampleDesc.Count 1
SampleDesc.Quality 0
Layout 布局
Flags flag
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
宽度 width
高度 height
DepthOrArraySize arraySize
MipLevels mipLevels
格式 format
SampleDesc.Count sampleCount
SampleDesc.Quality sampleQuality
Layout 布局
Flags flag
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
宽度 width
高度 height
DepthOrArraySize depth
MipLevels mipLevels
格式 format
SampleDesc.Count 1
SampleDesc.Quality 0
Layout 布局
Flags flag
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

请参阅