mesa: Add format/type matching for DEPTH/UINT_24_8.
authorEric Anholt <eric@anholt.net>
Wed, 18 Sep 2019 21:27:51 +0000 (14:27 -0700)
committerEric Anholt <eric@anholt.net>
Thu, 17 Oct 2019 21:07:29 +0000 (21:07 +0000)
We had missed this case where GLES3 allows glReadPixels(DEPTH, UINT_24_8),
and just got lucky by the readpixels path never asking for the matching
format from this function.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/main/glformats.c

index 3ab06456e8bb32b083a210803c3f1f7667ebe521..f2af50cd855e4f6eb45df312e5eb11391d76b3f3 100644 (file)
@@ -3738,6 +3738,8 @@ _mesa_format_from_format_and_type(GLenum format, GLenum type)
    case GL_UNSIGNED_INT_24_8:
       if (format == GL_DEPTH_STENCIL)
          return MESA_FORMAT_S8_UINT_Z24_UNORM;
    case GL_UNSIGNED_INT_24_8:
       if (format == GL_DEPTH_STENCIL)
          return MESA_FORMAT_S8_UINT_Z24_UNORM;
+      else if (format == GL_DEPTH_COMPONENT)
+         return MESA_FORMAT_X8_UINT_Z24_UNORM;
       break;
    case GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
       if (format == GL_DEPTH_STENCIL)
       break;
    case GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
       if (format == GL_DEPTH_STENCIL)