ID3D11Device::CreateGeometryShader Method

Create a geometry shader.

Syntax

HRESULT CreateGeometryShader(
  [in]   const void *pShaderBytecode,
  [in]   SIZE_T BytecodeLength,
  [in]   ID3D11ClassLinkage *pClassLinkage,
  [out]  ID3D11GeometryShader **ppGeometryShader
);

Parameter

  • pShaderBytecode [in]
    Typ: const void*

    A pointer to the compiled shader.

  • BytecodeLength [in]
    Typ: SIZE_T

    Size of the compiled geometry shader.

  • pClassLinkage [in]
    Typ: ID3D11ClassLinkage*

    A pointer to a class linkage interface (see ID3D11ClassLinkage); the value can be NULL.

  • ppGeometryShader [out]
    Typ: ID3D11GeometryShader**

    Address of a pointer to a ID3D11GeometryShader interface. If this is NULL, all other parameters will be validated, and if all parameters pass validation this API will return S_FALSE instead of S_OK.

Rückgabewert

Typ: HRESULT

This method returns one of the following Direct3D 11 Return Codes.

Hinweise

Once created, the shader can be set to the device by calling ID3D11DeviceContext::GSSetShader.

Beispiele

Usage Example


ID3D11GeometryShader*       g_pGeometryShader11 = NULL;
ID3DBlob* pGeometryShaderBuffer = NULL;
ID3DBlob * errorbuffer = NULL;

D3DX11CompileFromFile( str, NULL, NULL, "GS", "gs_4_0", dwShaderFlags, 0, NULL,
                                         &pGeometryShaderBuffer, &errorbuffer, NULL );

pd3dDevice->CreateGeometryShader( pGeometryShaderBuffer->GetBufferPointer(),
               pGeometryShaderBuffer->GetBufferSize(), NULL, &g_pGeometryShader11 );
     
          

Anforderungen

Header

D3D11.h

Bibliothek

D3D11.lib

Siehe auch

ID3D11Device