Support non-constant texture offsets on non-NVIDIA gpus

This commit is contained in:
gdkchan 2019-12-11 03:54:18 -03:00 committed by Thog
parent 3323a3a042
commit f2c85c5d58
11 changed files with 319 additions and 33 deletions

View file

@ -11,11 +11,14 @@ namespace Ryujinx.Graphics.OpenGL
private static Lazy<int> _maximumComputeSharedMemorySize = new Lazy<int>(() => GetLimit(All.MaxComputeSharedMemorySize));
private static Lazy<int> _storageBufferOffsetAlignment = new Lazy<int>(() => GetLimit(All.ShaderStorageBufferOffsetAlignment));
public static bool SupportsAstcCompression => _supportsAstcCompression.Value;
private static Lazy<bool> _isNvidiaDriver = new Lazy<bool>(() => IsNvidiaDriver());
public static int MaximumViewportDimensions => _maximumViewportDimensions.Value;
public static int MaximumComputeSharedMemorySize => _maximumComputeSharedMemorySize.Value;
public static int StorageBufferOffsetAlignment => _storageBufferOffsetAlignment.Value;
public static bool SupportsAstcCompression => _supportsAstcCompression.Value;
public static bool SupportsNonConstantTextureOffset => _isNvidiaDriver.Value;
public static int MaximumViewportDimensions => _maximumViewportDimensions.Value;
public static int MaximumComputeSharedMemorySize => _maximumComputeSharedMemorySize.Value;
public static int StorageBufferOffsetAlignment => _storageBufferOffsetAlignment.Value;
private static bool HasExtension(string name)
{
@ -36,5 +39,10 @@ namespace Ryujinx.Graphics.OpenGL
{
return GL.GetInteger((GetPName)name);
}
private static bool IsNvidiaDriver()
{
return GL.GetString(StringName.Vendor).Equals("NVIDIA Corporation");
}
}
}