I'm working in HLSL, and I'm getting this error from one of my shaders:
error X4505: maximum temp register index exceeded
The line that's causing this is:
int count = Passes[input.Tex.y].y;
Passes is defined as:
cbuffer Style
{
float3 Passes[256];
...
}
and input.Tex is a float2 declared as a TEXCOORD.
Can anybody explain this error to me please? It isn't documented on MSDN (or anywhere else as far as I can tell) and it isn't clear to me what is wrong here.
I'm using shader model 4.0 level 9_3.
Right now it reads the float as an integer index into the array.
Say your float is 1.0f,
this means 3F80 0000 in hex or 1,065,353,216 in decimal.
It now tries to read the adress Passes + 1065353216 * sizeof(float3)
This quite obviously registry index exceeded considering a single constant holds 4096 max constant.