PSSetShaderResource()'s first parameter:
void PSSetShaderResources(
[in] UINT StartSlot,
[in] UINT NumViews,
[in] ID3D11ShaderResourceView *const *ppShaderResourceViews
);
StartSlot: "Index into the device's zero-based array to begin setting shader resources"
So what's the tie up between integer indices and your .hlsl variables? In d3d9, everything was by string-based name. Now these integer indices seem to have something missing......
Say you have one shader file:
// shader_1.psh
Texture2D tex ;
And another..
// shader_2.psh
TextureCube cubeTex ;
If you're only using shader_1.psh, how do you distinguish between them when they are in separate files?
// something like this..
d3d11devicecontext->PSSetShaderResources( 0, 1, &texture2d ) ;
// index 0 sets 0th texture..
// what index is the tex cube?