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 |
|
|
|
|
|
reference |
05/31/2018 |
Gets a pointer to a reflection interface.
HRESULT D3D11Reflect(
in LPCVOID pSrcData,
in SIZE_T SrcDataSize,
out ID3D11ShaderReflection ppReflector
);
-
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.
Type: HRESULT
Returns one of the return codes described in the topic Direct3D 11 Return Codes.
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);
Requirement | Value |
---|---|
Header |
|
Library |
|
DLL |
|