summaryrefslogtreecommitdiffstats
path: root/src/vulkan
diff options
context:
space:
mode:
Diffstat (limited to 'src/vulkan')
-rw-r--r--src/vulkan/util/vk_alloc.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/vulkan/util/vk_alloc.h b/src/vulkan/util/vk_alloc.h
index 29150218269..f58a80625a8 100644
--- a/src/vulkan/util/vk_alloc.h
+++ b/src/vulkan/util/vk_alloc.h
@@ -37,6 +37,20 @@ vk_alloc(const VkAllocationCallbacks *alloc,
}
static inline void *
+vk_zalloc(const VkAllocationCallbacks *alloc,
+ size_t size, size_t align,
+ VkSystemAllocationScope scope)
+{
+ void *mem = vk_alloc(alloc, size, align, scope);
+ if (mem == NULL)
+ return NULL;
+
+ memset(mem, 0, size);
+
+ return mem;
+}
+
+static inline void *
vk_realloc(const VkAllocationCallbacks *alloc,
void *ptr, size_t size, size_t align,
VkSystemAllocationScope scope)