[Mesa-dev] [PATCH 6/7] i965: Add support for MESA_FORMAT_Z32_FLOAT and expose it under 3.0 override.

Chad Versace chad.versace at linux.intel.com
Mon Nov 28 15:00:48 PST 2011


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 11/23/2011 12:37 PM, Eric Anholt wrote:
> The MESA_FORMAT_Z32_FLOAT_X24S8 support will come later, and involves
> a bunch of trickery with hiz.  Also, Z32_FLOAT will fail for swrast
> paths until they change to MapRenderbuffer.
> ---
>  src/mesa/drivers/dri/i965/brw_wm_surface_state.c |    5 +++++
>  src/mesa/drivers/dri/intel/intel_extensions.c    |    2 ++
>  2 files changed, 7 insertions(+), 0 deletions(-)
> 
> diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
> index d51fdac..8cfd6db 100644
> --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
> +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
> @@ -541,6 +541,7 @@ brw_init_surface_formats(struct brw_context *brw)
>     brw->format_supported_as_render_target[MESA_FORMAT_X8_Z24] = true;
>     brw->format_supported_as_render_target[MESA_FORMAT_S8] = true;
>     brw->format_supported_as_render_target[MESA_FORMAT_Z16] = true;
> +   brw->format_supported_as_render_target[MESA_FORMAT_Z32_FLOAT] = true;
>  
>     /* We remap depth formats to a supported texturing format in
>      * translate_tex_format().
> @@ -548,6 +549,7 @@ brw_init_surface_formats(struct brw_context *brw)
>     ctx->TextureFormatSupported[MESA_FORMAT_S8_Z24] = true;
>     ctx->TextureFormatSupported[MESA_FORMAT_X8_Z24] = true;
>     ctx->TextureFormatSupported[MESA_FORMAT_Z16] = true;
> +   ctx->TextureFormatSupported[MESA_FORMAT_Z32_FLOAT] = true;
>  }
>  
>  bool
> @@ -575,6 +577,9 @@ translate_tex_format(gl_format mesa_format,
>     case MESA_FORMAT_X8_Z24:
>        return BRW_SURFACEFORMAT_I24X8_UNORM;
>  
> +   case MESA_FORMAT_Z32_FLOAT:
> +      return BRW_SURFACEFORMAT_I32_FLOAT;
> +
>     case MESA_FORMAT_SARGB8:
>     case MESA_FORMAT_SLA8:
>     case MESA_FORMAT_SL8:
> diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c
> index 681f5f2..2e2a31f 100644
> --- a/src/mesa/drivers/dri/intel/intel_extensions.c
> +++ b/src/mesa/drivers/dri/intel/intel_extensions.c
> @@ -109,6 +109,8 @@ intelInitExtensions(struct gl_context *ctx)
>  
>     if (intel->gen >= 4) {
>        ctx->Extensions.ARB_color_buffer_float = true;
> +      if (override_version >= 30)
> +	 ctx->Extensions.ARB_depth_buffer_float = true;
>        ctx->Extensions.ARB_depth_clamp = true;
>        ctx->Extensions.ARB_fragment_coord_conventions = true;
>        ctx->Extensions.ARB_fragment_program_shadow = true;

I think you need to update intel_mesa_format_to_rb_datatype() too. intel_fbo.c relies on that function.

- ----
Chad Versace
chad.versace at linux.intel.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iQIcBAEBAgAGBQJO1BKfAAoJEAIvNt057x8iBr0QAIREa8PnO4jR9jLPrF45dS9l
FCvomRP2UYnxRRkkzwToEP8Pqh5/TxiH0U4JK1XHc8mf+A+SAcrAVynZ9RKwdRp4
r/+KsnZaeVdOAPdiFE9e9CvTTpqcqQL/KAhFGJtG+6FLYAKXQBKgw3Cesghi4Ezp
+OUXJhC+uZOjDxcVTcu97DBiC1IBlm2hNdtrJSqrc3HP5zEGHvWKd4ljtRdiHyss
JacJrCyMohA9R4nGrA+KbRVbZNBHMEK0fxZTOuvzXthEBTVEwpBqaQKVInlFu8zR
a3Se0zhnE7RwtasNrOuReTv8HWRfI3BlRxKXdWhdUgHCjHqtZJaIJeuPRhJ7xRqx
uzXyl+L8LnXNhV/7MIlfsHfCRLpfD1VxXADnUU8bx1AYJKPdS9C/2Pbv+TmfQ81H
fDlz3vTI+j3J9KF4TpV5a+hQScsnwYREoUQagwpcfqlp6qyNZOb8Q8BHX8wSIDmN
N4x+XuVWiV4sGCRzSB/s9Ci5arCV9vt08RlIHWYnsBB0M/pWjfDVn4u+xNhU7U23
yHJywmuD1Hexc9sNt6VypWsXDM+vYrW/hdvcj/lcL52gOpYzhtO01hDEOnFWVTq/
I90n0SP9DRlpfPESTu2tW5QJI8qTGMhpxFhWiYgxodeWHqbXoQXjhGWBEPRohXxn
jS0Gl9zyu2z0Ae6pyTBq
=t9ln
-----END PGP SIGNATURE-----


More information about the mesa-dev mailing list