[Piglit] [PATCH 1/2] util: GL ES doesn't like glReadPixels(GL_RGB). Always use RGBA instead.

Ilia Mirkin imirkin at alum.mit.edu
Mon Apr 4 00:13:51 UTC 2016


Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
---
 tests/util/piglit-util-gl.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tests/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c
index d636810..dbdfb13 100644
--- a/tests/util/piglit-util-gl.c
+++ b/tests/util/piglit-util-gl.c
@@ -1223,11 +1223,11 @@ piglit_probe_rect_rgb(int x, int y, int w, int h, const float *expected)
 	GLfloat *probe;
 	GLfloat *pixels;
 
-	pixels = piglit_read_pixels_float(x, y, w, h, GL_RGB, NULL);
+	pixels = piglit_read_pixels_float(x, y, w, h, GL_RGBA, NULL);
 
 	for (j = 0; j < h; j++) {
 		for (i = 0; i < w; i++) {
-			probe = &pixels[(j*w+i)*3];
+			probe = &pixels[(j*w+i)*4];
 
 			for (p = 0; p < 3; ++p) {
 				if (fabs(probe[p] - expected[p]) >= piglit_tolerance[p]) {
-- 
2.7.3



More information about the Piglit mailing list