mesa: add GL_HALF_FLOAT as supported type to readpixels
authorLin Johnson <johnson.lin@intel.com>
Mon, 26 Mar 2018 14:13:32 +0000 (22:13 +0800)
committerTapani Pälli <tapani.palli@intel.com>
Tue, 27 Mar 2018 06:04:52 +0000 (09:04 +0300)
EXT_color_buffer_float spec states:

  "An INVALID_OPERATION error is generated ... if the color buffer is
   a floating-point format and type is not FLOAT, HALF FLOAT, or
   UNSIGNED_INT_10F_11F_11F_REV."

This means that GL_HALF_FLOAT type should be supported when color
buffer has floating-point format.

Fixes Android CTS test android.view.cts.PixelCopyTest.

v2: remove comments of EXT_color_buffer_half_float as
    EXT_color_buffer_float can use type GL_HALF_FLOAT

Signed-off-by: Lin Johnson <johnson.lin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
src/mesa/main/readpix.c

index 6ce340ddf9bbc8442aa515f669c60c96a7182868..4407f13289e2e21486d8a4fd15fb8b688aeeb092 100644 (file)
@@ -920,6 +920,8 @@ read_pixels_es3_error_check(GLenum format, GLenum type,
    case GL_RGBA:
       if (type == GL_FLOAT && data_type == GL_FLOAT)
          return GL_NO_ERROR; /* EXT_color_buffer_float */
+      if (type == GL_HALF_FLOAT && data_type == GL_FLOAT)
+         return GL_NO_ERROR;
       if (type == GL_UNSIGNED_BYTE && data_type == GL_UNSIGNED_NORMALIZED)
          return GL_NO_ERROR;
       if (internalFormat == GL_RGB10_A2 &&