From 21136d931d7f2130045fb3b9df1aea1b7b70b33b Mon Sep 17 00:00:00 2001 From: Vitaliy Triang3l Kuzmin Date: Sat, 5 Jul 2025 19:06:00 +0300 Subject: [PATCH] r600: Fix rectangle coordinate limits on R6xx/R7xx MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit R6xx/R7xx use D3D10 15.8 fixed-point coordinates rather than 16.8. Cc: mesa-stable Reviewed-by: Marek Olšák Signed-off-by: Vitaliy Triang3l Kuzmin Part-of: --- src/gallium/drivers/r600/r600_pipe_common.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/r600/r600_pipe_common.c b/src/gallium/drivers/r600/r600_pipe_common.c index d1df06e82e1..cb6a789b66c 100644 --- a/src/gallium/drivers/r600/r600_pipe_common.c +++ b/src/gallium/drivers/r600/r600_pipe_common.c @@ -123,9 +123,13 @@ void r600_draw_rectangle(struct blitter_context *blitter, unsigned offset = 0; float *vb; - if (unlikely(MAX2(abs(x1), abs(x2)) > INT16_MAX || - MAX2(abs(y1), abs(y2)) > INT16_MAX)) { - /* Fallback when coordinates can't fit in int16. */ + int rasterizer_screen_extent = + rctx->gfx_level >= EVERGREEN ? 1 << 15 : 1 << 14; + if (unlikely(MAX4(x1, x2, y1, y2) >= rasterizer_screen_extent || + MIN4(x1, x2, y1, y2) < -rasterizer_screen_extent)) { + /* Fallback when coordinates can't fit in the rasterizer + * fixed-point coordinate space. + */ util_blitter_save_vertex_elements(cctx->blitter, cctx->vertex_fetch_shader.cso); util_blitter_draw_rectangle(blitter, vertex_elements_cso, get_vs,