diff --git a/.pick_status.json b/.pick_status.json index fb112b4a08e..d673ba87720 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -661,7 +661,7 @@ "description": "st/pbo_compute: use different calc for non-3d compute buffer sizing", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": "e7b95619596167025d26f07efb04dc5bfd5e9aee" }, diff --git a/src/mesa/state_tracker/st_pbo_compute.c b/src/mesa/state_tracker/st_pbo_compute.c index 6895d8c4a60..542c9b628f4 100644 --- a/src/mesa/state_tracker/st_pbo_compute.c +++ b/src/mesa/state_tracker/st_pbo_compute.c @@ -919,7 +919,12 @@ download_texture_compute(struct st_context *st, } /* Set up destination buffer */ - unsigned img_stride = _mesa_image_image_stride(pack, width, height, format, type); + unsigned img_stride = src->target == PIPE_TEXTURE_3D || + src->target == PIPE_TEXTURE_2D_ARRAY || + src->target == PIPE_TEXTURE_CUBE_ARRAY ? + /* only use image stride for 3d images to avoid pulling in IMAGE_HEIGHT pixelstore */ + _mesa_image_image_stride(pack, width, height, format, type) : + _mesa_image_row_stride(pack, width, format, type) * height; unsigned buffer_size = (depth + (dim == 3 ? pack->SkipImages : 0)) * img_stride; { dst = pipe_buffer_create(screen, PIPE_BIND_SHADER_BUFFER, PIPE_USAGE_STAGING, buffer_size);