From 3842d10dd7d54ff193303e4913763a8a593ab6fb Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Thu, 9 Jan 2025 13:36:21 +0100 Subject: [PATCH] radeonsi: do not use std::max MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use MAX2 and abs to avoid build failures on some platforms. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/12434 Fixes: dc293ffe507 ("radeonsi: fallback to util_blitter_draw_rectangle") Reviewed-by: Timur Kristóf Reviewed-by: Marek Olšák Part-of: --- src/gallium/drivers/radeonsi/si_state_draw.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_state_draw.cpp b/src/gallium/drivers/radeonsi/si_state_draw.cpp index 5feaa64bb7e..9c65302a864 100644 --- a/src/gallium/drivers/radeonsi/si_state_draw.cpp +++ b/src/gallium/drivers/radeonsi/si_state_draw.cpp @@ -2470,8 +2470,7 @@ static void si_draw_rectangle(struct blitter_context *blitter, void *vertex_elem uint32_t attribute_ring_address_lo = sctx->gfx_level >= GFX11 ? sctx->screen->attribute_pos_prim_ring->gpu_address : 0; - if (std::max(std::abs(x1), std::abs(x2)) > INT16_MAX || - std::max(std::abs(y1), std::abs(y2)) > INT16_MAX) { + if (MAX2(abs(x1), abs(x2)) > INT16_MAX || MAX2(abs(y1), abs(y2)) > INT16_MAX) { /* Fallback when coordinates can't fit in int16. */ util_blitter_save_vertex_elements(sctx->blitter, sctx->vertex_elements); util_blitter_draw_rectangle(blitter, vertex_elements_cso, get_vs, x1, y1, x2, y2,