iris: Enable atomic operations on compressed surfaces
authorSagar Ghuge <sagar.ghuge@intel.com>
Tue, 21 Sep 2021 06:12:57 +0000 (23:12 -0700)
committerMarge Bot <eric+marge@anholt.net>
Fri, 1 Oct 2021 22:16:22 +0000 (22:16 +0000)
Let's not turn off compression for atomic operations since XeHPG
supports it.

Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12966>

src/gallium/drivers/iris/iris_resolve.c

index ecc0cbb..50fc9a9 100644 (file)
@@ -913,6 +913,8 @@ iris_image_view_aux_usage(struct iris_context *ice,
    if (!info)
       return ISL_AUX_USAGE_NONE;
 
+   const struct iris_screen *screen = (void *) ice->ctx.screen;
+   const struct intel_device_info *devinfo = &screen->devinfo;
    struct iris_resource *res = (void *) pview->resource;
 
    enum isl_format view_format = iris_image_view_get_format(ice, pview);
@@ -922,7 +924,11 @@ iris_image_view_aux_usage(struct iris_context *ice,
    bool uses_atomic_load_store =
       ice->shaders.uncompiled[info->stage]->uses_atomic_load_store;
 
-   if (aux_usage == ISL_AUX_USAGE_GFX12_CCS_E && !uses_atomic_load_store)
+   /* On GFX12, compressed surfaces supports non-atomic operations. GFX12HP and
+    * further, add support for all the operations.
+    */
+   if (aux_usage == ISL_AUX_USAGE_GFX12_CCS_E &&
+       (devinfo->verx10 >= 125 || !uses_atomic_load_store))
       return ISL_AUX_USAGE_GFX12_CCS_E;
 
    return ISL_AUX_USAGE_NONE;