[Mesa-dev] [PATCH 1/5] i965: Enable non-CCS_E fast-clears on gen9+
Jason Ekstrand
jason at jlekstrand.net
Fri Jun 16 05:01:28 UTC 2017
On Thu, Jun 15, 2017 at 12:31 AM, Michael Schellenberger Costa <
mschellenbergercosta at googlemail.com> wrote:
> 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>
>
All,
Please disregard this patch. It's woefully incomplete. There's a lot more
code that needs to be deleted before we can turn on CCS_D for sRGB on gen9.
> > ---
> > 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.
>
Sure, but this pattern of "if (...) return false;" is really nice for this
sort of funciton. Converting the last one in a chain to "return thing"
doesn't do anything for clarity.
> 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);
> > }
> >
> > /**
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170615/cbb1e0d8/attachment-0001.html>
More information about the mesa-dev
mailing list