If I have a load of constant buffers full of data cbuffer1, cbuffer2, cbuffer3 etc in my shader. Is there any way in hlsl that I can access a specific constant buffer dynamically at runtime? Something like this...
cbuffers[1].MyValue
Or is the only way to have a massive if statement like this...
if(index == 0){
return cbuffer0.MyValue;
} else if(index == 1){
return cbuffer1.MyValue;
} else if(index == 2){
return cbuffer2.MyValue;
}
Which seems like it wont perform well.