mesa: Make _mesa_choose_tex_format() handle stencil textures.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 21 Mar 2016 21:01:24 +0000 (14:01 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Sat, 2 Apr 2016 02:04:28 +0000 (19:04 -0700)
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@whitecape.org>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/mesa/main/texformat.c

index 419fd78e8939739d33b9ffa6100c7e1ed078ae1a..be2581b004f82033689397606f631ccfcac95101 100644 (file)
@@ -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:
        *