libktx Reference 4.3.2
Libraries and tools to create and read KTX image texture files.
Loading...
Searching...
No Matches
Vulkan Texture Image Loader

Create texture images on a Vulkan device. More...

Functions

ktxVulkanDeviceInfoktxVulkanDeviceInfo_Create (VkPhysicalDevice physicalDevice, VkDevice device, VkQueue queue, VkCommandPool cmdPool, const VkAllocationCallbacks *pAllocator)
 Create a ktxVulkanDeviceInfo object.
 
ktxVulkanDeviceInfoktxVulkanDeviceInfo_CreateEx (VkInstance instance, VkPhysicalDevice physicalDevice, VkDevice device, VkQueue queue, VkCommandPool cmdPool, const VkAllocationCallbacks *pAllocator, const ktxVulkanFunctions *pFuncs)
 Create a ktxVulkanDeviceInfo object.
 
KTX_error_code ktxVulkanDeviceInfo_Construct (ktxVulkanDeviceInfo *This, VkPhysicalDevice physicalDevice, VkDevice device, VkQueue queue, VkCommandPool cmdPool, const VkAllocationCallbacks *pAllocator)
 Construct a ktxVulkanDeviceInfo object.
 
KTX_error_code ktxVulkanDeviceInfo_ConstructEx (ktxVulkanDeviceInfo *This, VkInstance instance, VkPhysicalDevice physicalDevice, VkDevice device, VkQueue queue, VkCommandPool cmdPool, const VkAllocationCallbacks *pAllocator, const ktxVulkanFunctions *pFunctions)
 
void ktxVulkanDeviceInfo_Destruct (ktxVulkanDeviceInfo *This)
 Destruct a ktxVulkanDeviceInfo object.
 
void ktxVulkanDeviceInfo_Destroy (ktxVulkanDeviceInfo *This)
 Destroy a ktxVulkanDeviceInfo object.
 
KTX_error_code ktxTexture_VkUploadEx_WithSuballocator (ktxTexture *This, ktxVulkanDeviceInfo *vdi, ktxVulkanTexture *vkTexture, VkImageTiling tiling, VkImageUsageFlags usageFlags, VkImageLayout finalLayout, ktxVulkanTexture_subAllocatorCallbacks *subAllocatorCallbacks)
 Create a Vulkan image object from a ktxTexture object.
 
KTX_error_code ktxTexture_VkUploadEx (ktxTexture *This, ktxVulkanDeviceInfo *vdi, ktxVulkanTexture *vkTexture, VkImageTiling tiling, VkImageUsageFlags usageFlags, VkImageLayout finalLayout)
 Create a Vulkan image object from a ktxTexture object.
 
KTX_error_code ktxTexture_VkUpload (ktxTexture *texture, ktxVulkanDeviceInfo *vdi, ktxVulkanTexture *vkTexture)
 Create a Vulkan image object from a ktxTexture object.
 
KTX_error_code ktxTexture1_VkUploadEx_WithSuballocator (ktxTexture1 *This, ktxVulkanDeviceInfo *vdi, ktxVulkanTexture *vkTexture, VkImageTiling tiling, VkImageUsageFlags usageFlags, VkImageLayout finalLayout, ktxVulkanTexture_subAllocatorCallbacks *subAllocatorCallbacks)
 Create a Vulkan image object from a ktxTexture1 object.
 
KTX_error_code ktxTexture1_VkUploadEx (ktxTexture1 *This, ktxVulkanDeviceInfo *vdi, ktxVulkanTexture *vkTexture, VkImageTiling tiling, VkImageUsageFlags usageFlags, VkImageLayout finalLayout)
 Create a Vulkan image object from a ktxTexture1 object.
 
KTX_error_code ktxTexture1_VkUpload (ktxTexture1 *texture, ktxVulkanDeviceInfo *vdi, ktxVulkanTexture *vkTexture)
 Create a Vulkan image object from a ktxTexture1 object.
 
KTX_error_code ktxTexture2_VkUploadEx_WithSuballocator (ktxTexture2 *This, ktxVulkanDeviceInfo *vdi, ktxVulkanTexture *vkTexture, VkImageTiling tiling, VkImageUsageFlags usageFlags, VkImageLayout finalLayout, ktxVulkanTexture_subAllocatorCallbacks *subAllocatorCallbacks)
 Create a Vulkan image object from a ktxTexture2 object.
 
