main: Add STENCIL_INDEX formats to base_tex_format
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 30 Jan 2015 22:24:13 +0000 (14:24 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Fri, 30 Jan 2015 23:49:45 +0000 (15:49 -0800)
This fixes a bug on BDW when our meta-based stencil blit path assert-fails
due to an invalid internal format even though we do support the
ARB_stencil_texturing extension.

Reviewed-by: Matt Turner <mattst88@gmail.com>
src/mesa/main/teximage.c

index e067078b17d2be0fa7101d11bc7a94baafdb8daa..29c325bf222dc58b4fa133e5648c4618df312004 100644 (file)
@@ -221,6 +221,16 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat )
       }
    }
 
+   if (ctx->Extensions.ARB_stencil_texturing) {
+      switch (internalFormat) {
+      case GL_STENCIL_INDEX:
+      case GL_STENCIL_INDEX8:
+         return GL_STENCIL_INDEX;
+      default:
+         ; /* fallthrough */
+      }
+   }
+
    switch (internalFormat) {
    case GL_COMPRESSED_ALPHA:
       return GL_ALPHA;