dri: fail creating DRI images that exceed hw limits

otherwise random stuff happens

it probably resolves https://gitlab.freedesktop.org/mesa/mesa/-/issues/13652

Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/36566>
This commit is contained in:
Marek Olšák 2025-08-04 23:51:16 -04:00 committed by Marge Bot
parent ae66bd1c00
commit 692206d58c

View file

@ -916,6 +916,10 @@ dri_create_image(struct dri_screen *screen,
if (!pscreen->resource_create_with_modifiers && count > 0)
return NULL;
if (width > pscreen->caps.max_texture_2d_size ||
height > pscreen->caps.max_texture_2d_size)
return NULL;
if (pscreen->is_format_supported(pscreen, map->pipe_format, screen->target,
0, 0, PIPE_BIND_RENDER_TARGET))
tex_usage |= PIPE_BIND_RENDER_TARGET;