diff --git a/.pick_status.json b/.pick_status.json index faa61734c52..5950ac2d77d 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -3172,7 +3172,7 @@ "description": "llvmpipe: fix compressed image sizes.", "nominated": true, "nomination_type": 0, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null }, diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c index 5a6ba3350be..865795de33d 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_setup.c @@ -710,7 +710,11 @@ lp_setup_set_fs_images(struct lp_setup_context *setup, if (llvmpipe_resource_is_texture(res)) { uint32_t mip_offset = lp_res->mip_offsets[image->u.tex.level]; + const uint32_t bw = util_format_get_blockwidth(image->resource->format); + const uint32_t bh = util_format_get_blockheight(image->resource->format); + jit_image->width = DIV_ROUND_UP(jit_image->width, bw); + jit_image->height = DIV_ROUND_UP(jit_image->height, bh); jit_image->width = u_minify(jit_image->width, image->u.tex.level); jit_image->height = u_minify(jit_image->height, image->u.tex.level); diff --git a/src/gallium/drivers/llvmpipe/lp_state_cs.c b/src/gallium/drivers/llvmpipe/lp_state_cs.c index 9a3291ded46..1e9b9029c1f 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_cs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_cs.c @@ -1126,7 +1126,11 @@ lp_csctx_set_cs_images(struct lp_cs_context *csctx, if (llvmpipe_resource_is_texture(res)) { uint32_t mip_offset = lp_res->mip_offsets[image->u.tex.level]; + const uint32_t bw = util_format_get_blockwidth(image->resource->format); + const uint32_t bh = util_format_get_blockheight(image->resource->format); + jit_image->width = DIV_ROUND_UP(jit_image->width, bw); + jit_image->height = DIV_ROUND_UP(jit_image->height, bh); jit_image->width = u_minify(jit_image->width, image->u.tex.level); jit_image->height = u_minify(jit_image->height, image->u.tex.level); diff --git a/src/gallium/drivers/llvmpipe/lp_state_sampler.c b/src/gallium/drivers/llvmpipe/lp_state_sampler.c index 9303e3bd7ec..95ec38b25a6 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_sampler.c +++ b/src/gallium/drivers/llvmpipe/lp_state_sampler.c @@ -457,11 +457,19 @@ prepare_shader_images( if (!img) continue; - unsigned width = u_minify(img->width0, view->u.tex.level); - unsigned height = u_minify(img->height0, view->u.tex.level); + unsigned width = img->width0; + unsigned height = img->height0; unsigned num_layers = img->depth0; unsigned num_samples = img->nr_samples; + const uint32_t bw = util_format_get_blockwidth(view->resource->format); + const uint32_t bh = util_format_get_blockheight(view->resource->format); + + width = DIV_ROUND_UP(width, bw); + height = DIV_ROUND_UP(height, bh); + width = u_minify(width, view->u.tex.level); + height = u_minify(height, view->u.tex.level); + if (!lp_img->dt) { /* regular texture - setup array of mipmap level offsets */ struct pipe_resource *res = view->resource;