KTX_error_code ktxTexture2_VkUploadEx (ktxTexture2 *This, ktxVulkanDeviceInfo *vdi, ktxVulkanTexture *vkTexture, VkImageTiling tiling, VkImageUsageFlags usageFlags, VkImageLayout finalLayout)
 Create a Vulkan image object from a ktxTexture2 object.
 
KTX_error_code ktxTexture2_VkUpload (ktxTexture2 *This, ktxVulkanDeviceInfo *vdi, ktxVulkanTexture *vkTexture)
 Create a Vulkan image object from a ktxTexture2 object.
 
VkFormat ktxTexture1_GetVkFormat (ktxTexture1 *This)
 Return the VkFormat enum of a ktxTexture1 object.
 
VkFormat ktxTexture2_GetVkFormat (ktxTexture2 *This)
 Return the VkFormat enum of a ktxTexture2 object.
 
VkFormat ktxTexture_GetVkFormat (ktxTexture *This)
 Return the VkFormat enum of a ktxTexture object.
 
ktx_error_code_e ktxVulkanTexture_Destruct_WithSuballocator (ktxVulkanTexture *vkTexture, VkDevice device, const VkAllocationCallbacks *pAllocator, ktxVulkanTexture_subAllocatorCallbacks *subAllocatorCallbacks)
 Destructor for the object returned when loading a texture image.
 
void ktxVulkanTexture_Destruct (ktxVulkanTexture *vkTexture, VkDevice device, const VkAllocationCallbacks *pAllocator)
 Destructor for the object returned when loading a texture image.
 

Detailed Description

Create texture images on a Vulkan device.

Function Documentation

◆ ktxTexture1_GetVkFormat()

VkFormat ktxTexture1_GetVkFormat ( ktxTexture1 This)

Return the VkFormat enum of a ktxTexture1 object.

Returns
The VkFormat of the texture object. May return VK_FORMAT_UNDEFINED if there is no mapping from the GL internalformat and format.

◆ ktxTexture1_VkUpload()

KTX_error_code ktxTexture1_VkUpload ( ktxTexture1 texture,
ktxVulkanDeviceInfo vdi,
ktxVulkanTexture vkTexture 
)

Create a Vulkan image object from a ktxTexture1 object.

Calls ktxTexture_VkUploadEx() with the most commonly used options: VK_IMAGE_TILING_OPTIMAL, VK_IMAGE_USAGE_SAMPLED_BIT and VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL. Use that for complete control.

◆ ktxTexture1_VkUploadEx()

KTX_error_code ktxTexture1_VkUploadEx ( ktxTexture1 This,
ktxVulkanDeviceInfo vdi,
ktxVulkanTexture vkTexture,
VkImageTiling  tiling,
VkImageUsageFlags  usageFlags,
VkImageLayout  finalLayout 
)

Create a Vulkan image object from a ktxTexture1 object.

Calls ktxTexture_VkUploadEx_WithSuballocator() with no supplied suballocator callbacks. Use that for complete control.

◆ ktxTexture1_VkUploadEx_WithSuballocator()

KTX_error_code ktxTexture1_VkUploadEx_WithSuballocator ( ktxTexture1 This,
ktxVulkanDeviceInfo vdi,
ktxVulkanTexture vkTexture,
VkImageTiling  tiling,
VkImageUsageFlags  usageFlags,
VkImageLayout  finalLayout,
ktxVulkanTexture_subAllocatorCallbacks subAllocatorCallbacks 
)

Create a Vulkan image object from a ktxTexture1 object.

This simply calls ktxTexture_VkUploadEx_WithSuballocator()

Creates a VkImage with VkFormat etc. matching the KTX data and uploads the images. Mipmaps will be generated if the ktxTexture's generateMipmaps flag is set. Returns the handles of the created objects and information about the texture in the ktxVulkanTexture pointed at by vkTexture.

The created VkImage will have VK_SHARING_MODE_EXCLUSIVE set thus the resulting image will be usable only with queues of the same family as the queue in the ktxVulkanDeviceInfo pointed to by vdi.

