mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-06-09 14:28:18 +02:00
llvmpipe: Stop aligning height to raster block size for unbacked handles
This code path is usually used by lavapipe when importing dmabufs, not for output. The resulting size_required is then used to calculate the size requirements for VkMemoryRequirements2 etc. Requiring a multiple of LP_RASTER_BLOCK_SIZE - 4 - can eventually result in lavapipe rejecting dmabuf imports. An example is YUV420 at a resolution of 1680x1050 produced by Gstreamer 1.28 - e.g. from a screencasts. In this case we currently compute a size of 3235840, while other drivers like radv compute 3225600. The actual size is 3227648, fitting into the later but not the former. Removing the alignment brings lavapipe in line with other drivers. Cc: mesa-stable Signed-off-by: Robert Mader <robert.mader@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40424>
This commit is contained in:
parent
4466914680
commit
0bbc26d2c4
1 changed files with 13 additions and 4 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue