iris: Move depth-format assertion out of iris_blit

Instead of having a depth-specific assertion in a generic portion of
iris_blit, move it into the depth-specific cases of
iris_resource_texture_aux_usage. Since iris_blit calls that function,
the test still occurs.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8340>
This commit is contained in:
Nanley Chery 2020-12-14 11:19:29 -08:00 committed by Marge Bot
parent ce3a6dfa79
commit 04d73e2dc2
2 changed files with 3 additions and 3 deletions

View file

@ -410,9 +410,6 @@ iris_blit(struct pipe_context *ctx, const struct pipe_blit_info *info)
enum isl_aux_usage src_aux_usage =
iris_resource_texture_aux_usage(ice, src_res, src_fmt.fmt);
if (iris_resource_level_has_hiz(src_res, info->src.level))
assert(src_res->surf.format == src_fmt.fmt);
bool src_clear_supported = isl_aux_usage_has_fast_clears(src_aux_usage) &&
src_res->surf.format == src_fmt.fmt;

View file

@ -812,15 +812,18 @@ iris_resource_texture_aux_usage(struct iris_context *ice,
switch (res->aux.usage) {
case ISL_AUX_USAGE_HIZ:
assert(res->surf.format == view_format);
if (iris_sample_with_depth_aux(devinfo, res))
return ISL_AUX_USAGE_HIZ;
break;
case ISL_AUX_USAGE_HIZ_CCS:
assert(res->surf.format == view_format);
assert(!iris_sample_with_depth_aux(devinfo, res));
return ISL_AUX_USAGE_NONE;
case ISL_AUX_USAGE_HIZ_CCS_WT:
assert(res->surf.format == view_format);
if (iris_sample_with_depth_aux(devinfo, res))
return ISL_AUX_USAGE_HIZ_CCS_WT;
break;