From 838d3c13ccc920c089318389cc99854a730c50eb 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: (cherry picked from commit 1eb4a2f5cd5a5bc557be57b16028cf372baad8b4) --- .pick_status.json | 2 +- src/gallium/drivers/iris/iris_screen.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.pick_status.json b/.pick_status.json index 415e4cd3cab..51fbfccf205 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -5384,7 +5384,7 @@ "description": "iris: Limit max_shader_buffer_size to INT32_MAX", "nominated": true, "nomination_type": 2, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "2f8b8649f015720fd1ac08f779accbfb4701c074", "notes": null diff --git a/src/gallium/drivers/iris/iris_screen.c b/src/gallium/drivers/iris/iris_screen.c index 8f4eaf3c329..63d15410743 100644 --- a/src/gallium/drivers/iris/iris_screen.c +++ b/src/gallium/drivers/iris/iris_screen.c @@ -413,7 +413,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;