mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 09:28:07 +02:00
v3dv: fix image tiling configuration
We were not doing this right for images created with VK_IMAGE_TILING_LINEAR. Also, only assign a DRM modifier if the image has been created for WSI. This fixes a bunch of CTS tests that use copies to linear images to verify the result of rendering. Fixes multiple failures in: dEQP-VK.draw.* Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6766>
This commit is contained in:
parent
f986a60451
commit
5ba6fd3447
1 changed files with 10 additions and 7 deletions
|
|
@ -307,15 +307,18 @@ v3dv_CreateImage(VkDevice _device,
|
|||
vk_find_struct_const(pCreateInfo->pNext, WSI_IMAGE_CREATE_INFO_MESA);
|
||||
if (wsi_info)
|
||||
modifier = DRM_FORMAT_MOD_LINEAR;
|
||||
else
|
||||
modifier = DRM_FORMAT_MOD_BROADCOM_UIF;
|
||||
}
|
||||
|
||||
/* 1D and 1D_ARRAY textures are always raster-order */
|
||||
VkImageTiling tiling;
|
||||
if (pCreateInfo->imageType == VK_IMAGE_TYPE_1D)
|
||||
modifier = DRM_FORMAT_MOD_LINEAR;
|
||||
|
||||
assert(modifier != DRM_FORMAT_MOD_INVALID);
|
||||
tiling = VK_IMAGE_TILING_LINEAR;
|
||||
else if (modifier == DRM_FORMAT_MOD_INVALID)
|
||||
tiling = pCreateInfo->tiling;
|
||||
else if (modifier == DRM_FORMAT_MOD_BROADCOM_UIF)
|
||||
tiling = VK_IMAGE_TILING_OPTIMAL;
|
||||
else
|
||||
tiling = VK_IMAGE_TILING_LINEAR;
|
||||
|
||||
const struct v3dv_format *format = v3dv_get_format(pCreateInfo->format);
|
||||
v3dv_assert(format != NULL && format->supported);
|
||||
|
|
@ -335,10 +338,10 @@ v3dv_CreateImage(VkDevice _device,
|
|||
image->samples = pCreateInfo->samples;
|
||||
image->usage = pCreateInfo->usage;
|
||||
image->create_flags = pCreateInfo->flags;
|
||||
image->tiling = pCreateInfo->tiling;
|
||||
|
||||
image->drm_format_mod = modifier;
|
||||
image->tiled = image->drm_format_mod != DRM_FORMAT_MOD_LINEAR;
|
||||
image->tiling = tiling;
|
||||
image->tiled = tiling == VK_IMAGE_TILING_OPTIMAL;
|
||||
|
||||
image->cpp = vk_format_get_blocksize(image->vk_format);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue