Explorar o código

yuzu: Use test window with VulkanSurface to check for present modes.

It is probably not correct to create a surface on a non-VulkanSurface window.
On macOS this causes a preferences crash due to missing CAMetalLayer.
Steveice10 %!s(int64=3) %!d(string=hai) anos
pai
achega
aa89ec9214
Modificáronse 1 ficheiros con 4 adicións e 1 borrados
  1. 4 1
      src/yuzu/vk_device_info.cpp

+ 4 - 1
src/yuzu/vk_device_info.cpp

@@ -26,7 +26,10 @@ Record::~Record() = default;
 void PopulateRecords(std::vector<Record>& records, QWindow* window) try {
 void PopulateRecords(std::vector<Record>& records, QWindow* window) try {
     using namespace Vulkan;
     using namespace Vulkan;
 
 
-    auto wsi = QtCommon::GetWindowSystemInfo(window);
+    // Create a test window with a Vulkan surface type for checking present modes.
+    QWindow test_window(window);
+    test_window.setSurfaceType(QWindow::VulkanSurface);
+    auto wsi = QtCommon::GetWindowSystemInfo(&test_window);
 
 
     vk::InstanceDispatch dld;
     vk::InstanceDispatch dld;
     const auto library = OpenLibrary();
     const auto library = OpenLibrary();