mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 07:18:17 +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> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/40250>
This commit is contained in:
parent
0d8e2354ed
commit
765a9f4fd9
1 changed files with 3 additions and 8 deletions
|
|
@ -94,14 +94,9 @@ static void pvr_image_plane_init_physical_extent(
|
|||
assert(image->memlayout == PVR_MEMLAYOUT_LINEAR);
|
||||
plane->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)) {
|
||||
plane->physical_extent.width =
|
||||
align(plane->physical_extent.width, pbe_stride_align);
|
||||
}
|
||||
/* Align the image for being rendered to (written by the PBE). */
|
||||
plane->physical_extent.width =
|
||||
align(plane->physical_extent.width, pbe_stride_align);
|
||||
|
||||
if (image->vk.tiling == VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT) {
|
||||
const VkImageDrmFormatModifierExplicitCreateInfoEXT *explicit_mod =
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue