diff options
| author | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2026-10-22 00:36:55 +0200 |
|---|---|---|
| committer | Jean-Philippe Bruyère <jp_bruyere@hotmail.com> | 2026-10-22 00:36:55 +0200 |
| commit | c5b7f0e6000fd61a920a69d4983624ae105a644b (patch) | |
| tree | 3e4948953b442f8c2da393c74789f3f4cb7b1685 | |
| parent | 5ca4e5debfa35aeaf9fc1688890c238e40d72475 (diff) | |
don't recreate allocattor on dev import if exists
| -rw-r--r-- | src/vkh_device.c | 6 | ||||
| -rw-r--r-- | src/vkh_device.h | 4 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/vkh_device.c b/src/vkh_device.c index 8849a55..8659ef3 100644 --- a/src/vkh_device.c +++ b/src/vkh_device.c @@ -48,8 +48,10 @@ VkhDevice vkh_device_import(VkInstance inst, VkPhysicalDevice phy, VkDevice vkDe vkGetPhysicalDeviceMemoryProperties(phy, &dev->phyMemProps); #ifdef VKH_USE_VMA - VmaAllocatorCreateInfo allocatorInfo = {.physicalDevice = phy, .device = vkDev}; - vmaCreateAllocator(&allocatorInfo, &dev->allocator); + if (!dev->allocator) { + VmaAllocatorCreateInfo allocatorInfo = {.physicalDevice = phy, .device = vkDev}; + vmaCreateAllocator(&allocatorInfo, &dev->allocator); + } #else #endif diff --git a/src/vkh_device.h b/src/vkh_device.h index 16c449a..1340bdf 100644 --- a/src/vkh_device.h +++ b/src/vkh_device.h @@ -33,15 +33,15 @@ extern "C" { #endif typedef struct _vkh_device_t { + VkResult status; VkDevice dev; - VkPhysicalDeviceMemoryProperties phyMemProps; VkPhysicalDevice phy; VkInstance instance; + VkPhysicalDeviceMemoryProperties phyMemProps; #ifdef VKH_USE_VMA VmaAllocator allocator; #endif VkhApp vkhApplication; - VkResult status; } vkh_device_t; #ifdef __cplusplus |