Line data Source code
1 : /* Copyright (C) 2023 Wildfire Games.
2 : * This file is part of 0 A.D.
3 : *
4 : * 0 A.D. is free software: you can redistribute it and/or modify
5 : * it under the terms of the GNU General Public License as published by
6 : * the Free Software Foundation, either version 2 of the License, or
7 : * (at your option) any later version.
8 : *
9 : * 0 A.D. is distributed in the hope that it will be useful,
10 : * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 : * GNU General Public License for more details.
13 : *
14 : * You should have received a copy of the GNU General Public License
15 : * along with 0 A.D. If not, see <http://www.gnu.org/licenses/>.
16 : */
17 :
18 : #ifndef INCLUDED_RENDERER_BACKEND_VULKAN_VMA
19 : #define INCLUDED_RENDERER_BACKEND_VULKAN_VMA
20 :
21 : #include "lib/debug.h"
22 : #include "lib/sysdep/os.h"
23 : #include "ps/CLogger.h"
24 :
25 : #include <glad/vulkan.h>
26 : #include <mutex>
27 :
28 : #define VMA_VULKAN_VERSION 1000000
29 : #define VMA_ASSERT(EXPR) ASSERT(EXPR)
30 : #define VMA_HEAVY_ASSERT(EXPR) ENSURE(EXPR)
31 : #define VMA_DYNAMIC_VULKAN_FUNCTIONS 0
32 : #define VMA_STATIC_VULKAN_FUNCTIONS 0
33 : #define VMA_BUFFER_DEVICE_ADDRESS 0
34 :
35 : #ifndef NDEBUG
36 : #define VMA_DEBUG_LOG(...) debug_printf(__VA_ARGS__)
37 : #define VMA_STATS_STRING_ENABLED 1
38 : #else
39 : #define VMA_DEBUG_LOG(...)
40 : #define VMA_STATS_STRING_ENABLED 0
41 : #endif
42 :
43 : #if OS_WIN
44 : // MSVC doesn't enable std::shared_mutex for XP toolkit.
45 : #define VMA_USE_STL_SHARED_MUTEX 0
46 : #endif
47 :
48 : #if GCC_VERSION
49 : #pragma GCC diagnostic push
50 : #pragma GCC diagnostic ignored "-Wformat"
51 : #pragma GCC diagnostic ignored "-Wimplicit-fallthrough"
52 : #pragma GCC diagnostic ignored "-Wundef"
53 : #pragma GCC diagnostic ignored "-Wunused-parameter"
54 : #pragma GCC diagnostic ignored "-Wunused-variable"
55 : #endif
56 : #if CLANG_VERSION
57 : #pragma clang diagnostic push
58 : #pragma clang diagnostic ignored "-Wformat"
59 : #pragma clang diagnostic ignored "-Wnullability-completeness"
60 : #pragma clang diagnostic ignored "-Wundef"
61 : #pragma clang diagnostic ignored "-Wunused-parameter"
62 : #pragma clang diagnostic ignored "-Wunused-variable"
63 : #endif
64 : #if MSC_VERSION
65 : #pragma warning(push, 1)
66 : #pragma warning(disable: 4100) // Unreferenced formal parameter.
67 : #pragma warning(disable: 4701) // Potentially uninitialized local variable used.
68 : #pragma warning(disable: 4703) // Potentially uninitialized local pointer variable used.
69 : #endif
70 :
71 : #include "third_party/vma/vk_mem_alloc.h"
72 :
73 : #if GCC_VERSION
74 3 : #pragma GCC diagnostic pop
75 : #endif
76 : #if CLANG_VERSION
77 : #pragma clang diagnostic pop
78 : #endif
79 : #if MSC_VERSION
80 : #pragma warning(pop)
81 : #endif
82 :
83 : #endif // INCLUDED_RENDERER_BACKEND_VULKAN_VMA
|