Skip to content
Snippets Groups Projects
Commit 30db1ba5 authored by Andreas Traczyk's avatar Andreas Traczyk Committed by Sébastien Blin
Browse files

misc: don't prefer Vulkan RHI

WebEngine view destruction crashes on Windows 10 when using Vulkan. Disable the preference for now. It will default to D3D11.

Gitlab: #1515
Change-Id: I8396163a937b3b439569115887020d49e3a8e751
parent 6aaac127
No related branches found
No related tags found
No related merge requests found
...@@ -343,6 +343,8 @@ if(Vulkan_FOUND) ...@@ -343,6 +343,8 @@ if(Vulkan_FOUND)
add_definitions(-DHAS_VULKAN) add_definitions(-DHAS_VULKAN)
include_directories(${Vulkan_INCLUDE_DIR}) include_directories(${Vulkan_INCLUDE_DIR})
endif() endif()
# Define PREFER_VULKAN to prefer Vulkan over the default API
# on GNU/Linux and Windows. Metal is always preferred on macOS.
if(MSVC) if(MSVC)
set(WINDOWS_SYS_LIBS set(WINDOWS_SYS_LIBS
......
...@@ -93,7 +93,7 @@ main(int argc, char* argv[]) ...@@ -93,7 +93,7 @@ main(int argc, char* argv[])
} }
#else #else
if (std::invoke([] { if (std::invoke([] {
#if defined(HAS_VULKAN) && !defined(Q_OS_LINUX) #if defined(HAS_VULKAN) && defined(PREFER_VULKAN)
// Somehow, several bug reports show that, on Windows, QVulkanInstance // Somehow, several bug reports show that, on Windows, QVulkanInstance
// verification passes, but goes on to fail when creating the QQuickWindow // verification passes, but goes on to fail when creating the QQuickWindow
// with "Failed to initialize graphics backend for Vulkan". // with "Failed to initialize graphics backend for Vulkan".
...@@ -119,8 +119,6 @@ main(int argc, char* argv[]) ...@@ -119,8 +119,6 @@ main(int argc, char* argv[])
// removed. So we need to re-implement this (custom controls) // removed. So we need to re-implement this (custom controls)
// or wait for a future version // or wait for a future version
QQuickWindow::setGraphicsApi(QSGRendererInterface::VulkanRhi); QQuickWindow::setGraphicsApi(QSGRendererInterface::VulkanRhi);
} else {
QQuickWindow::setGraphicsApi(QSGRendererInterface::Unknown);
} }
#endif #endif
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment