From bd839d4bfceeafcc5883fa9254d51b19bd41499e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Fri, 21 Nov 2025 17:56:43 -0500 Subject: [PATCH] st/mesa: don't use the PBO GetTexImage compute shader for 64K textures I uses uint16_t for width/height. Reviewed-by: Qiang Yu Part-of: --- src/mesa/state_tracker/st_pbo_compute.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/mesa/state_tracker/st_pbo_compute.c b/src/mesa/state_tracker/st_pbo_compute.c index 449307359e0..b65a1ae787f 100644 --- a/src/mesa/state_tracker/st_pbo_compute.c +++ b/src/mesa/state_tracker/st_pbo_compute.c @@ -1304,11 +1304,12 @@ st_GetTexSubImage_shader(struct gl_context * ctx, return false; view_target = get_target_from_texture(src); - /* I don't know why this works - * only for the texture rects - * but that's how it is - */ - if ((src->target != PIPE_TEXTURE_RECT && + + /* 64K x 64K aren't supported by the shader (pbo_data::width/height have 16 bits) */ + if (width >= UINT16_MAX || height >= UINT16_MAX || + /* I don't know why this works only for the texture rects + * but that's how it is. */ + (src->target != PIPE_TEXTURE_RECT && /* this would need multiple samplerviews */ ((util_format_is_depth_and_stencil(src_format) && util_format_is_depth_and_stencil(dst_format)) || /* these format just doesn't work and science can't explain why */