Mesa (master): mesa: Make _mesa_choose_tex_format() handle stencil textures.

Kenneth Graunke kwg at kemper.freedesktop.org
Sat Apr 2 02:05:24 UTC 2016


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

Author: Kenneth Graunke <kenneth at whitecape.org>
Date:   Mon Mar 21 14:01:24 2016 -0700

mesa: Make _mesa_choose_tex_format() handle stencil textures.

This is necessary for ARB_texture_stencil8 support on classic drivers.
Presumably Gallium works because it implements its own ChooseTexFormat.

Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>

---

 src/mesa/main/texformat.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c
index 419fd78..be2581b 100644
--- a/src/mesa/main/texformat.c
+++ b/src/mesa/main/texformat.c
@@ -765,6 +765,11 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target,
       RETURN_IF_SUPPORTED(MESA_FORMAT_B8G8R8A8_UNORM);
       break;
 
+   case GL_STENCIL_INDEX:
+   case GL_STENCIL_INDEX8:
+      RETURN_IF_SUPPORTED(MESA_FORMAT_S_UINT8);
+      break;
+
    default:
       /* For non-generic compressed format we assert two things:
        *




More information about the mesa-commit mailing list