- avoid Vulkan initialization when it's disabled in Cocoa backend

This commit is contained in:
alexey.lysiuk 2019-03-17 14:45:19 +02:00
parent 83de8ae5a0
commit 97fc3aa9a6

View file

@ -364,24 +364,24 @@ public:
vulkanView.layer.backgroundColor = NSColor.blackColor.CGColor; vulkanView.layer.backgroundColor = NSColor.blackColor.CGColor;
[ms_window setContentView:vulkanView]; [ms_window setContentView:vulkanView];
try
{
m_vulkanDevice = new VulkanDevice();
fb = new VulkanFrameBuffer(nullptr, fullscreen, m_vulkanDevice);
}
catch (std::exception const&)
{
ms_isVulkanEnabled = false;
SetupOpenGLView(ms_window);
}
} }
else else
{ {
SetupOpenGLView(ms_window); SetupOpenGLView(ms_window);
} }
try
{
m_vulkanDevice = new VulkanDevice();
fb = new VulkanFrameBuffer(nullptr, fullscreen, m_vulkanDevice);
}
catch (std::exception const&)
{
ms_isVulkanEnabled = false;
SetupOpenGLView(ms_window);
}
if (fb == nullptr) if (fb == nullptr)
{ {
fb = new OpenGLRenderer::OpenGLFrameBuffer(0, fullscreen); fb = new OpenGLRenderer::OpenGLFrameBuffer(0, fullscreen);