mirror of
https://github.com/godotengine/godot.git
synced 2025-10-20 00:13:30 +00:00
Fix build with Vulkan disabled and no Vulkan headers installed.
This commit is contained in:
parent
2b505b74b9
commit
4dd8f68120
14 changed files with 56 additions and 10 deletions
|
@ -1590,11 +1590,17 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
|
||||||
// Now validate whether the selected driver matches with the renderer.
|
// Now validate whether the selected driver matches with the renderer.
|
||||||
bool valid_combination = false;
|
bool valid_combination = false;
|
||||||
Vector<String> available_drivers;
|
Vector<String> available_drivers;
|
||||||
|
#ifdef VULKAN_ENABLED
|
||||||
if (rendering_method == "forward_plus" || rendering_method == "mobile") {
|
if (rendering_method == "forward_plus" || rendering_method == "mobile") {
|
||||||
available_drivers.push_back("vulkan");
|
available_drivers.push_back("vulkan");
|
||||||
} else if (rendering_method == "gl_compatibility") {
|
}
|
||||||
|
#endif
|
||||||
|
#ifdef GLES3_ENABLED
|
||||||
|
if (rendering_method == "gl_compatibility") {
|
||||||
available_drivers.push_back("opengl3");
|
available_drivers.push_back("opengl3");
|
||||||
} else {
|
}
|
||||||
|
#endif
|
||||||
|
if (available_drivers.is_empty()) {
|
||||||
OS::get_singleton()->print("Unknown renderer name '%s', aborting.\n", rendering_method.utf8().get_data());
|
OS::get_singleton()->print("Unknown renderer name '%s', aborting.\n", rendering_method.utf8().get_data());
|
||||||
goto error;
|
goto error;
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,6 +28,8 @@
|
||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
|
#ifdef VULKAN_ENABLED
|
||||||
|
|
||||||
#include "vulkan_context_android.h"
|
#include "vulkan_context_android.h"
|
||||||
|
|
||||||
#ifdef USE_VOLK
|
#ifdef USE_VOLK
|
||||||
|
@ -63,3 +65,5 @@ bool VulkanContextAndroid::_use_validation_layers() {
|
||||||
// On Android, we use validation layers automatically if they were explicitly linked with the app.
|
// On Android, we use validation layers automatically if they were explicitly linked with the app.
|
||||||
return count > 0;
|
return count > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // VULKAN_ENABLED
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#ifndef VULKAN_CONTEXT_ANDROID_H
|
#ifndef VULKAN_CONTEXT_ANDROID_H
|
||||||
#define VULKAN_CONTEXT_ANDROID_H
|
#define VULKAN_CONTEXT_ANDROID_H
|
||||||
|
|
||||||
|
#ifdef VULKAN_ENABLED
|
||||||
|
|
||||||
#include "drivers/vulkan/vulkan_context.h"
|
#include "drivers/vulkan/vulkan_context.h"
|
||||||
|
|
||||||
struct ANativeWindow;
|
struct ANativeWindow;
|
||||||
|
@ -48,4 +50,6 @@ protected:
|
||||||
bool _use_validation_layers() override;
|
bool _use_validation_layers() override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif // VULKAN_ENABLED
|
||||||
|
|
||||||
#endif // VULKAN_CONTEXT_ANDROID_H
|
#endif // VULKAN_CONTEXT_ANDROID_H
|
||||||
|
|
|
@ -40,7 +40,6 @@
|
||||||
|
|
||||||
#include "vulkan_context_ios.h"
|
#include "vulkan_context_ios.h"
|
||||||
|
|
||||||
#import <QuartzCore/CAMetalLayer.h>
|
|
||||||
#ifdef USE_VOLK
|
#ifdef USE_VOLK
|
||||||
#include <volk.h>
|
#include <volk.h>
|
||||||
#else
|
#else
|
||||||
|
@ -48,6 +47,9 @@
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#import <Foundation/Foundation.h>
|
||||||
|
#import <QuartzCore/CAMetalLayer.h>
|
||||||
|
|
||||||
class DisplayServerIOS : public DisplayServer {
|
class DisplayServerIOS : public DisplayServer {
|
||||||
GDCLASS(DisplayServerIOS, DisplayServer)
|
GDCLASS(DisplayServerIOS, DisplayServer)
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,6 @@
|
||||||
#include "tts_ios.h"
|
#include "tts_ios.h"
|
||||||
#import "view_controller.h"
|
#import "view_controller.h"
|
||||||
|
|
||||||
#import <Foundation/Foundation.h>
|
|
||||||
#import <sys/utsname.h>
|
#import <sys/utsname.h>
|
||||||
|
|
||||||
static const float kDisplayServerIOSAcceleration = 1.f;
|
static const float kDisplayServerIOSAcceleration = 1.f;
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#ifndef VULKAN_CONTEXT_IOS_H
|
#ifndef VULKAN_CONTEXT_IOS_H
|
||||||
#define VULKAN_CONTEXT_IOS_H
|
#define VULKAN_CONTEXT_IOS_H
|
||||||
|
|
||||||
|
#ifdef VULKAN_ENABLED
|
||||||
|
|
||||||
#include "drivers/vulkan/vulkan_context.h"
|
#include "drivers/vulkan/vulkan_context.h"
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
|
@ -45,4 +47,6 @@ public:
|
||||||
~VulkanContextIOS();
|
~VulkanContextIOS();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif // VULKAN_ENABLED
|
||||||
|
|
||||||
#endif // VULKAN_CONTEXT_IOS_H
|
#endif // VULKAN_CONTEXT_IOS_H
|
||||||
|
|
|
@ -28,6 +28,8 @@
|
||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
|
#ifdef VULKAN_ENABLED
|
||||||
|
|
||||||
#include "vulkan_context_ios.h"
|
#include "vulkan_context_ios.h"
|
||||||
#ifdef USE_VOLK
|
#ifdef USE_VOLK
|
||||||
#include <volk.h>
|
#include <volk.h>
|
||||||
|
@ -57,3 +59,5 @@ Error VulkanContextIOS::window_create(DisplayServer::WindowID p_window_id, Displ
|
||||||
VulkanContextIOS::VulkanContextIOS() {}
|
VulkanContextIOS::VulkanContextIOS() {}
|
||||||
|
|
||||||
VulkanContextIOS::~VulkanContextIOS() {}
|
VulkanContextIOS::~VulkanContextIOS() {}
|
||||||
|
|
||||||
|
#endif // VULKAN_ENABLED
|
||||||
|
|
|
@ -28,6 +28,8 @@
|
||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
|
#ifdef VULKAN_ENABLED
|
||||||
|
|
||||||
#include "vulkan_context_x11.h"
|
#include "vulkan_context_x11.h"
|
||||||
|
|
||||||
#ifdef USE_VOLK
|
#ifdef USE_VOLK
|
||||||
|
@ -59,3 +61,5 @@ VulkanContextX11::VulkanContextX11() {
|
||||||
|
|
||||||
VulkanContextX11::~VulkanContextX11() {
|
VulkanContextX11::~VulkanContextX11() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // VULKAN_ENABLED
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#ifndef VULKAN_CONTEXT_X11_H
|
#ifndef VULKAN_CONTEXT_X11_H
|
||||||
#define VULKAN_CONTEXT_X11_H
|
#define VULKAN_CONTEXT_X11_H
|
||||||
|
|
||||||
|
#ifdef VULKAN_ENABLED
|
||||||
|
|
||||||
#include "drivers/vulkan/vulkan_context.h"
|
#include "drivers/vulkan/vulkan_context.h"
|
||||||
#include <X11/Xlib.h>
|
#include <X11/Xlib.h>
|
||||||
|
|
||||||
|
@ -44,4 +46,6 @@ public:
|
||||||
~VulkanContextX11();
|
~VulkanContextX11();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif // VULKAN_ENABLED
|
||||||
|
|
||||||
#endif // VULKAN_CONTEXT_X11_H
|
#endif // VULKAN_CONTEXT_X11_H
|
||||||
|
|
|
@ -223,6 +223,8 @@ def configure(env: "Environment"):
|
||||||
"AVFoundation",
|
"AVFoundation",
|
||||||
"-framework",
|
"-framework",
|
||||||
"CoreMedia",
|
"CoreMedia",
|
||||||
|
"-framework",
|
||||||
|
"QuartzCore",
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
env.Append(LIBS=["pthread", "z"])
|
env.Append(LIBS=["pthread", "z"])
|
||||||
|
@ -236,7 +238,7 @@ def configure(env: "Environment"):
|
||||||
|
|
||||||
if env["vulkan"]:
|
if env["vulkan"]:
|
||||||
env.Append(CPPDEFINES=["VULKAN_ENABLED"])
|
env.Append(CPPDEFINES=["VULKAN_ENABLED"])
|
||||||
env.Append(LINKFLAGS=["-framework", "Metal", "-framework", "QuartzCore", "-framework", "IOSurface"])
|
env.Append(LINKFLAGS=["-framework", "Metal", "-framework", "IOSurface"])
|
||||||
if not env["use_volk"]:
|
if not env["use_volk"]:
|
||||||
env.Append(LINKFLAGS=["-lMoltenVK"])
|
env.Append(LINKFLAGS=["-lMoltenVK"])
|
||||||
mvk_found = False
|
mvk_found = False
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#ifndef VULKAN_CONTEXT_MACOS_H
|
#ifndef VULKAN_CONTEXT_MACOS_H
|
||||||
#define VULKAN_CONTEXT_MACOS_H
|
#define VULKAN_CONTEXT_MACOS_H
|
||||||
|
|
||||||
|
#ifdef VULKAN_ENABLED
|
||||||
|
|
||||||
#include "drivers/vulkan/vulkan_context.h"
|
#include "drivers/vulkan/vulkan_context.h"
|
||||||
#import <AppKit/AppKit.h>
|
#import <AppKit/AppKit.h>
|
||||||
|
|
||||||
|
@ -44,4 +46,6 @@ public:
|
||||||
~VulkanContextMacOS();
|
~VulkanContextMacOS();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif // VULKAN_ENABLED
|
||||||
|
|
||||||
#endif // VULKAN_CONTEXT_MACOS_H
|
#endif // VULKAN_CONTEXT_MACOS_H
|
||||||
|
|
|
@ -28,6 +28,7 @@
|
||||||
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
/* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|
||||||
|
#ifdef VULKAN_ENABLED
|
||||||
#include "vulkan_context_macos.h"
|
#include "vulkan_context_macos.h"
|
||||||
#ifdef USE_VOLK
|
#ifdef USE_VOLK
|
||||||
#include <volk.h>
|
#include <volk.h>
|
||||||
|
@ -57,3 +58,5 @@ VulkanContextMacOS::VulkanContextMacOS() {
|
||||||
|
|
||||||
VulkanContextMacOS::~VulkanContextMacOS() {
|
VulkanContextMacOS::~VulkanContextMacOS() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // VULKAN_ENABLED
|
||||||
|
|
|
@ -582,12 +582,14 @@ def configure_mingw(env):
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
|
||||||
env.Append(CPPDEFINES=["VULKAN_ENABLED"])
|
if env["vulkan"]:
|
||||||
if not env["use_volk"]:
|
env.Append(CPPDEFINES=["VULKAN_ENABLED"])
|
||||||
env.Append(LIBS=["vulkan"])
|
if not env["use_volk"]:
|
||||||
|
env.Append(LIBS=["vulkan"])
|
||||||
|
|
||||||
env.Append(CPPDEFINES=["GLES3_ENABLED"])
|
if env["opengl3"]:
|
||||||
env.Append(LIBS=["opengl32"])
|
env.Append(CPPDEFINES=["GLES3_ENABLED"])
|
||||||
|
env.Append(LIBS=["opengl32"])
|
||||||
|
|
||||||
env.Append(CPPDEFINES=["MINGW_ENABLED", ("MINGW_HAS_SECURE_API", 1)])
|
env.Append(CPPDEFINES=["MINGW_ENABLED", ("MINGW_HAS_SECURE_API", 1)])
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,8 @@
|
||||||
#ifndef VULKAN_CONTEXT_WIN_H
|
#ifndef VULKAN_CONTEXT_WIN_H
|
||||||
#define VULKAN_CONTEXT_WIN_H
|
#define VULKAN_CONTEXT_WIN_H
|
||||||
|
|
||||||
|
#ifdef VULKAN_ENABLED
|
||||||
|
|
||||||
#include "drivers/vulkan/vulkan_context.h"
|
#include "drivers/vulkan/vulkan_context.h"
|
||||||
|
|
||||||
#define WIN32_LEAN_AND_MEAN
|
#define WIN32_LEAN_AND_MEAN
|
||||||
|
@ -46,4 +48,6 @@ public:
|
||||||
~VulkanContextWindows();
|
~VulkanContextWindows();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#endif // VULKAN_ENABLED
|
||||||
|
|
||||||
#endif // VULKAN_CONTEXT_WIN_H
|
#endif // VULKAN_CONTEXT_WIN_H
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue