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

Anuj Phogat anuj.phogat at gmail.com
Tue Aug 21 16:32:14 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.

Signed-off-by: Anuj Phogat <anuj.phogat at gmail.com>
---
Brian, both these patches (including the one I sent earlier today) resolve
separate issues. So, I'm keeping this fix in a separate patch. Let me know
if you have any comments on the patches.

 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..43bc78b 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, 1);
+				pass = piglit_probe_rect_rgba(x, y, IMAGE_SIZE,
+							      1,
+							      expected)
 				       && pass;
 				break;
 
-- 
1.7.7.6



More information about the Piglit mailing list