Condividi tramite


CD3D11_SHADER_RESOURCE_VIEW_DESC struttura (d3d11.h)

Rappresenta una visualizzazione delle risorse shader e fornisce metodi pratici per la creazione di viste shader-resource.

Sintassi

struct CD3D11_SHADER_RESOURCE_VIEW_DESC : D3D11_SHADER_RESOURCE_VIEW_DESC {
  void CD3D11_SHADER_RESOURCE_VIEW_DESC();
  void CD3D11_SHADER_RESOURCE_VIEW_DESC(
    const D3D11_SHADER_RESOURCE_VIEW_DESC & o
  );
  void CD3D11_SHADER_RESOURCE_VIEW_DESC(
    D3D11_SRV_DIMENSION viewDimension,
    DXGI_FORMAT         format,
    UINT                mostDetailedMip,
    UINT                mipLevels,
    UINT                firstArraySlice,
    UINT                arraySize,
    UINT                flags
  );
  void CD3D11_SHADER_RESOURCE_VIEW_DESC(
    ID3D11Buffer *unnamedParam1,
    DXGI_FORMAT  format,
    UINT         firstElement,
    UINT         numElements,
    UINT         flags
  );
  void CD3D11_SHADER_RESOURCE_VIEW_DESC(
    ID3D11Texture1D     *pTex1D,
    D3D11_SRV_DIMENSION viewDimension,
    DXGI_FORMAT         format,
    UINT                mostDetailedMip,
    UINT                mipLevels,
    UINT                firstArraySlice,
    UINT                arraySize
  );
  void CD3D11_SHADER_RESOURCE_VIEW_DESC(
    ID3D11Texture2D     *pTex2D,
    D3D11_SRV_DIMENSION viewDimension,
    DXGI_FORMAT         format,
    UINT                mostDetailedMip,
    UINT                mipLevels,
    UINT                firstArraySlice,
    UINT                arraySize
  );
  void CD3D11_SHADER_RESOURCE_VIEW_DESC(
    ID3D11Texture3D *pTex3D,
    DXGI_FORMAT     format,
    UINT            mostDetailedMip,
    UINT            mipLevels
  );
  void ~CD3D11_SHADER_RESOURCE_VIEW_DESC();
};

Ereditarietà

La struttura CD3D11_SHADER_RESOURCE_VIEW_DESC implementa D3D11_SHADER_RESOURCE_VIEW_DESC .

Membri

void CD3D11_SHADER_RESOURCE_VIEW_DESC()

Crea un'istanza di una nuova istanza di una struttura di CD3D11_SHADER_RESOURCE_VIEW_DESC non inizializzata.

void CD3D11_SHADER_RESOURCE_VIEW_DESC( const D3D11_SHADER_RESOURCE_VIEW_DESC & o)

Crea un'istanza di una nuova istanza di una struttura CD3D11_SHADER_RESOURCE_VIEW_DESC inizializzata con una struttura D3D11_SHADER_RESOURCE_VIEW_DESC .

void CD3D11_SHADER_RESOURCE_VIEW_DESC( D3D11_SRV_DIMENSION viewDimension, DXGI_FORMAT formato, UINT mostDetailedMip, UINT mipLevels, UINT firstArraySlice, UINT arraySize, UINT flags)

Crea un'istanza di una nuova istanza di una struttura di CD3D11_SHADER_RESOURCE_VIEW_DESC inizializzata con valori D3D11_SHADER_RESOURCE_VIEW_DESC .

void CD3D11_SHADER_RESOURCE_VIEW_DESC( ID3D11Buffer *unnamedParam1, DXGI_FORMAT formato, UINT firstElement, UINT numElements, flag UINT)

Crea un'istanza di una nuova istanza di una struttura CD3D11_SHADER_RESOURCE_VIEW_DESC inizializzata con valori D3D11_BUFFEREX_SRV .

