CD3DX12_RESOURCE_DESC structure

A helper structure to enable easy initialization of a D3D12_RESOURCE_DESC structure.

Syntax

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);
};

Members

CD3DX12_RESOURCE_DESC()

Creates a new, uninitialized, instance of a CD3DX12_RESOURCE_DESC.

explicit CD3DX12_RESOURCE_DESC(const D3D12_RESOURCE_DESC& o)

Creates a new instance of a CD3DX12_RESOURCE_DESC, initialized with the contents of another D3D12_RESOURCE_DESC structure.

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)

Creates a new instance of a CD3DX12_RESOURCE_DESC, initializing the following parameters:

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

static inline Buffer(const D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo, D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE)

Specifies a function that initializes the following parameters:

D3D12_RESOURCE_ALLOCATION_INFO& resAllocInfo

(opt) D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE

static inline Buffer(UINT64 width, D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE, UINT64 alignment = 0)

Specifies a function that initializes the following parameters:

UINT64 width

(opt) D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE

(opt) UINT64 alignment = 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)

Specifies a function that initializes the following parameters:

DXGI_FORMAT format

UINT64 width

(opt) UINT16 arraySize = 1

(opt) UINT16 mipLevels = 0

(opt) D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE

(opt) D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN

(opt) UINT64 alignment = 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)

Specifies a function that initializes the following parameters:

DXGI_FORMAT format

UINT64 width

UINT height

(opt) UINT16 arraySize = 1

(opt) UINT16 mipLevels = 0

(opt) UINT sampleCount = 1

(opt) UINT sampleQuality = 0

(opt) D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE

(opt) D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN

(opt) UINT64 alignment = 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 alignment = 0)

Specifies a function that initializes the following parameters:

DXGI_FORMAT format

UINT64 width

UINT height

UINT16 depth

(opt) UINT16 mipLevels = 0

(opt) D3D12_RESOURCE_FLAGS flags = D3D12_RESOURCE_FLAG_NONE

(opt) D3D12_TEXTURE_LAYOUT layout = D3D12_TEXTURE_LAYOUT_UNKNOWN

(opt) UINT64 alignment = 0

inline Depth() const

If Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D, returns DepthOrArraySize. If Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE3D, returns 1.

inline ArraySize() const

If Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE3D, returns DepthOrArraySize. If Dimension == D3D12_RESOURCE_DIMENSION_TEXTURE3D, returns 1. See D3D12_RESOURCE_DIMENSION_TEXTURE3D.

inline PlaneCount(ID3D12Device* pDevice) const

Returns D3D12GetFormatPlaneCount(pDevice, Format). See D3D12GetFormatPlaneCount and ID3D12Device.

inline Subresources(ID3D12Device* pDevice) const

Returns the number of subresources, calculated as MipLevels * ArraySize() * PlaneCount(pDevice).

inline CalcSubresource(UINT MipSlice, UINT ArraySlice, UINT PlaneSlice)

Calculates a subresource index, by using D3D12CalcSubresource.

operator const D3D12_RESOURCE_DESC&() const

Defines the & pass-by-reference operator for the parent structure type.

operator == (const D3D12_RESOURCE_DESC& l, const D3D12_RESOURCE_DESC& r)

Returns true if all members of each structure are identical.

operator != (const D3D12_RESOURCE_DESC& l, const D3D12_RESOURCE_DESC& r)

Returns false if all members of each structure are identical.

Requirements

Requirement Value
Header
D3dx12.h

See also

D3D12_RESOURCE_DESC

Helper Structures for D3D12