From 1eb4a2f5cd5a5bc557be57b16028cf372baad8b4 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 10 Sep 2025 13:07:12 -0700 Subject: [PATCH] iris: Limit max_shader_buffer_size to INT32_MAX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit GLSL arrays are sized by signed integers. Other places in the Mesa treat this value is int32_t. Having the value larger than (uint32_t)INT32_MAX causes assertion failures in many piglit tests. Reviewed-by: Tapani Pälli Closes: #13873 Fixes: 2f8b8649f01 ("iris: Increase max_shader_buffer_size to max_buffer_size") Part-of: --- src/gallium/drivers/iris/iris_screen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/iris/iris_screen.c b/src/gallium/drivers/iris/iris_screen.c index 716bcb46062..8e172801ed5 100644 --- a/src/gallium/drivers/iris/iris_screen.c +++ b/src/gallium/drivers/iris/iris_screen.c @@ -409,7 +409,7 @@ iris_init_screen_caps(struct iris_screen *screen) caps->constant_buffer_offset_alignment = 32; caps->min_map_buffer_alignment = IRIS_MAP_BUFFER_ALIGNMENT; caps->shader_buffer_offset_alignment = 4; - caps->max_shader_buffer_size = (unsigned)MIN2(screen->isl_dev.max_buffer_size, UINT32_MAX); + caps->max_shader_buffer_size = (unsigned)MIN2(screen->isl_dev.max_buffer_size, INT32_MAX); // INT32_MAX is correct. caps->texture_buffer_offset_alignment = 16; // XXX: u_screen says 256 is the minimum value... caps->linear_image_pitch_alignment = 1; caps->linear_image_base_address_alignment = 1;