mesa: Add MESA_FORMAT_X8_Z24 to _mesa_choose_tex_format
authorChad Versace <chad@chad-versace.us>
Mon, 23 May 2011 20:47:17 +0000 (13:47 -0700)
committerChad Versace <chad@chad-versace.us>
Wed, 25 May 2011 14:41:31 +0000 (07:41 -0700)
Prefer MESA_FORMAT_X8_Z24 over MESA_FORMAT_S8_Z24 for textures with
internal format GL_DEPTH_COMPONENT*.

i965 needs MESA_FORMAT_X8_Z24 for HiZ and separate stencil.

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/main/texformat.c

index 456687b0c5c073d78348830d62a152e7e39a0982..8cbb021d8b02b74d53a49d74fad257161d3f7d93 100644 (file)
@@ -217,10 +217,12 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,
          case GL_DEPTH_COMPONENT24:
          case GL_DEPTH_COMPONENT32:
            RETURN_IF_SUPPORTED(MESA_FORMAT_Z32);
+           RETURN_IF_SUPPORTED(MESA_FORMAT_X8_Z24);
            RETURN_IF_SUPPORTED(MESA_FORMAT_S8_Z24);
            break;
          case GL_DEPTH_COMPONENT16:
            RETURN_IF_SUPPORTED(MESA_FORMAT_Z16);
+           RETURN_IF_SUPPORTED(MESA_FORMAT_X8_Z24);
            RETURN_IF_SUPPORTED(MESA_FORMAT_S8_Z24);
          default:
             ; /* fallthrough */