From 9e016efe62abd37bb16febfde7f5bdc505a4a1e4 Mon Sep 17 00:00:00 2001 From: Courtney Goeltzenleuchter Date: Thu, 9 Jul 2015 21:57:28 -0600 Subject: bug-14184: Transient memory allocations --- loader/table_ops.h | 3 +++ loader/trampoline.c | 9 +++++++++ 2 files changed, 12 insertions(+) (limited to 'loader') diff --git a/loader/table_ops.h b/loader/table_ops.h index 8e8ce9bf..601be425 100644 --- a/loader/table_ops.h +++ b/loader/table_ops.h @@ -49,6 +49,7 @@ static inline void loader_init_device_dispatch_table(VkLayerDispatchTable *table table->UnmapMemory = (PFN_vkUnmapMemory) gpa(dev, "vkUnmapMemory"); table->FlushMappedMemoryRanges = (PFN_vkFlushMappedMemoryRanges) gpa(dev, "vkFlushMappedMemoryRanges"); table->InvalidateMappedMemoryRanges = (PFN_vkInvalidateMappedMemoryRanges) gpa(dev, "vkInvalidateMappedMemoryRanges"); + table->GetDeviceMemoryCommitment = (PFN_vkGetDeviceMemoryCommitment) gpa(dev, "vkGetDeviceMemoryCommitment"); table->GetBufferMemoryRequirements = (PFN_vkGetBufferMemoryRequirements) gpa(dev, "vkGetBufferMemoryRequirements"); table->GetImageMemoryRequirements = (PFN_vkGetImageMemoryRequirements) gpa(dev, "vkGetImageMemoryRequirements"); table->BindBufferMemory = (PFN_vkBindBufferMemory) gpa(dev, "vkBindBufferMemory"); @@ -208,6 +209,8 @@ static inline void *loader_lookup_device_dispatch_table( return (void *) table->FlushMappedMemoryRanges; if (!strcmp(name, "InvalidateMappedMemoryRanges")) return (void *) table->InvalidateMappedMemoryRanges; + if (!strcmp(name, "GetDeviceMemoryCommitment")) + return (void *) table->GetDeviceMemoryCommitment; if (!strcmp(name, "GetBufferMemoryRequirements")) return (void *) table->GetBufferMemoryRequirements; if (!strcmp(name, "GetImageMemoryRequirements")) diff --git a/loader/trampoline.c b/loader/trampoline.c index 13d4e680..0e102741 100644 --- a/loader/trampoline.c +++ b/loader/trampoline.c @@ -420,6 +420,15 @@ LOADER_EXPORT VkResult VKAPI vkInvalidateMappedMemoryRanges(VkDevice device, uin return disp->InvalidateMappedMemoryRanges(device, memRangeCount, pMemRanges); } +LOADER_EXPORT VkResult VKAPI vkGetDeviceMemoryCommitment(VkDevice device, VkDeviceMemory memory, VkDeviceSize* pCommittedMemoryInBytes) +{ + const VkLayerDispatchTable *disp; + + disp = loader_get_dispatch(device); + + return disp->GetDeviceMemoryCommitment(device, memory, pCommittedMemoryInBytes); +} + LOADER_EXPORT VkResult VKAPI vkGetBufferMemoryRequirements(VkDevice device, VkBuffer buffer, VkMemoryRequirements* pMemoryRequirements) { const VkLayerDispatchTable *disp; -- cgit v1.2.3