[Piglit] [PATCH] copyteximage: Fix the test to eliminate GL_TEXTURE_1D failures on NVIDIA

Anuj Phogat anuj.phogat at gmail.com
Wed Aug 22 10:20:52 PDT 2012


Draw and probe a QUAD (in place of a LINE) in case of GL_TEXTURE_1D. This
fixes the test failures on NVIDIA's proprietary linux drivers. In case of
LINE, glReadPixels() misses the relevant pixels by one pixel on NVIDIA.

V2: Draw taller quad to avoid the risk of hitting specific pixels in
glReadPixels.

Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
---
 tests/texturing/copyteximage.c |   16 +++++-----------
 1 files changed, 5 insertions(+), 11 deletions(-)

diff --git a/tests/texturing/copyteximage.c b/tests/texturing/copyteximage.c
index c8a8492..4b7f877 100644
--- a/tests/texturing/copyteximage.c
+++ b/tests/texturing/copyteximage.c
@@ -442,8 +442,6 @@ piglit_display(void)
 		for (i = 0; i < ARRAY_SIZE(test_vectors); i++) {
 			GLint x = IMAGE_SIZE * (i + 1);
 			GLint y = 0;
-			GLfloat vertices_1d[2][2] = { {x, y},
-						      {x + IMAGE_SIZE, y} };
 
 			format = test_vectors[i].format;
 			expected = (const float*)test_vectors[i].expected;
@@ -485,15 +483,11 @@ piglit_display(void)
 				       && pass;
 
 				glEnable(target[j].target);
-				glEnableClientState(GL_VERTEX_ARRAY);
-				glTexCoordPointer(1, GL_FLOAT, 0, texCoords_1d);
-				glVertexPointer(2, GL_FLOAT, 0, vertices_1d);
-
-				glDrawArrays(GL_LINES, 0, 2);
-				pass = piglit_probe_pixel_rgba(x, 0, expected)
-				       && pass;
-				pass = piglit_probe_pixel_rgba(x + IMAGE_SIZE - 1,
-							       0, expected)
+				glTexCoordPointer(2, GL_FLOAT, 0, texCoords_2d);
+				piglit_draw_rect(x, y, IMAGE_SIZE, IMAGE_SIZE);
+				pass = piglit_probe_rect_rgba(x, y, IMAGE_SIZE,
+							      IMAGE_SIZE,
+							      expected)
 				       && pass;
 				break;
 
-- 
1.7.7.6



More information about the Piglit mailing list