Original Post
I write a glsl for gauss blur.My code below: uniform sampler2D postSrc; uniform vec4 gaussParam[16]; varying vec4 gl_TexCoord[1]; void main(void) { vec4 sample = vec4(0.0,0.0,0.0,0.0); sample += texture2D( postSrc, (gl_TexCoord[0].xy + gaussParam[0].xy)) * gaussParam[8].x; sample += texture2D( postSrc, (gl_TexCoord[0].xy + gaussParam[0].wz)) * gaussParam[8].y; sample += texture2D( postSrc, (gl_TexCoord[0].xy + gaussParam[1].xy)) * gaussParam[9].x; sample += texture2D( postSrc, (gl_TexCoord[0].xy + gaussParam[1].wz)) * gaussParam[9].y; sample += texture2D( postSrc, (gl_TexCoord[0].xy + gaussParam[2].xy)) * gaussParam[10].x; sample += texture2D( postSrc, (gl_TexCoord[0].xy + gaussParam[2].wz)) * gaussParam[10].y; sample += texture2D( postSrc, (gl_TexCoord[0].xy + gaussParam[3].xy)) * gaussParam[11].x; sample += texture2D( postSrc, (gl_TexCoord[0].xy + gaussParam[3].wz)) * gaussParam[11].y; sample += texture2D( postSrc, (gl_TexCoord[0].xy + gaussParam[4].xy)) * gaussParam[12].x; sample += texture2D( postSrc, (gl_TexCoord[0].xy + gaussParam[4].wz)) * gaussParam[12].y; sample += texture2D( postSrc, (gl_TexCoord[0].xy + gaussParam[5].xy)) * gaussParam[13].x; sample += texture2D( postSrc, (gl_TexCoord[0].xy + gaussParam[5].wz)) * gaussParam[13].y; sample += texture2D( postSrc, (gl_TexCoord[0].xy + gaussParam[6].xy)) * gaussParam[14].x; sample += texture2D( postSrc, (gl_TexCoord[0].xy + gaussParam[6].wz)) * gaussParam[14].y; sample += texture2D( postSrc, (gl_TexCoord[0].xy + gaussParam[7].xy)) * gaussParam[15].x; /* int i; for(i=0; i<7; i++) { sample += texture2D( postSrc, gl_TexCoord[0].xy + gaussParam.xy) * gaussParam[i+8].x; sample += texture2D( postSrc, gl_TexCoord[0].xy + gaussParam.wz) * gaussParam[i+8].y; } sample += texture2D( postSrc, (gl_TexCoord[0].xy + gaussParam[7].xy)) * gaussParam[15].x; */ gl_FragColor = sample; } The comment part is the same meaning of the code on top of it.But the "for loop" can only run well on nvidia card but will crash down on ATI card. The problem is the gaussParam[i+8].x and gaussParam[i+8].y will cause crash. If I remove it from the code, the shader will run on ATI card. I find that on ATI card the loop iter can not be given any comput, such as I use a float point as the bone index and use it to acce the bone array in uniform, the index is a float, I use the int(boneIdx) to convert it to a int and try to acce the array, but the result is only acce the [0] element. If I use a const such as bone[3], the result is ok, So is there any special place on ATI card for glsl? I change a lot of drivers but it seems no different. Can someone give me some help? Thank you a lot!