@@ -1893,6 +1893,49 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
18931893#endif
18941894 }
18951895
1896+ #ifdef TOOLS_ENABLED
1897+ if (!project_manager && !editor) {
1898+ // If we didn't find a project, we fall back to the project manager.
1899+ project_manager = !found_project && !cmdline_tool;
1900+ }
1901+
1902+ {
1903+ // Synced with https://github.com/baldurk/renderdoc/blob/2b01465c7/renderdoc/driver/vulkan/vk_layer.cpp#L118-L165
1904+ LocalVector<String> layers_to_disable = {
1905+ " DISABLE_RTSS_LAYER" , // GH-57937.
1906+ " DISABLE_VULKAN_OBS_CAPTURE" , // GH-103800.
1907+ " DISABLE_VULKAN_OW_OBS_CAPTURE" , // GH-104154.
1908+ " DISABLE_SAMPLE_LAYER" , // GH-104154.
1909+ " DISABLE_GAMEPP_LAYER" , // GH-104154.
1910+ " DISABLE_VK_LAYER_TENCENT_wegame_cross_overlay_1" , // GH-104154.
1911+ // "NODEVICE_SELECT", // Kept as it's useful - GH-104592.
1912+ " VK_LAYER_bandicam_helper_DEBUG_1" , // GH-101480.
1913+ " DISABLE_VK_LAYER_bandicam_helper_1" , // GH-101480.
1914+ " DISABLE_VK_LAYER_reshade_1" , // GH-70849.
1915+ " DISABLE_VK_LAYER_GPUOpen_GRS" , // GH-104154.
1916+ " DISABLE_LAYER" , // GH-104154 (fpsmon).
1917+ " DISABLE_MANGOHUD" , // GH-57403.
1918+ " DISABLE_VKBASALT" ,
1919+ };
1920+
1921+ #if defined(WINDOWS_ENABLED) || defined(LINUXBSD_ENABLED)
1922+ if (editor || project_manager || test_rd_support || test_rd_creation) {
1923+ #else
1924+ if (editor || project_manager) {
1925+ #endif
1926+ // Disable Vulkan overlays in editor, they cause various issues.
1927+ for (const String &layer_disable : layers_to_disable) {
1928+ OS::get_singleton ()->set_environment (layer_disable, " 1" );
1929+ }
1930+ } else {
1931+ // Re-allow using Vulkan overlays, disabled while using the editor.
1932+ for (const String &layer_disable : layers_to_disable) {
1933+ OS::get_singleton ()->unset_environment (layer_disable);
1934+ }
1935+ }
1936+ }
1937+ #endif
1938+
18961939#if defined(TOOLS_ENABLED) && (defined(WINDOWS_ENABLED) || defined(LINUXBSD_ENABLED))
18971940 if (test_rd_support) {
18981941 // Test Rendering Device creation and exit.
@@ -1932,11 +1975,6 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
19321975 }
19331976 }
19341977
1935- if (!project_manager && !editor) {
1936- // If we didn't find a project, we fall back to the project manager.
1937- project_manager = !found_project && !cmdline_tool;
1938- }
1939-
19401978 if (project_manager) {
19411979 Engine::get_singleton ()->set_project_manager_hint (true );
19421980 }
@@ -2526,38 +2564,9 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
25262564 OS::get_singleton ()->_allow_layered = GLOBAL_DEF_RST (" display/window/per_pixel_transparency/allowed" , false );
25272565
25282566#ifdef TOOLS_ENABLED
2529- {
2530- // Synced with https://github.com/baldurk/renderdoc/blob/2b01465c7/renderdoc/driver/vulkan/vk_layer.cpp#L118-L165
2531- LocalVector<String> layers_to_disable = {
2532- " DISABLE_RTSS_LAYER" , // GH-57937.
2533- " DISABLE_VULKAN_OBS_CAPTURE" , // GH-103800.
2534- " DISABLE_VULKAN_OW_OBS_CAPTURE" , // GH-104154.
2535- " DISABLE_SAMPLE_LAYER" , // GH-104154.
2536- " DISABLE_GAMEPP_LAYER" , // GH-104154.
2537- " DISABLE_VK_LAYER_TENCENT_wegame_cross_overlay_1" , // GH-104154.
2538- // "NODEVICE_SELECT", // Kept as it's useful - GH-104592.
2539- " VK_LAYER_bandicam_helper_DEBUG_1" , // GH-101480.
2540- " DISABLE_VK_LAYER_bandicam_helper_1" , // GH-101480.
2541- " DISABLE_VK_LAYER_reshade_1" , // GH-70849.
2542- " DISABLE_VK_LAYER_GPUOpen_GRS" , // GH-104154.
2543- " DISABLE_LAYER" , // GH-104154 (fpsmon).
2544- " DISABLE_MANGOHUD" , // GH-57403.
2545- " DISABLE_VKBASALT" ,
2546- };
2547-
2548- if (editor || project_manager) {
2549- // The editor and project manager always detect and use hiDPI if needed.
2550- OS::get_singleton ()->_allow_hidpi = true ;
2551- // Disable Vulkan overlays in editor, they cause various issues.
2552- for (const String &layer_disable : layers_to_disable) {
2553- OS::get_singleton ()->set_environment (layer_disable, " 1" );
2554- }
2555- } else {
2556- // Re-allow using Vulkan overlays, disabled while using the editor.
2557- for (const String &layer_disable : layers_to_disable) {
2558- OS::get_singleton ()->unset_environment (layer_disable);
2559- }
2560- }
2567+ if (editor || project_manager) {
2568+ // The editor and project manager always detect and use hiDPI if needed.
2569+ OS::get_singleton ()->_allow_hidpi = true ;
25612570 }
25622571#endif
25632572
0 commit comments