diff options
author | Dave Airlie <[email protected]> | 2016-10-14 13:36:45 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2016-10-19 09:05:26 +1000 |
commit | 4450f405195d77f8bcc3fbd3e590405c8f540fab (patch) | |
tree | ec931282a17a12fec97a7d0f4bfe61d49ca7b8b2 /src/amd/vulkan/radv_private.h | |
parent | 1ae6ece9802e77ede97722c0f7cdd0c24e6fbd04 (diff) |
radv: move to using shared vk_alloc inlines.
This moves to the shared vk_alloc inlines for vulkan
memory allocations.
Acked-by: Jason Ekstrand <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_private.h')
-rw-r--r-- | src/amd/vulkan/radv_private.h | 47 |
1 files changed, 2 insertions, 45 deletions
diff --git a/src/amd/vulkan/radv_private.h b/src/amd/vulkan/radv_private.h index 8dddf70b294..3c99bc679a2 100644 --- a/src/amd/vulkan/radv_private.h +++ b/src/amd/vulkan/radv_private.h @@ -47,7 +47,9 @@ #include "compiler/shader_enums.h" #include "util/macros.h" #include "util/list.h" +#include "util/vk_alloc.h" #include "main/macros.h" + #include "radv_radeon_winsys.h" #include "ac_binary.h" #include "ac_nir_to_llvm.h" @@ -240,51 +242,6 @@ void *radv_lookup_entrypoint(const char *name); extern struct radv_dispatch_table dtable; -static inline void * -radv_alloc(const VkAllocationCallbacks *alloc, - size_t size, size_t align, - VkSystemAllocationScope scope) -{ - return alloc->pfnAllocation(alloc->pUserData, size, align, scope); -} - -static inline void * -radv_realloc(const VkAllocationCallbacks *alloc, - void *ptr, size_t size, size_t align, - VkSystemAllocationScope scope) -{ - return alloc->pfnReallocation(alloc->pUserData, ptr, size, align, scope); -} - -static inline void -radv_free(const VkAllocationCallbacks *alloc, void *data) -{ - alloc->pfnFree(alloc->pUserData, data); -} - -static inline void * -radv_alloc2(const VkAllocationCallbacks *parent_alloc, - const VkAllocationCallbacks *alloc, - size_t size, size_t align, - VkSystemAllocationScope scope) -{ - if (alloc) - return radv_alloc(alloc, size, align, scope); - else - return radv_alloc(parent_alloc, size, align, scope); -} - -static inline void -radv_free2(const VkAllocationCallbacks *parent_alloc, - const VkAllocationCallbacks *alloc, - void *data) -{ - if (alloc) - radv_free(alloc, data); - else - radv_free(parent_alloc, data); -} - struct radv_wsi_interaface; #define VK_ICD_WSI_PLATFORM_MAX 5 |