[Piglit] [PATCH 07/16] shader_runner: Conditionally use piglit_draw_rect_shader

Ian Romanick idr at freedesktop.org
Mon Aug 26 11:37:06 PDT 2013


From: Ian Romanick <ian.d.romanick at intel.com>

If the shader uses the attribute piglit_vertex with the command "draw
rect", assume that it wants to use generic vertex attributes.  With the
preceeding changes to piglit_draw_rect_from_arrays, "draw rect" should
now function a desktop OpenGL core profile.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Cc: Matt Turner <mattst88 at gmail.com>
Cc: Paul Berry <stereoytpe441 at gmail.com>
---
 tests/shaders/shader_runner.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index 6676601..7a87943 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -1669,7 +1669,11 @@ piglit_display(void)
 		} else if (string_match("draw rect", line)) {
 			program_must_be_in_use();
 			get_floats(line + 9, c, 4);
-			piglit_draw_rect(c[0], c[1], c[2], c[3]);
+
+			if (glGetAttribLocation(prog, "piglit_vertex") >= 0)
+				piglit_draw_rect_shader(c[0], c[1], c[2], c[3]);
+			else
+				piglit_draw_rect(c[0], c[1], c[2], c[3]);
 		} else if (string_match("draw instanced rect", line)) {
 			int primcount;
 
-- 
1.8.1.4



More information about the Piglit mailing list