[Mesa-dev] [PATCH 22/23] i965: Add helper for checking for lossless compressible
Pohjolainen, Topi
topi.pohjolainen at intel.com
Tue Feb 9 13:08:16 UTC 2016
On Mon, Feb 08, 2016 at 06:51:42PM +0200, Topi Pohjolainen wrote:
> Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
> ---
> src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 21 +++++++++++++++++++++
> src/mesa/drivers/dri/i965/intel_mipmap_tree.h | 3 +++
> 2 files changed, 24 insertions(+)
>
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> index 1fd2654..59961f2 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> @@ -270,6 +270,27 @@ intel_miptree_supports_non_msrt_fast_clear(struct brw_context *brw,
> return true;
> }
>
> +bool
> +intel_miptree_supports_lossless_compressed(mesa_format format)
> +{
> + /* For now compression is only enabled for integer formats even though
> + * there exist supported floating point formats also. This is a heuristic
> + * decision based on current public benchmarks. In none of the cases these
> + * formats provided any improvement but a few cases were seen to regress.
> + * Hence these are left to to be enabled in the future when they are known
> + * to improve things.
> + */
> + if (!_mesa_is_format_integer_color(format))
This is wrong afterall, it doesn't take GL_UNSIGNED_NORMALIZED into
account which is definitely needed. The performance numbers are valid though,
I got them having an explicit check against MESA_FORMAT_RGBA_FLOAT16 here
allowing MESA_FORMAT_R8G8B8A8_UNORM through that makes the difference in
the benches.
> + return false;
> +
> + /* In principle, fast clear mechanism and lossless compression go hand in
> + * hand. However, fast clear can be also used to clear srgb surfaces by
> + * using equivalent linear format. This trick, however, can't be extended
> + * to be used with lossless compression and therefore a check is needed to
> + * see if the format really is linear.
> + */
> + return _mesa_get_srgb_format_linear(format) == format;
> +}
>
> /**
> * Determine depth format corresponding to a depth+stencil format,
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
> index f05436d..3a1ecd2 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.h
> @@ -684,6 +684,9 @@ intel_miptree_supports_non_msrt_fast_clear(struct brw_context *brw,
> const struct intel_mipmap_tree *mt);
>
> bool
> +intel_miptree_supports_lossless_compressed(mesa_format format);
> +
> +bool
> intel_miptree_alloc_non_msrt_mcs(struct brw_context *brw,
> struct intel_mipmap_tree *mt);
>
> --
> 2.5.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
More information about the mesa-dev
mailing list