title: Reflecting texture register from a HLSL shader by name
body: <p>I know how to reflect constant buffers, but how do I reflect textures? Here's my shader:</p>
  
  <pre><code>cbuffer buffer : register(b0)
  {
      column_major matrix viewProjectionMatrix;
      column_major matrix modelMatrix;
      float4 texScaleOffset;
      float4 tint;
  }
  
  struct VS_INPUT
  {
      float4 Pos : POSITION;
      float2 Tex : TEXCOORD0;
  };
  
  struct PS_INPUT
  {
      float4 Pos : SV_POSITION;
      float2 Tex : TEXCOORD0;
  };
  
  PS_INPUT VS( VS_INPUT input )
  {
      PS_INPUT output = (PS_INPUT)0;
      output.Pos = mul( viewProjectionMatrix, mul( modelMatrix, input.Pos ) );
      output.Tex = input.Tex * texScaleOffset.xy + texScaleOffset.zw;
  
      return output;
  }
  
  Texture2D textureMap : register(t0);
  SamplerState SampleType : register(s0);
  
  float4 PS( PS_INPUT input ) : SV_Target
  {
      return textureMap.Sample( SampleType, input.Tex );
  }
  </code></pre>
  
  <p>So how do I query textureMap's register number from C++ if I know its name ("textureMap")? My use case is an engine that allows users to write their own shaders so I can't hardcode any values.</p>