intel: Change supported texture formats for separate stencil
authorChad Versace <chad@chad-versace.us>
Mon, 23 May 2011 20:47:27 +0000 (13:47 -0700)
committerChad Versace <chad@chad-versace.us>
Wed, 25 May 2011 14:41:31 +0000 (07:41 -0700)
When hardware supports separate stencil, enable support for separate
depth/stencil texture formats in the table
intel_context.ctx.TextureFormatsSupported. If the hardware must use
separate stencil, then disable support for combined depth/stencil formats.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad@chad-versace.us>
src/mesa/drivers/dri/intel/intel_context.c
src/mesa/drivers/dri/intel/intel_tex_format.c

index 91cf5dbf44bef504b79b487c663997ae2c8f185a..2ea52c26106974abd26f032a4d49a09bac93a3fe 100644 (file)
@@ -758,7 +758,12 @@ intelInitContext(struct intel_context *intel,
    ctx->TextureFormatSupported[MESA_FORMAT_AL88] = GL_TRUE;
    if (intel->gen >= 4)
       ctx->TextureFormatSupported[MESA_FORMAT_AL1616] = GL_TRUE;
-   ctx->TextureFormatSupported[MESA_FORMAT_S8_Z24] = GL_TRUE;
+
+   /* Depth and stencil */
+   ctx->TextureFormatSupported[MESA_FORMAT_S8_Z24] = !intel->must_use_separate_stencil;
+   ctx->TextureFormatSupported[MESA_FORMAT_X8_Z24] = intel->has_separate_stencil;
+   ctx->TextureFormatSupported[MESA_FORMAT_S8] = intel->has_separate_stencil;
+
    /*
     * This was disabled in initial FBO enabling to avoid combinations
     * of depth+stencil that wouldn't work together.  We since decided
index befa615d1e66c2154195e8a725fce37c17956acf..6890a690ab1e8b7d726f2f716538426583dcd47e 100644 (file)
@@ -22,6 +22,7 @@ intel_mesa_format_to_rb_datatype(gl_format format)
    case MESA_FORMAT_RGB565:
    case MESA_FORMAT_ARGB1555:
    case MESA_FORMAT_ARGB4444:
+   case MESA_FORMAT_S8:
       return GL_UNSIGNED_BYTE;
    case MESA_FORMAT_R16:
    case MESA_FORMAT_RG1616: