mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-02-01 13:20:25 +01:00
v3dv: be more precise in vkGetImageSubresourceLayout
Only return non-zero values for arrayPitch and depthPitch if they make sense for the image type. Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25074>
This commit is contained in:
parent
8019a1b929
commit
717fbda536
1 changed files with 4 additions and 2 deletions
|
|
@ -565,8 +565,10 @@ v3dv_GetImageSubresourceLayout(VkDevice device,
|
|||
v3dv_layer_offset(image, subresource->mipLevel, subresource->arrayLayer,
|
||||
plane) - image->planes[plane].mem_offset;
|
||||
layout->rowPitch = slice->stride;
|
||||
layout->depthPitch = image->planes[plane].cube_map_stride;
|
||||
layout->arrayPitch = image->planes[plane].cube_map_stride;
|
||||
layout->depthPitch = image->vk.image_type == VK_IMAGE_TYPE_3D ?
|
||||
image->planes[plane].cube_map_stride : 0;
|
||||
layout->arrayPitch = image->vk.array_layers > 1 ?
|
||||
image->planes[plane].cube_map_stride : 0;
|
||||
|
||||
if (image->vk.image_type != VK_IMAGE_TYPE_3D) {
|
||||
layout->size = slice->size;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue