I am trying to move my shader code from OSX 10.2 to 10.3 and I am getting new shader compiler errors. The error might be platform specific but then again I might have been doing something boneheaded which the old compiler did not catch.
The exact error I am getting is:
“invalid swizzle for scalar op (hint: ‘specular’)”
The code being referred in the error to is:
TEMP specular, lightVec1, normal, …;
high power specular
MOV specular, lightVec1;
DP3 specular, normal, specular;
POW specular, specular, 1000; # ERROR HERE
the same error also applies to:
POW specular, specular, 1000.0;
There is some problem with the POW instruction and it seems to be related to the operands. I tried replacing the inline constant with a constant variable but got the same error. What’s wierd is that the compiler is complaining about a scalar op but there is no scalar type declaration, only floating point temporary variables TEMP (to my knowledge).
Commenting out the line with the POW instruction eliminates the error. I get similar errors for the RSQ and RCP instructions.
Any help would be greatly appreciated.