Skip to content

Commit

Permalink
Reducing API surface area without impacting flexibility or functional…
Browse files Browse the repository at this point in the history
…ity.
  • Loading branch information
toomuchvoltage committed Aug 24, 2023
1 parent 398d489 commit f683e4a
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 172 deletions.
31 changes: 12 additions & 19 deletions include/ktxvulkan.h
Original file line number Diff line number Diff line change
Expand Up @@ -134,15 +134,19 @@ typedef VkResult(*subAllocatorBindImageFuncPtr)(VkImage image, uint64_t allocId)
typedef VkResult(*subAllocatorMemoryMapFuncPtr)(uint64_t allocId, VkDeviceSize offsetFromOffset, VkDeviceSize len, void** dataPtr);
typedef void (*subAllocatorMemoryUnmapFuncPtr)(uint64_t allocId);
typedef void (*subAllocatorFreeMemFuncPtr)(uint64_t allocId);

KTX_API void KTX_APIENTRY
ktxVulkanTexture_Destruct_WithPotentialSuballocator(ktxVulkanTexture* This, VkDevice device,
const VkAllocationCallbacks* pAllocator,
subAllocatorFreeMemFuncPtr freeMemFuncPtr);
typedef struct {
subAllocatorAllocMemFuncPtr allocMemFuncPtr;
subAllocatorBindBufferFuncPtr bindBufferFuncPtr;
subAllocatorBindImageFuncPtr bindImageFuncPtr;
subAllocatorMemoryMapFuncPtr memoryMapFuncPtr;
subAllocatorMemoryUnmapFuncPtr memoryUnmapFuncPtr;
subAllocatorFreeMemFuncPtr freeMemFuncPtr;
} subAllocatorCallbacks;

KTX_API void KTX_APIENTRY
ktxVulkanTexture_Destruct(ktxVulkanTexture* This, VkDevice device,
const VkAllocationCallbacks* pAllocator);
const VkAllocationCallbacks* pAllocator,
subAllocatorCallbacks* subAllocatorCallbacks);



Expand Down Expand Up @@ -222,23 +226,12 @@ ktxVulkanDeviceInfo_Destruct(ktxVulkanDeviceInfo* This);
KTX_API void KTX_APIENTRY
ktxVulkanDeviceInfo_Destroy(ktxVulkanDeviceInfo* This);
KTX_API KTX_error_code KTX_APIENTRY
ktxTexture_VkUploadEx_WithPotentialSuballocator(ktxTexture* This, ktxVulkanDeviceInfo* vdi,
ktxVulkanTexture* vkTexture,
VkImageTiling tiling,
VkImageUsageFlags usageFlags,
VkImageLayout finalLayout,
subAllocatorAllocMemFuncPtr allocMemFuncPtr,
subAllocatorBindBufferFuncPtr bindBufferFuncPtr,
subAllocatorBindImageFuncPtr bindImageFuncPtr,
subAllocatorMemoryMapFuncPtr memoryMapFuncPtr,
subAllocatorMemoryUnmapFuncPtr memoryUnmapFuncPtr,
subAllocatorFreeMemFuncPtr freeMemFuncPtr);
KTX_API KTX_error_code KTX_APIENTRY
ktxTexture_VkUploadEx(ktxTexture* This, ktxVulkanDeviceInfo* vdi,
ktxVulkanTexture* vkTexture,
VkImageTiling tiling,
VkImageUsageFlags usageFlags,
VkImageLayout finalLayout);
VkImageLayout finalLayout,
subAllocatorCallbacks* subAllocatorCallbacks);
KTX_API KTX_error_code KTX_APIENTRY
ktxTexture_VkUpload(ktxTexture* texture, ktxVulkanDeviceInfo* vdi,
ktxVulkanTexture *vkTexture);
Expand Down
Loading

0 comments on commit f683e4a

Please sign in to comment.