[Mesa-dev] [PATCH 67/70] Add translation for the packed DEPTH_STENCIL from GL to MESA format

Chris Wilson chris at chris-wilson.co.uk
Fri Aug 7 13:14:11 PDT 2015


The GL format/datatype for GL_DEPTH_STENCIL_EXT (GL_UNSIGNED_INT_24_8_EXT)
was lacking a translation to the internal MESA format (Z24_UNORM_S8_UINT),
and similarly for the packed floating point DEPTH_STENCIL.

Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
---
 src/mesa/main/glformats.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
index 71f43ec..7e36fd1 100644
--- a/src/mesa/main/glformats.c
+++ b/src/mesa/main/glformats.c
@@ -2797,6 +2797,10 @@ _mesa_format_from_format_and_type(GLenum format, GLenum type)
       else if (format == GL_BGRA_INTEGER)
          return MESA_FORMAT_B10G10R10A2_UINT;
       break;
+   case GL_UNSIGNED_INT_24_8_EXT:
+      if (format == GL_DEPTH_STENCIL_EXT)
+         return MESA_FORMAT_Z24_UNORM_S8_UINT;
+      break;
    case GL_UNSIGNED_INT_8_8_8_8:
       if (format == GL_RGBA)
          return MESA_FORMAT_A8B8G8R8_UNORM;
@@ -2824,6 +2828,10 @@ _mesa_format_from_format_and_type(GLenum format, GLenum type)
    case GL_UNSIGNED_INT_10F_11F_11F_REV:
       if (format == GL_RGB)
          return MESA_FORMAT_R11G11B10_FLOAT;
+   case GL_FLOAT_32_UNSIGNED_INT_24_8_REV:
+      if (format == GL_DEPTH_STENCIL_EXT)
+         return MESA_FORMAT_Z32_FLOAT_S8X24_UINT;
+      break;
    default:
       break;
    }
-- 
2.5.0



More information about the mesa-dev mailing list