title: DirectX 11: Number of BOUND Shader Resource Views
body: <p>I have a management system for my shader resources which auto generates the HLSL header code for all of my shaders which looks something like:</p>
  
  <pre><code>   Texture2DArray &lt;float4&gt; MyTextureArray1 : register(t0)
     Texture2DArray &lt;float4&gt; MyTextureArray2 : register(t1)
     Texture2DArray &lt;float4&gt; MyTextureArray3 : register(t2)
     Texture2DArray &lt;float4&gt; MyTextureArray4 : register(t3)
  </code></pre>
  
  <p>The management system also automatically creates and binds all of the shader resource views at creation time. Obviously, my shaders use maybe 1 or 2 of these textures but I leave them all bound all the time. Can anyone speculate as to whether it is better for me to only bind the SRVs that I currently need and clear the others every time I bind a shader, or is it better to just bind all of the SRVs at creation time and never touch them again? I haven't found much documentation stating the overhead of leaving resources bound even though I'm not currently using them.</p>
  
  <p>As a side note, in some of my projects I have 30 or 40 SRVs due to various formats, texture dimensions, and usages.</p>
  
  <p>Which is better?</p>
  
  <p>1) Bind all 128 and never change the bindings</p>
  
  <p>2) Bind and unbind SRVs as needed when changing shaders</p>