1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Vulkan: Disable layers in editor deemed buggy by RenderDoc

This commit is contained in:
unvermuthet
2025-03-14 22:35:53 +01:00
parent 87f897ae0a
commit e41200b407

View File

@@ -2517,24 +2517,38 @@ Error Main::setup(const char *execpath, int argc, char *argv[], bool p_second_ph
OS::get_singleton()->_allow_layered = GLOBAL_DEF_RST("display/window/per_pixel_transparency/allowed", false); OS::get_singleton()->_allow_layered = GLOBAL_DEF_RST("display/window/per_pixel_transparency/allowed", false);
#ifdef TOOLS_ENABLED #ifdef TOOLS_ENABLED
{
// Synced with https://github.com/baldurk/renderdoc/blob/2b01465c7/renderdoc/driver/vulkan/vk_layer.cpp#L118-L165
LocalVector<String> layers_to_disable = {
"DISABLE_RTSS_LAYER", // GH-57937.
"DISABLE_VULKAN_OBS_CAPTURE", // GH-103800.
"DISABLE_VULKAN_OW_OBS_CAPTURE", // GH-104154.
"DISABLE_SAMPLE_LAYER", // GH-104154.
"DISABLE_GAMEPP_LAYER", // GH-104154.
"DISABLE_VK_LAYER_TENCENT_wegame_cross_overlay_1", // GH-104154.
"NODEVICE_SELECT", // GH-104154.
"VK_LAYER_bandicam_helper_DEBUG_1", // GH-101480.
"DISABLE_VK_LAYER_bandicam_helper_1", // GH-101480.
"DISABLE_VK_LAYER_reshade_1", // GH-70849.
"DISABLE_VK_LAYER_GPUOpen_GRS", // GH-104154.
"DISABLE_LAYER", // GH-104154 (fpsmon).
"DISABLE_MANGOHUD", // GH-57403.
"DISABLE_VKBASALT",
};
if (editor || project_manager) { if (editor || project_manager) {
// The editor and project manager always detect and use hiDPI if needed. // The editor and project manager always detect and use hiDPI if needed.
OS::get_singleton()->_allow_hidpi = true; OS::get_singleton()->_allow_hidpi = true;
// Disable Vulkan overlays in editor, they cause various issues. // Disable Vulkan overlays in editor, they cause various issues.
OS::get_singleton()->set_environment("DISABLE_MANGOHUD", "1"); // GH-57403. for (const String &layer_disable : layers_to_disable) {
OS::get_singleton()->set_environment("DISABLE_RTSS_LAYER", "1"); // GH-57937. OS::get_singleton()->set_environment(layer_disable, "1");
OS::get_singleton()->set_environment("DISABLE_VKBASALT", "1"); }
OS::get_singleton()->set_environment("DISABLE_VK_LAYER_reshade_1", "1"); // GH-70849.
OS::get_singleton()->set_environment("VK_LAYER_bandicam_helper_DEBUG_1", "1"); // GH-101480.
OS::get_singleton()->set_environment("DISABLE_VK_LAYER_bandicam_helper_1", "1"); // GH-101480.
} else { } else {
// Re-allow using Vulkan overlays, disabled while using the editor. // Re-allow using Vulkan overlays, disabled while using the editor.
OS::get_singleton()->unset_environment("DISABLE_MANGOHUD"); for (const String &layer_disable : layers_to_disable) {
OS::get_singleton()->unset_environment("DISABLE_RTSS_LAYER"); OS::get_singleton()->unset_environment(layer_disable);
OS::get_singleton()->unset_environment("DISABLE_VKBASALT"); }
OS::get_singleton()->unset_environment("DISABLE_VK_LAYER_reshade_1"); }
OS::get_singleton()->unset_environment("VK_LAYER_bandicam_helper_DEBUG_1");
OS::get_singleton()->unset_environment("DISABLE_VK_LAYER_bandicam_helper_1");
} }
#endif #endif