void CD3D11_SHADER_RESOURCE_VIEW_DESC( ID3D11Texture1D *pTex1D, D3D11_SRV_DIMENSION viewDimension, DXGI_FORMAT formato, UINT mostDetailedMip, UINT mipLevels, UINT firstArraySlice, UINT arraySize)

Crea un'istanza di una nuova istanza di una struttura di CD3D11_SHADER_RESOURCE_VIEW_DESC inizializzata con valori D3D11_TEX1D_SRV o D3D11_TEX1D_ARRAY_SRV .

void CD3D11_SHADER_RESOURCE_VIEW_DESC( ID3D11Texture2D *pTex2D, D3D11_SRV_DIMENSION viewDimension, DXGI_FORMAT formato, UINT mostDetailedMip, UINT mipLevels, UINT firstArraySlice, UINT arraySize)

Crea un'istanza di una nuova istanza di una struttura CD3D11_SHADER_RESOURCE_VIEW_DESC inizializzata con valori di trama 2D.

void CD3D11_SHADER_RESOURCE_VIEW_DESC( ID3D11Texture3D *pTex3D, DXGI_FORMAT formato, UINT mostDetailedMip, UINT mipLevels)

Crea un'istanza di una nuova istanza di una struttura CD3D11_SHADER_RESOURCE_VIEW_DESC inizializzata con valori di trama 3D.

void ~CD3D11_SHADER_RESOURCE_VIEW_DESC()

Elimina un'istanza di una struttura CD3D11_SHADER_RESOURCE_VIEW_DESC .

Commenti

Ecco come D3D11.h definisce CD3D11_SHADER_RESOURCE_VIEW_DESC:

