[Mesa-dev] [PATCH 4/4] st/dri: don't create 24-bit depth, non-stencil visuals

Brian Paul brianp at vmware.com
Thu Mar 14 06:55:42 PDT 2013


Omit Z24+0S visuals when we've created Z24+S8 visuals.  The
former offers no memory savings.

This reduces the number of advertised visuals and FBconfigs
but there still seem to be a fair number of duplicated modes.
---
 src/gallium/state_trackers/dri/common/dri_screen.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/gallium/state_trackers/dri/common/dri_screen.c b/src/gallium/state_trackers/dri/common/dri_screen.c
index 2f525a2..cac2829 100644
--- a/src/gallium/state_trackers/dri/common/dri_screen.c
+++ b/src/gallium/state_trackers/dri/common/dri_screen.c
@@ -140,16 +140,16 @@ dri_fill_in_modes(struct dri_screen *screen)
       depth_bits_array[depth_buffer_factor] = 16;
       stencil_bits_array[depth_buffer_factor++] = 0;
    }
-   if (pf_x8z24 || pf_z24x8) {
-      depth_bits_array[depth_buffer_factor] = 24;
-      stencil_bits_array[depth_buffer_factor++] = 0;
-      screen->d_depth_bits_last = pf_x8z24;
-   }
    if (pf_s8z24 || pf_z24s8) {
       depth_bits_array[depth_buffer_factor] = 24;
       stencil_bits_array[depth_buffer_factor++] = 8;
       screen->sd_depth_bits_last = pf_s8z24;
    }
+   else if (pf_x8z24 || pf_z24x8) {
+      depth_bits_array[depth_buffer_factor] = 24;
+      stencil_bits_array[depth_buffer_factor++] = 0;
+      screen->d_depth_bits_last = pf_x8z24;
+   }
    if (pf_z32) {
       depth_bits_array[depth_buffer_factor] = 32;
       stencil_bits_array[depth_buffer_factor++] = 0;
-- 
1.7.3.4



More information about the mesa-dev mailing list