Skip to content

Commit

Permalink
Merge pull request #1 from suDisdain/test
Browse files Browse the repository at this point in the history
vk_instance.cpp: fix getting driver_id for vulkan device
  • Loading branch information
suDisdain authored Apr 9, 2024
2 parents f5cf180 + 61c417a commit b08004e
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions src/video_core/renderer_vulkan/vk_instance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,16 @@ std::string GetReadableVersion(u32 version) {
} // Anonymous namespace

Instance::Instance(bool enable_validation, bool dump_command_buffers)
: library{OpenLibrary()}, instance{CreateInstance(*library,
Frontend::WindowSystemType::Headless,
enable_validation, dump_command_buffers)},
: library{OpenLibrary()},
instance{CreateInstance(*library, Frontend::WindowSystemType::Headless, enable_validation,
dump_command_buffers)},
physical_devices{instance->enumeratePhysicalDevices()} {}

Instance::Instance(Frontend::EmuWindow& window, u32 physical_device_index)
: library{OpenLibrary(&window)}, instance{CreateInstance(
*library, window.GetWindowInfo().type,
Settings::values.renderer_debug.GetValue(),
Settings::values.dump_command_buffers.GetValue())},
: library{OpenLibrary(&window)},
instance{CreateInstance(*library, window.GetWindowInfo().type,
Settings::values.renderer_debug.GetValue(),
Settings::values.dump_command_buffers.GetValue())},
debug_callback{CreateDebugCallback(*instance, debug_utils_supported)},
physical_devices{instance->enumeratePhysicalDevices()} {
const std::size_t num_physical_devices = static_cast<u16>(physical_devices.size());
Expand Down Expand Up @@ -406,9 +406,15 @@ bool Instance::CreateDevice() {
vk::PhysicalDevicePipelineCreationCacheControlFeaturesEXT,
vk::PhysicalDeviceFragmentShaderBarycentricFeaturesKHR>();
const vk::StructureChain properties_chain =
physical_device.getProperties2<vk::PhysicalDeviceProperties2,
vk::PhysicalDevicePortabilitySubsetPropertiesKHR,
vk::PhysicalDeviceExternalMemoryHostPropertiesEXT>();
physical_device
.getProperties2<vk::PhysicalDeviceProperties2, vk::PhysicalDeviceDriverProperties,
vk::PhysicalDevicePortabilitySubsetPropertiesKHR,
vk::PhysicalDeviceExternalMemoryHostPropertiesEXT>();
const vk::PhysicalDeviceDriverProperties driver =
properties_chain.get<vk::PhysicalDeviceDriverProperties>();

driver_id = driver.driverID;
vendor_name = driver.driverName.data();

features = feature_chain.get().features;
if (available_extensions.empty()) {
Expand Down

0 comments on commit b08004e

Please sign in to comment.