mirror of
https://git.ryujinx.app/projects/Kenji-NX.git
synced 2026-09-27 12:37:54 +02:00
Compare commits
2
Commits
1a1fe53535
...
bed294bb92
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
bed294bb92 | ||
|
|
ed70f7921e |
@@ -5,12 +5,14 @@ namespace Ryujinx.Graphics.GAL
|
||||
public string GpuVendor { get; }
|
||||
public string GpuModel { get; }
|
||||
public string GpuDriver { get; }
|
||||
public string GpuDriverVersion { get; }
|
||||
|
||||
public HardwareInfo(string gpuVendor, string gpuModel, string gpuDriver)
|
||||
public HardwareInfo(string gpuVendor, string gpuModel, string gpuDriver, string gpuDriverVersion)
|
||||
{
|
||||
GpuVendor = gpuVendor;
|
||||
GpuModel = gpuModel;
|
||||
GpuDriver = gpuDriver;
|
||||
GpuDriverVersion = gpuDriverVersion;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,7 +133,7 @@ namespace Ryujinx.Graphics.OpenGL
|
||||
|
||||
public HardwareInfo GetHardwareInfo()
|
||||
{
|
||||
return new HardwareInfo(GpuVendor, GpuRenderer, GpuVendor); // OpenGL does not provide a driver name, vendor name is closest analogue.
|
||||
return new HardwareInfo(GpuVendor, GpuRenderer, GpuVendor, GpuVersion); // OpenGL does not provide a driver name, vendor name is closest analogue.
|
||||
}
|
||||
|
||||
public PinnedSpan<byte> GetBufferData(BufferHandle buffer, int offset, int size)
|
||||
|
||||
@@ -27,6 +27,9 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
[GeneratedRegex("NVIDIA GeForce (R|G)?TX? (\\d{3}\\d?)M?")]
|
||||
public static partial Regex NvidiaConsumerClassRegex();
|
||||
|
||||
[GeneratedRegex(@"^\d+\.\d+\.\d+\.\d+$")]
|
||||
internal static partial Regex IntelWindowsDriverVersionRegex();
|
||||
|
||||
public static Vendor FromId(uint id)
|
||||
{
|
||||
return id switch
|
||||
|
||||
@@ -105,6 +105,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
public string GpuDriver { get; private set; }
|
||||
public string GpuRenderer { get; private set; }
|
||||
public string GpuVersion { get; private set; }
|
||||
public string GpuDriverVersion { get; private set; }
|
||||
|
||||
public bool PreferThreading => true;
|
||||
|
||||
@@ -177,6 +178,14 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
SType = StructureType.PhysicalDeviceProperties2,
|
||||
};
|
||||
|
||||
PhysicalDeviceIDProperties propertiesId = new()
|
||||
{
|
||||
SType = StructureType.PhysicalDeviceIDProperties,
|
||||
PNext = properties2.PNext,
|
||||
};
|
||||
|
||||
properties2.PNext = &propertiesId;
|
||||
|
||||
PhysicalDeviceSubgroupProperties propertiesSubgroup = new()
|
||||
{
|
||||
SType = StructureType.PhysicalDeviceSubgroupProperties,
|
||||
@@ -367,13 +376,17 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
GpuVendor = VendorUtils.GetNameFromId(properties.VendorID);
|
||||
GpuDriver = hasDriverProperties && !OperatingSystem.IsMacOS() ?
|
||||
VendorUtils.GetFriendlyDriverName(driverProperties.DriverID) : GpuVendor; // Fallback to vendor name if driver is unavailable or on MacOS where vendor is preferred.
|
||||
GpuDriverVersion = TryGetIntelWindowsDriverVersionFromUuid(ref propertiesId, out string intelDriverVersion) ? intelDriverVersion :
|
||||
hasDriverProperties ?
|
||||
GetDriverInfo(ref driverProperties) ?? ParseDriverVersion(ref properties) :
|
||||
ParseDriverVersion(ref properties);
|
||||
|
||||
fixed (byte* deviceName = properties.DeviceName)
|
||||
{
|
||||
GpuRenderer = Marshal.PtrToStringAnsi((nint)deviceName);
|
||||
}
|
||||
|
||||
GpuVersion = $"Vulkan v{ParseStandardVulkanVersion(properties.ApiVersion)}, Driver v{ParseDriverVersion(ref properties)}";
|
||||
GpuVersion = $"Vulkan v{ParseStandardVulkanVersion(properties.ApiVersion)}";
|
||||
|
||||
IsAmdGcn = !IsMoltenVk && Vendor == Vendor.Amd && VendorUtils.AmdGcnRegex().IsMatch(GpuRenderer);
|
||||
|
||||
@@ -824,7 +837,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
|
||||
public HardwareInfo GetHardwareInfo()
|
||||
{
|
||||
return new HardwareInfo(GpuVendor, GpuRenderer, GpuDriver);
|
||||
return new HardwareInfo(GpuVendor, GpuRenderer, GpuDriver, GpuDriverVersion);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -874,9 +887,55 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
return $"{(driverVersionRaw >> 22) & 0x3FF}.{(driverVersionRaw >> 14) & 0xFF}.{(driverVersionRaw >> 6) & 0xFF}.{driverVersionRaw & 0x3F}";
|
||||
}
|
||||
|
||||
// Intel's Windows Vulkan driver exposes the 101.xxxx build portion in a custom layout.
|
||||
if (properties.VendorID == 0x8086 && OperatingSystem.IsWindows())
|
||||
{
|
||||
return $"{driverVersionRaw >> 14}.{driverVersionRaw & 0x3FFF}";
|
||||
}
|
||||
|
||||
return ParseStandardVulkanVersion(driverVersionRaw);
|
||||
}
|
||||
|
||||
private static unsafe string GetDriverInfo(ref PhysicalDeviceDriverPropertiesKHR driverProperties)
|
||||
{
|
||||
fixed (byte* driverInfo = driverProperties.DriverInfo)
|
||||
{
|
||||
string driverInfoString = Marshal.PtrToStringAnsi((nint)driverInfo);
|
||||
|
||||
return string.IsNullOrWhiteSpace(driverInfoString) ? null : driverInfoString;
|
||||
}
|
||||
}
|
||||
|
||||
private static unsafe bool TryGetIntelWindowsDriverVersionFromUuid(ref PhysicalDeviceIDProperties propertiesId, out string driverVersion)
|
||||
{
|
||||
driverVersion = null;
|
||||
|
||||
if (!OperatingSystem.IsWindows())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
fixed (byte* driverUuid = propertiesId.DriverUuid)
|
||||
{
|
||||
string driverUuidString = Marshal.PtrToStringAnsi((nint)driverUuid, (int)Vk.UuidSize);
|
||||
int terminatorIndex = driverUuidString.IndexOf('\0');
|
||||
|
||||
if (terminatorIndex >= 0)
|
||||
{
|
||||
driverUuidString = driverUuidString[..terminatorIndex];
|
||||
}
|
||||
|
||||
if (VendorUtils.IntelWindowsDriverVersionRegex().IsMatch(driverUuidString))
|
||||
{
|
||||
driverVersion = driverUuidString;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
internal PrimitiveTopology TopologyRemap(PrimitiveTopology topology)
|
||||
{
|
||||
return topology switch
|
||||
@@ -902,7 +961,7 @@ namespace Ryujinx.Graphics.Vulkan
|
||||
|
||||
private void PrintGpuInformation()
|
||||
{
|
||||
Logger.Notice.Print(LogClass.Gpu, $"{GpuVendor} {GpuRenderer} ({GpuVersion})");
|
||||
Logger.Notice.Print(LogClass.Gpu, $"{GpuVendor} {GpuRenderer} ({GpuVersion}, Driver: {GpuDriver} {GpuDriverVersion})");
|
||||
Logger.Notice.Print(LogClass.Gpu, $"GPU Memory: {GetTotalGPUMemory() / (1024 * 1024)} MiB");
|
||||
}
|
||||
|
||||
|
||||
@@ -189,13 +189,13 @@
|
||||
Click="StopEmulation_Click"
|
||||
Header="{locale:Locale MenuBarOptionsStopEmulation}"
|
||||
InputGesture="Escape"
|
||||
IsEnabled="{Binding IsGameRunning}" />
|
||||
<MenuItem
|
||||
Name="RestartEmulationMenuItem"
|
||||
Header="{locale:Locale MenuBarOptionsRestartEmulation}"
|
||||
InputGesture="Ctrl + R"
|
||||
IsEnabled="{Binding IsGameRunning}"
|
||||
ToolTip.Tip="{locale:Locale StopEmulationTooltip}" />
|
||||
<MenuItem
|
||||
Click="RestartEmulation_Click"
|
||||
Header="{locale:Locale MenuBarOptionsRestartEmulation}"
|
||||
InputGesture="Ctrl + R"
|
||||
IsEnabled="{Binding IsGameRunning}" />
|
||||
<MenuItem Command="{Binding SimulateWakeUpMessage}" Header="{locale:Locale MenuBarOptionsSimulateWakeUpMessage}" />
|
||||
<Separator />
|
||||
<MenuItem
|
||||
|
||||
@@ -119,6 +119,11 @@ namespace Ryujinx.Ava.UI.Views.Main
|
||||
Window.ViewModel.AppHost?.Resume();
|
||||
}
|
||||
|
||||
private void RestartEmulation_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Window.ViewModel?.RestartEmulation();
|
||||
}
|
||||
|
||||
public async void OpenMiiApplet(object sender, RoutedEventArgs e)
|
||||
{
|
||||
string contentPath = ViewModel.ContentManager.GetInstalledContentPath(0x0100000000001009, StorageId.BuiltInSystem, NcaContentType.Program);
|
||||
|
||||
Reference in New Issue
Block a user