usageFlags and thus acceptable usage of the created image may be augmented as follows:

  • with VK_IMAGE_USAGE_TRANSFER_DST_BIT if tiling is VK_IMAGE_TILING_OPTIMAL
  • with VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT if generateMipmaps is set in the ktxTexture.

Most Vulkan implementations support VK_IMAGE_TILING_LINEAR only for a very limited number of formats and features. Generally VK_IMAGE_TILING_OPTIMAL is preferred. The latter requires a staging buffer so will use more memory during loading.

If a pointer to a set of suballocator callbacks is provided, they will be used instead of manual allocation of VkDeviceMemory. A 64 bit uint that references the suballocated page(s) is returned on memory procurement and saved in the allocationId field of the structure pointed to by vkTexture.

Parameters
[in]Thispointer to the ktxTexture from which to upload.
[in]vdipointer to a ktxVulkanDeviceInfo structure providing information about the Vulkan device onto which to load the texture.
[in,out]vkTexturepointer to a ktxVulkanTexture structure into which the function writes information about the created VkImage.
[in]tilingtype of tiling to use in the destination image on the Vulkan device.
[in]usageFlagsa set of VkImageUsageFlags bits indicating the intended usage of the destination image.
[in]finalLayouta VkImageLayout value indicating the desired final layout of the created image.
[in]subAllocatorCallbackspointer to a set of suballocator callbacks that wrap around suballocator calls: alloc, bindbuffer, bindimage, map, unmap and free. They use a uint64_t stored in the allocationId field of the structure pointed at by vkTexture to reference allocated page(s).
Returns
KTX_SUCCESS on success, other KTX_* enum values on error.
Exceptions
KTX_INVALID_VALUEAn incomplete set of callbacks are provided in subAllocatorCallbacks.
KTX_INVALID_VALUEThis, vdi or vkTexture is NULL.
KTX_INVALID_OPERATIONThe ktxTexture contains neither images nor an active stream from which to read them.
KTX_INVALID_OPERATIONThe combination of the ktxTexture's format, tiling and usageFlags is not supported by the physical device.
KTX_INVALID_OPERATIONRequested mipmap generation is not supported by the physical device for the combination of the ktxTexture's format and tiling.
KTX_INVALID_OPERATIONNumber of mip levels or array layers exceeds the maximums supported for the ktxTexture's format and tiling.
KTX_OUT_OF_MEMORYSufficient memory could not be allocated on either the CPU or the Vulkan device.
KTX_UNSUPPORTED_FEATUREAttempting to sparsely bind KTX textures for the time being will report this error.
See also
ktxVulkanDeviceInfo_Construct()

◆ ktxTexture2_GetVkFormat()

VkFormat ktxTexture2_GetVkFormat ( ktxTexture2 This)

Return the VkFormat enum of a ktxTexture2 object.

Returns
The VkFormat of the texture object.

◆ ktxTexture2_VkUpload()

KTX_error_code ktxTexture2_VkUpload ( ktxTexture2 This,
ktxVulkanDeviceInfo vdi,
ktxVulkanTexture vkTexture 
)

Create a Vulkan image object from a ktxTexture2 object.

Calls ktxTexture_VkUploadEx() with the most commonly used options: VK_IMAGE_TILING_OPTIMAL, VK_IMAGE_USAGE_SAMPLED_BIT and VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL. Use that for complete control.

◆ ktxTexture2_VkUploadEx()

KTX_error_code ktxTexture2_VkUploadEx ( ktxTexture2 This,
ktxVulkanDeviceInfo vdi,
ktxVulkanTexture vkTexture,
VkImageTiling  tiling,
VkImageUsageFlags  usageFlags,
VkImageLayout  finalLayout 
)

Create a Vulkan image object from a ktxTexture2 object.

This simply calls ktxTexture_VkUploadEx().

Calls ktxTexture_VkUploadEx_WithSuballocator() with no supplied suballocator callbacks. Use that for complete control.

◆ ktxTexture2_VkUploadEx_WithSuballocator()

KTX_error_code ktxTexture2_VkUploadEx_WithSuballocator ( ktxTexture2 This,
ktxVulkanDeviceInfo vdi,
ktxVulkanTexture vkTexture,
VkImageTiling  tiling,
VkImageUsageFlags  usageFlags,
VkImageLayout  finalLayout,
ktxVulkanTexture_subAllocatorCallbacks subAllocatorCallbacks 
)

