CD3D11_DEPTH_STENCIL_VIEW_DESC 结构 (d3d11.h)

表示深度模具视图,并提供用于创建深度模具视图的便捷方法。

语法

struct CD3D11_DEPTH_STENCIL_VIEW_DESC : D3D11_DEPTH_STENCIL_VIEW_DESC {
  void CD3D11_DEPTH_STENCIL_VIEW_DESC();
  void CD3D11_DEPTH_STENCIL_VIEW_DESC(
    const D3D11_DEPTH_STENCIL_VIEW_DESC & o
  );
  void CD3D11_DEPTH_STENCIL_VIEW_DESC(
    D3D11_DSV_DIMENSION viewDimension,
    DXGI_FORMAT         format,
    UINT                mipSlice,
    UINT                firstArraySlice,
    UINT                arraySize,
    UINT                flags
  );
  void CD3D11_DEPTH_STENCIL_VIEW_DESC(
    ID3D11Texture1D     *pTex1D,
    D3D11_DSV_DIMENSION viewDimension,
    DXGI_FORMAT         format,
    UINT                mipSlice,
    UINT                firstArraySlice,
    UINT                arraySize,
    UINT                flags
  );
  void CD3D11_DEPTH_STENCIL_VIEW_DESC(
    ID3D11Texture2D     *pTex2D,
    D3D11_DSV_DIMENSION viewDimension,
    DXGI_FORMAT         format,
    UINT                mipSlice,
    UINT                firstArraySlice,
    UINT                arraySize,
    UINT                flags
  );
  void ~CD3D11_DEPTH_STENCIL_VIEW_DESC();
};

继承

CD3D11_DEPTH_STENCIL_VIEW_DESC 结构实现D3D11_DEPTH_STENCIL_VIEW_DESC。

成员

void CD3D11_DEPTH_STENCIL_VIEW_DESC ()

实例化未初始化 的 CD3D11_DEPTH_STENCIL_VIEW_DESC 结构的新实例。

void CD3D11_DEPTH_STENCIL_VIEW_DESC ( const D3D11_DEPTH_STENCIL_VIEW_DESC & o)

实例化 使用 D3D11_DEPTH_STENCIL_VIEW_DESC 结构初始化的 CD3D11_DEPTH_STENCIL_VIEW_DESC 结构的新实例。

void CD3D11_DEPTH_STENCIL_VIEW_DESC ( D3D11_DSV_DIMENSION viewDimension, DXGI_FORMAT format, UINT mipSlice, UINT firstArraySlice, UINT arraySize, UINT flags)

实例化 使用D3D11_DEPTH_STENCIL_VIEW_DESC 值初始化的 CD3D11_DEPTH_STENCIL_VIEW_DESC 结构的新实例。

void CD3D11_DEPTH_STENCIL_VIEW_DESC ( ID3D11Texture1D *pTex1D, D3D11_DSV_DIMENSION viewDimension, DXGI_FORMAT format, UINT mipSlice, UINT firstArraySlice, UINT arraySize, UINT flags)

实例化使用D3D11_TEX1D_DSV或D3D11_TEX1D_ARRAY_DSV值初始化的 CD3D11_DEPTH_STENCIL_VIEW_DESC 结构的新实例。

void CD3D11_DEPTH_STENCIL_VIEW_DESC ( ID3D11Texture2D *pTex2D, D3D11_DSV_DIMENSION viewDimension, DXGI_FORMAT format, UINT mipSlice, UINT firstArraySlice, UINT arraySize, UINT flags)

实例化使用 2D 纹理值初始化 的 CD3D11_DEPTH_STENCIL_VIEW_DESC 结构的新实例。

void ~CD3D11_DEPTH_STENCIL_VIEW_DESC ()

销毁 CD3D11_DEPTH_STENCIL_VIEW_DESC 结构的实例。

注解

下面是 D3D11.h 定义 CD3D11_DEPTH_STENCIL_VIEW_DESC的方式:

