v3dv: keep track of whether an image may be backed by external memory

Such images will always require dedicated allocations.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11002>
This commit is contained in:
Iago Toral Quiroga
2021-05-26 09:33:12 +02:00
parent d87afc1acc
commit e60b009271
2 changed files with 5 additions and 0 deletions
+4
View File
@@ -296,6 +296,9 @@ v3dv_CreateImage(VkDevice _device,
modifier = DRM_FORMAT_MOD_LINEAR;
}
const VkExternalMemoryImageCreateInfo *external_info =
vk_find_struct_const(pCreateInfo->pNext, EXTERNAL_MEMORY_IMAGE_CREATE_INFO);
/* 1D and 1D_ARRAY textures are always raster-order */
VkImageTiling tiling;
if (pCreateInfo->imageType == VK_IMAGE_TYPE_1D)
@@ -332,6 +335,7 @@ v3dv_CreateImage(VkDevice _device,
image->drm_format_mod = modifier;
image->tiling = tiling;
image->tiled = tiling == VK_IMAGE_TILING_OPTIMAL;
image->external = external_info != NULL;
image->cpp = vk_format_get_blocksize(image->vk_format);
+1
View File
@@ -518,6 +518,7 @@ struct v3dv_image {
uint64_t drm_format_mod;
bool tiled;
bool external;
struct v3d_resource_slice slices[V3D_MAX_MIP_LEVELS];
uint64_t size; /* Total size in bytes */