Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.3] Merge commit godotengine/godot@90f21a3 #909

Merged
merged 2 commits into from
Dec 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions drivers/vulkan/godot_vulkan.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/**************************************************************************/
/* godot_vulkan.h */
/**************************************************************************/
/* This file is part of: */
/* REDOT ENGINE */
/* https://redotengine.org */
/**************************************************************************/
/* Copyright (c) 2024-present Redot Engine contributors */
/* (see REDOT_AUTHORS.md) */
/* 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
6 changes: 1 addition & 5 deletions drivers/vulkan/rendering_context_driver_vulkan.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,7 @@

#include "servers/rendering/rendering_context_driver.h"

#ifdef USE_VOLK
#include <volk.h>
#else
#include <vulkan/vulkan.h>
#endif
#include "drivers/vulkan/godot_vulkan.h"

class RenderingContextDriverVulkan : public RenderingContextDriver {
public:
Expand Down
6 changes: 1 addition & 5 deletions drivers/vulkan/rendering_device_driver_vulkan.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,7 @@
#endif
#include "thirdparty/vulkan/vk_mem_alloc.h"

#ifdef USE_VOLK
#include <volk.h>
#else
#include <vulkan/vulkan.h>
#endif
#include "drivers/vulkan/godot_vulkan.h"

// Design principles:
// - Vulkan structs are zero-initialized and fields not requiring a non-zero value are omitted (except in cases where expresivity reasons apply).
Expand Down
6 changes: 1 addition & 5 deletions drivers/vulkan/vulkan_hooks.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@
#ifndef VULKAN_HOOKS_H
#define VULKAN_HOOKS_H

#ifdef USE_VOLK
#include <volk.h>
#else
#include <vulkan/vulkan.h>
#endif
#include "drivers/vulkan/godot_vulkan.h"

class VulkanHooks {
private:
Expand Down
6 changes: 1 addition & 5 deletions platform/android/rendering_context_driver_vulkan_android.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@

#ifdef VULKAN_ENABLED

#ifdef USE_VOLK
#include <volk.h>
#else
#include <vulkan/vulkan.h>
#endif
#include "drivers/vulkan/godot_vulkan.h"

const char *RenderingContextDriverVulkanAndroid::_get_platform_surface_extension() const {
return VK_KHR_ANDROID_SURFACE_EXTENSION_NAME;
Expand Down
6 changes: 1 addition & 5 deletions platform/ios/display_server_ios.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,7 @@
#if defined(VULKAN_ENABLED)
#import "rendering_context_driver_vulkan_ios.h"

#ifdef USE_VOLK
#include <volk.h>
#else
#include <vulkan/vulkan.h>
#endif
#include "drivers/vulkan/godot_vulkan.h"
#endif // VULKAN_ENABLED
#endif // RD_ENABLED

Expand Down
6 changes: 1 addition & 5 deletions platform/ios/os_ios.mm
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,7 @@
#import <QuartzCore/CAMetalLayer.h>

#if defined(VULKAN_ENABLED)
#ifdef USE_VOLK
#include <volk.h>
#else
#include <vulkan/vulkan.h>
#endif
#include "drivers/vulkan/godot_vulkan.h"
#endif // VULKAN_ENABLED
#endif

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@

#include "rendering_context_driver_vulkan_wayland.h"

#ifdef USE_VOLK
#include <volk.h>
#else
#include <vulkan/vulkan.h>
#endif
#include "drivers/vulkan/godot_vulkan.h"

const char *RenderingContextDriverVulkanWayland::_get_platform_surface_extension() const {
return VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,7 @@

#include "rendering_context_driver_vulkan_x11.h"

#ifdef USE_VOLK
#include <volk.h>
#else
#include <vulkan/vulkan.h>
#endif
#include "drivers/vulkan/godot_vulkan.h"

const char *RenderingContextDriverVulkanX11::_get_platform_surface_extension() const {
return VK_KHR_XLIB_SURFACE_EXTENSION_NAME;
Expand Down
6 changes: 1 addition & 5 deletions platform/windows/rendering_context_driver_vulkan_windows.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@

#include "rendering_context_driver_vulkan_windows.h"

#ifdef USE_VOLK
#include <volk.h>
#else
#include <vulkan/vulkan.h>
#endif
#include "drivers/vulkan/godot_vulkan.h"

const char *RenderingContextDriverVulkanWindows::_get_platform_surface_extension() const {
return VK_KHR_WIN32_SURFACE_EXTENSION_NAME;
Expand Down
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:
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)
6 changes: 1 addition & 5 deletions thirdparty/vulkan/vk_enum_string_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,7 @@
#ifdef __cplusplus
#include <string>
#endif
#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:
Expand Down
6 changes: 1 addition & 5 deletions thirdparty/vulkan/vk_mem_alloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +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

#ifdef USE_VOLK
#include <volk.h>
#else
#include <vulkan/vulkan.h>
#endif

#if !defined(VMA_VULKAN_VERSION)
#if defined(VK_VERSION_1_3)
Expand Down
Loading