ID3D11ShaderReflectionVariable::GetInterfaceSlot method

Gets the corresponding interface slot for a variable that represents an interface pointer.

Syntax


UINT GetInterfaceSlot(
  [in]  UINT uArrayIndex
);

Parameters

uArrayIndex [in]

Type: UINT

Index of the array element to get the slot number for. For a non-array variable this value will be zero.

Return value

Type: UINT

Returns the index of the interface in the interface array.

Remarks

GetInterfaceSlot gets the corresponding slot in an dynamic linkage array for an interface instance. The returned slot number is used to set an interface instance to a particular class instance. See the HLSL Interfaces and Classes overview for additional information.

This method's interface is hosted in the out-of-box DLL D3DCompiler_xx.dll.

Examples

Retrieving and using an interface slot



ID3D11ShaderReflectionVariable* pAmbientLightingVar = pReflector->GetVariableByName("g_abstractAmbientLighting");
g_iAmbientLightingOffset = pAmbientLightingVar->GetInterfaceSlot(0);
g_pPSClassLinkage->GetClassInstance( "g_hemiAmbientLight", 0, &g_pHemiAmbientLightClass );
g_dynamicLinkageArray[g_iAmbientLightingOffset] = g_pHemiAmbientLightClass; 
...
pd3dImmediateContext->PSSetShader( g_pPixelShader, g_dynamicLinkageArray, g_iNumPSInterfaces );
      

Requirements

Header

D3D11Shader.h

Library

D3DCompiler.lib

DLL

D3DCompiler_47.dll

See also

ID3D11ShaderReflectionVariable Interface

 

 

Community Additions

ADD
Show:
© 2014 Microsoft