forked from godotengine/godot
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move Vulkan includes to a central godot_vulkan.h header
Also fixes Vulkan build problem with recent Clang.
- Loading branch information
Showing
14 changed files
with
64 additions
and
69 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/**************************************************************************/ | ||
/* godot_vulkan.h */ | ||
/**************************************************************************/ | ||
/* This file is part of: */ | ||
/* GODOT ENGINE */ | ||
/* https://godotengine.org */ | ||
/**************************************************************************/ | ||
/* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ | ||
/* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ | ||
/* */ | ||
/* Permission is hereby granted, free of charge, to any person obtaining */ | ||
/* a copy of this software and associated documentation files (the */ | ||
/* "Software"), to deal in the Software without restriction, including */ | ||
/* without limitation the rights to use, copy, modify, merge, publish, */ | ||
/* distribute, sublicense, and/or sell copies of the Software, and to */ | ||
/* permit persons to whom the Software is furnished to do so, subject to */ | ||
/* the following conditions: */ | ||
/* */ | ||
/* The above copyright notice and this permission notice shall be */ | ||
/* included in all copies or substantial portions of the Software. */ | ||
/* */ | ||
/* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ | ||
/* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ | ||
/* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ | ||
/* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ | ||
/* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ | ||
/* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ | ||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ | ||
/**************************************************************************/ | ||
|
||
#ifndef GODOT_VULKAN_H | ||
#define GODOT_VULKAN_H | ||
|
||
#ifdef USE_VOLK | ||
#include <volk.h> | ||
#else | ||
#include <stdint.h> | ||
#define VK_NO_STDINT_H | ||
#include <vulkan/vulkan.h> | ||
#endif | ||
|
||
#endif // GODOT_VULKAN_H |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 3 additions & 7 deletions
10
...patches/VKEnumStringHelper-use-volk.patch → ...VKEnumStringHelper-use-godot-vulkan.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,13 @@ | ||
diff --git a/thirdparty/vulkan/vk_enum_string_helper.h b/thirdparty/vulkan/vk_enum_string_helper.h | ||
index 9d2af46344..d61dbb1290 100644 | ||
index 8026787ad4..7a54b12a38 100644 | ||
--- a/thirdparty/vulkan/vk_enum_string_helper.h | ||
+++ b/thirdparty/vulkan/vk_enum_string_helper.h | ||
@@ -13,7 +13,11 @@ | ||
@@ -13,7 +13,7 @@ | ||
#ifdef __cplusplus | ||
#include <string> | ||
#endif | ||
-#include <vulkan/vulkan.h> | ||
+#ifdef USE_VOLK | ||
+ #include <volk.h> | ||
+#else | ||
+ #include <vulkan/vulkan.h> | ||
+#endif | ||
+#include "drivers/vulkan/godot_vulkan.h" | ||
static inline const char* string_VkResult(VkResult input_value) { | ||
switch (input_value) { | ||
case VK_SUCCESS: |
15 changes: 8 additions & 7 deletions
15
thirdparty/vulkan/patches/VMA-use-volk.patch → ...vulkan/patches/VMA-use-godot-vulkan.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,18 @@ | ||
diff --git a/thirdparty/vulkan/vk_mem_alloc.h b/thirdparty/vulkan/vk_mem_alloc.h | ||
index 711f486571..e5eaa80e74 100644 | ||
index 2307325d4e..ecb84094b9 100644 | ||
--- a/thirdparty/vulkan/vk_mem_alloc.h | ||
+++ b/thirdparty/vulkan/vk_mem_alloc.h | ||
@@ -127,7 +127,11 @@ See documentation chapter: \ref statistics. | ||
@@ -122,12 +122,12 @@ for user-defined purpose without allocating any real GPU memory. | ||
See documentation chapter: \ref statistics. | ||
*/ | ||
|
||
+#include "drivers/vulkan/godot_vulkan.h" | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
-#include <vulkan/vulkan.h> | ||
+#ifdef USE_VOLK | ||
+ #include <volk.h> | ||
+#else | ||
+ #include <vulkan/vulkan.h> | ||
+#endif | ||
|
||
#if !defined(VMA_VULKAN_VERSION) | ||
#if defined(VK_VERSION_1_3) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters