aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorgdkchan <gab.dark.100@gmail.com>2024-03-26 22:27:48 -0300
committerGitHub <noreply@github.com>2024-03-26 22:27:48 -0300
commit72bdc24db8047b015490182b6156c67b31f88669 (patch)
treebde9fc2deb6c4638ccee4164c1407cfdc48538eb /src
parent43514771bf22b3d2f666e83f0b7c7ab515821d7f (diff)
Disable push descriptors for Intel ARC GPUs on Windows (#6551)
* Move some init logic out of PrintGpuInformation, then delete it * Disable push descriptors for Intel ARC on Windows * Re-add PrintGpuInformation just to show it in the log
Diffstat (limited to 'src')
-rw-r--r--src/Ryujinx.Graphics.Vulkan/ShaderCollection.cs8
-rw-r--r--src/Ryujinx.Graphics.Vulkan/VulkanRenderer.cs94
2 files changed, 58 insertions, 44 deletions
diff --git a/src/Ryujinx.Graphics.Vulkan/ShaderCollection.cs b/src/Ryujinx.Graphics.Vulkan/ShaderCollection.cs
index 7f687fb4..e4ea0e4e 100644
--- a/src/Ryujinx.Graphics.Vulkan/ShaderCollection.cs
+++ b/src/Ryujinx.Graphics.Vulkan/ShaderCollection.cs
@@ -111,8 +111,8 @@ namespace Ryujinx.Graphics.Vulkan
bool usePushDescriptors = !isMinimal &&
VulkanConfiguration.UsePushDescriptors &&
_gd.Capabilities.SupportsPushDescriptors &&
- !_gd.IsNvidiaPreTuring &&
!IsCompute &&
+ !HasPushDescriptorsBug(gd) &&
CanUsePushDescriptors(gd, resourceLayout, IsCompute);
ReadOnlyCollection<ResourceDescriptorCollection> sets = usePushDescriptors ?
@@ -147,6 +147,12 @@ namespace Ryujinx.Graphics.Vulkan
_firstBackgroundUse = !fromCache;
}
+ private static bool HasPushDescriptorsBug(VulkanRenderer gd)
+ {
+ // Those GPUs/drivers do not work properly with push descriptors, so we must force disable them.
+ return gd.IsNvidiaPreTuring || (gd.IsIntelArc && gd.IsIntelWindows);
+ }
+
private static bool CanUsePushDescriptors(VulkanRenderer gd, ResourceLayout layout, bool isCompute)
{
// If binding 3 is immediately used, use an alternate set of reserved bindings.
diff --git a/src/Ryujinx.Graphics.Vulkan/VulkanRenderer.cs b/src/Ryujinx.Graphics.Vulkan/VulkanRenderer.cs
index 7d7c1095..ede54a6f 100644
--- a/src/Ryujinx.Graphics.Vulkan/VulkanRenderer.cs
+++ b/src/Ryujinx.Graphics.Vulkan/VulkanRenderer.cs
@@ -87,6 +87,7 @@ namespace Ryujinx.Graphics.Vulkan
internal bool IsIntelWindows { get; private set; }
internal bool IsAmdGcn { get; private set; }
internal bool IsNvidiaPreTuring { get; private set; }
+ internal bool IsIntelArc { get; private set; }
internal bool IsMoltenVk { get; private set; }
internal bool IsTBDR { get; private set; }
internal bool IsSharedMemory { get; private set; }
@@ -310,6 +311,51 @@ namespace Ryujinx.Graphics.Vulkan
ref var properties = ref properties2.Properties;
+ var hasDriverProperties = _physicalDevice.TryGetPhysicalDeviceDriverPropertiesKHR(Api, out var driverProperties);
+
+ string vendorName = VendorUtils.GetNameFromId(properties.VendorID);
+
+ Vendor = VendorUtils.FromId(properties.VendorID);
+
+ IsAmdWindows = Vendor == Vendor.Amd && OperatingSystem.IsWindows();
+ IsIntelWindows = Vendor == Vendor.Intel && OperatingSystem.IsWindows();
+ IsTBDR =
+ Vendor == Vendor.Apple ||
+ Vendor == Vendor.Qualcomm ||
+ Vendor == Vendor.ARM ||
+ Vendor == Vendor.Broadcom ||
+ Vendor == Vendor.ImgTec;
+
+ GpuVendor = vendorName;
+ GpuDriver = hasDriverProperties ? Marshal.PtrToStringAnsi((IntPtr)driverProperties.DriverName) : vendorName; // Fall back to vendor name if driver name isn't available.
+
+ fixed (byte* deviceName = properties.DeviceName)
+ {
+ GpuRenderer = Marshal.PtrToStringAnsi((IntPtr)deviceName);
+ }
+
+ GpuVersion = $"Vulkan v{ParseStandardVulkanVersion(properties.ApiVersion)}, Driver v{ParseDriverVersion(ref properties)}";
+
+ IsAmdGcn = !IsMoltenVk && Vendor == Vendor.Amd && VendorUtils.AmdGcnRegex().IsMatch(GpuRenderer);
+
+ if (Vendor == Vendor.Nvidia)
+ {
+ var match = VendorUtils.NvidiaConsumerClassRegex().Match(GpuRenderer);
+
+ if (match != null && int.TryParse(match.Groups[2].Value, out int gpuNumber))
+ {
+ IsNvidiaPreTuring = gpuNumber < 2000;
+ }
+ else if (GpuDriver.Contains("TITAN") && !GpuDriver.Contains("RTX"))
+ {
+ IsNvidiaPreTuring = true;
+ }
+ }
+ else if (Vendor == Vendor.Intel)
+ {
+ IsIntelArc = GpuRenderer.StartsWith("Intel(R) Arc(TM)");
+ }
+
ulong minResourceAlignment = Math.Max(
Math.Max(
properties.Limits.MinStorageBufferOffsetAlignment,
@@ -732,49 +778,6 @@ namespace Ryujinx.Graphics.Vulkan
return ParseStandardVulkanVersion(driverVersionRaw);
}
- private unsafe void PrintGpuInformation()
- {
- var properties = _physicalDevice.PhysicalDeviceProperties;
-
- var hasDriverProperties = _physicalDevice.TryGetPhysicalDeviceDriverPropertiesKHR(Api, out var driverProperties);
-
- string vendorName = VendorUtils.GetNameFromId(properties.VendorID);
-
- Vendor = VendorUtils.FromId(properties.VendorID);
-
- IsAmdWindows = Vendor == Vendor.Amd && OperatingSystem.IsWindows();
- IsIntelWindows = Vendor == Vendor.Intel && OperatingSystem.IsWindows();
- IsTBDR =
- Vendor == Vendor.Apple ||
- Vendor == Vendor.Qualcomm ||
- Vendor == Vendor.ARM ||
- Vendor == Vendor.Broadcom ||
- Vendor == Vendor.ImgTec;
-
- GpuVendor = vendorName;
- GpuDriver = hasDriverProperties ? Marshal.PtrToStringAnsi((IntPtr)driverProperties.DriverName) : vendorName; // Fall back to vendor name if driver name isn't available.
- GpuRenderer = Marshal.PtrToStringAnsi((IntPtr)properties.DeviceName);
- GpuVersion = $"Vulkan v{ParseStandardVulkanVersion(properties.ApiVersion)}, Driver v{ParseDriverVersion(ref properties)}";
-
- IsAmdGcn = !IsMoltenVk && Vendor == Vendor.Amd && VendorUtils.AmdGcnRegex().IsMatch(GpuRenderer);
-
- if (Vendor == Vendor.Nvidia)
- {
- var match = VendorUtils.NvidiaConsumerClassRegex().Match(GpuRenderer);
-
- if (match != null && int.TryParse(match.Groups[2].Value, out int gpuNumber))
- {
- IsNvidiaPreTuring = gpuNumber < 2000;
- }
- else if (GpuDriver.Contains("TITAN") && !GpuDriver.Contains("RTX"))
- {
- IsNvidiaPreTuring = true;
- }
- }
-
- Logger.Notice.Print(LogClass.Gpu, $"{GpuVendor} {GpuRenderer} ({GpuVersion})");
- }
-
internal PrimitiveTopology TopologyRemap(PrimitiveTopology topology)
{
return topology switch
@@ -798,6 +801,11 @@ namespace Ryujinx.Graphics.Vulkan
};
}
+ private void PrintGpuInformation()
+ {
+ Logger.Notice.Print(LogClass.Gpu, $"{GpuVendor} {GpuRenderer} ({GpuVersion})");
+ }
+
public void Initialize(GraphicsDebugLevel logLevel)
{
SetupContext(logLevel);