[Piglit] [PATCH 04/18] shader_runner: Draw instanced rectangles using triangle strips instead of quads.

Fabian Bieler fabianbieler at fastmail.fm
Mon Jun 3 05:42:22 PDT 2013


This is usefull for core profile OpenGL contexts and geometry shaders.
---
 tests/shaders/shader_runner.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/tests/shaders/shader_runner.c b/tests/shaders/shader_runner.c
index e022b90..874e76b 100644
--- a/tests/shaders/shader_runner.c
+++ b/tests/shaders/shader_runner.c
@@ -1454,11 +1454,11 @@ draw_instanced_rect(int primcount, float x, float y, float w, float h)
 	verts[1][1] = y;
 	verts[1][2] = 0.0;
 	verts[1][3] = 1.0;
-	verts[2][0] = x + w;
+	verts[2][0] = x;
 	verts[2][1] = y + h;
 	verts[2][2] = 0.0;
 	verts[2][3] = 1.0;
-	verts[3][0] = x;
+	verts[3][0] = x + w;
 	verts[3][1] = y + h;
 	verts[3][2] = 0.0;
 	verts[3][3] = 1.0;
@@ -1466,7 +1466,7 @@ draw_instanced_rect(int primcount, float x, float y, float w, float h)
 	glVertexPointer(4, GL_FLOAT, 0, verts);
 	glEnableClientState(GL_VERTEX_ARRAY);
 
-	glDrawArraysInstanced(GL_QUADS, 0, 4, primcount);
+	glDrawArraysInstanced(GL_TRIANGLE_STRIP, 0, 4, primcount);
 
 	glDisableClientState(GL_VERTEX_ARRAY);
 }
-- 
1.8.1.2



More information about the Piglit mailing list