[Mesa-dev] [PATCH 2/2] intel/isl: Only create a CCS buffer if the surface format supports it
Jason Ekstrand
jason at jlekstrand.net
Wed Apr 19 02:58:37 UTC 2017
On Tue, Apr 18, 2017 at 4:31 PM, Nanley Chery <nanleychery at gmail.com> wrote:
> Signed-off-by: Nanley Chery <nanley.g.chery at intel.com>
> ---
> src/intel/isl/isl.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
> index f89f351c15..09dafcbab6 100644
> --- a/src/intel/isl/isl.c
> +++ b/src/intel/isl/isl.c
> @@ -1573,8 +1573,11 @@ isl_surf_get_ccs_surf(const struct isl_device *dev,
> if (ISL_DEV_GEN(dev) <= 8 && surf->dim != ISL_SURF_DIM_2D)
> return false;
>
> - if (isl_format_is_compressed(surf->format))
> + if (!isl_format_supports_ccs_d(dev->info, surf->format)) {
> + /* CCS_E supported formats are a subset of CCS_D supported formats.
> */
> + assert(!isl_format_supports_ccs_e(dev->info, surf->format));
>
The code we have today fails to create a CCS under *almost* the same
conditions. The one case this covers but the original code does not is if
you have a non-renderable format which happens to be 32, 64, or 128 bpb.
One such format is R9G9B9E5. With these exotic formats, your new code will
return false while the old code will go ahead and create a CCS. However,
even with one of these exotic formats, you could create a view that does
have a renderable format and that view could have CCS_D enabled so long as
it's resolve before the non-renderable format is used for texturing. I'm
not sure if that's a case we care about or not, but it is valid.
> return false;
> + }
>
> /* TODO: More conditions where it can fail. */
>
> --
> 2.12.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170418/9912de77/attachment-0001.html>
More information about the mesa-dev
mailing list