<div dir="ltr">On 6 January 2013 06:12, Marek Ol¹ák <span dir="ltr"><<a href="mailto:maraeo@gmail.com" target="_blank">maraeo@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

---<br>
 tests/spec/ext_framebuffer_multisample/common.cpp  |  126 ++++++++++++--------<br>
 .../draw-buffers-common.cpp                        |   52 +++++---<br>
 .../ext_framebuffer_multisample/interpolation.cpp  |   28 ++---<br>
 .../polygon-stipple.cpp                            |    6 +-<br>
 .../sample-coverage.cpp                            |    6 +-<br>
 5 files changed, 130 insertions(+), 88 deletions(-)<br>
<br>
diff --git a/tests/spec/ext_framebuffer_multisample/common.cpp b/tests/spec/ext_framebuffer_multisample/common.cpp<br>
index fe6b40b..9109b86 100644<br>
--- a/tests/spec/ext_framebuffer_multisample/common.cpp<br>
+++ b/tests/spec/ext_framebuffer_multisample/common.cpp<br>
@@ -195,12 +195,13 @@ Fbo::try_setup(const FboConfig &new_config)<br>
                                                  GL_COLOR_ATTACHMENT0,<br>
                                                  GL_RENDERBUFFER, color_rb);<br>
                } else {<br>
-                       glBindTexture(GL_TEXTURE_2D, color_tex);<br>
-                       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,<br>
+                       piglit_require_extension("GL_ARB_texture_rectangle");<br>
+                       glBindTexture(GL_TEXTURE_RECTANGLE, color_tex);<br>
+                       glTexParameteri(GL_TEXTURE_RECTANGLE, GL_TEXTURE_MIN_FILTER,<br>
                                        GL_NEAREST);<br>
-                       glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER,<br>
+                       glTexParameteri(GL_TEXTURE_RECTANGLE, GL_TEXTURE_MAG_FILTER,<br>
                                        GL_NEAREST);<br>
-                       glTexImage2D(GL_TEXTURE_2D,<br>
+                       glTexImage2D(GL_TEXTURE_RECTANGLE,<br>
                                     0 /* level */,<br>
                                     config.color_internalformat,<br>
                                     config.width,<br>
@@ -211,7 +212,7 @@ Fbo::try_setup(const FboConfig &new_config)<br>
                                     NULL /* data */);<br>
                        glFramebufferTexture2D(GL_DRAW_FRAMEBUFFER,<br>
                                               GL_COLOR_ATTACHMENT0,<br>
-                                              GL_TEXTURE_2D,<br>
+                                              GL_TEXTURE_RECTANGLE,<br>
                                               color_tex,<br>
                                               0 /* level */);<br>
                }<br>
@@ -274,10 +275,10 @@ void<br>
 DownsampleProg::compile(int supersample_factor)<br>
 {<br>
        static const char *vert =<br>
-               "#version 130\n"<br>
-               "in vec2 pos;\n"<br>
-               "in vec2 texCoord;\n"<br>
-               "out vec2 texCoordVarying;\n"<br>
+               "#version 120\n"<br>
+               "attribute vec2 pos;\n"<br>
+               "attribute vec2 texCoord;\n"<br>
+               "varying vec2 texCoordVarying;\n"<br>
                "void main()\n"<br>
                "{\n"<br>
                "  gl_Position = vec4(pos, 0.0, 1.0);\n"<br>
@@ -285,18 +286,18 @@ DownsampleProg::compile(int supersample_factor)<br>
                "}\n";<br>
<br>
        static const char *frag =<br>
-               "#version 130\n"<br>
-               "uniform sampler2D samp;\n"<br>
+               "#version 120\n"<br>
+               "uniform sampler2DRect samp;\n"<br>
                "uniform int supersample_factor;\n"<br>
-               "in vec2 texCoordVarying;\n"<br>
+               "varying vec2 texCoordVarying;\n"<br>
                "void main()\n"<br>
                "{\n"<br>
                "  vec4 sum = vec4(0.0);\n"<br>
-               "  ivec2 pixel = ivec2(texCoordVarying);\n"<br>
+               "  vec2 pixel = floor(texCoordVarying);\n"<br>
                "  for (int i = 0; i < supersample_factor; ++i) {\n"<br>
                "    for (int j = 0; j < supersample_factor; ++j) {\n"<br>
-               "      sum += texelFetch(\n"<br>
-               "          samp, pixel * supersample_factor + ivec2(i, j), 0);\n"<br>
+               "      sum += texture2DRect(\n"<br>
+               "          samp, pixel * float(supersample_factor) + vec2(i, j));\n"<br>
                "    }\n"<br>
                "  }\n"<br>
                "  gl_FragColor = sum / (supersample_factor * supersample_factor);\n"<br>
@@ -354,7 +355,7 @@ DownsampleProg::run(const Fbo *src_fbo, int dest_width, int dest_height,<br>
        float h = dest_height;<br>
<br>
        glActiveTexture(GL_TEXTURE0);<br>
-       glBindTexture(GL_TEXTURE_2D, src_fbo->color_tex);<br>
+       glBindTexture(GL_TEXTURE_RECTANGLE, src_fbo->color_tex);<br>
<br>
        glUseProgram(prog);<br>
        glBindVertexArray(vao);<br>
@@ -384,15 +385,15 @@ void<br>
 ManifestStencil::compile()<br>
 {<br>
        static const char *vert =<br>
-               "#version 130\n"<br>
-               "in vec2 pos;\n"<br>
+               "#version 120\n"<br>
+               "attribute vec2 pos;\n"<br>
                "void main()\n"<br>
                "{\n"<br>
                "  gl_Position = vec4(pos, 0.0, 1.0);\n"<br>
                "}\n";<br>
<br>
        static const char *frag =<br>
-               "#version 130\n"<br>
+               "#version 120\n"<br>
                "uniform vec4 color;\n"<br>
                "void main()\n"<br>
                "{\n"<br>
@@ -483,8 +484,8 @@ void<br>
 ManifestDepth::compile()<br>
 {<br>
        static const char *vert =<br>
-               "#version 130\n"<br>
-               "in vec2 pos;\n"<br>
+               "#version 120\n"<br>
+               "attribute vec2 pos;\n"<br>
                "uniform float depth;\n"<br>
                "void main()\n"<br>
                "{\n"<br>
@@ -492,7 +493,7 @@ ManifestDepth::compile()<br>
                "}\n";<br>
<br>
        static const char *frag =<br>
-               "#version 130\n"<br>
+               "#version 120\n"<br>
                "uniform vec4 color;\n"<br>
                "void main()\n"<br>
                "{\n"<br>
@@ -618,8 +619,8 @@ void Triangles::compile()<br>
        float final_scale = 0.95;<br>
<br>
        static const char *vert =<br>
-               "#version 130\n"<br>
-               "in vec2 pos_within_tri;\n"<br>
+               "#version 120\n"<br>
+               "attribute vec2 pos_within_tri;\n"<br>
                "uniform float tri_scale;\n"<br>
                "uniform float rotation_delta;\n"<br>
                "uniform int tris_across;\n"<br>
@@ -633,7 +634,7 @@ void Triangles::compile()<br>
                "  float rotation = rotation_delta * tri_num;\n"<br>
                "  pos = mat2(cos(rotation), sin(rotation),\n"<br>
                "             -sin(rotation), cos(rotation)) * pos;\n"<br>
-               "  int i = tri_num % tris_across;\n"<br>
+               "  int i = int(mod(float(tri_num), float(tris_across)));\n"<br>
                "  int j = tris_across - 1 - tri_num / tris_across;\n"<br>
                "  pos += (vec2(i, j) * 2.0 + 1.0) / tris_across - 1.0;\n"<br>
                "  pos *= final_scale;\n"<br>
@@ -641,7 +642,7 @@ void Triangles::compile()<br>
                "}\n";<br>
<br>
        static const char *frag =<br>
-               "#version 130\n"<br>
+               "#version 120\n"<br>
                "void main()\n"<br>
                "{\n"<br>
                "  gl_FragColor = vec4(1.0);\n"<br>
@@ -731,13 +732,13 @@ InterpolationTestPattern::compile()<br>
        float final_scale = 0.95;<br>
<br>
        static const char *vert =<br>
-               "#version 130\n"<br>
-               "in vec2 pos_within_tri;\n"<br>
-               "in vec3 in_barycentric_coords;\n"<br>
-               "out vec3 barycentric_coords;\n"<br>
-               "centroid out vec3 barycentric_coords_centroid;\n"<br>
-               "out vec2 pixel_pos;\n"<br>
-               "centroid out vec2 pixel_pos_centroid;\n"<br>
+               "#version 120\n"<br>
+               "attribute vec2 pos_within_tri;\n"<br>
+               "attribute vec3 in_barycentric_coords;\n"<br>
+               "varying vec3 barycentric_coords;\n"<br>
+               "centroid varying vec3 barycentric_coords_centroid;\n"<br>
+               "varying vec2 pixel_pos;\n"<br>
+               "centroid varying vec2 pixel_pos_centroid;\n"<br>
                "uniform float tri_scale;\n"<br>
                "uniform float rotation_delta;\n"<br>
                "uniform int tris_across;\n"<br>
@@ -752,7 +753,7 @@ InterpolationTestPattern::compile()<br>
                "  float rotation = rotation_delta * tri_num;\n"<br>
                "  pos = mat2(cos(rotation), sin(rotation),\n"<br>
                "             -sin(rotation), cos(rotation)) * pos;\n"<br>
-               "  int i = tri_num % tris_across;\n"<br>
+               "  int i = int(mod(float(tri_num), float(tris_across)));\n"<br>
                "  int j = tris_across - 1 - tri_num / tris_across;\n"<br>
                "  pos += (vec2(i, j) * 2.0 + 1.0) / tris_across - 1.0;\n"<br>
                "  pos *= final_scale;\n"<br>
@@ -852,8 +853,8 @@ void Lines::compile()<br>
        float final_scale = 0.95;<br>
<br>
        static const char *vert =<br>
-               "#version 130\n"<br>
-               "in vec2 pos_line;\n"<br>
+               "#version 120\n"<br>
+               "attribute vec2 pos_line;\n"<br>
                "uniform float line_scale;\n"<br>
                "uniform float rotation_delta;\n"<br>
                "uniform int lines_across;\n"<br>
@@ -867,7 +868,7 @@ void Lines::compile()<br>
                "  float rotation = rotation_delta * line_num;\n"<br>
                "  pos = mat2(cos(rotation), sin(rotation),\n"<br>
                "             -sin(rotation), cos(rotation)) * pos;\n"<br>
-               "  int i = line_num % lines_across;\n"<br>
+               "  int i = int(mod(float(line_num), float(lines_across)));\n"<br>
                "  int j = lines_across - 1 - line_num / lines_across;\n"<br>
                "  pos += (vec2(i, j) * 2.0 + 1.0) / lines_across - 1.0;\n"<br>
                "  pos *= final_scale;\n"<br>
@@ -875,7 +876,7 @@ void Lines::compile()<br>
                "}\n";<br>
<br>
        static const char *frag =<br>
-               "#version 130\n"<br>
+               "#version 120\n"<br>
                "void main()\n"<br>
                "{\n"<br>
                "  gl_FragColor = vec4(1.0);\n"<br>
@@ -951,8 +952,8 @@ void Points::compile()<br>
        float final_scale = 0.95;<br>
<br>
        static const char *vert =<br>
-               "#version 130\n"<br>
-               "in vec2 pos_point;\n"<br>
+               "#version 120\n"<br>
+               "attribute vec2 pos_point;\n"<br>
                "uniform float point_scale;\n"<br>
                "uniform int points_across;\n"<br>
                "uniform float final_scale;\n"<br>
@@ -963,7 +964,7 @@ void Points::compile()<br>
                "void main()\n"<br>
                "{\n"<br>
                "  vec2 pos = point_scale * pos_point;\n"<br>
-               "  int i = point_num % points_across;\n"<br>
+               "  int i = int(mod(float(point_num), float(points_across)));\n"<br>
                "  int j = points_across - 1 - point_num / points_across;\n"<br>
                "  pos += (vec2(i, j) * 2.0 + 1.0) / points_across - 1.0;\n"<br>
                "  pos *= final_scale;\n"<br>
@@ -971,7 +972,7 @@ void Points::compile()<br>
                "}\n";<br>
<br>
        static const char *frag =<br>
-               "#version 130\n"<br>
+               "#version 120\n"<br>
                "void main()\n"<br>
                "{\n"<br>
                "  gl_FragColor = vec4(1.0);\n"<br>
@@ -1076,15 +1077,20 @@ void Sunburst::compile()<br>
                { {  0.0,  1.0 }, { 0, 1, 0 } },<br>
                { {  0.3, -0.8 }, { 0, 0, 1 } }<br>
        };<br>
+        bool need_glsl130 = out_type == GL_INT || out_type == GL_UNSIGNED_INT;<br>
+<br>
+       if (need_glsl130) {<br>
+               piglit_require_gl_version(30);<br></blockquote><div><br></div><div>Minor nit-pick: how about<br><br>piglit_require_GLSL_version(130);<br><br>instead?  In practice it will be equivalent, and it's a little more straightforward to ask for GLSL 1.30 if that's what you need.<br>

</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+       }<br>
<br>
        /* Total number of triangles drawn */<br>
        num_tris = 7;<br>
<br>
-       static const char *vert =<br>
-               "#version 130\n"<br>
-               "in vec2 pos_within_tri;\n"<br>
-               "in vec3 in_barycentric_coords;\n"<br>
-               "out vec3 barycentric_coords;\n"<br>
+       static const char *vert_template =<br>
+               "#version %s\n"<br>
+               "attribute vec2 pos_within_tri;\n"<br>
+               "attribute vec3 in_barycentric_coords;\n"<br>
+               "varying vec3 barycentric_coords;\n"<br>
                "uniform float rotation;\n"<br>
                "uniform float vert_depth;\n"<br>
                "uniform mat4 proj;\n"<br>
@@ -1099,17 +1105,23 @@ void Sunburst::compile()<br>
                "}\n";<br>
<br>
        static const char *frag_template =<br>
-               "#version 130\n"<br>
+               "#version %s\n"<br>
                "#define OUT_TYPE %s\n"<br>
                "#define COMPUTE_DEPTH %s\n"<br>
                "uniform float frag_depth;\n"<br>
-               "in vec3 barycentric_coords;\n"<br>
+               "varying vec3 barycentric_coords;\n"<br>
                "uniform mat3x4 draw_colors;\n"<br>
-               "out OUT_TYPE frag_out;\n"<br>
+               "#if __VERSION__ == 130\n"<br>
+               "  out OUT_TYPE frag_out;\n"<br>
+               "#endif\n"<br>
                "\n"<br>
                "void main()\n"<br>
                "{\n"<br>
+               "#if __VERSION__ == 130\n"<br>
                "  frag_out = OUT_TYPE(draw_colors * barycentric_coords);\n"<br>
+               "#else\n"<br>
+               "  gl_FragColor = draw_colors * barycentric_coords;\n"<br>
+               "#endif\n"<br>
                "#if COMPUTE_DEPTH\n"<br>
                "  gl_FragDepth = (frag_depth + 1.0) / 2.0;\n"<br>
                "#endif\n"<br>
@@ -1117,20 +1129,30 @@ void Sunburst::compile()<br>
<br>
        /* Compile program */<br>
        prog = glCreateProgram();<br>
+       unsigned vert_alloc_len =<br>
+               strlen(vert_template) + 4;<br>
+       char *vert = (char *) malloc(vert_alloc_len);<br>
+       sprintf(vert, vert_template, need_glsl130 ? "130" : "120");<br>
        GLint vs = piglit_compile_shader_text(GL_VERTEX_SHADER, vert);<br>
+       free(vert);<br>
        glAttachShader(prog, vs);<br>
+<br>
        const char *out_type_glsl = get_out_type_glsl();<br>
        unsigned frag_alloc_len =<br>
                strlen(frag_template) + strlen(out_type_glsl) + 1;<br></blockquote><div><br></div><div>Can we change this from "+ 1" to "+ 4" to account for the new version parameter?  I'm not 100% sure it's necessary (there's some slop due to the fact that the template contains "%s"s that get stripped out by sprintf), but it would make the code more obviously correct.<br>

</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
        char *frag = (char *) malloc(frag_alloc_len);<br>
-       sprintf(frag, frag_template, out_type_glsl,<br>
+       sprintf(frag, frag_template, need_glsl130 ? "130" : "120",<br>
+               out_type_glsl,<br>
                compute_depth ? "1" : "0");<br>
        GLint fs = piglit_compile_shader_text(GL_FRAGMENT_SHADER, frag);<br>
        free(frag);<br>
        glAttachShader(prog, fs);<br>
+<br>
        glBindAttribLocation(prog, 0, "pos_within_tri");<br>
        glBindAttribLocation(prog, 1, "in_barycentric_coords");<br>
-       glBindFragDataLocation(prog, 0, "frag_out");<br>
+       if (need_glsl130) {<br>
+               glBindFragDataLocation(prog, 0, "frag_out");<br>
+       }<br>
        glLinkProgram(prog);<br>
        if (!piglit_link_check_status(prog)) {<br>
                piglit_report_result(PIGLIT_FAIL);<br>
diff --git a/tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp b/tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp<br>
index 3831720..e3a98b2 100644<br>
--- a/tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp<br>
+++ b/tests/spec/ext_framebuffer_multisample/draw-buffers-common.cpp<br>
@@ -107,9 +107,9 @@ static const GLenum draw_buffers[] = {<br>
 /* Offset the viewport transformation on depth value passed to the vertex<br>
  * shader by setting it to (2 * depth - 1.0).<br>
  */<br>
-static const char *vert =<br>
-       "#version 130\n"<br>
-       "in vec2 pos;\n"<br>
+static const char *vert_template =<br>
+       "#version %s\n"<br>
+       "attribute vec2 pos;\n"<br>
        "uniform float depth;\n"<br>
        "void main()\n"<br>
        "{\n"<br>
@@ -122,13 +122,19 @@ static const char *vert =<br>
  * are enabled or not.<br>
  */<br>
 static const char *frag_template =<br>
-       "#version 130\n"<br>
+       "#version %s\n"<br>
        "#define DUAL_SRC_BLEND %d\n"<br>
        "#define ALPHA_TO_COVERAGE %d\n"<br>
        "#define OUT_TYPE %s\n"<br>
+       "#if __VERSION__ == 130\n"<br>
        "out OUT_TYPE frag_out_0;\n"<br>
        "out vec4 frag_out_1;\n"<br>
        "out vec4 frag_out_2;\n"<br>
+       "#else\n"<br>
+       "#define frag_out_0 gl_FragData[0]\n"<br>
+       "#define frag_out_1 gl_FragData[1]\n"<br>
+       "#define frag_out_2 gl_FragData[2]\n"<br>
+       "#endif\n"<br>
        "uniform OUT_TYPE frag_0_color;\n"<br>
        "uniform vec4 color;\n"<br>
        "void main()\n"<br>
@@ -155,16 +161,28 @@ get_out_type_glsl(void)<br>
 void<br>
 shader_compile(bool sample_alpha_to_coverage, bool dual_src_blend)<br>
 {<br>
+       bool need_glsl130 = is_buffer_zero_integer_format || dual_src_blend;<br>
+<br>
+       if (need_glsl130) {<br>
+               piglit_require_gl_version(30);<br></blockquote><div><br></div><div>Same comment as above.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


+       }<br>
+<br>
        is_dual_src_blending = dual_src_blend;<br>
+<br>
        /* Compile program */<br>
+       unsigned vert_alloc_len = strlen(vert_template) + 4;<br>
+       char *vert = (char *) malloc(vert_alloc_len);<br>
+       sprintf(vert, vert_template, need_glsl130 ? "130" : "120");<br>
        GLint vs = piglit_compile_shader_text(GL_VERTEX_SHADER, vert);<br>
+       free(vert);<br>
<br>
        /* Generate appropriate fragment shader program */<br>
-       const char *out_type_glsl = get_out_type_glsl();;<br>
+       const char *out_type_glsl = get_out_type_glsl();<br>
         unsigned frag_alloc_len = strlen(frag_template) +<br>
                                  strlen(out_type_glsl) + 1;<br></blockquote><div><br></div><div>Same comment as above.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">


        char *frag = (char *) malloc(frag_alloc_len);<br>
-       sprintf(frag, frag_template, is_dual_src_blending,<br>
+       sprintf(frag, frag_template, need_glsl130 ? "130" : "120",<br>
+               is_dual_src_blending,<br>
                sample_alpha_to_coverage, out_type_glsl);<br>
<br>
        GLint fs = piglit_compile_shader_text(GL_FRAGMENT_SHADER, frag);<br>
@@ -175,18 +193,20 @@ shader_compile(bool sample_alpha_to_coverage, bool dual_src_blend)<br>
        }<br>
        free(frag);<br>
<br>
-       if (is_dual_src_blending) {<br>
-               glBindFragDataLocationIndexed(prog, 0, 0, "frag_out_0");<br>
-               glBindFragDataLocationIndexed(prog, 0, 1, "frag_out_1");<br>
+       if (need_glsl130) {<br>
+               if (is_dual_src_blending) {<br>
+                       glBindFragDataLocationIndexed(prog, 0, 0, "frag_out_0");<br>
+                       glBindFragDataLocationIndexed(prog, 0, 1, "frag_out_1");<br>
<br>
+               }<br>
+               else if (num_draw_buffers > 1) {<br>
+                       glBindFragDataLocation(prog, 0, "frag_out_0");<br>
+                       glBindFragDataLocation(prog, 1, "frag_out_1");<br>
+                       glBindFragDataLocation(prog, 2, "frag_out_2");<br>
+               }<br>
+               else<br>
+                       glBindFragDataLocation(prog, 0, "frag_out_0");<br>
        }<br>
-       else if (num_draw_buffers > 1) {<br>
-               glBindFragDataLocation(prog, 0, "frag_out_0");<br>
-               glBindFragDataLocation(prog, 1, "frag_out_1");<br>
-               glBindFragDataLocation(prog, 2, "frag_out_2");<br>
-       }<br>
-       else<br>
-               glBindFragDataLocation(prog, 0, "frag_out_0");<br>
<br>
        glBindAttribLocation(prog, 0, "pos");<br>
        glEnableVertexAttribArray(0);<br>
diff --git a/tests/spec/ext_framebuffer_multisample/interpolation.cpp b/tests/spec/ext_framebuffer_multisample/interpolation.cpp<br>
index 841e0e1..c54491b 100644<br>
--- a/tests/spec/ext_framebuffer_multisample/interpolation.cpp<br>
+++ b/tests/spec/ext_framebuffer_multisample/interpolation.cpp<br>
@@ -167,8 +167,8 @@ bool disable_msaa_during_test_image = false;<br>
  * each triangle.<br>
  */<br>
 const char *frag_non_centroid_barycentric =<br>
-       "#version 130\n"<br>
-       "in vec3 barycentric_coords;\n"<br>
+       "#version 120\n"<br>
+       "varying vec3 barycentric_coords;\n"<br>
        "\n"<br>
        "void main()\n"<br>
        "{\n"<br>
@@ -182,8 +182,8 @@ const char *frag_non_centroid_barycentric =<br>
  * triangle.<br>
  */<br>
 const char *frag_centroid_barycentric =<br>
-       "#version 130\n"<br>
-       "centroid in vec3 barycentric_coords_centroid;\n"<br>
+       "#version 120\n"<br>
+       "centroid varying vec3 barycentric_coords_centroid;\n"<br>
        "\n"<br>
        "void main()\n"<br>
        "{\n"<br>
@@ -197,8 +197,8 @@ const char *frag_centroid_barycentric =<br>
  * barycentric coordinates is outside the range [0, 1].<br>
  */<br>
 const char *frag_centroid_range_check =<br>
-       "#version 130\n"<br>
-       "centroid in vec3 barycentric_coords_centroid;\n"<br>
+       "#version 120\n"<br>
+       "centroid varying vec3 barycentric_coords_centroid;\n"<br>
        "\n"<br>
        "void main()\n"<br>
        "{\n"<br>
@@ -218,8 +218,8 @@ const char *frag_centroid_range_check =<br>
  * are non-centroid interpolated.<br>
  */<br>
 const char *frag_non_centroid_deriv =<br>
-       "#version 130\n"<br>
-       "in vec2 pixel_pos;\n"<br>
+       "#version 120\n"<br>
+       "varying vec2 pixel_pos;\n"<br>
        "\n"<br>
        "void main()\n"<br>
        "{\n"<br>
@@ -237,8 +237,8 @@ const char *frag_non_centroid_deriv =<br>
  * are non-centroid interpolated.<br>
  */<br>
 const char *frag_centroid_deriv =<br>
-       "#version 130\n"<br>
-       "centroid in vec2 pixel_pos_centroid;\n"<br>
+       "#version 120\n"<br>
+       "centroid varying vec2 pixel_pos_centroid;\n"<br>
        "\n"<br>
        "void main()\n"<br>
        "{\n"<br>
@@ -254,8 +254,8 @@ const char *frag_centroid_deriv =<br>
  * tolerance.<br>
  */<br>
 const char *frag_centroid_deriv_range_check =<br>
-       "#version 130\n"<br>
-       "centroid in vec2 pixel_pos_centroid;\n"<br>
+       "#version 120\n"<br>
+       "centroid varying vec2 pixel_pos_centroid;\n"<br>
        "\n"<br>
        "void main()\n"<br>
        "{\n"<br>
@@ -272,7 +272,7 @@ const char *frag_centroid_deriv_range_check =<br>
  * frag_centroid_range_check and frag_centroid_deriv_range_check).<br>
  */<br>
 const char *frag_blue =<br>
-       "#version 130\n"<br>
+       "#version 120\n"<br>
        "\n"<br>
        "void main()\n"<br>
        "{\n"<br>
@@ -286,7 +286,7 @@ const char *frag_blue =<br>
  * frag_centroid_deriv).<br>
  */<br>
 const char *frag_rg_0_5 =<br>
-       "#version 130\n"<br>
+       "#version 120\n"<br>
        "\n"<br>
        "void main()\n"<br>
        "{\n"<br>
diff --git a/tests/spec/ext_framebuffer_multisample/polygon-stipple.cpp b/tests/spec/ext_framebuffer_multisample/polygon-stipple.cpp<br>
index 578ac60..3394695 100644<br>
--- a/tests/spec/ext_framebuffer_multisample/polygon-stipple.cpp<br>
+++ b/tests/spec/ext_framebuffer_multisample/polygon-stipple.cpp<br>
@@ -97,8 +97,8 @@ static GLubyte stipple_pattern[] =<br>
 };<br>
<br>
 static const char *vert =<br>
-       "#version 130\n"<br>
-       "in vec2 pos;\n"<br>
+       "#version 120\n"<br>
+       "attribute vec2 pos;\n"<br>
        "uniform float depth;\n"<br>
        "void main()\n"<br>
        "{\n"<br>
@@ -107,7 +107,7 @@ static const char *vert =<br>
        "}\n";<br>
<br>
 static const char *frag =<br>
-       "#version 130\n"<br>
+       "#version 120\n"<br>
        "uniform vec4 color;\n"<br>
        "void main()\n"<br>
        "{\n"<br>
diff --git a/tests/spec/ext_framebuffer_multisample/sample-coverage.cpp b/tests/spec/ext_framebuffer_multisample/sample-coverage.cpp<br>
index 1838f8e..d0ce4a0 100644<br>
--- a/tests/spec/ext_framebuffer_multisample/sample-coverage.cpp<br>
+++ b/tests/spec/ext_framebuffer_multisample/sample-coverage.cpp<br>
@@ -91,8 +91,8 @@ static int depth_loc;<br>
 static const float bg_color[4] = { 0.4, 0.6, 0.0, 0.8 };<br>
<br>
 static const char *vert =<br>
-       "#version 130\n"<br>
-       "in vec2 pos;\n"<br>
+       "#version 120\n"<br>
+       "attribute vec2 pos;\n"<br>
        "uniform float depth;\n"<br>
        "void main()\n"<br>
        "{\n"<br>
@@ -101,7 +101,7 @@ static const char *vert =<br>
        "}\n";<br>
<br>
 static const char *frag =<br>
-       "#version 130\n"<br>
+       "#version 120\n"<br>
        "uniform vec4 color;\n"<br>
        "void main()\n"<br>
        "{\n"<br>
<span><font color="#888888">--<br>
1.7.10.4<br>
<br>
_______________________________________________<br>
Piglit mailing list<br>
<a href="mailto:Piglit@lists.freedesktop.org" target="_blank">Piglit@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/piglit" target="_blank">http://lists.freedesktop.org/mailman/listinfo/piglit</a><br>
</font></span></blockquote></div><br></div></div>