diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2020-10-27 16:00:15 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2020-10-27 16:19:15 +0100 |
commit | 54e6338c9bf87719908b173ab9023c7b56a9df6a (patch) | |
tree | 864ab04fafc99f1548dc562acb715256055a2b7b /core/engine.cpp | |
parent | 67f64ef4fe61d0c9c8f46804448fcf1196cae525 (diff) |
Vulkan: Make validation layers optional
They're now disabled by default, and can be enabled with the command line
argument `--vk-layers`.
When enabled, the errors about them being missing are now warnings, as
users were confused and thought this meant Vulkan is broken for them.
Fix crash in `~VulkanContext` when validation layers are disabled (exposed by
this PR since before they could not be disabled without source modification).
Also moved VulkanContext member initializations to header.
Fixes #37102.
Diffstat (limited to 'core/engine.cpp')
-rw-r--r-- | core/engine.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/core/engine.cpp b/core/engine.cpp index d08cf92ecb..b0037ffb37 100644 --- a/core/engine.cpp +++ b/core/engine.cpp @@ -181,6 +181,14 @@ String Engine::get_license_text() const { return String(GODOT_LICENSE_TEXT); } +bool Engine::is_abort_on_gpu_errors_enabled() const { + return abort_on_gpu_errors; +} + +bool Engine::is_validation_layers_enabled() const { + return use_validation_layers; +} + void Engine::add_singleton(const Singleton &p_singleton) { singletons.push_back(p_singleton); singleton_ptrs[p_singleton.name] = p_singleton.ptr; @@ -208,10 +216,6 @@ Engine *Engine::get_singleton() { return singleton; } -bool Engine::is_abort_on_gpu_errors_enabled() const { - return abort_on_gpu_errors; -} - Engine::Engine() { singleton = this; } |