[Mesa-dev] [PATCH 03/22] glformats: Add a mapping for MESA_FORMAT_S_UINT8

Chris Wilson chris at chris-wilson.co.uk
Sat Aug 5 09:39:55 UTC 2017


Map the user format of GL_DEPTH_COMPONENT, GL_UNSIGNED_BYTE to the
internal format of MESA_FORMAT_S_UINT8.
---
 src/mesa/main/glformats.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/mesa/main/glformats.c b/src/mesa/main/glformats.c
index 06be3ec48d..8ae833ca65 100644
--- a/src/mesa/main/glformats.c
+++ b/src/mesa/main/glformats.c
@@ -3472,6 +3472,10 @@ _mesa_format_from_format_and_type(GLenum format, GLenum type)
     * matching the OpenGL format and data type
     */
    switch (type) {
+   case GL_UNSIGNED_BYTE:
+      if (format == GL_STENCIL_INDEX)
+         return MESA_FORMAT_S_UINT8;
+      break;
    case GL_UNSIGNED_SHORT_5_6_5:
      if (format == GL_RGB)
          return MESA_FORMAT_B5G6R5_UNORM;
-- 
2.13.3



More information about the mesa-dev mailing list