iris: Refactor a ternary in iris_resource_get_param

Suggested-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14759>
This commit is contained in:
Nanley Chery 2022-01-27 21:47:08 -05:00 committed by Marge Bot
parent db9098f2ef
commit ea5ffa0128
1 changed files with 4 additions and 3 deletions

View File

@ -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 :