title: Is it possible to get the interface name (Dynamic Shader Linkage)?
body: <p>I am currently working on implementing dynamic shader linkage into my shader reflection code. It works quite nicely, but to make my code as dynamic as possible i would like to automate the process of getting the offset into the dynamicLinkageArray. Microsoft suggests something like this in their sample:</p>
  
  <pre><code>g_iNumPSInterfaces = pReflector-&gt;GetNumInterfaceSlots(); 
  g_dynamicLinkageArray = (ID3D11ClassInstance**) malloc( sizeof(ID3D11ClassInstance*) * g_iNumPSInterfaces );
  if ( !g_dynamicLinkageArray )
      return E_FAIL;
  
  ID3D11ShaderReflectionVariable* pAmbientLightingVar = pReflector-&gt;GetVariableByName("g_abstractAmbientLighting");
  g_iAmbientLightingOffset = pAmbientLightingVar-&gt;GetInterfaceSlot(0);
  </code></pre>
  
  <p>I would like to this without giving the exact name, so when the shader changes i do not have to manually change this code. To accomplish this i would need to get the name i marked below through shader reflection. Is this possible? I searched through the References of the Shader-Reflection but did not find anything useful, besides the number of interface slots (<code>GetNumInterfaceSlots()</code>).</p>
  
  <pre><code>#include "BasicShader_PSBuffers.hlsli"
  
  iBaseLight     g_abstractAmbientLighting;
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^
  
  struct PixelInput
  {
      float4 position : SV_POSITION;
      float3 normals : NORMAL;
      float2 tex: TEXCOORD0;
  };
  
  float4 main(PixelInput input) : SV_TARGET
  {
      float3 Ambient = (float3)0.0f;
      Ambient = g_txDiffuse.Sample(g_samplerLin, input.tex) * g_abstractAmbientLighting.IlluminateAmbient(input.normals);
  
      return float4(saturate(Ambient), 1.0f);
  }
  </code></pre>
  
  <p>If this is not possible, how would one go about this? Just add anything i can think of there so that i have to change as little as possible manually?</p>
  
  <p>Thanks in advance</p>