[Mesa-dev] glsl: do_vec_index_to_cond_assign not called; has problems if called

Aras Pranckevicius aras at unity3d.com
Wed Aug 17 07:45:40 PDT 2011

Looks like do_vec_index_to_cond_assing was lost in this commit:

Not sure if that was intentional or not. However if I try to manually
call it like it used to be called before (just after
do_vec_index_to_swizzle), it has problems with some shaders. Same
problem I reported a while ago here:
- but now it aborts in IR validation stage instead of crashing.

Fragment shader it has problems on:

vec2 nonInlinedFunction (vec2 a) {
 if (a.x < 0.0)
   return -a;
 return a*2.0;
void main() {
 vec2 c = vec2(0.0);
 for (int j = 0; j < 2; ++j) {
   c += nonInlinedFunction (vec2(vec2(0.0)[j])); // <- weird, but legit
 gl_FragColor = vec4(c,0.0,0.0);

Aras Pranckevičius
work: http://unity3d.com
home: http://aras-p.info

More information about the mesa-dev mailing list