While the extension does technically require GL3, it's only
really required for the new error language added to
VertexAttribIPointer.

V2: Bind attrib locations before linking as required.

Signed-off-by: Chris Forbes <[email protected]>
---
 .../arb_vertex_type_10f_11f_11f_rev/api-errors.c   |  8 +++++---
 .../draw-vertices.c                                | 23 ++++++++++++----------
 2 files changed, 18 insertions(+), 13 deletions(-)

diff --git a/tests/spec/arb_vertex_type_10f_11f_11f_rev/api-errors.c 
b/tests/spec/arb_vertex_type_10f_11f_11f_rev/api-errors.c
index 4dd1d79..843f8d5 100644
--- a/tests/spec/arb_vertex_type_10f_11f_11f_rev/api-errors.c
+++ b/tests/spec/arb_vertex_type_10f_11f_11f_rev/api-errors.c
@@ -30,7 +30,7 @@
 #include "piglit-util-gl-common.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
-       config.supports_gl_compat_version = 30;
+       config.supports_gl_compat_version = 20;
        config.window_visual = PIGLIT_GL_VISUAL_RGB | PIGLIT_GL_VISUAL_DOUBLE;
 PIGLIT_GL_TEST_CONFIG_END
 
@@ -147,8 +147,10 @@ test_vertex_attribs()
         * VertexAttribLPointer, ... if <type> is UNSIGNED_INT_10F_11F_11F_REV.
         */
 
-       glVertexAttribIPointer(0, 3, GL_UNSIGNED_INT_10F_11F_11F_REV, 0, 
(GLvoid *)0);
-       TEST("VertexAttribIPointer-not-allowed", GL_INVALID_ENUM);
+       if (piglit_get_gl_version() >= 30) {
+               glVertexAttribIPointer(0, 3, GL_UNSIGNED_INT_10F_11F_11F_REV, 
0, (GLvoid *)0);
+               TEST("VertexAttribIPointer-not-allowed", GL_INVALID_ENUM);
+       }
 
        if (piglit_is_extension_supported("GL_ARB_vertex_attrib_64bit")) {
                glVertexAttribLPointer(0, 3, GL_UNSIGNED_INT_10F_11F_11F_REV, 
0, (GLvoid *)0);
diff --git a/tests/spec/arb_vertex_type_10f_11f_11f_rev/draw-vertices.c 
b/tests/spec/arb_vertex_type_10f_11f_11f_rev/draw-vertices.c
index 9eb894d..f94b0c3 100644
--- a/tests/spec/arb_vertex_type_10f_11f_11f_rev/draw-vertices.c
+++ b/tests/spec/arb_vertex_type_10f_11f_11f_rev/draw-vertices.c
@@ -32,7 +32,7 @@
 #include "r11g11b10f.h"
 
 PIGLIT_GL_TEST_CONFIG_BEGIN
-       config.supports_gl_compat_version = 30;
+       config.supports_gl_compat_version = 20;
        config.window_visual = PIGLIT_GL_VISUAL_RGBA | PIGLIT_GL_VISUAL_DOUBLE;
        config.window_width = 128;
        config.window_height = 128;
@@ -93,7 +93,6 @@ piglit_init(int argc, char **argv)
        for (n = 0; n < 16; n++)
                colors[n] = float3_to_r11g11b10f(unpacked_colors[n/4]);
 
-       piglit_require_extension("GL_ARB_explicit_attrib_location");
        piglit_require_extension("GL_ARB_vertex_type_10f_11f_11f_rev");
 
        glGenBuffers(1, &bo_pos);
@@ -110,20 +109,24 @@ piglit_init(int argc, char **argv)
        glVertexAttribPointer(1, 3, GL_UNSIGNED_INT_10F_11F_11F_REV, GL_FALSE, 
0, (GLvoid const *)0);
        glEnableVertexAttribArray(1);
 
-       prog = piglit_build_simple_program(
-               "#version 130\n"
-               "#extension GL_ARB_explicit_attrib_location: require\n"
-               "layout(location=0) in vec2 p;\n"
-               "layout(location=1) in vec3 c;\n"
-               "out vec3 color;\n"
+       prog = piglit_build_simple_program_unlinked(
+               "attribute vec2 p;\n"
+               "attribute vec3 c;\n"
+               "varying vec3 color;\n"
                "void main() { gl_Position = vec4(p, 0, 1); color = c; }\n",
 
-               "#version 130\n"
-               "in vec3 color;\n"
+               "varying vec3 color;\n"
                "void main() { gl_FragColor = vec4(color,1); }\n"
                );
        if (!prog)
                piglit_report_result(PIGLIT_FAIL);
+
+       glBindAttribLocation(prog, 0, "p");
+       glBindAttribLocation(prog, 1, "c");
+       glLinkProgram(prog);
+       if (!piglit_link_check_status(prog))
+               piglit_report_result(PIGLIT_FAIL);
+
        glUseProgram(prog);
 }
 
-- 
1.9.1

_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to