struct CD3D11_SHADER_RESOURCE_VIEW_DESC : public D3D11_SHADER_RESOURCE_VIEW_DESC
{
    CD3D11_SHADER_RESOURCE_VIEW_DESC()
    {}
    explicit CD3D11_SHADER_RESOURCE_VIEW_DESC( const D3D11_SHADER_RESOURCE_VIEW_DESC& o ) :
        D3D11_SHADER_RESOURCE_VIEW_DESC( o )
    {}
    explicit CD3D11_SHADER_RESOURCE_VIEW_DESC(
        D3D11_SRV_DIMENSION viewDimension,
        DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
        UINT mostDetailedMip = 0, // FirstElement for BUFFER
        UINT mipLevels = -1, // NumElements for BUFFER
        UINT firstArraySlice = 0, // First2DArrayFace for TEXTURECUBEARRAY
        UINT arraySize = -1, // NumCubes for TEXTURECUBEARRAY
        UINT flags = 0 ) // BUFFEREX only
    {
        Format = format;
        ViewDimension = viewDimension;
        switch (viewDimension)
        {
        case D3D11_SRV_DIMENSION_BUFFER:
            Buffer.FirstElement = mostDetailedMip;
            Buffer.NumElements = mipLevels;
            break;
        case D3D11_SRV_DIMENSION_TEXTURE1D:
            Texture1D.MostDetailedMip = mostDetailedMip;
            Texture1D.MipLevels = mipLevels;
            break;
        case D3D11_SRV_DIMENSION_TEXTURE1DARRAY:
            Texture1DArray.MostDetailedMip = mostDetailedMip;
            Texture1DArray.MipLevels = mipLevels;
            Texture1DArray.FirstArraySlice = firstArraySlice;
            Texture1DArray.ArraySize = arraySize;
            break;
        case D3D11_SRV_DIMENSION_TEXTURE2D:
            Texture2D.MostDetailedMip = mostDetailedMip;
            Texture2D.MipLevels = mipLevels;
            break;
        case D3D11_SRV_DIMENSION_TEXTURE2DARRAY:
            Texture2DArray.MostDetailedMip = mostDetailedMip;
            Texture2DArray.MipLevels = mipLevels;
            Texture2DArray.FirstArraySlice = firstArraySlice;
            Texture2DArray.ArraySize = arraySize;
            break;
        case D3D11_SRV_DIMENSION_TEXTURE2DMS:
            break;
        case D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY:
            Texture2DMSArray.FirstArraySlice = firstArraySlice;
            Texture2DMSArray.ArraySize = arraySize;
            break;
        case D3D11_SRV_DIMENSION_TEXTURE3D:
            Texture3D.MostDetailedMip = mostDetailedMip;
            Texture3D.MipLevels = mipLevels;
            break;
        case D3D11_SRV_DIMENSION_TEXTURECUBE:
            TextureCube.MostDetailedMip = mostDetailedMip;
            TextureCube.MipLevels = mipLevels;
            break;
        case D3D11_SRV_DIMENSION_TEXTURECUBEARRAY:
            TextureCubeArray.MostDetailedMip = mostDetailedMip;
            TextureCubeArray.MipLevels = mipLevels;
            TextureCubeArray.First2DArrayFace = firstArraySlice;
            TextureCubeArray.NumCubes = arraySize;
            break;
        case D3D11_SRV_DIMENSION_BUFFEREX:
            BufferEx.FirstElement = mostDetailedMip;
            BufferEx.NumElements = mipLevels;
            BufferEx.Flags = flags;
            break;
        default: break;
        }
    }
    explicit CD3D11_SHADER_RESOURCE_VIEW_DESC(
        _In_ ID3D11Buffer*,
        DXGI_FORMAT format,
        UINT firstElement,
        UINT numElements,
        UINT flags = 0 )
    {
        Format = format;
        ViewDimension = D3D11_SRV_DIMENSION_BUFFEREX;
        BufferEx.FirstElement = firstElement;
        BufferEx.NumElements = numElements;
        BufferEx.Flags = flags;
    }
    explicit CD3D11_SHADER_RESOURCE_VIEW_DESC(
        _In_ ID3D11Texture1D* pTex1D,
        D3D11_SRV_DIMENSION viewDimension,
        DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
        UINT mostDetailedMip = 0,
        UINT mipLevels = -1,
        UINT firstArraySlice = 0,
        UINT arraySize = -1 )
    {
        ViewDimension = viewDimension;
        if (DXGI_FORMAT_UNKNOWN == format || -1 == mipLevels ||
            (-1 == arraySize && D3D11_SRV_DIMENSION_TEXTURE1DARRAY == viewDimension))
        {
            D3D11_TEXTURE1D_DESC TexDesc;
            pTex1D->GetDesc( &TexDesc );
            if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format;
            if (-1 == mipLevels) mipLevels = TexDesc.MipLevels - mostDetailedMip;
            if (-1 == arraySize) arraySize = TexDesc.ArraySize - firstArraySlice;
        }
        Format = format;
        switch (viewDimension)
        {
        case D3D11_SRV_DIMENSION_TEXTURE1D:
            Texture1D.MostDetailedMip = mostDetailedMip;
            Texture1D.MipLevels = mipLevels;
            break;
        case D3D11_SRV_DIMENSION_TEXTURE1DARRAY:
            Texture1DArray.MostDetailedMip = mostDetailedMip;
            Texture1DArray.MipLevels = mipLevels;
            Texture1DArray.FirstArraySlice = firstArraySlice;
            Texture1DArray.ArraySize = arraySize;
            break;
        default: break;
        }
    }
    explicit CD3D11_SHADER_RESOURCE_VIEW_DESC(
        _In_ ID3D11Texture2D* pTex2D,
        D3D11_SRV_DIMENSION viewDimension,
        DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
        UINT mostDetailedMip = 0,
        UINT mipLevels = -1,
        UINT firstArraySlice = 0, // First2DArrayFace for TEXTURECUBEARRAY
        UINT arraySize = -1 ) // NumCubes for TEXTURECUBEARRAY
    {
        ViewDimension = viewDimension;
        if (DXGI_FORMAT_UNKNOWN == format || 
            (-1 == mipLevels &&
                D3D11_SRV_DIMENSION_TEXTURE2DMS != viewDimension &&
                D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY != viewDimension) ||
            (-1 == arraySize &&
                (D3D11_SRV_DIMENSION_TEXTURE2DARRAY == viewDimension ||
                D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY == viewDimension ||
                D3D11_SRV_DIMENSION_TEXTURECUBEARRAY == viewDimension)))
        {
            D3D11_TEXTURE2D_DESC TexDesc;
            pTex2D->GetDesc( &TexDesc );
            if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format;
            if (-1 == mipLevels) mipLevels = TexDesc.MipLevels - mostDetailedMip;
            if (-1 == arraySize)
            {
                arraySize = TexDesc.ArraySize - firstArraySlice;
                if (D3D11_SRV_DIMENSION_TEXTURECUBEARRAY == viewDimension) arraySize /= 6;
            }
        }
        Format = format;
        switch (viewDimension)
        {
        case D3D11_SRV_DIMENSION_TEXTURE2D:
            Texture2D.MostDetailedMip = mostDetailedMip;
            Texture2D.MipLevels = mipLevels;
            break;
        case D3D11_SRV_DIMENSION_TEXTURE2DARRAY:
            Texture2DArray.MostDetailedMip = mostDetailedMip;
            Texture2DArray.MipLevels = mipLevels;
            Texture2DArray.FirstArraySlice = firstArraySlice;
            Texture2DArray.ArraySize = arraySize;
            break;
        case D3D11_SRV_DIMENSION_TEXTURE2DMS:
            break;
        case D3D11_SRV_DIMENSION_TEXTURE2DMSARRAY:
            Texture2DMSArray.FirstArraySlice = firstArraySlice;
            Texture2DMSArray.ArraySize = arraySize;
            break;
        case D3D11_SRV_DIMENSION_TEXTURECUBE:
            TextureCube.MostDetailedMip = mostDetailedMip;
            TextureCube.MipLevels = mipLevels;
            break;
        case D3D11_SRV_DIMENSION_TEXTURECUBEARRAY:
            TextureCubeArray.MostDetailedMip = mostDetailedMip;
            TextureCubeArray.MipLevels = mipLevels;
            TextureCubeArray.First2DArrayFace = firstArraySlice;
            TextureCubeArray.NumCubes = arraySize;
            break;
        default: break;
        }
    }
    explicit CD3D11_SHADER_RESOURCE_VIEW_DESC(
        _In_ ID3D11Texture3D* pTex3D,
        DXGI_FORMAT format = DXGI_FORMAT_UNKNOWN,
        UINT mostDetailedMip = 0,
        UINT mipLevels = -1 )
    {
        ViewDimension = D3D11_SRV_DIMENSION_TEXTURE3D;
        if (DXGI_FORMAT_UNKNOWN == format || -1 == mipLevels)
        {
            D3D11_TEXTURE3D_DESC TexDesc;
            pTex3D->GetDesc( &TexDesc );
            if (DXGI_FORMAT_UNKNOWN == format) format = TexDesc.Format;
            if (-1 == mipLevels) mipLevels = TexDesc.MipLevels - mostDetailedMip;
        }
        Format = format;
        Texture3D.MostDetailedMip = mostDetailedMip;
        Texture3D.MipLevels = mipLevels;
    }
    ~CD3D11_SHADER_RESOURCE_VIEW_DESC() {}
    operator const D3D11_SHADER_RESOURCE_VIEW_DESC&() const { return *this; }
};

Requisiti

Requisito Valore
Client minimo supportato Windows 7 [app desktop | App UWP]
Server minimo supportato Windows Server 2008 R2 [app desktop | App UWP]
Intestazione d3d11.h

Vedi anche

Strutture helper CD3D11