- limited MoltenVK logging without vk_debug

If vk_debug is set to zero (which is by default) only errors will be reported
This commit is contained in:
alexey.lysiuk 2019-03-24 16:19:39 +02:00
parent 15e0b6c8a7
commit 651d749eea

View file

@ -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
#endif