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

Kenneth Graunke kenneth at whitecape.org
Mon Apr 4 08:59:05 UTC 2016


On Sunday, April 3, 2016 8:13:51 PM PDT Ilia Mirkin wrote:
> 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]) {
> 

These two are:
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part.
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20160404/3a11ab15/attachment.sig>


More information about the Piglit mailing list