From ea5ffa012870d49df15b6e32f13e45ad73e2b018 Mon Sep 17 00:00:00 2001 From: Nanley Chery Date: Thu, 27 Jan 2022 21:47:08 -0500 Subject: [PATCH] iris: Refactor a ternary in iris_resource_get_param MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Suggested-by: Francisco Jerez Reviewed-by: Tapani Pälli Part-of: --- src/gallium/drivers/iris/iris_resource.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c index c38bb259178..7fe2355da66 100644 --- a/src/gallium/drivers/iris/iris_resource.c +++ b/src/gallium/drivers/iris/iris_resource.c @@ -1581,6 +1581,8 @@ iris_resource_get_param(struct pipe_screen *pscreen, bool mod_with_aux = res->mod_info && res->mod_info->aux_usage != ISL_AUX_USAGE_NONE; bool wants_aux = mod_with_aux && plane > 0; + bool wants_cc = mod_with_aux && + mod_plane_is_clear_color(res->mod_info->modifier, plane); bool result; unsigned handle; @@ -1605,9 +1607,8 @@ iris_resource_get_param(struct pipe_screen *pscreen, *value = wants_aux ? res->aux.surf.row_pitch_B : res->surf.row_pitch_B; return true; case PIPE_RESOURCE_PARAM_OFFSET: - *value = wants_aux ? - mod_plane_is_clear_color(res->mod_info->modifier, plane) ? - res->aux.clear_color_offset : res->aux.offset : 0; + *value = wants_cc ? res->aux.clear_color_offset : + wants_aux ? res->aux.offset : 0; return true; case PIPE_RESOURCE_PARAM_MODIFIER: *value = res->mod_info ? res->mod_info->modifier :