struct CD3D11_DEPTH_STENCIL_VIEW_DESC : public D3D11_DEPTH_STENCIL_VIEW_DESC
{
    CD3D11_DEPTH_STENCIL_VIEW_DESC()
    {}
    explicit CD3D11_DEPTH_STENCIL_VIEW_DESC( const D3D11_DEPTH_STENCIL_VIEW_DESC& o ) :
        D3D11_DEPTH_STENCIL_VIEW_DESC( o )
    {}
    explicit CD3D11_DEPTH_STENCIL_VIEW_DESC(
        D3D11_DSV_DIMENSION viewDimension,
        DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
        UINT mipSlice = 0,
        UINT firstArraySlice = 0,
        UINT arraySize = -1,
        UINT flags = 0 )
    {
        Format = format;
        ViewDimension = viewDimension;
        Flags = flags;
        switch (viewDimension)
        {
        case D3D11_DSV_DIMENSION_TEXTURE1D:
            Texture1D.MipSlice = mipSlice;
            break;
        case D3D11_DSV_DIMENSION_TEXTURE1DARRAY:
            Texture1DArray.MipSlice = mipSlice;
            Texture1DArray.FirstArraySlice = firstArraySlice;
            Texture1DArray.ArraySize = arraySize;
            break;
        case D3D11_DSV_DIMENSION_TEXTURE2D:
            Texture2D.MipSlice = mipSlice;
            break;
        case D3D11_DSV_DIMENSION_TEXTURE2DARRAY:
            Texture2DArray.MipSlice = mipSlice;
            Texture2DArray.FirstArraySlice = firstArraySlice;
            Texture2DArray.ArraySize = arraySize;
            break;
        case D3D11_DSV_DIMENSION_TEXTURE2DMS:
            break;
        case D3D11_DSV_DIMENSION_TEXTURE2DMSARRAY:
            Texture2DMSArray.FirstArraySlice = firstArraySlice;
            Texture2DMSArray.ArraySize = arraySize;
            break;
        default: break;
        }
    }
    explicit CD3D11_DEPTH_STENCIL_VIEW_DESC(
        _In_ ID3D11Texture1D* pTex1D,
        D3D11_DSV_DIMENSION viewDimension,
        DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
        UINT mipSlice = 0,
        UINT firstArraySlice = 0,
        UINT arraySize = -1,
        UINT flags = 0 )
    {
        ViewDimension = viewDimension;
        Flags = flags;
        if (DXGI_FORMAT_UNKNOWN == format ||
            (-1 == arraySize && D3D11_DSV_DIMENSION_TEXTURE1DARRAY == viewDimension))
        {
            D3D11_TEXTURE1D_DESC TexDesc;
            pTex1D->GetDesc( &TexDesc );
            if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format;
            if (-1 == arraySize) arraySize = TexDesc.ArraySize - firstArraySlice;
        }
        Format = format;
        switch (viewDimension)
        {
        case D3D11_DSV_DIMENSION_TEXTURE1D:
            Texture1D.MipSlice = mipSlice;
            break;
        case D3D11_DSV_DIMENSION_TEXTURE1DARRAY:
            Texture1DArray.MipSlice = mipSlice;
            Texture1DArray.FirstArraySlice = firstArraySlice;
            Texture1DArray.ArraySize = arraySize;
            break;
        default: break;
        }
    }
    explicit CD3D11_DEPTH_STENCIL_VIEW_DESC(
        _In_ ID3D11Texture2D* pTex2D,
        D3D11_DSV_DIMENSION viewDimension,
        DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
        UINT mipSlice = 0,
        UINT firstArraySlice = 0,
        UINT arraySize = -1,
        UINT flags = 0 )
    {
        ViewDimension = viewDimension;
        Flags = flags;
        if (DXGI_FORMAT_UNKNOWN == format || 
            (-1 == arraySize &&
                (D3D11_DSV_DIMENSION_TEXTURE2DARRAY == viewDimension ||
                D3D11_DSV_DIMENSION_TEXTURE2DMSARRAY == viewDimension)))
        {
            D3D11_TEXTURE2D_DESC TexDesc;
            pTex2D->GetDesc( &TexDesc );
            if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format;
            if (-1 == arraySize) arraySize = TexDesc.ArraySize - firstArraySlice;
        }
        Format = format;
        switch (viewDimension)
        {
        case D3D11_DSV_DIMENSION_TEXTURE2D:
            Texture2D.MipSlice = mipSlice;
            break;
        case D3D11_DSV_DIMENSION_TEXTURE2DARRAY:
            Texture2DArray.MipSlice = mipSlice;
            Texture2DArray.FirstArraySlice = firstArraySlice;
            Texture2DArray.ArraySize = arraySize;
            break;
        case D3D11_DSV_DIMENSION_TEXTURE2DMS:
            break;
        case D3D11_DSV_DIMENSION_TEXTURE2DMSARRAY:
            Texture2DMSArray.FirstArraySlice = firstArraySlice;
            Texture2DMSArray.ArraySize = arraySize;
            break;
        default: break;
        }
    }
    ~CD3D11_DEPTH_STENCIL_VIEW_DESC() {}
    operator const D3D11_DEPTH_STENCIL_VIEW_DESC&() const { return *this; }
};

要求

   
最低受支持的客户端 Windows 7 [仅限桌面应用]
最低受支持的服务器 Windows Server 2008 R2 [仅限桌面应用]
标头 d3d11.h

另请参阅

CD3D11 帮助程序结构