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 <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2957>
This commit is contained in:
Nanley Chery 2019-11-08 15:07:34 -08:00 committed by Marge Bot
parent 58d4749e56
commit fec957900d
3 changed files with 5 additions and 5 deletions

View 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,

View 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 */

View 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