diff --git a/.pick_status.json b/.pick_status.json index 232c8be4872..6d9542f9eed 100644 --- a/.pick_status.json +++ b/.pick_status.json @@ -6164,7 +6164,7 @@ "description": "llvmpipe: Stop aligning height to raster block size for unbacked handles", "nominated": true, "nomination_type": 1, - "resolution": 0, + "resolution": 1, "main_sha": null, "because_sha": null, "notes": null diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c index 08d73d3be3d..2d19021f8eb 100644 --- a/src/gallium/drivers/llvmpipe/lp_texture.c +++ b/src/gallium/drivers/llvmpipe/lp_texture.c @@ -751,11 +751,20 @@ llvmpipe_resource_from_handle(struct pipe_screen *_screen, assert(lpr->base.height0 == height); #endif - unsigned nblocksy = util_format_get_nblocksy(template->format, align(template->height0, LP_RASTER_BLOCK_SIZE)); - if (whandle->type == WINSYS_HANDLE_TYPE_UNBACKED && whandle->image_stride) - lpr->img_stride[0] = whandle->image_stride; - else + if (whandle->type == WINSYS_HANDLE_TYPE_UNBACKED) { + if (whandle->image_stride) { + lpr->img_stride[0] = whandle->image_stride; + } else { + unsigned nblocksy = util_format_get_nblocksy(template->format, + template->height0); + lpr->img_stride[0] = whandle->stride * nblocksy; + } + } else { + unsigned nblocksy = util_format_get_nblocksy(template->format, + align(template->height0, + LP_RASTER_BLOCK_SIZE)); lpr->img_stride[0] = whandle->stride * nblocksy; + } lpr->sample_stride = lpr->img_stride[0]; lpr->size_required = lpr->sample_stride;