iris: Use iris_sample_with_depth_aux more often

We're going to remove res->aux.sampler_usages. This will simplify the
commit in which we do so.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14806>
This commit is contained in:
Nanley Chery 2022-01-17 11:16:03 -05:00 committed by Marge Bot
parent 85a7fb1e19
commit d905018a2c
3 changed files with 6 additions and 2 deletions

View file

@ -864,7 +864,8 @@ iris_resource_texture_aux_usage(struct iris_context *ice,
case ISL_AUX_USAGE_HIZ_CCS:
case ISL_AUX_USAGE_HIZ_CCS_WT:
assert(res->surf.format == view_format);
return util_last_bit(res->aux.sampler_usages) - 1;
return iris_sample_with_depth_aux(devinfo, res) ?
res->aux.usage : ISL_AUX_USAGE_NONE;
case ISL_AUX_USAGE_MCS:
case ISL_AUX_USAGE_MCS_CCS:

View file

@ -554,7 +554,7 @@ iris_get_aux_clear_color_state_size(struct iris_screen *screen,
* sampler via render surface state objects.
*/
if (isl_surf_usage_is_depth(res->surf.usage) &&
res->aux.sampler_usages == 1 << ISL_AUX_USAGE_NONE)
!iris_sample_with_depth_aux(&screen->devinfo, res))
return 0;
return screen->isl_dev.ss.clear_color_state_size;

View file

@ -2529,6 +2529,9 @@ iris_create_sampler_view(struct pipe_context *ctx,
isv->res->aux.usage == ISL_AUX_USAGE_GFX12_CCS_E) &&
!isl_format_supports_ccs_e(devinfo, isv->view.format)) {
aux_usages = 1 << ISL_AUX_USAGE_NONE;
} else if (isl_aux_usage_has_hiz(isv->res->aux.usage) &&
!iris_sample_with_depth_aux(devinfo, isv->res)) {
aux_usages = 1 << ISL_AUX_USAGE_NONE;
} else {
aux_usages = isv->res->aux.sampler_usages;
}