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 */