[Piglit] [PATCH 1/2] util: make it easier to use probe functions on ES

Tapani Pälli tapani.palli at intel.com
Wed Feb 13 12:46:52 UTC 2019


Reviewed-by: Tapani Pälli <tapani.palli at intel.com>

On 2/13/19 5:40 AM, Ilia Mirkin wrote:
> With float color buffers, one can use glReadPixels with GL_FLOAT. Allow
> that usage scenario.
> 
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> ---
>   tests/util/piglit-util-gl.c | 5 +++--
>   1 file changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/tests/util/piglit-util-gl.c b/tests/util/piglit-util-gl.c
> index 3f2dcb9c0..64c6fdae6 100644
> --- a/tests/util/piglit-util-gl.c
> +++ b/tests/util/piglit-util-gl.c
> @@ -1046,7 +1046,7 @@ read_pixels_float(GLint x, GLint y, GLsizei width, GLsizei height,
>   	if (!pixels)
>   		pixels = malloc(width * height * comps * sizeof(GLfloat));
>   
> -	if (!piglit_is_gles()) {
> +	if (!piglit_is_gles() || piglit_is_extension_supported("GL_EXT_color_buffer_float")) {
>   		glReadPixels(x, y, width, height, format, GL_FLOAT, pixels);
>   		return pixels;
>   	}
> @@ -1068,7 +1068,8 @@ can_probe_ubyte()
>   {
>   	int r,g,b,a,read;
>   
> -	if (!piglit_is_extension_supported("GL_ARB_framebuffer_object"))
> +	if (!piglit_is_extension_supported("GL_ARB_framebuffer_object") &&
> +	    !(piglit_is_gles() && piglit_get_gl_version() >= 20))
>   		return false;
>   
>   	glGetIntegerv(GL_READ_BUFFER, &read);
> 


More information about the Piglit mailing list