Module: Mesa Branch: main Commit: 08f7d37fb97712e377f0b788be99bd10f899fa79 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=08f7d37fb97712e377f0b788be99bd10f899fa79
Author: Thomas H.P. Andersen <[email protected]> Date: Thu Dec 23 16:15:00 2021 +0100 panvk: cast negative value to unint8_t The index is a uint8_t but can be assigned a negative 1 value in panvk_pipeline_builder_parse_color_blend() The comparison to ~0 thus makes sense but clang will complain: "result of comparison of constant -1 with expression of type 'const uint8_t' (aka 'const unsigned char') is always true [-Wtautological-constant-out-of-range-compare]" Fix this by casting to a uint8_t before comparison. Fixes a warning with clang Reviewed-by: Emma Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14289> --- src/panfrost/vulkan/panvk_vX_cmd_buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/panfrost/vulkan/panvk_vX_cmd_buffer.c b/src/panfrost/vulkan/panvk_vX_cmd_buffer.c index a08f428a2ae..5eaf7e49cf7 100644 --- a/src/panfrost/vulkan/panvk_vX_cmd_buffer.c +++ b/src/panfrost/vulkan/panvk_vX_cmd_buffer.c @@ -468,7 +468,7 @@ panvk_draw_prepare_fs_rsd(struct panvk_cmd_buffer *cmdbuf, void *bd = rsd.cpu + pan_size(RENDERER_STATE); for (unsigned i = 0; i < pipeline->blend.state.rt_count; i++) { - if (pipeline->blend.constant[i].index != ~0) { + if (pipeline->blend.constant[i].index != (uint8_t)~0) { struct mali_blend_packed bd_dyn; struct mali_blend_packed *bd_templ = (struct mali_blend_packed *)&pipeline->blend.bd_template[i];
