Mesa (main): iris: Compute aux.possible_usages from aux.usage
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Feb 10 05:10:56 UTC 2022
Module: Mesa
Branch: main
Commit: ae763940e8c70ea0cdc43fe66b216d54fc2dd799
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=ae763940e8c70ea0cdc43fe66b216d54fc2dd799
Author: Nanley Chery <nanley.g.chery at intel.com>
Date: Mon Jan 17 13:34:06 2022 -0500
iris: Compute aux.possible_usages from aux.usage
We're going to remove res->aux.possible_usages. This will simplify the
commit in which we do so.
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14806>
---
src/gallium/drivers/iris/iris_resource.c | 22 +++++++++++-----------
1 file changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c
index ba8fd078254..248dfd84826 100644
--- a/src/gallium/drivers/iris/iris_resource.c
+++ b/src/gallium/drivers/iris/iris_resource.c
@@ -772,40 +772,40 @@ iris_resource_configure_aux(struct iris_screen *screen,
assert(!res->mod_info);
assert(!has_hiz);
if (has_ccs) {
- res->aux.possible_usages |= 1 << ISL_AUX_USAGE_MCS_CCS;
+ res->aux.usage = ISL_AUX_USAGE_MCS_CCS;
} else {
- res->aux.possible_usages |= 1 << ISL_AUX_USAGE_MCS;
+ res->aux.usage = ISL_AUX_USAGE_MCS;
}
} else if (has_hiz) {
assert(!res->mod_info);
assert(!has_mcs);
if (!has_ccs) {
- res->aux.possible_usages |= 1 << ISL_AUX_USAGE_HIZ;
+ res->aux.usage = ISL_AUX_USAGE_HIZ;
} else if (res->surf.samples == 1 &&
(res->surf.usage & ISL_SURF_USAGE_TEXTURE_BIT)) {
/* If this resource is single-sampled and will be used as a texture,
* put the HiZ surface in write-through mode so that we can sample
* from it.
*/
- res->aux.possible_usages |= 1 << ISL_AUX_USAGE_HIZ_CCS_WT;
+ res->aux.usage = ISL_AUX_USAGE_HIZ_CCS_WT;
} else {
- res->aux.possible_usages |= 1 << ISL_AUX_USAGE_HIZ_CCS;
+ res->aux.usage = ISL_AUX_USAGE_HIZ_CCS;
}
} else if (has_ccs) {
if (res->mod_info) {
- res->aux.possible_usages |= 1 << res->mod_info->aux_usage;
+ res->aux.usage = res->mod_info->aux_usage;
} else if (isl_surf_usage_is_stencil(res->surf.usage)) {
- res->aux.possible_usages |= 1 << ISL_AUX_USAGE_STC_CCS;
+ res->aux.usage = ISL_AUX_USAGE_STC_CCS;
} else if (want_ccs_e_for_format(devinfo, res->surf.format)) {
- res->aux.possible_usages |= devinfo->ver < 12 ?
- 1 << ISL_AUX_USAGE_CCS_E : 1 << ISL_AUX_USAGE_GFX12_CCS_E;
+ res->aux.usage = devinfo->ver < 12 ?
+ ISL_AUX_USAGE_CCS_E : ISL_AUX_USAGE_GFX12_CCS_E;
} else {
assert(isl_format_supports_ccs_d(devinfo, res->surf.format));
- res->aux.possible_usages |= 1 << ISL_AUX_USAGE_CCS_D;
+ res->aux.usage = ISL_AUX_USAGE_CCS_D;
}
}
- res->aux.usage = util_last_bit(res->aux.possible_usages) - 1;
+ res->aux.possible_usages |= 1 << res->aux.usage;
if (!has_hiz || iris_sample_with_depth_aux(devinfo, res))
res->aux.sampler_usages = res->aux.possible_usages;
More information about the mesa-commit
mailing list