Create a Vulkan image object from a ktxTexture2 object.

This simplly calls ktxTexture_VkUploadEx_WithSuballocator().

Creates a VkImage with VkFormat etc. matching the KTX data and uploads the images. Mipmaps will be generated if the ktxTexture's generateMipmaps flag is set. Returns the handles of the created objects and information about the texture in the ktxVulkanTexture pointed at by vkTexture.

The created VkImage will have VK_SHARING_MODE_EXCLUSIVE set thus the resulting image will be usable only with queues of the same family as the queue in the ktxVulkanDeviceInfo pointed to by vdi.

usageFlags and thus acceptable usage of the created image may be augmented as follows:

  • with VK_IMAGE_USAGE_TRANSFER_DST_BIT if tiling is VK_IMAGE_TILING_OPTIMAL
  • with VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT if generateMipmaps is set in the ktxTexture.

Most Vulkan implementations support VK_IMAGE_TILING_LINEAR only for a very limited number of formats and features. Generally VK_IMAGE_TILING_OPTIMAL is preferred. The latter requires a staging buffer so will use more memory during loading.

If a pointer to a set of suballocator callbacks is provided, they will be used instead of manual allocation of VkDeviceMemory. A 64 bit uint that references the suballocated page(s) is returned on memory procurement and saved in the allocationId field of the structure pointed to by vkTexture.

Parameters
[in]Thispointer to the ktxTexture from which to upload.
[in]vdipointer to a ktxVulkanDeviceInfo structure providing information about the Vulkan device onto which to load the texture.
[in,out]vkTexturepointer to a ktxVulkanTexture structure into which the function writes information about the created VkImage.
[in]tilingtype of tiling to use in the destination image on the Vulkan device.
[in]usageFlagsa set of VkImageUsageFlags bits indicating the intended usage of the destination image.
[in]finalLayouta VkImageLayout value indicating the desired final layout of the created image.
[in]subAllocatorCallbackspointer to a set of suballocator callbacks that wrap around suballocator calls: alloc, bindbuffer, bindimage, map, unmap and free. They use a uint64_t stored in the allocationId field of the structure pointed at by vkTexture to reference allocated page(s).
Returns
KTX_SUCCESS on success, other KTX_* enum values on error.
Exceptions
KTX_INVALID_VALUEAn incomplete set of callbacks are provided in subAllocatorCallbacks.
KTX_INVALID_VALUEThis, vdi or vkTexture is NULL.
KTX_INVALID_OPERATIONThe ktxTexture contains neither images nor an active stream from which to read them.
KTX_INVALID_OPERATIONThe combination of the ktxTexture's format, tiling and usageFlags is not supported by the physical device.
KTX_INVALID_OPERATIONRequested mipmap generation is not supported by the physical device for the combination of the ktxTexture's format and tiling.
KTX_INVALID_OPERATIONNumber of mip levels or array layers exceeds the maximums supported for the ktxTexture's format and tiling.
KTX_OUT_OF_MEMORYSufficient memory could not be allocated on either the CPU or the Vulkan device.
KTX_UNSUPPORTED_FEATUREAttempting to sparsely bind KTX textures for the time being will report this error.
See also
ktxVulkanDeviceInfo_Construct()

◆ ktxTexture_GetVkFormat()

VkFormat ktxTexture_GetVkFormat ( ktxTexture This)

Return the VkFormat enum of a ktxTexture object.

In ordert to ensure that the Vulkan uploader is not linked into an application unless explicitly called, this is not a virtual function. It determines the texture type then dispatches to the correct function.

See also
ktxTexture1_GetVkFormat()
ktxTexture2_GetVkFormat()

◆ ktxTexture_VkUpload()

KTX_error_code ktxTexture_VkUpload ( ktxTexture texture,
ktxVulkanDeviceInfo vdi,
ktxVulkanTexture vkTexture 
)

Create a Vulkan image object from a ktxTexture object.

Calls ktxTexture_VkUploadEx() with the most commonly used options: VK_IMAGE_TILING_OPTIMAL, VK_IMAGE_USAGE_SAMPLED_BIT and VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL. Use that for complete control.

