aboutsummaryrefslogtreecommitdiff
path: root/src/yuzu/vk_device_info.cpp
diff options
context:
space:
mode:
authorcrueter <crueter@eden-emu.dev>2026-05-20 04:49:16 +0200
committercrueter <crueter@eden-emu.dev>2026-05-20 04:49:16 +0200
commitfeb8c5f88eae046c1b76f46e4fa103a844fb0f23 (patch)
tree70f71937a8930c1a5b562f69047e35491d6156b4 /src/yuzu/vk_device_info.cpp
parent300a646a34b6729879e3fb71d53e625a09683bb2 (diff)
[desktop] More qt_common reorganization (#3916)
Ported from QML branch. Main "big" change is that EmuThread is now a shared state in QtCommon, not individually managed/passed around by GRenderWindow and MainWindow. Signed-off-by: crueter <crueter@eden-emu.dev> Reviewed-on: https://git.eden-emu.dev/eden-emu/eden/pulls/3916 Reviewed-by: Lizzie <lizzie@eden-emu.dev> Reviewed-by: MaranBr <maranbr@eden-emu.dev>
Diffstat (limited to 'src/yuzu/vk_device_info.cpp')
-rw-r--r--src/yuzu/vk_device_info.cpp81
1 files changed, 0 insertions, 81 deletions
diff --git a/src/yuzu/vk_device_info.cpp b/src/yuzu/vk_device_info.cpp
deleted file mode 100644
index 1e8e140d77..0000000000
--- a/src/yuzu/vk_device_info.cpp
+++ /dev/null
@@ -1,81 +0,0 @@
-// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
-// SPDX-License-Identifier: GPL-3.0-or-later
-
-// SPDX-FileCopyrightText: 2023 yuzu Emulator Project
-// SPDX-License-Identifier: GPL-2.0-or-later
-
-#include <utility>
-#include <vector>
-
-#include "qt_common/qt_common.h"
-
-#include "common/dynamic_library.h"
-#include "common/logging.h"
-#include "video_core/vulkan_common/vulkan_device.h"
-#include "video_core/vulkan_common/vulkan_instance.h"
-#include "video_core/vulkan_common/vulkan_library.h"
-#include "video_core/vulkan_common/vulkan_surface.h"
-#include "video_core/vulkan_common/vulkan_wrapper.h"
-#include "vulkan/vulkan_core.h"
-#include "yuzu/vk_device_info.h"
-
-class QWindow;
-
-namespace VkDeviceInfo {
-Record::Record(std::string_view name_, const std::vector<VkPresentModeKHR>& vsync_modes_,
- bool has_broken_compute_)
- : name{name_}, vsync_support{vsync_modes_}, has_broken_compute{has_broken_compute_} {}
-
-Record::~Record() = default;
-
-void PopulateRecords(std::vector<Record>& records, QWindow* window) try {
- using namespace Vulkan;
-
- // Create a test window with a Vulkan surface type for checking present modes.
- QWindow test_window(window);
- test_window.setSurfaceType(QWindow::VulkanSurface);
- test_window.create();
- auto wsi = QtCommon::GetWindowSystemInfo(&test_window);
-
- vk::InstanceDispatch dld;
- const auto library = OpenLibrary();
- const vk::Instance instance = CreateInstance(*library, dld, VK_API_VERSION_1_1, wsi.type);
- const std::vector<VkPhysicalDevice> physical_devices = instance.EnumeratePhysicalDevices();
- vk::SurfaceKHR surface = CreateSurface(instance, wsi);
-
- records.clear();
- records.reserve(physical_devices.size());
- for (const VkPhysicalDevice device : physical_devices) {
- const auto physical_device = vk::PhysicalDevice(device, dld);
- std::string name = physical_device.GetProperties().deviceName;
-
- const std::vector<VkPresentModeKHR> present_modes =
- physical_device.GetSurfacePresentModesKHR(*surface);
-
- VkPhysicalDeviceDriverProperties driver_properties{};
- driver_properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_DRIVER_PROPERTIES;
- driver_properties.pNext = nullptr;
- VkPhysicalDeviceProperties2 properties{};
- properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2_KHR;
- properties.pNext = &driver_properties;
- dld.vkGetPhysicalDeviceProperties2(physical_device, &properties);
-
- const auto driverID = driver_properties.driverID;
-
- bool has_broken_compute{
- Vulkan::Device::CheckBrokenCompute(driverID, properties.properties.driverVersion)};
-
- std::string driver_string = Vulkan::vk::GetDriverName(driver_properties);
-
- if (driver_string.empty())
- driver_string = "Unknown";
-
- name = fmt::format("{} ({})", name, driver_string);
-
- records.push_back(VkDeviceInfo::Record(name, present_modes, has_broken_compute));
- }
-} catch (const Vulkan::vk::Exception& exception) {
- LOG_ERROR(Frontend, "Failed to enumerate devices with error: {}", exception.what());
-}
-
-} // namespace VkDeviceInfo