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

Marek Olšák maraeo at gmail.com
Thu Mar 14 07:18:40 PDT 2013


Z24X8 actually does save memory, because Radeon HD 5000 and later
cards don't support combined depth stencil formats, therefore Z24S8 is
allocated internally as two separate buffers Z24X8 and S8.

Marek

On Thu, Mar 14, 2013 at 2:55 PM, Brian Paul <brianp at vmware.com> wrote:
> 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
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list