mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 20:18:12 +02:00
llvmpipe: follow winsys handle attributes when imported with explicit layout
TILE_SIZE round up can conflict with explicit plane size, which assumes a smaller alignment e.g. sw YV12 Reviewed-by: Lucas Fryzek <lfryzek@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40426>
This commit is contained in:
parent
28799c8261
commit
0aa6d727c9
1 changed files with 13 additions and 4 deletions
|
|
@ -1718,11 +1718,20 @@ llvmpipe_resource_bind_backing(struct pipe_screen *pscreen,
|
|||
winsys->displaytarget_destroy(winsys, lpr->dt);
|
||||
}
|
||||
if (pmem) {
|
||||
/* Round up the surface size to a multiple of the tile size to
|
||||
* avoid tile clipping.
|
||||
/* For import alloc with explicit layout, follow the provided
|
||||
* attributes since the layout has been decided externally.
|
||||
*
|
||||
* For export alloc, round up the surface size to a multiple of the
|
||||
* tile size to avoid tile clipping.
|
||||
*/
|
||||
const unsigned width = MAX2(1, align(lpr->base.width0, TILE_SIZE));
|
||||
const unsigned height = MAX2(1, align(lpr->base.height0, TILE_SIZE));
|
||||
unsigned width, height;
|
||||
if (lpr->backable) {
|
||||
width = lpr->base.width0;
|
||||
height = lpr->base.height0;
|
||||
} else {
|
||||
width = MAX2(1, align(lpr->base.width0, TILE_SIZE));
|
||||
height = MAX2(1, align(lpr->base.height0, TILE_SIZE));
|
||||
}
|
||||
|
||||
lpr->dt = winsys->displaytarget_create_mapped(winsys,
|
||||
lpr->base.bind,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue