summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_private.h
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2016-10-14 13:31:35 +1000
committerDave Airlie <[email protected]>2016-10-19 09:05:26 +1000
commit1ae6ece9802e77ede97722c0f7cdd0c24e6fbd04 (patch)
treea4bd20d4a57a7853616b8696b6dfa47ad200faea /src/intel/vulkan/anv_private.h
parent0cfd428aefe13441e93cc6f57d70f0b282ad2b21 (diff)
anv: move to using vk_alloc helpers.
This moves all the alloc/free in anv to the generic helpers. Acked-by: Jason Ekstrand <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_private.h')
-rw-r--r--src/intel/vulkan/anv_private.h46
1 files changed, 1 insertions, 45 deletions
diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h
index 7efbe01f08f..2e3706906cc 100644
--- a/src/intel/vulkan/anv_private.h
+++ b/src/intel/vulkan/anv_private.h
@@ -47,6 +47,7 @@
#include "util/macros.h"
#include "util/list.h"
#include "util/u_vector.h"
+#include "util/vk_alloc.h"
/* Pre-declarations needed for WSI entrypoints */
struct wl_surface;
@@ -452,51 +453,6 @@ struct anv_bo *anv_scratch_pool_alloc(struct anv_device *device,
extern struct anv_dispatch_table dtable;
-static inline void *
-anv_alloc(const VkAllocationCallbacks *alloc,
- size_t size, size_t align,
- VkSystemAllocationScope scope)
-{
- return alloc->pfnAllocation(alloc->pUserData, size, align, scope);
-}
-
-static inline void *
-anv_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
-anv_free(const VkAllocationCallbacks *alloc, void *data)
-{
- alloc->pfnFree(alloc->pUserData, data);
-}
-
-static inline void *
-anv_alloc2(const VkAllocationCallbacks *parent_alloc,
- const VkAllocationCallbacks *alloc,
- size_t size, size_t align,
- VkSystemAllocationScope scope)
-{
- if (alloc)
- return anv_alloc(alloc, size, align, scope);
- else
- return anv_alloc(parent_alloc, size, align, scope);
-}
-
-static inline void
-anv_free2(const VkAllocationCallbacks *parent_alloc,
- const VkAllocationCallbacks *alloc,
- void *data)
-{
- if (alloc)
- anv_free(alloc, data);
- else
- anv_free(parent_alloc, data);
-}
-
struct anv_wsi_interaface;
#define VK_ICD_WSI_PLATFORM_MAX 5