Mesa (master): iris: Make iris_has_color_unresolved more generic
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Fri Sep 4 15:36:34 UTC 2020
Module: Mesa
Branch: master
Commit: 2982d7c63b6c605ca4309925bda35dc13a198a83
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2982d7c63b6c605ca4309925bda35dc13a198a83
Author: Nanley Chery <nanley.g.chery at intel.com>
Date: Tue Jun 23 09:52:47 2020 -0700
iris: Make iris_has_color_unresolved more generic
Replace iris_has_color_unresolved with iris_has_invalid_primary.
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6192>
---
src/gallium/drivers/iris/iris_resolve.c | 16 +++++++++-------
src/gallium/drivers/iris/iris_resource.c | 2 +-
src/gallium/drivers/iris/iris_resource.h | 6 +++---
3 files changed, 13 insertions(+), 11 deletions(-)
diff --git a/src/gallium/drivers/iris/iris_resolve.c b/src/gallium/drivers/iris/iris_resolve.c
index 37af7920ada..023389bb535 100644
--- a/src/gallium/drivers/iris/iris_resolve.c
+++ b/src/gallium/drivers/iris/iris_resolve.c
@@ -673,9 +673,9 @@ miptree_layer_range_length(const struct iris_resource *res, uint32_t level,
}
bool
-iris_has_color_unresolved(const struct iris_resource *res,
- unsigned start_level, unsigned num_levels,
- unsigned start_layer, unsigned num_layers)
+iris_has_invalid_primary(const struct iris_resource *res,
+ unsigned start_level, unsigned num_levels,
+ unsigned start_layer, unsigned num_layers)
{
if (!res->aux.bo)
return false;
@@ -685,13 +685,15 @@ iris_has_color_unresolved(const struct iris_resource *res,
for (uint32_t l = 0; l < num_levels; l++) {
const uint32_t level = start_level + l;
+ if (!level_has_aux(res, level))
+ continue;
+
const uint32_t level_layers =
miptree_layer_range_length(res, level, start_layer, num_layers);
for (unsigned a = 0; a < level_layers; a++) {
enum isl_aux_state aux_state =
iris_resource_get_aux_state(res, level, start_layer + a);
- assert(aux_state != ISL_AUX_STATE_AUX_INVALID);
- if (aux_state != ISL_AUX_STATE_PASS_THROUGH)
+ if (!isl_aux_state_has_valid_primary(aux_state))
return true;
}
}
@@ -844,8 +846,8 @@ iris_resource_texture_aux_usage(struct iris_context *ice,
* ISL_AUX_USAGE_NONE. This way, texturing won't even look at the
* aux surface and we can save some bandwidth.
*/
- if (!iris_has_color_unresolved(res, 0, INTEL_REMAINING_LEVELS,
- 0, INTEL_REMAINING_LAYERS))
+ if (!iris_has_invalid_primary(res, 0, INTEL_REMAINING_LEVELS,
+ 0, INTEL_REMAINING_LAYERS))
return ISL_AUX_USAGE_NONE;
/* On Gen9 color buffers may be compressed by the hardware (lossless
diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c
index 734441b8fae..3396678154c 100644
--- a/src/gallium/drivers/iris/iris_resource.c
+++ b/src/gallium/drivers/iris/iris_resource.c
@@ -1799,7 +1799,7 @@ iris_transfer_map(struct pipe_context *ctx,
(res->aux.usage == ISL_AUX_USAGE_CCS_D ||
res->aux.usage == ISL_AUX_USAGE_CCS_E ||
res->aux.usage == ISL_AUX_USAGE_GEN12_CCS_E) &&
- iris_has_color_unresolved(res, level, 1, box->z, box->depth);
+ iris_has_invalid_primary(res, level, 1, box->z, box->depth);
need_resolve = need_color_resolve ||
need_hiz_resolve ||
diff --git a/src/gallium/drivers/iris/iris_resource.h b/src/gallium/drivers/iris/iris_resource.h
index 2d062ec3af4..e98d2ac69d1 100644
--- a/src/gallium/drivers/iris/iris_resource.h
+++ b/src/gallium/drivers/iris/iris_resource.h
@@ -477,9 +477,9 @@ iris_resource_unfinished_aux_import(struct iris_resource *res)
void iris_resource_finish_aux_import(struct pipe_screen *pscreen,
struct iris_resource *res);
-bool iris_has_color_unresolved(const struct iris_resource *res,
- unsigned start_level, unsigned num_levels,
- unsigned start_layer, unsigned num_layers);
+bool iris_has_invalid_primary(const struct iris_resource *res,
+ unsigned start_level, unsigned num_levels,
+ unsigned start_layer, unsigned num_layers);
void iris_resource_check_level_layer(const struct iris_resource *res,
uint32_t level, uint32_t layer);
More information about the mesa-commit
mailing list