[Piglit] [PATCH 6/9] arb_texture_multisample: Use piglit_draw_rect_from_arrays instead of open-coding it

Ian Romanick idr at freedesktop.org
Thu Nov 19 20:00:12 PST 2015


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

This requires changing from drawing a triangle to drawing a diamond
(quadrilateral) shape.

Signed-off-by: Ian Romanick <ian.d.romanick at intel.com>
Suggested-by: Neil Roberts <neil at linux.intel.com>
---
 tests/spec/arb_texture_multisample/texelfetch.c | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/tests/spec/arb_texture_multisample/texelfetch.c b/tests/spec/arb_texture_multisample/texelfetch.c
index b24ec95..981e3c6 100644
--- a/tests/spec/arb_texture_multisample/texelfetch.c
+++ b/tests/spec/arb_texture_multisample/texelfetch.c
@@ -104,10 +104,11 @@ static int num_samples = 0;
 enum piglit_result
 piglit_display(void)
 {
-	static const GLfloat tri_verts[3][2] = {
-		{ -0.8, -1 },
-		{ 0.8, -0.9 },
-		{ 0.1, 1}
+	static const GLfloat quad_verts[4][4] = {
+		{  0.8,  0.1, 0, 1 },
+		{  0.1,  1.0, 0, 1 },
+		{ -0.1, -1.0, 0, 1 },
+		{ -0.8, -0.1, 0, 1 },
 	};
 	unsigned i, j, num_diffs;
 	GLfloat *images[MAX_SAMPLES], *average;
@@ -126,11 +127,7 @@ piglit_display(void)
 	piglit_check_gl_error(GL_NO_ERROR);
 
 	glUseProgram(draw_prog);
-	glVertexAttribPointer(PIGLIT_ATTRIB_POS, 2, GL_FLOAT,
-			      GL_FALSE, 0, tri_verts);
-	glEnableVertexAttribArray(PIGLIT_ATTRIB_POS);
-	glDrawArrays(GL_TRIANGLES, 0, 3);
-	glDisableVertexAttribArray(PIGLIT_ATTRIB_POS);
+	piglit_draw_rect_from_arrays(quad_verts, NULL, false);
 
 	piglit_check_gl_error(GL_NO_ERROR);
 
-- 
2.1.0



More information about the Piglit mailing list