Share via


D3D11_RESOURCE_DESC structure

[This documentation is preliminary and is subject to change.]

Describes a resource.

Syntax

typedef struct D3D11_RESOURCE_DESC {
  D3D11_RESOURCE_DIMENSION Dimension;
  UINT                     Width;
  UINT                     Height;
  UINT                     MipLevels;
  UINT                     ArraySize;
  DXGI_FORMAT              Format;
  DXGI_SAMPLE_DESC         SampleDesc;
  D3D11_USAGE              Usage;
  UINT                     BindFlags;
  UINT                     CPUAccessFlags;
  UINT                     MiscFlags;
  UINT                     StructureByteStride;
} D3D11_RESOURCE_DESC;

Members

  • Dimension
    A D3D11_RESOURCE_DIMENSION-typed value that specifies the type of resource.

  • Width
    Texture width (in texels). The range is from 1 to D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION (16384). For a texture cube-map, the range is from 1 to D3D11_REQ_TEXTURECUBE_DIMENSION (16384). However, the range is actually constrained by the feature level at which you create the rendering device.

  • Height
    Texture height (in texels). The range is from 1 to D3D11_REQ_TEXTURE2D_U_OR_V_DIMENSION (16384). For a texture cube-map, the range is from 1 to D3D11_REQ_TEXTURECUBE_DIMENSION (16384). However, the range is actually constrained by the feature level at which you create the rendering device.

  • MipLevels
    The maximum number of mipmap levels in the texture. See the remarks in D3D11_TEX1D_SRV. Use 1 for a multisampled texture; or 0 to generate a full set of subtextures.

  • ArraySize
    Number of textures in the texture array. The range is from 1 to D3D11_REQ_TEXTURE2D_ARRAY_AXIS_DIMENSION (2048). For a texture cube-map, this value is a multiple of 6 (that is, 6 times the value in the NumCubes member of D3D11_TEXCUBE_ARRAY_SRV), and the range is from 6 to 2046. The range is actually constrained by the feature level at which you create the rendering device.

  • Format
    A DXGI_FORMAT-typed value that specifies the texture format.

  • SampleDesc
    A DXGI_SAMPLE_DESC structure that specifies multisampling parameters for the texture.

  • Usage
    A D3D11_USAGE-typed value that identifies how the texture is to be read from and written to. The most common value is D3D11_USAGE_DEFAULT.

  • BindFlags
    A combination of D3D11_BIND_FLAG-typed values that are combined by using a bitwise OR operation. The resulting value specifies how to bind the resource to pipeline stages.

  • CPUAccessFlags
    A combination of D3D11_CPU_ACCESS_FLAG-typed values that are combined by using a bitwise OR operation. The resulting value specifies the types of CPU access allowed.

  • MiscFlags
    A combination of D3D11_RESOURCE_MISC_FLAG-typed values that are combined by using a bitwise OR operation. The resulting value identifies other, less common resource options. Use 0 if none of these values apply. For a texture cube-map, set the D3D11_RESOURCE_MISC_TEXTURECUBE flag. Cube-map arrays (that is, ArraySize > 6) require feature level D3D_FEATURE_LEVEL_10_1 or higher.

  • StructureByteStride
    The size of each element in the buffer structure (in bytes) when the buffer represents a structured buffer. For more info about structured buffers, see Structured Buffer.

    The size value in StructureByteStride must match the size of the format that you use for views of the buffer. For example, if you use a shader resource view (SRV) to read a buffer in a pixel shader, the SRV format size must match the size value in StructureByteStride.

Remarks

This structure is used in a call to ID3D12Device::CreateDefaultResource.

Requirements

Header

D3D12.h