aboutsummaryrefslogtreecommitdiffstatsci
diff options
context:
space:
mode:
-rw-r--r--src/vkh_device.c6
-rw-r--r--src/vkh_device.h4
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