st/mesa: prefer formats without stencil for DEPTH_COMPONENT
authorBrian Paul <brianp@vmware.com>
Tue, 24 May 2011 14:59:09 +0000 (08:59 -0600)
committerBrian Paul <brianp@vmware.com>
Tue, 24 May 2011 15:00:17 +0000 (09:00 -0600)
for fast Z clears to be used more often.

Original patch by Marek Olšák.  Rebased to table-driven st_choose_format()
by Brian Paul.

src/mesa/state_tracker/st_format.c

index 6ebe721bfd6d70ad730c2296a7ebcf04e7fd6332..de30b4fc6101d158c326eb8c28c5fd01aaeba94e 100644 (file)
@@ -741,8 +741,9 @@ static struct format_mapping format_map[] = {
    },
    {
       { GL_DEPTH_COMPONENT24, 0 },
-      { PIPE_FORMAT_Z24_UNORM_S8_USCALED,
-        PIPE_FORMAT_S8_USCALED_Z24_UNORM, PIPE_FORMAT_Z32_UNORM, 0 }
+      { PIPE_FORMAT_Z24X8_UNORM, PIPE_FORMAT_X8Z24_UNORM,
+        PIPE_FORMAT_Z24_UNORM_S8_USCALED, PIPE_FORMAT_S8_USCALED_Z24_UNORM,
+        PIPE_FORMAT_Z32_UNORM, 0 }
    },
    {
       { GL_DEPTH_COMPONENT32, 0 },
@@ -750,8 +751,9 @@ static struct format_mapping format_map[] = {
    },
    {
       { GL_DEPTH_COMPONENT, 0 },
-      { PIPE_FORMAT_Z32_UNORM, PIPE_FORMAT_Z24_UNORM_S8_USCALED,
-        PIPE_FORMAT_S8_USCALED_Z24_UNORM, PIPE_FORMAT_Z16_UNORM, 0 }
+      { PIPE_FORMAT_Z24X8_UNORM, PIPE_FORMAT_X8Z24_UNORM,
+        PIPE_FORMAT_Z32_UNORM, PIPE_FORMAT_Z16_UNORM,
+        PIPE_FORMAT_Z24_UNORM_S8_USCALED, PIPE_FORMAT_S8_USCALED_Z24_UNORM, 0 }
    },
 
    /* stencil formats */