Use driver name instead of vendor name in the status bar for Vulkan. (#6146)

* 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>
This commit is contained in:
Elijah 2024-01-25 16:07:20 -08:00 committed by GitHub
parent fbdd390f90
commit d7ec4308b4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 47 additions and 14 deletions

View file

@ -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(