r600: Fix rectangle coordinate limits on R6xx/R7xx
Some checks are pending
macOS-CI / macOS-CI (dri) (push) Waiting to run
macOS-CI / macOS-CI (xlib) (push) Waiting to run

R6xx/R7xx use D3D10 15.8 fixed-point coordinates rather than 16.8.

Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Vitaliy Triang3l Kuzmin <triang3l@yandex.ru>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/35953>
This commit is contained in:
Vitaliy Triang3l Kuzmin 2025-07-05 19:06:00 +03:00 committed by Marge Bot
parent ace49d9e52
commit 21136d931d

View file

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