mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-03 11:30:21 +01:00
venus: override aspectMask for internal tiling modifier
WSI images and Android AHBs can have tiling modifier overrides, thus we must override the aspectMask upon image subresource layout query. Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15993>
This commit is contained in:
parent
d7256043b3
commit
09cee71e80
1 changed files with 32 additions and 0 deletions
|
|
@ -523,6 +523,38 @@ vn_GetImageSubresourceLayout(VkDevice device,
|
|||
VkSubresourceLayout *pLayout)
|
||||
{
|
||||
struct vn_device *dev = vn_device_from_handle(device);
|
||||
struct vn_image *img = vn_image_from_handle(image);
|
||||
|
||||
/* override aspect mask for wsi/ahb images with tiling modifier */
|
||||
VkImageSubresource local_subresource;
|
||||
if ((img->wsi.is_wsi && img->wsi.tiling_override ==
|
||||
VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT) ||
|
||||
img->deferred_info) {
|
||||
VkImageAspectFlags aspect = pSubresource->aspectMask;
|
||||
switch (aspect) {
|
||||
case VK_IMAGE_ASPECT_COLOR_BIT:
|
||||
case VK_IMAGE_ASPECT_DEPTH_BIT:
|
||||
case VK_IMAGE_ASPECT_STENCIL_BIT:
|
||||
case VK_IMAGE_ASPECT_PLANE_0_BIT:
|
||||
aspect = VK_IMAGE_ASPECT_MEMORY_PLANE_0_BIT_EXT;
|
||||
break;
|
||||
case VK_IMAGE_ASPECT_PLANE_1_BIT:
|
||||
aspect = VK_IMAGE_ASPECT_MEMORY_PLANE_1_BIT_EXT;
|
||||
break;
|
||||
case VK_IMAGE_ASPECT_PLANE_2_BIT:
|
||||
aspect = VK_IMAGE_ASPECT_MEMORY_PLANE_2_BIT_EXT;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
/* only handle supported aspect override */
|
||||
if (aspect != pSubresource->aspectMask) {
|
||||
local_subresource = *pSubresource;
|
||||
local_subresource.aspectMask = aspect;
|
||||
pSubresource = &local_subresource;
|
||||
}
|
||||
}
|
||||
|
||||
/* TODO local cache */
|
||||
vn_call_vkGetImageSubresourceLayout(dev->instance, device, image,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue