summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2020-11-18 21:22:04 +0100
committerGitHub <noreply@github.com>2020-11-18 21:22:04 +0100
commit8028663a4b1cc67e9eed31957af0d9c9a8636e72 (patch)
tree2f4d7cd22a2a6190c9faf262f7d666899ec410e7
parent9a3d3df0e2b98214cc208542834a51fbc16f6894 (diff)
parente9527d0353db7a33fa1d9549256b199e396bb1c7 (diff)
Merge pull request #43651 from winterpixelgames/PR-fix-validation-layers-parse
allow vulkan validation layers in release builds if explicity asked for
-rw-r--r--drivers/vulkan/vulkan_context.cpp2
-rw-r--r--drivers/vulkan/vulkan_context.h1
-rw-r--r--main/main.cpp4
3 files changed, 3 insertions, 4 deletions
diff --git a/drivers/vulkan/vulkan_context.cpp b/drivers/vulkan/vulkan_context.cpp
index f56507532b..ecf9dac61b 100644
--- a/drivers/vulkan/vulkan_context.cpp
+++ b/drivers/vulkan/vulkan_context.cpp
@@ -302,7 +302,7 @@ Error VulkanContext::_create_physical_device() {
/*flags*/ 0,
/*pApplicationInfo*/ &app,
/*enabledLayerCount*/ enabled_layer_count,
- /*ppEnabledLayerNames*/ (const char *const *)instance_validation_layers,
+ /*ppEnabledLayerNames*/ (const char *const *)enabled_layers,
/*enabledExtensionCount*/ enabled_extension_count,
/*ppEnabledExtensionNames*/ (const char *const *)extension_names,
};
diff --git a/drivers/vulkan/vulkan_context.h b/drivers/vulkan/vulkan_context.h
index 26d4b76e86..62b97a7e60 100644
--- a/drivers/vulkan/vulkan_context.h
+++ b/drivers/vulkan/vulkan_context.h
@@ -120,7 +120,6 @@ class VulkanContext {
uint32_t enabled_extension_count = 0;
const char *extension_names[MAX_EXTENSIONS];
- const char **instance_validation_layers = nullptr;
uint32_t enabled_layer_count = 0;
const char *enabled_layers[MAX_LAYERS];
diff --git a/main/main.cpp b/main/main.cpp
index 51d2cbfe71..09f16e9d75 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -334,8 +334,8 @@ void Main::print_help(const char *p_binary) {
OS::get_singleton()->print(" -d, --debug Debug (local stdout debugger).\n");
OS::get_singleton()->print(" -b, --breakpoints Breakpoint list as source::line comma-separated pairs, no spaces (use %%20 instead).\n");
OS::get_singleton()->print(" --profiling Enable profiling in the script debugger.\n");
-#if DEBUG_ENABLED
OS::get_singleton()->print(" --vk-layers Enable Vulkan Validation layers for debugging.\n");
+#if DEBUG_ENABLED
OS::get_singleton()->print(" --gpu-abort Abort on GPU errors (usually validation layer errors), may help see the problem if your system freezes.\n");
#endif
OS::get_singleton()->print(" --remote-debug <uri> Remote debug (<protocol>://<host/IP>[:<port>], e.g. tcp://127.0.0.1:6007).\n");
@@ -698,9 +698,9 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
} else if (I->get() == "-w" || I->get() == "--windowed") { // force windowed window
init_windowed = true;
-#ifdef DEBUG_ENABLED
} else if (I->get() == "--vk-layers") {
Engine::singleton->use_validation_layers = true;
+#ifdef DEBUG_ENABLED
} else if (I->get() == "--gpu-abort") {
Engine::singleton->abort_on_gpu_errors = true;
#endif