Modifier

Partager via


D3DX10ReflectShader function

This function -- which creates a shader-reflection object for retrieving information about a compiled shader -- no longer exists. Instead, use D3DReflect or D3D11Reflect.

Syntax

HRESULT D3DX10ReflectShader(
  _In_  const void                    *pShaderBytecode,
  _In_        SIZE_T                  BytecodeLength,
  _Out_       ID3D10ShaderReflection1 **ppReflector
);

Parameters

pShaderBytecode [in]

Type: const void*

A pointer to the compiled shader. To get this pointer see Getting a Pointer to a Compiled Shader.

BytecodeLength [in]

Type: SIZE_T

Length of pShaderBytecode.

ppReflector [out]

Type: ID3D10ShaderReflection1**

Address of a shader reflection interface (see ID3D10ShaderReflection1 Interface.)

Return value

Type: HRESULT

Returns one of the following Direct3D 10 Return Codes.

Remarks

Here is an example of creating a shader-reflection object. The example assumes you start with a compiled shader (shown as

pVSBuf

which you can see in HLSLWithoutFX10 Sample).

ID3D10ShaderReflection1* pIShaderReflection1 = NULL;
D3D10_SHADER_DESC desc;
hr = D3D10ReflectShader( (void*) pVSBuf->GetBufferPointer(), pVSBuf->GetBufferSize(),
    &pIShaderReflection1 );
if( pIShaderReflection1 )
{
    pIShaderReflection1->GetDesc( &desc );
}

Requirements

Requirement Value
Header
D3DX10Core.h

See also

General Purpose Functions