Flutter Engine
The Flutter Engine
VulkanMemoryAllocatorWrapper.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2018 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
7
8// We use our own functions pointers
9#define VMA_STATIC_VULKAN_FUNCTIONS 0
10#define VMA_DYNAMIC_VULKAN_FUNCTIONS 0
11
12// vma_mem_alloc.h will use VMA_NULLABLE and VMA_NOT_NULL as clang nullability attribtues but does a
13// poor job at using them everywhere. Thus it causes lots of clang compiler warnings. We just
14// disable them here by defining them to be nothing.
15#define VMA_NULLABLE
16#define VMA_NOT_NULL
17
18#define VMA_IMPLEMENTATION
19
20// On windows, vk_mem_alloc.h uses Windows SRWLock, which is normally included by vulkan.h, and so
21// the relevant symbols/defines need to be included here.
22#ifdef _WIN32
23#include <windows.h>
24#endif
25
26// Work around https://github.com/GPUOpen-LibrariesAndSDKs/VulkanMemoryAllocator/issues/312
27// We should be able to remove this when we are able to update to the latest
28// version (as of Oct 2023, blocked on version mismatch in G3)
29#include <cstdio>
30
31#include <vulkan/vulkan_core.h>