[Piglit] [PATCH 2/2] draw-vertices-2101010: add 'glsl' option.

Chris Forbes chrisf at ijw.co.nz
Mon Nov 19 19:45:24 PST 2012


At least i965 takes a fairly different path for FF and ARB VP
compared to GLSL vertex shaders. Add a 'glsl' option to allow
this test to exercise either path.

Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
---
 tests/all.tests                                       |  3 ++-
 .../draw-vertices-2101010.c                           | 19 +++++++++++++++++++
 2 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/tests/all.tests b/tests/all.tests
index 4a5c35e..ab8b459 100644
--- a/tests/all.tests
+++ b/tests/all.tests
@@ -2063,7 +2063,8 @@ arb_half_float_vertex['draw-vertices-half-float-user'] = PlainExecTest(['draw-ve
 
 arb_vertex_type_2_10_10_10_rev = Group()
 spec['ARB_vertex_type_2_10_10_10_rev'] = arb_vertex_type_2_10_10_10_rev
-add_plain_test(arb_vertex_type_2_10_10_10_rev, 'draw-vertices-2101010')
+add_concurrent_test(arb_vertex_type_2_10_10_10_rev, 'draw-vertices-2101010')
+add_concurrent_test(arb_vertex_type_2_10_10_10_rev, 'draw-vertices-2101010 glsl')
 arb_vertex_type_2_10_10_10_rev['attribs'] = concurrent_test('attribs GL_ARB_vertex_type_2_10_10_10_rev')
 
 arb_draw_buffers = Group()
diff --git a/tests/spec/arb_vertex_type_2_10_10_10_rev/draw-vertices-2101010.c b/tests/spec/arb_vertex_type_2_10_10_10_rev/draw-vertices-2101010.c
index 0b17415..305a329 100644
--- a/tests/spec/arb_vertex_type_2_10_10_10_rev/draw-vertices-2101010.c
+++ b/tests/spec/arb_vertex_type_2_10_10_10_rev/draw-vertices-2101010.c
@@ -57,6 +57,9 @@ static unsigned iconv(int x, int y, int z, int w)
 
 void piglit_init(int argc, char **argv)
 {
+    GLuint vs, prog;
+    bool use_glsl = false;
+
     piglit_ortho_projection(piglit_width, piglit_height, GL_FALSE);
 
     piglit_require_gl_version(15);
@@ -64,6 +67,22 @@ void piglit_init(int argc, char **argv)
     piglit_require_extension("GL_ARB_vertex_type_2_10_10_10_rev");
     glShadeModel(GL_FLAT);
     glClearColor(0.2, 0.2, 0.2, 1.0);
+
+    for(;argc;argc--,argv++)
+        if (!strcmp("glsl", *argv))
+            use_glsl = true;
+
+    if (use_glsl) {
+        piglit_require_GLSL();
+        vs = piglit_compile_shader_text(GL_VERTEX_SHADER,
+            "void main() {\n"
+            "    gl_Position = ftransform();\n"
+            "    gl_FrontColor = gl_Color;\n"
+            "}\n"
+            );
+        prog = piglit_link_simple_program(vs, 0);
+        glUseProgram(prog);
+    }
 }
 
 static GLuint vboVertexPointer(GLint size, GLenum type, GLsizei stride,
-- 
1.8.0



More information about the Piglit mailing list