# unsupported language element used (or: I am sick of ATI)

## Recommended Posts

Hello, I get an "unsupported language element used" error when I try to run my GLSL shader (fragment) on an ATI X1600 Pro (do I need to mention that it runs fine on Nvidia 6600 and above). So I checked if I really wrote something strange in the code but I didn't. So I began to depserately try things out and found the following: What this shader is doing is calculating 6 different complex light sources on the scene. Therefore I use uniform arrays with 6 entrys for the data I need and and also an array of 6 elemts to indicate which light are on and off, the (problematic) code is basicly:
vec3 accLightColor = vec3(0.0);
for(int i; i < 6; i++)
{
if(lightActive[i])
{
calculate the light (kinda complex thing with a lot of if's and stuff
lightColor = result of the lighting calculation for the actual light source
}
accLightColor += lightColor;
}

So in my desperation I put down the numer of loop runs. And when I used 2 instead of 6 for the break condition, it worked O.o Also erasing by some of the lighting calculation i.e. performing a more simple calculation I can rise the number of loops again a little! So it seems to me either, that I reached the limit of instructions. But my shader code has just 200 lines and i simply can't belive it will compile to more than 64.000 instruction which a SM 3.0 card should be capable of. Or can it be, that to many if/else blocks cause this kinda problem O.o And this would still not explain why I only get an "unsupported language element used" error. Because all I changed to make it work was exchanging one "6" by a "2" Does anyone have an idea what is wrong on this ATI X1600 Pro? Do I have to expect the same problems on other (better) ATIs? greetz repunzel

##### Share on other sites
I think your card supports 1024 native instructions in fragment
report.html

I suggest that you count the # of instructions. Try Cg 1.5 or since you have a nVidia, have it dump the assembler shaders to disk with NVemulate

##### Share on other sites
O.o It seems true and would explain everything.

But I thought Shader Model 3.0 requieres at least 64k instructions? So what does this number actually mean? I mean 1024 is almost nothing ... I saw that a 6600 GT has 8192 ... also not close to 64k ...

##### Share on other sites
Probably ATI's 1024 is the real minimum to SM 3.0
and keep in mind that the SM 2.0 minimum is 64

Anyway, that error message was given when I used unrollable for loops on Radeon 9700, so it made sense. In your case, it should say "exceeded number of ALU instructions" or "exceeded number of TEX instructions", so their driver is a little screwy.