Merge pull request #43651 from winterpixelgames/PR-fix-validation-layers-parse

allow vulkan validation layers in release builds if explicity asked for
This commit is contained in:
Rémi Verschelde 2020-11-18 21:22:04 +01:00 committed by GitHub
commit 8028663a4b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 4 deletions

View File

@ -302,7 +302,7 @@ Error VulkanContext::_create_physical_device() {
/*flags*/ 0, /*flags*/ 0,
/*pApplicationInfo*/ &app, /*pApplicationInfo*/ &app,
/*enabledLayerCount*/ enabled_layer_count, /*enabledLayerCount*/ enabled_layer_count,
/*ppEnabledLayerNames*/ (const char *const *)instance_validation_layers, /*ppEnabledLayerNames*/ (const char *const *)enabled_layers,
/*enabledExtensionCount*/ enabled_extension_count, /*enabledExtensionCount*/ enabled_extension_count,
/*ppEnabledExtensionNames*/ (const char *const *)extension_names, /*ppEnabledExtensionNames*/ (const char *const *)extension_names,
}; };

View File

@ -120,7 +120,6 @@ class VulkanContext {
uint32_t enabled_extension_count = 0; uint32_t enabled_extension_count = 0;
const char *extension_names[MAX_EXTENSIONS]; const char *extension_names[MAX_EXTENSIONS];
const char **instance_validation_layers = nullptr;
uint32_t enabled_layer_count = 0; uint32_t enabled_layer_count = 0;
const char *enabled_layers[MAX_LAYERS]; const char *enabled_layers[MAX_LAYERS];

View File

@ -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(" -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(" -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"); 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"); 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"); 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 #endif
OS::get_singleton()->print(" --remote-debug <uri> Remote debug (<protocol>://<host/IP>[:<port>], e.g. tcp://127.0.0.1:6007).\n"); 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 } else if (I->get() == "-w" || I->get() == "--windowed") { // force windowed window
init_windowed = true; init_windowed = true;
#ifdef DEBUG_ENABLED
} else if (I->get() == "--vk-layers") { } else if (I->get() == "--vk-layers") {
Engine::singleton->use_validation_layers = true; Engine::singleton->use_validation_layers = true;
#ifdef DEBUG_ENABLED
} else if (I->get() == "--gpu-abort") { } else if (I->get() == "--gpu-abort") {
Engine::singleton->abort_on_gpu_errors = true; Engine::singleton->abort_on_gpu_errors = true;
#endif #endif