◆ ktxTexture_VkUploadEx()

KTX_error_code ktxTexture_VkUploadEx ( ktxTexture This,
ktxVulkanDeviceInfo vdi,
ktxVulkanTexture vkTexture,
VkImageTiling  tiling,
VkImageUsageFlags  usageFlags,
VkImageLayout  finalLayout 
)

Create a Vulkan image object from a ktxTexture object.

Calls ktxTexture_VkUploadEx_WithSuballocator() with no supplied suballocator callbacks. Use that for complete control.

◆ ktxTexture_VkUploadEx_WithSuballocator()

KTX_error_code ktxTexture_VkUploadEx_WithSuballocator ( ktxTexture This,
ktxVulkanDeviceInfo vdi,
ktxVulkanTexture vkTexture,
VkImageTiling  tiling,
VkImageUsageFlags  usageFlags,
VkImageLayout  finalLayout,
ktxVulkanTexture_subAllocatorCallbacks subAllocatorCallbacks 
)

Create a Vulkan image object from a ktxTexture object.

Creates a VkImage with VkFormat etc. matching the KTX data and uploads the images. Mipmaps will be generated if the ktxTexture's generateMipmaps flag is set. Returns the handles of the created objects and information about the texture in the ktxVulkanTexture pointed at by vkTexture.

The created VkImage will have VK_SHARING_MODE_EXCLUSIVE set thus the resulting image will be usable only with queues of the same family as the queue in the ktxVulkanDeviceInfo pointed to by vdi.

usageFlags and thus acceptable usage of the created image may be augmented as follows:

  • with VK_IMAGE_USAGE_TRANSFER_DST_BIT if tiling is VK_IMAGE_TILING_OPTIMAL
  • with VK_IMAGE_USAGE_TRANSFER_DST_BIT | VK_IMAGE_USAGE_TRANSFER_SRC_BIT if generateMipmaps is set in the ktxTexture.

Most Vulkan implementations support VK_IMAGE_TILING_LINEAR only for a very limited number of formats and features. Generally VK_IMAGE_TILING_OPTIMAL is preferred. The latter requires a staging buffer so will use more memory during loading.

If a pointer to a set of suballocator callbacks is provided, they will be used instead of manual allocation of VkDeviceMemory. A 64 bit uint that references the suballocated page(s) is returned on memory procurement and saved in the allocationId field of the structure pointed to by vkTexture.

Parameters
[in]Thispointer to the ktxTexture from which to upload.
[in]vdipointer to a ktxVulkanDeviceInfo structure providing information about the Vulkan device onto which to load the texture.
[in,out]vkTexturepointer to a ktxVulkanTexture structure into which the function writes information about the created VkImage.
[in]tilingtype of tiling to use in the destination image on the Vulkan device.
[in]usageFlagsa set of VkImageUsageFlags bits indicating the intended usage of the destination image.
[in]finalLayouta VkImageLayout value indicating the desired final layout of the created image.
[in]subAllocatorCallbackspointer to a set of suballocator callbacks that wrap around suballocator calls: alloc, bindbuffer, bindimage, map, unmap and free. They use a uint64_t stored in the allocationId field of the structure pointed at by vkTexture to reference allocated page(s).
Returns
KTX_SUCCESS on success, other KTX_* enum values on error.
Exceptions
KTX_INVALID_VALUEAn incomplete set of callbacks are provided in subAllocatorCallbacks.
KTX_INVALID_VALUEThis, vdi or vkTexture is NULL.
KTX_INVALID_OPERATIONThe ktxTexture contains neither images nor an active stream from which to read them.
KTX_INVALID_OPERATIONThe combination of the ktxTexture's format, tiling and usageFlags is not supported by the physical device.
KTX_INVALID_OPERATIONRequested mipmap generation is not supported by the physical device for the combination of the ktxTexture's format and tiling.
KTX_INVALID_OPERATIONNumber of mip levels or array layers exceeds the maximums supported for the ktxTexture's format and tiling.
KTX_OUT_OF_MEMORYSufficient memory could not be allocated on either the CPU or the Vulkan device.
KTX_UNSUPPORTED_FEATUREAttempting to sparsely bind KTX textures for the time being will report this error.
See also
ktxVulkanDeviceInfo_Construct()

