diff options
author | Kenneth Graunke <kenneth@whitecape.org> | 2021-12-06 15:42:01 -0800 |
---|---|---|
committer | Eric Engestrom <eric@engestrom.ch> | 2022-01-26 18:28:31 +0000 |
commit | 12beba1f71b64827f2f00f68fde03ab05da8bdb5 (patch) | |
tree | 968c27d72245eec780ccb45245b4d3d6443eaf53 | |
parent | 102b83d77d8b4edef367eaed5b6040c8fc0ba003 (diff) |
iris: Fix and refactor check for clear color being fully zero
I missed updating this code to check res->aux.clear_color_unknown when
I added it a while back. While we're here, also refactor this code into
a helper function - I'll want to use it in another place shortly.
Fixes: e83da2d8e3b ("iris: Don't try to CPU read imported clear color BOs")
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14687>
(cherry picked from commit 09072a08030061f16b290984305e4ba09e2ad3fe)
-rw-r--r-- | .pick_status.json | 2 | ||||
-rw-r--r-- | src/gallium/drivers/iris/iris_blit.c | 15 |
2 files changed, 12 insertions, 5 deletions
diff --git a/.pick_status.json b/.pick_status.json index 41affd8a5e1..0425b049109 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -364,7 +364,7 @@ "description": "iris: Fix and refactor check for clear color being fully zero", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "e83da2d8e3b1129d6857bb18cb212fdd08cbc69b" }, diff --git a/src/gallium/drivers/iris/iris_blit.c b/src/gallium/drivers/iris/iris_blit.c index a755f9427eb..ad097a1ff24 100644 --- a/src/gallium/drivers/iris/iris_blit.c +++ b/src/gallium/drivers/iris/iris_blit.c @@ -337,6 +337,16 @@ pipe_format_for_aspect(enum pipe_format format, unsigned pipe_mask) } } +static bool +clear_color_is_fully_zero(const struct iris_resource *res) +{ + return !res->aux.clear_color_unknown && + res->aux.clear_color.u32[0] == 0 && + res->aux.clear_color.u32[1] == 0 && + res->aux.clear_color.u32[2] == 0 && + res->aux.clear_color.u32[3] == 0; +} + /** * The pipe->blit() driver hook. * @@ -590,10 +600,7 @@ get_copy_region_aux_settings(struct iris_context *ice, * original format (e.g. A8_UNORM/R8_UINT). */ *out_clear_supported = (devinfo->ver >= 11 && !is_render_target) || - (res->aux.clear_color.u32[0] == 0 && - res->aux.clear_color.u32[1] == 0 && - res->aux.clear_color.u32[2] == 0 && - res->aux.clear_color.u32[3] == 0); + clear_color_is_fully_zero(res); break; default: *out_aux_usage = ISL_AUX_USAGE_NONE; |