Skip to content

Latest commit

 

History

History
110 lines (68 loc) · 2.96 KB

d3d11reflect.md

File metadata and controls

110 lines (68 loc) · 2.96 KB
title description ms.assetid keywords topic_type api_name api_location api_type ms.topic ms.date
D3D11Reflect function
Gets a pointer to a reflection interface.
855097c7-988b-4ab6-90c5-e5dd0bc9e1e0
D3D11Reflect function HLSL
apiref
D3D11Reflect
D3dcompiler_47.dll
DllExport
reference
05/31/2018

D3D11Reflect function

Gets a pointer to a reflection interface.

Syntax

HRESULT D3D11Reflect(
  in  LPCVOID pSrcData,
  in  SIZE_T SrcDataSize,
  out ID3D11ShaderReflection ppReflector
);

Parameters

pSrcData [in]

Type: LPCVOID

A pointer to source data as compiled HLSL code.

SrcDataSize [in]

Type: SIZE_T

Length of pSrcData.

ppReflector [out]

Type: ID3D11ShaderReflection**

The address of a pointer to the ID3D11ShaderReflection interface.

Return value

Type: HRESULT

Returns one of the return codes described in the topic Direct3D 11 Return Codes.

Remarks

The inline D3D11Reflect compiler function is a wrapper for the D3DReflect compiler function. D3D11Reflect can retrieve only a ID3D11ShaderReflection interface from a shader. D3DReflect can retrieve a ID3D11ShaderReflection interface or a Direct3D 10 or Direct3D 10.1 reflection interface, for example, ID3D10ShaderReflection.

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

The following code shows how to retrieve a ID3D11ShaderReflection interface from a shader.

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

ID3D11ShaderReflection* pReflector = NULL; 
D3D11Reflect( pPixelShaderBuffer->GetBufferPointer(), pPixelShaderBuffer->GetBufferSize(), 
            &pReflector);

Requirements

Requirement Value
Header
D3DCompiler.inl
Library
D3dcompiler_47.lib
DLL
D3dcompiler_47.dll

See also

Functions