I'm really a novice with shaders, but...
What PS/VS compiler versions are you using? I know that older versions such as 1.1, etc do not support certain operators and commands.
I saw on
here that any version under 3.0 will not allow non-constant variables in a for loop. It's GLSL not HLSL, but I would assume this issue would be the same for both?
I'm lazy and didn't attempt to compile anything, but:
if( i = 2 ) break;
//shouldn't this be
if( i == 2 ) break;
Hope you figure it out! Best of luck!
Everybody is a genius. But if you judge a fish by its ability to climb a tree, it will live its whole life believing that it is stupid.