◆ ktxVulkanDeviceInfo_Construct()

KTX_error_code ktxVulkanDeviceInfo_Construct ( ktxVulkanDeviceInfo This,
VkPhysicalDevice  physicalDevice,
VkDevice  device,
VkQueue  queue,
VkCommandPool  cmdPool,
const VkAllocationCallbacks *  pAllocator 
)

Construct a ktxVulkanDeviceInfo object.

Records the device information, allocates a command buffer that will be used to transfer image data to the Vulkan device and retrieves the physical device memory properties for ease of use when allocating device memory for the images.

If VK_IMAGE_TILING_OPTIMAL will be passed to ktxTexture_VkUploadEx(), the family of the queue parameter must support transfers. This is true if any of VK_QUEUE_GRAPHICS_BIT, VK_QUEUE_COMPUTE_BIT or VK_QUEUE_TRANSFER_BIT is set in the queueFlags property of the queue's VkQueueFamilyProperties. If protected memory is being used, i.e queueFlags has the VK_QUEUE_PROTECTED_BIT set, then VK_IMAGE_TILING_OPTIMAL must be passed to ktxTexture_VkUploadEx().

VkImages created in ktxTexture_VkUploadEx() will have VK_SHARING_MODE_EXCLUSIVE set. Thus the resulting image will be usable only with queues of the same family as queue.

Pass a valid ktxVulkanDeviceInfo* to any Vulkan KTX image loading function to provide it with the information.

Returns
KTX_SUCCESS on success, other KTX_* enum values on error.
Exceptions
KTX_NOT_FOUNDA dynamically loaded Vulkan function required by the loader was not found.
KTX_OUT_OF_MEMORYA command buffer could not be allocated.
See also
ktxVulkanDeviceInfo_Destruct()
Parameters
Thispointer to the ktxVulkanDeviceInfo object to initialize.
physicalDevicehandle of the Vulkan physical device.
devicehandle of the Vulkan logical device.
queuehandle of the Vulkan queue.
cmdPoolhandle of the Vulkan command pool.
pAllocatorpointer to the allocator to use for the image memory. If NULL, the default allocator will be used.

◆ ktxVulkanDeviceInfo_ConstructEx()

KTX_error_code ktxVulkanDeviceInfo_ConstructEx ( ktxVulkanDeviceInfo This,
VkInstance  instance,
VkPhysicalDevice  physicalDevice,
VkDevice  device,
VkQueue  queue,
VkCommandPool  cmdPool,
const VkAllocationCallbacks *  pAllocator,
const ktxVulkanFunctions pFunctions 
)

Construct a ktxVulkanDeviceInfo object.

Records the device information, allocates a command buffer that will be used to transfer image data to the Vulkan device and retrieves the physical device memory properties for ease of use when allocating device memory for the images.

If VK_IMAGE_TILING_OPTIMAL will be passed to ktxTexture_VkUploadEx(), the family of the queue parameter must support transfers. This is true if any of VK_QUEUE_GRAPHICS_BIT, VK_QUEUE_COMPUTE_BIT or VK_QUEUE_TRANSFER_BIT is set in the queueFlags property of the queue's VkQueueFamilyProperties. If protected memory is being used, i.e queueFlags has the VK_QUEUE_PROTECTED_BIT set, then VK_IMAGE_TILING_OPTIMAL must be passed to ktxTexture_VkUploadEx().

VkImages created in ktxTexture_VkUploadEx() will have VK_SHARING_MODE_EXCLUSIVE set. Thus the resulting image will be usable only with queues of the same family as queue.

Pass a valid ktxVulkanDeviceInfo* to any Vulkan KTX image loading function to provide it with the information.

