From: Nanley Chery Date: Fri, 8 Nov 2019 23:07:34 +0000 (-0800) Subject: iris: Use isl_aux_usage_has_fast_clear() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=fec957900d6612493a6e03d0e5958dbe8c362733;p=mesa.git iris: Use isl_aux_usage_has_fast_clear() Make sure fast-clears aren't attempted or allowed for ISL_AUX_USAGE_MC. Reviewed-by: Jason Ekstrand Part-of: --- diff --git a/src/gallium/drivers/iris/iris_blit.c b/src/gallium/drivers/iris/iris_blit.c index ca45c1827da..20b73406383 100644 --- a/src/gallium/drivers/iris/iris_blit.c +++ b/src/gallium/drivers/iris/iris_blit.c @@ -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, diff --git a/src/gallium/drivers/iris/iris_clear.c b/src/gallium/drivers/iris/iris_clear.c index 94b68c8dcd8..5f7914a5ba0 100644 --- a/src/gallium/drivers/iris/iris_clear.c +++ b/src/gallium/drivers/iris/iris_clear.c @@ -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 */ diff --git a/src/gallium/drivers/iris/iris_resolve.c b/src/gallium/drivers/iris/iris_resolve.c index eb9c0f0cfd9..0cfc89716f6 100644 --- a/src/gallium/drivers/iris/iris_resolve.c +++ b/src/gallium/drivers/iris/iris_resolve.c @@ -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