mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 13:48:06 +02:00
pvr: Align width for PBE write when creating linear image
Even if a linear image isn't created with usages declaring PBE writes,
the image might be exported and then re-imported with a usage that
allows rendering to.
Always align linear images' width for being written by PBE.
This fixes WSI creating surfaces with odd width, exporting them and
re-importing for rendering.
Backport-to: 26.0
Signed-off-by: Icenowy Zheng <zhengxingda@iscas.ac.cn>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
(cherry picked from commit 765a9f4fd9)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40752>
This commit is contained in:
parent
b5547c33bb
commit
ca4f356d37
2 changed files with 4 additions and 9 deletions
|
|
@ -2174,7 +2174,7 @@
|
|||
"description": "pvr: Align width for PBE write when creating linear image",
|
||||
"nominated": true,
|
||||
"nomination_type": 4,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"main_sha": null,
|
||||
"because_sha": null,
|
||||
"notes": null
|
||||
|
|
|
|||
|
|
@ -84,14 +84,9 @@ static void pvr_image_init_physical_extent(struct pvr_image *image,
|
|||
assert(image->memlayout == PVR_MEMLAYOUT_LINEAR);
|
||||
image->physical_extent = image->vk.extent;
|
||||
|
||||
/* If the image is being rendered to (written by the PBE) make sure the
|
||||
* width is aligned correctly.
|
||||
*/
|
||||
if (image->vk.usage & (VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT |
|
||||
VK_IMAGE_USAGE_TRANSFER_DST_BIT)) {
|
||||
image->physical_extent.width =
|
||||
align(image->physical_extent.width, pbe_stride_align);
|
||||
}
|
||||
/* Align the image for being rendered to (written by the PBE). */
|
||||
image->physical_extent.width =
|
||||
align(image->physical_extent.width, pbe_stride_align);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue