Corrected procedure to collect proper size of image from VkImageCreateInfo (#2289)

Fixes #2155 according to issue description

Additional remark: The image size was previously calculated based on the
memory size, which seems unusual. Due to Vulkan's configuration
capabilities, the size of memory allocated for a specific texture may
differ from what would be expected based on the texture dimensions.
Thus, calculating the image dimensions back from the memory size of a
Vulkan texture can be challenging.
This commit is contained in:
Marcin Hajder
2025-05-27 19:17:14 +02:00
committed by GitHub
parent 3ab4d8aab2
commit f30a191978
7 changed files with 128 additions and 84 deletions

View File

@@ -71,8 +71,10 @@ extern pfnclEnqueueReleaseExternalMemObjectsKHR
extern pfnclReleaseSemaphoreKHR clReleaseSemaphoreKHRptr;
extern pfnclReImportSemaphoreSyncFdKHR pfnclReImportSemaphoreSyncFdKHRptr;
cl_int getCLImageInfoFromVkImageInfo(const VkImageCreateInfo *, size_t,
cl_image_format *, cl_image_desc *);
cl_int
getCLImageInfoFromVkImageInfo(const cl_device_id, const VkImageCreateInfo *,
cl_image_format *, cl_image_desc *,
const VkSubresourceLayout *layout = nullptr);
cl_int check_external_memory_handle_type(
cl_device_id deviceID,
cl_external_memory_handle_type_khr requiredHandleType);