diff options
author | Elijah <elitkramer@gmail.com> | 2024-01-25 16:07:20 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-26 01:07:20 +0100 |
commit | d7ec4308b45d4ecb8d77cdc8d98ee618944292ed (patch) | |
tree | 7c14d1c74c6ed77f539c4d26fe3ab37b26858bb1 /src/Ryujinx.Graphics.Vulkan/VulkanPhysicalDevice.cs | |
parent | fbdd390f902f5d37a3ae759de81076d925c014f9 (diff) |
Use driver name instead of vendor name in the status bar for Vulkan. (#6146)1.1.1135
* Replace vendor id lookup with driver name
* Create separate field for driver name, handle OpenGL
* Document changes in VulkanPhysicalDevice.cs
* Always display driver over vendor
* Replace Vulkan 1.2 requirement with VK_KHR_driver_properties
* Remove empty line
* Remove redundant unsafe block
* Apply suggestions from code review
---------
Co-authored-by: Ac_K <Acoustik666@gmail.com>
Diffstat (limited to 'src/Ryujinx.Graphics.Vulkan/VulkanPhysicalDevice.cs')
-rw-r--r-- | src/Ryujinx.Graphics.Vulkan/VulkanPhysicalDevice.cs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/Ryujinx.Graphics.Vulkan/VulkanPhysicalDevice.cs b/src/Ryujinx.Graphics.Vulkan/VulkanPhysicalDevice.cs index 547f3654..3bee1e9d 100644 --- a/src/Ryujinx.Graphics.Vulkan/VulkanPhysicalDevice.cs +++ b/src/Ryujinx.Graphics.Vulkan/VulkanPhysicalDevice.cs @@ -58,6 +58,33 @@ namespace Ryujinx.Graphics.Vulkan public bool IsDeviceExtensionPresent(string extension) => DeviceExtensions.Contains(extension); + public unsafe bool TryGetPhysicalDeviceDriverPropertiesKHR(Vk api, out PhysicalDeviceDriverPropertiesKHR res) + { + if (!IsDeviceExtensionPresent("VK_KHR_driver_properties")) + { + res = default; + + return false; + } + + PhysicalDeviceDriverPropertiesKHR physicalDeviceDriverProperties = new() + { + SType = StructureType.PhysicalDeviceDriverPropertiesKhr + }; + + PhysicalDeviceProperties2 physicalDeviceProperties2 = new() + { + SType = StructureType.PhysicalDeviceProperties2, + PNext = &physicalDeviceDriverProperties + }; + + api.GetPhysicalDeviceProperties2(PhysicalDevice, &physicalDeviceProperties2); + + res = physicalDeviceDriverProperties; + + return true; + } + public DeviceInfo ToDeviceInfo() { return new DeviceInfo( |