Returns
KTX_SUCCESS on success, other KTX_* enum values on error.
Exceptions
KTX_NOT_FOUNDA dynamically loaded Vulkan function required by the loader was not found.
KTX_OUT_OF_MEMORYA command buffer could not be allocated.
See also
ktxVulkanDeviceInfo_Destruct()
Parameters
Thispointer to the ktxVulkanDeviceInfo object to initialize.
physicalDevicehandle of the Vulkan physical device.
devicehandle of the Vulkan logical device.
queuehandle of the Vulkan queue.
cmdPoolhandle of the Vulkan command pool.
pAllocatorpointer to the allocator to use for the image memory. If NULL, the default allocator will be used.
instancehandle of the Vulkan instance. If VK_NULL_HANDLE, which is not recommended, the function will attempt to initialize the instance-level functions via the platform's standard dynamic library symbol loading mechanisms.
pFunctionspointer to the struct of functions to use for vulkan operations. Can be NULL in which case the function will retrieve the proc addresses itself.

◆ ktxVulkanDeviceInfo_Create()

ktxVulkanDeviceInfo * ktxVulkanDeviceInfo_Create ( VkPhysicalDevice  physicalDevice,
VkDevice  device,
VkQueue  queue,
VkCommandPool  cmdPool,
const VkAllocationCallbacks *  pAllocator 
)

Create a ktxVulkanDeviceInfo object.

Allocates CPU memory for a ktxVulkanDeviceInfo object then calls ktxVulkanDeviceInfo_Construct(). See it for documentation of the parameters.

Returns
a pointer to the constructed ktxVulkanDeviceInfo.
See also
ktxVulkanDeviceInfo_Construct()
ktxVulkanDeviceInfo_Destroy()

◆ ktxVulkanDeviceInfo_CreateEx()

ktxVulkanDeviceInfo * ktxVulkanDeviceInfo_CreateEx ( VkInstance  instance,
VkPhysicalDevice  physicalDevice,
VkDevice  device,
VkQueue  queue,
VkCommandPool  cmdPool,
const VkAllocationCallbacks *  pAllocator,
const ktxVulkanFunctions pFuncs 
)

Create a ktxVulkanDeviceInfo object.

Allocates CPU memory for a ktxVulkanDeviceInfo object then calls ktxVulkanDeviceInfo_Construct(). See it for documentation of the parameters.

Returns
a pointer to the constructed ktxVulkanDeviceInfo.
See also
ktxVulkanDeviceInfo_Construct()
ktxVulkanDeviceInfo_Destroy()

◆ ktxVulkanDeviceInfo_Destroy()

void ktxVulkanDeviceInfo_Destroy ( ktxVulkanDeviceInfo This)

Destroy a ktxVulkanDeviceInfo object.

Calls ktxVulkanDeviceInfo_Destruct() then frees the ktxVulkanDeviceInfo.

Parameters
Thispointer to the ktxVulkanDeviceInfo to destroy.

◆ ktxVulkanDeviceInfo_Destruct()

void ktxVulkanDeviceInfo_Destruct ( ktxVulkanDeviceInfo This)

Destruct a ktxVulkanDeviceInfo object.

Frees the command buffer.

Parameters
Thispointer to the ktxVulkanDeviceInfo to destruct.

◆ ktxVulkanTexture_Destruct()

void ktxVulkanTexture_Destruct ( ktxVulkanTexture vkTexture,
VkDevice  device,
const VkAllocationCallbacks *  pAllocator 
)

Destructor for the object returned when loading a texture image.

Calls ktxVulkanTexture_Destruct_WithSuballocator() without a set of suballocator callbacks.

See also
ktxVulkanTexture_Destruct_WithSuballocator() for details and use that for complete control.

◆ ktxVulkanTexture_Destruct_WithSuballocator()

ktx_error_code_e ktxVulkanTexture_Destruct_WithSuballocator ( ktxVulkanTexture vkTexture,
VkDevice  device,
const VkAllocationCallbacks *  pAllocator,
ktxVulkanTexture_subAllocatorCallbacks subAllocatorCallbacks 
)

Destructor for the object returned when loading a texture image.

Frees the Vulkan resources created when the texture image was loaded. If a complete set of suballocator callbacks are provided, it will use the free call from those instead.

Parameters
vkTexturepointer to the ktxVulkanTexture to be destructed.
devicehandle to the Vulkan logical device to which the texture was loaded.
pAllocatorpointer to the allocator used during loading.
subAllocatorCallbackspointer to a structure of suballocator callbacks. Pass NULL if a suballocator was not used.
Returns
KTX_SUCCESS on success, KTX_INVALID_VALUE if the supplied subAllocatorCallbacks structure is incomplete.