[Mesa-dev] [PATCH 1/5] i965: Enable non-CCS_E fast-clears on gen9+
Michael Schellenberger Costa
mschellenbergercosta at googlemail.com
Thu Jun 15 07:31:54 UTC 2017
Hi Jason
On 15.06.2017 03:54, Jason Ekstrand wrote:
> Sky Lake and above can fast-clear exactly the same set of formats as
> older hardware. The only restriction is that you can't *texture* from
> it unless the format supports CCS_E but you can fast-clear and render to
> it just fine. All of the code exists and now that we have sane resolves,
> we can trivially turn it on.
>
> Reviewed-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
> ---
> src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 18 ++++--------------
> 1 file changed, 4 insertions(+), 14 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> index 02e74ca..c19d2d5 100644
> --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c
> @@ -207,13 +207,7 @@ intel_miptree_supports_non_msrt_fast_clear(struct brw_context *brw,
> if (!brw->format_supported_as_render_target[mt->format])
> return false;
Can you just do
return brw->format_supported_as_render_target[mt->format];
now the second clause is gone.
Michael
>
> - if (brw->gen >= 9) {
> - mesa_format linear_format = _mesa_get_srgb_format_linear(mt->format);
> - const enum isl_format isl_format =
> - brw_isl_format_for_mesa_format(linear_format);
> - return isl_format_supports_ccs_e(&brw->screen->devinfo, isl_format);
> - } else
> - return true;
> + return true;
> }
>
> /* On Gen9 support for color buffer compression was extended to single
> @@ -257,16 +251,12 @@ intel_miptree_supports_lossless_compressed(struct brw_context *brw,
> if (_mesa_get_format_datatype(mt->format) == GL_FLOAT)
> return false;
>
> - /* Fast clear mechanism and lossless compression go hand in hand. */
> + /* Fast clear support is a pre-requisite for lossless compression */
> if (!intel_miptree_supports_non_msrt_fast_clear(brw, mt))
> return false;
>
> - /* 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(mt->format) == mt->format;
> + enum isl_format isl_format = brw_isl_format_for_mesa_format(mt->format);
> + return isl_format_supports_ccs_e(&brw->screen->devinfo, isl_format);
> }
>
> /**
More information about the mesa-dev
mailing list