1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-05 12:10:55 +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
if (editor || project_manager) { {
// The editor and project manager always detect and use hiDPI if needed. // Synced with https://github.com/baldurk/renderdoc/blob/2b01465c7/renderdoc/driver/vulkan/vk_layer.cpp#L118-L165
OS::get_singleton()->_allow_hidpi = true; LocalVector<String> layers_to_disable = {
// Disable Vulkan overlays in editor, they cause various issues. "DISABLE_RTSS_LAYER", // GH-57937.
OS::get_singleton()->set_environment("DISABLE_MANGOHUD", "1"); // GH-57403. "DISABLE_VULKAN_OBS_CAPTURE", // GH-103800.
OS::get_singleton()->set_environment("DISABLE_RTSS_LAYER", "1"); // GH-57937. "DISABLE_VULKAN_OW_OBS_CAPTURE", // GH-104154.
OS::get_singleton()->set_environment("DISABLE_VKBASALT", "1"); "DISABLE_SAMPLE_LAYER", // GH-104154.
OS::get_singleton()->set_environment("DISABLE_VK_LAYER_reshade_1", "1"); // GH-70849. "DISABLE_GAMEPP_LAYER", // GH-104154.
OS::get_singleton()->set_environment("VK_LAYER_bandicam_helper_DEBUG_1", "1"); // GH-101480. "DISABLE_VK_LAYER_TENCENT_wegame_cross_overlay_1", // GH-104154.
OS::get_singleton()->set_environment("DISABLE_VK_LAYER_bandicam_helper_1", "1"); // GH-101480. "NODEVICE_SELECT", // GH-104154.
} else { "VK_LAYER_bandicam_helper_DEBUG_1", // GH-101480.
// Re-allow using Vulkan overlays, disabled while using the editor. "DISABLE_VK_LAYER_bandicam_helper_1", // GH-101480.
OS::get_singleton()->unset_environment("DISABLE_MANGOHUD"); "DISABLE_VK_LAYER_reshade_1", // GH-70849.
OS::get_singleton()->unset_environment("DISABLE_RTSS_LAYER"); "DISABLE_VK_LAYER_GPUOpen_GRS", // GH-104154.
OS::get_singleton()->unset_environment("DISABLE_VKBASALT"); "DISABLE_LAYER", // GH-104154 (fpsmon).
OS::get_singleton()->unset_environment("DISABLE_VK_LAYER_reshade_1"); "DISABLE_MANGOHUD", // GH-57403.
OS::get_singleton()->unset_environment("VK_LAYER_bandicam_helper_DEBUG_1"); "DISABLE_VKBASALT",
OS::get_singleton()->unset_environment("DISABLE_VK_LAYER_bandicam_helper_1"); };
if (editor || project_manager) {
// The editor and project manager always detect and use hiDPI if needed.
OS::get_singleton()->_allow_hidpi = true;
// Disable Vulkan overlays in editor, they cause various issues.
for (const String &layer_disable : layers_to_disable) {
OS::get_singleton()->set_environment(layer_disable, "1");
}
} else {
// Re-allow using Vulkan overlays, disabled while using the editor.
for (const String &layer_disable : layers_to_disable) {
OS::get_singleton()->unset_environment(layer_disable);
}
}
} }
#endif #endif