iris: Use isl_aux_usage_has_fast_clear()
authorNanley Chery <nanley.g.chery@intel.com>
Fri, 8 Nov 2019 23:07:34 +0000 (15:07 -0800)
committerMarge Bot <eric+marge@anholt.net>
Mon, 24 Feb 2020 18:00:05 +0000 (18:00 +0000)
Make sure fast-clears aren't attempted or allowed for ISL_AUX_USAGE_MC.

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

src/gallium/drivers/iris/iris_blit.c
src/gallium/drivers/iris/iris_clear.c
src/gallium/drivers/iris/iris_resolve.c

index ca45c1827da8e3faf660044b2aad5d2427ff3a62..20b7340638345c1e1f83f7ee1fca9ec31cddfde8 100644 (file)
@@ -357,7 +357,7 @@ iris_blit(struct pipe_context *ctx, const struct pipe_blit_info *info)
    if (iris_resource_level_has_hiz(src_res, info->src.level))
       src_aux_usage = ISL_AUX_USAGE_NONE;
 
-   bool src_clear_supported = src_aux_usage != ISL_AUX_USAGE_NONE &&
+   bool src_clear_supported = isl_aux_usage_has_fast_clears(src_aux_usage) &&
                               src_res->surf.format == src_fmt.fmt;
 
    iris_resource_prepare_access(ice, batch, src_res, info->src.level, 1,
@@ -369,7 +369,7 @@ iris_blit(struct pipe_context *ctx, const struct pipe_blit_info *info)
                             ISL_SURF_USAGE_RENDER_TARGET_BIT);
    enum isl_aux_usage dst_aux_usage =
       iris_resource_render_aux_usage(ice, dst_res, dst_fmt.fmt, false, false);
-   bool dst_clear_supported = dst_aux_usage != ISL_AUX_USAGE_NONE;
+   bool dst_clear_supported = isl_aux_usage_has_fast_clears(dst_aux_usage);
 
    struct blorp_surf src_surf, dst_surf;
    iris_blorp_surf_for_resource(&ice->vtbl, &screen->isl_dev,  &src_surf,
index 94b68c8dcd899335c7b6679cbe26ec43e2ae63f9..5f7914a5ba0bd3a976cc7afc2a7a3bc645d83c0b 100644 (file)
@@ -78,7 +78,7 @@ can_fast_clear_color(struct iris_context *ice,
    if (INTEL_DEBUG & DEBUG_NO_FAST_CLEAR)
       return false;
 
-   if (res->aux.usage == ISL_AUX_USAGE_NONE)
+   if (!isl_aux_usage_has_fast_clears(res->aux.usage))
       return false;
 
    /* Check for partial clear */
index eb9c0f0cfd9b286537b87da8b1bdc677ecd8c631..0cfc89716f620315bdb06e3ce0ba68c7917c0c5e 100644 (file)
@@ -1401,7 +1401,7 @@ iris_resource_prepare_texture(struct iris_context *ice,
    enum isl_aux_usage aux_usage =
       iris_resource_texture_aux_usage(ice, res, view_format);
 
-   bool clear_supported = aux_usage != ISL_AUX_USAGE_NONE;
+   bool clear_supported = isl_aux_usage_has_fast_clears(aux_usage);
 
    /* Clear color is specified as ints or floats and the conversion is done by
     * the sampler.  If we have a texture view, we would have to perform the
@@ -1466,7 +1466,7 @@ iris_resource_prepare_render(struct iris_context *ice,
 {
    iris_resource_prepare_access(ice, batch, res, level, 1, start_layer,
                                 layer_count, aux_usage,
-                                aux_usage != ISL_AUX_USAGE_NONE);
+                                isl_aux_usage_has_fast_clears(aux_usage));
 }
 
 void