[Mesa-dev] [PATCH] Revert "mesa: add GL_HALF_FLOAT as supported type to readpixels"

Eric Anholt eric at anholt.net
Tue Apr 3 17:07:04 UTC 2018


>From GLES 3.0.2:

     Only two combinations of format and type are accepted in most
     cases. The first varies depending on the format of the currently
     bound rendering surface. For normalized fixed-point rendering
     surfaces, the combination format RGBA and type UNSIGNED_BYTE is
     accepted. For signed integer rendering surfaces, the combina- tion
     format RGBA_INTEGER and type INT is accepted. For unsigned integer
     rendering surfaces, the combination format RGBA_INTEGER and type
     UNSIGNED_INT is accepted.

     [...]

     ReadPixels generates an INVALID_OPERATION error if the combination
     of format and type is unsupported.

and the spec cited in the change added:

     For floating-point rendering surfaces, the combination
     format RGBA and type FLOAT is accepted.

Since we don't expose HALF_FLOAT in COLOR_READ_FORMAT, we can't allow
HALF_FLOAT readpixels or the CTS
KHR-GLES3.packed_pixels.pbo_rectangle.r11f_g11f_b10f and many others would
fail.
---
 src/mesa/main/readpix.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/src/mesa/main/readpix.c b/src/mesa/main/readpix.c
index 4407f13289e2..6ce340ddf9bb 100644
--- a/src/mesa/main/readpix.c
+++ b/src/mesa/main/readpix.c
@@ -920,8 +920,6 @@ 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 &&
-- 
2.16.3



More information about the mesa-dev mailing list