Mesa (master): mesa: Add format/type matching for DEPTH/UINT_24_8.

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Oct 17 21:40:00 UTC 2019


Module: Mesa
Branch: master
Commit: 4f4fc7535787e4a1006051611f573dc6d5eae741
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4f4fc7535787e4a1006051611f573dc6d5eae741

Author: Eric Anholt <eric at anholt.net>
Date:   Wed Sep 18 14:27:51 2019 -0700

mesa: Add format/type matching for DEPTH/UINT_24_8.

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 at whitecape.org>

---

 src/mesa/main/glformats.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
index 3ab06456e8b..f2af50cd855 100644
--- a/src/mesa/main/glformats.c
+++ b/src/mesa/main/glformats.c
@@ -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;
+      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)




More information about the mesa-commit mailing list