diff options
| author | gdkchan <gab.dark.100@gmail.com> | 2021-10-28 19:53:12 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-28 19:53:12 -0300 |
| commit | 99445dd0a63f4a6fcb53e7818cda689d8299453b (patch) | |
| tree | 9d979f95e3e4cdf12999bc005655505953a60613 /Ryujinx.Graphics.OpenGL | |
| parent | a7a40a77f2c07ea0ea9f6e7bfb57dbe9fce06db7 (diff) | |
Add support for fragment shader interlock (#2768)
* Support coherent images
* Add support for fragment shader interlock
* Change to tree based match approach
* Refactor + check for branch targets and external registers
* Make detection more robust
* Use Intel fragment shader ordering if interlock is not available, use nothing if both are not available
* Remove unused field
Diffstat (limited to 'Ryujinx.Graphics.OpenGL')
| -rw-r--r-- | Ryujinx.Graphics.OpenGL/HwCapabilities.cs | 8 | ||||
| -rw-r--r-- | Ryujinx.Graphics.OpenGL/Renderer.cs | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/Ryujinx.Graphics.OpenGL/HwCapabilities.cs b/Ryujinx.Graphics.OpenGL/HwCapabilities.cs index 9a62bb2e..ec9bd4a2 100644 --- a/Ryujinx.Graphics.OpenGL/HwCapabilities.cs +++ b/Ryujinx.Graphics.OpenGL/HwCapabilities.cs @@ -6,7 +6,10 @@ namespace Ryujinx.Graphics.OpenGL static class HwCapabilities { private static readonly Lazy<bool> _supportsAstcCompression = new Lazy<bool>(() => HasExtension("GL_KHR_texture_compression_astc_ldr")); + private static readonly Lazy<bool> _supportsFragmentShaderInterlock = new Lazy<bool>(() => HasExtension("GL_ARB_fragment_shader_interlock")); + private static readonly Lazy<bool> _supportsFragmentShaderOrdering = new Lazy<bool>(() => HasExtension("GL_INTEL_fragment_shader_ordering")); private static readonly Lazy<bool> _supportsImageLoadFormatted = new Lazy<bool>(() => HasExtension("GL_EXT_shader_image_load_formatted")); + private static readonly Lazy<bool> _supportsIndirectParameters = new Lazy<bool>(() => HasExtension("GL_ARB_indirect_parameters")); private static readonly Lazy<bool> _supportsParallelShaderCompile = new Lazy<bool>(() => HasExtension("GL_ARB_parallel_shader_compile")); private static readonly Lazy<bool> _supportsPolygonOffsetClamp = new Lazy<bool>(() => HasExtension("GL_EXT_polygon_offset_clamp")); private static readonly Lazy<bool> _supportsQuads = new Lazy<bool>(SupportsQuadsCheck); @@ -14,7 +17,6 @@ namespace Ryujinx.Graphics.OpenGL private static readonly Lazy<bool> _supportsShaderBallot = new Lazy<bool>(() => HasExtension("GL_ARB_shader_ballot")); private static readonly Lazy<bool> _supportsTextureShadowLod = new Lazy<bool>(() => HasExtension("GL_EXT_texture_shadow_lod")); private static readonly Lazy<bool> _supportsViewportSwizzle = new Lazy<bool>(() => HasExtension("GL_NV_viewport_swizzle")); - private static readonly Lazy<bool> _supportsIndirectParameters = new Lazy<bool>(() => HasExtension("GL_ARB_indirect_parameters")); private static readonly Lazy<int> _maximumComputeSharedMemorySize = new Lazy<int>(() => GetLimit(All.MaxComputeSharedMemorySize)); private static readonly Lazy<int> _storageBufferOffsetAlignment = new Lazy<int>(() => GetLimit(All.ShaderStorageBufferOffsetAlignment)); @@ -41,7 +43,10 @@ namespace Ryujinx.Graphics.OpenGL public static bool UsePersistentBufferForFlush => _gpuVendor.Value == GpuVendor.AmdWindows || _gpuVendor.Value == GpuVendor.Nvidia; public static bool SupportsAstcCompression => _supportsAstcCompression.Value; + public static bool SupportsFragmentShaderInterlock => _supportsFragmentShaderInterlock.Value; + public static bool SupportsFragmentShaderOrdering => _supportsFragmentShaderOrdering.Value; public static bool SupportsImageLoadFormatted => _supportsImageLoadFormatted.Value; + public static bool SupportsIndirectParameters => _supportsIndirectParameters.Value; public static bool SupportsParallelShaderCompile => _supportsParallelShaderCompile.Value; public static bool SupportsPolygonOffsetClamp => _supportsPolygonOffsetClamp.Value; public static bool SupportsQuads => _supportsQuads.Value; @@ -49,7 +54,6 @@ namespace Ryujinx.Graphics.OpenGL public static bool SupportsShaderBallot => _supportsShaderBallot.Value; public static bool SupportsTextureShadowLod => _supportsTextureShadowLod.Value; public static bool SupportsViewportSwizzle => _supportsViewportSwizzle.Value; - public static bool SupportsIndirectParameters => _supportsIndirectParameters.Value; public static bool SupportsMismatchingViewFormat => _gpuVendor.Value != GpuVendor.AmdWindows && _gpuVendor.Value != GpuVendor.IntelWindows; public static bool SupportsNonConstantTextureOffset => _gpuVendor.Value == GpuVendor.Nvidia; diff --git a/Ryujinx.Graphics.OpenGL/Renderer.cs b/Ryujinx.Graphics.OpenGL/Renderer.cs index 768c7450..25b762b2 100644 --- a/Ryujinx.Graphics.OpenGL/Renderer.cs +++ b/Ryujinx.Graphics.OpenGL/Renderer.cs @@ -104,6 +104,8 @@ namespace Ryujinx.Graphics.OpenGL HwCapabilities.Vendor == HwCapabilities.GpuVendor.IntelWindows, HwCapabilities.Vendor == HwCapabilities.GpuVendor.AmdWindows, HwCapabilities.SupportsAstcCompression, + HwCapabilities.SupportsFragmentShaderInterlock, + HwCapabilities.SupportsFragmentShaderOrdering, HwCapabilities.SupportsImageLoadFormatted, HwCapabilities.SupportsMismatchingViewFormat, HwCapabilities.SupportsNonConstantTextureOffset, |
