Mesa (master): iris: Disable color fast-clears in iris_copy_region

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Nov 13 21:54:18 UTC 2020


Module: Mesa
Branch: master
Commit: 7779b1d71bf053f0c73a1b717e6d2ed91f948378
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=7779b1d71bf053f0c73a1b717e6d2ed91f948378

Author: Nanley Chery <nanley.g.chery at intel.com>
Date:   Fri Jun  5 14:14:46 2020 -0700

iris: Disable color fast-clears in iris_copy_region

During a blorp_copy between two color surfaces, the source and
destination formats are re-interpreted to UINT (if possible) to avoid
losing bits.

If either surface has CCS_E, then extra steps are taken to support
fast-cleared blocks with this format re-interpretation. Each clear value
is packed in the original format, then unpacked in the new UINT format.
This is then placed into the surface state object for some platforms.
There are couple problems here:

1. This is only being done for CCS_E, but MCS also supports fast-clears.

2. These steps aren't enough for fast-clears on gen11+. On gen11+, the
   clear color isn't part of the surface state object that BLORP
   creates. Instead it's stored in a separate BO, that the surface state
   object references. Since that BO doesn't get updated during
   blorp_copy, the incorrect/unconverted clear color is used for the copy
   operation.

I didn't measure any performance gain from this code, so this patch
simply disables the feature.

Makes iris pass the nv_copy_image-simple piglit test on gen11+.

Reviewed-by: Jason Ekstrand <jason at jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5388>

---

 src/gallium/drivers/iris/iris_blit.c | 11 -----------
 1 file changed, 11 deletions(-)

diff --git a/src/gallium/drivers/iris/iris_blit.c b/src/gallium/drivers/iris/iris_blit.c
index f60b480498f..06684fae827 100644
--- a/src/gallium/drivers/iris/iris_blit.c
+++ b/src/gallium/drivers/iris/iris_blit.c
@@ -599,9 +599,6 @@ get_copy_region_aux_settings(struct iris_context *ice,
                              bool *out_clear_supported,
                              bool is_render_target)
 {
-   struct iris_screen *screen = (void *) ice->ctx.screen;
-   const struct gen_device_info *devinfo = &screen->devinfo;
-
    switch (res->aux.usage) {
    case ISL_AUX_USAGE_HIZ:
    case ISL_AUX_USAGE_HIZ_CCS:
@@ -618,14 +615,6 @@ get_copy_region_aux_settings(struct iris_context *ice,
    case ISL_AUX_USAGE_MCS_CCS:
    case ISL_AUX_USAGE_CCS_E:
    case ISL_AUX_USAGE_GEN12_CCS_E:
-      *out_aux_usage = res->aux.usage;
-      /* Prior to Gen9, fast-clear only supported 0/1 clear colors.  Since
-       * we're going to re-interpret the format as an integer format possibly
-       * with a different number of components, we can't handle clear colors
-       * until Gen9.
-       */
-      *out_clear_supported = devinfo->gen >= 9;
-      break;
    case ISL_AUX_USAGE_STC_CCS:
       *out_aux_usage = res->aux.usage;
       *out_clear_supported = false;



More information about the mesa-commit mailing list