v3dv: create a helper for image creation

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11037>
This commit is contained in:
Iago Toral Quiroga
2021-05-27 10:00:37 +02:00
committed by Marge Bot
parent f07c797e93
commit bf60ba6e7f
+15 -6
View File
@@ -245,13 +245,12 @@ v3dv_layer_offset(const struct v3dv_image *image, uint32_t level, uint32_t layer
return image->mem_offset + slice->offset + layer * image->cube_map_stride;
}
VkResult
v3dv_CreateImage(VkDevice _device,
const VkImageCreateInfo *pCreateInfo,
const VkAllocationCallbacks *pAllocator,
VkImage *pImage)
static VkResult
create_image(struct v3dv_device *device,
const VkImageCreateInfo *pCreateInfo,
const VkAllocationCallbacks *pAllocator,
VkImage *pImage)
{
V3DV_FROM_HANDLE(v3dv_device, device, _device);
struct v3dv_image *image = NULL;
assert(pCreateInfo->sType == VK_STRUCTURE_TYPE_IMAGE_CREATE_INFO);
@@ -346,6 +345,16 @@ v3dv_CreateImage(VkDevice _device,
return VK_SUCCESS;
}
VkResult
v3dv_CreateImage(VkDevice _device,
const VkImageCreateInfo *pCreateInfo,
const VkAllocationCallbacks *pAllocator,
VkImage *pImage)
{
V3DV_FROM_HANDLE(v3dv_device, device, _device);
return create_image(device, pCreateInfo, pAllocator, pImage);
}
void
v3dv_GetImageSubresourceLayout(VkDevice device,
VkImage _image,