D3DReflect function (d3dcompiler.h)

Gets a pointer to a reflection interface.

Syntax

HRESULT D3DReflect(
  [in]  LPCVOID pSrcData,
  [in]  SIZE_T  SrcDataSize,
  [in]  REFIID  pInterface,
  [out] void    **ppReflector
);

Parameters

[in] pSrcData

Type: LPCVOID

A pointer to source data as compiled HLSL code.

[in] SrcDataSize

Type: SIZE_T

Length of pSrcData.

[in] pInterface

Type: REFIID

The reference GUID of the COM interface to use. For example, IID_ID3D11ShaderReflection.

[out] ppReflector

Type: void**

A pointer to a reflection interface.

Return value

Type: HRESULT

Returns one of the Direct3D 11 return codes.

Remarks

Shader code contains metadata that can be inspected using the reflection APIs.

The following code illustrates retrieving a ID3D11ShaderReflection Interface from a shader.


pd3dDevice->CreatePixelShader( pPixelShaderBuffer->GetBufferPointer(),
                               pPixelShaderBuffer->GetBufferSize(), g_pPSClassLinkage, &g_pPixelShader );

ID3D11ShaderReflection* pReflector = NULL; 
D3DReflect( pPixelShaderBuffer->GetBufferPointer(), pPixelShaderBuffer->GetBufferSize(), 
            IID_ID3D11ShaderReflection, (void**) &pReflector);

Requirements

Requirement Value
Target Platform Windows
Header d3dcompiler.h
Library D3dcompiler_47.lib
DLL D3dcompiler_47.dll

See also

Functions