From 651d749eeaaae9d63532ca990054410e01e2909b Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 24 Mar 2019 16:19:39 +0200 Subject: [PATCH] - limited MoltenVK logging without vk_debug If vk_debug is set to zero (which is by default) only errors will be reported --- src/posix/cocoa/i_video.mm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/posix/cocoa/i_video.mm b/src/posix/cocoa/i_video.mm index e30e376fb..89471824e 100644 --- a/src/posix/cocoa/i_video.mm +++ b/src/posix/cocoa/i_video.mm @@ -95,6 +95,7 @@ EXTERN_CVAR(Bool, vid_hidpi) EXTERN_CVAR(Int, vid_defwidth) EXTERN_CVAR(Int, vid_defheight) EXTERN_CVAR(Int, vid_backend) +EXTERN_CVAR(Bool, vk_debug) CUSTOM_CVAR(Bool, vid_autoswitch, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL) { @@ -367,6 +368,12 @@ public: [ms_window setContentView:vulkanView]; + if (!vk_debug) + { + // Limit MoltenVK logging to errors only + setenv("MVK_CONFIG_LOG_LEVEL", "1", 0); + } + if (!vid_autoswitch) { // CVAR from pre-Vulkan era has a priority over vk_device selection @@ -881,4 +888,4 @@ bool I_CreateVulkanSurface(VkInstance instance, VkSurfaceKHR *surface) const VkResult result = vkCreateMacOSSurfaceMVK(instance, &windowCreateInfo, nullptr, surface); return result == VK_SUCCESS; } -#endif \ No newline at end of file +#endif