[Mesa-dev] [PATCH 04/12] mesa/main: Add MESA_FORMAT_X8_Z24 to _mesa_choose_tex_format

chad at chad-versace.us chad at chad-versace.us
Fri Apr 29 18:04:54 PDT 2011


From: Chad Versace <chad.versace at intel.com>

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.

Signed-off-by: Chad Versace <chad.versace at intel.com>
---
 src/mesa/main/texformat.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c
index 456687b..8cbb021 100644
--- a/src/mesa/main/texformat.c
+++ b/src/mesa/main/texformat.c
@@ -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 */
-- 
1.7.4.2



More information about the mesa-dev mailing list