[Mesa-dev] glsl2: assignment write masks vs. swizzles

Aras Pranckevicius aras at unity3d.com
Thu Aug 5 12:23:06 PDT 2010


> So when you say those types are vec2s above, I saw, before and after, a
> masked operation on the two vec4s involved when it came to actual code
> generated.

Ok. So I assume current behavior is correct.

The trouble I have now is unrelated to Mesa itself; I'm trying to use
GLSL2 for a GLSL optimizer
(http://github.com/aras-p/glsl-optimizer/commits/glsl2). So when the
original GLSL was:
    gl_Position.zw = gl_Vertex.xy*2.0;
and the current HIR has vec4 types and xxxy masks, my current GLSL
naive printing code produces something like:
    gl_Position.zw = vec2((gl_Vertex.xy * 2.000000).xxxy);
which is obviously wrong. I'll try to adapt my printing code for the
change somehow.


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


More information about the mesa-dev mailing list