From 2bb39ff03e7f8b4f3383d5a5383dc9cbd808f0b6 Mon Sep 17 00:00:00 2001 From: gdkchan Date: Sun, 12 Jan 2020 19:12:40 -0300 Subject: [PATCH] Replace glFinish with barrier for WaitForIdle (#878) --- Ryujinx.Graphics.GAL/IPipeline.cs | 2 ++ Ryujinx.Graphics.GAL/IRenderer.cs | 2 -- Ryujinx.Graphics.Gpu/NvGpuFifo.cs | 2 +- Ryujinx.Graphics.OpenGL/Pipeline.cs | 5 +++++ Ryujinx.Graphics.OpenGL/Renderer.cs | 5 ----- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Ryujinx.Graphics.GAL/IPipeline.cs b/Ryujinx.Graphics.GAL/IPipeline.cs index 1a502913b7..41e35dd40a 100644 --- a/Ryujinx.Graphics.GAL/IPipeline.cs +++ b/Ryujinx.Graphics.GAL/IPipeline.cs @@ -4,6 +4,8 @@ namespace Ryujinx.Graphics.GAL { public interface IPipeline { + void Barrier(); + void ClearRenderTargetColor(int index, uint componentMask, ColorF color); void ClearRenderTargetDepthStencil( diff --git a/Ryujinx.Graphics.GAL/IRenderer.cs b/Ryujinx.Graphics.GAL/IRenderer.cs index 1139ba0609..56856b2368 100644 --- a/Ryujinx.Graphics.GAL/IRenderer.cs +++ b/Ryujinx.Graphics.GAL/IRenderer.cs @@ -18,8 +18,6 @@ namespace Ryujinx.Graphics.GAL ISampler CreateSampler(SamplerCreateInfo info); ITexture CreateTexture(TextureCreateInfo info); - void FlushPipelines(); - Capabilities GetCapabilities(); ulong GetCounter(CounterType type); diff --git a/Ryujinx.Graphics.Gpu/NvGpuFifo.cs b/Ryujinx.Graphics.Gpu/NvGpuFifo.cs index 853e5dfdd3..11a9e3fba4 100644 --- a/Ryujinx.Graphics.Gpu/NvGpuFifo.cs +++ b/Ryujinx.Graphics.Gpu/NvGpuFifo.cs @@ -154,7 +154,7 @@ namespace Ryujinx.Graphics.Gpu { _context.Methods.PerformDeferredDraws(); - _context.Renderer.FlushPipelines(); + _context.Renderer.Pipeline.Barrier(); break; } diff --git a/Ryujinx.Graphics.OpenGL/Pipeline.cs b/Ryujinx.Graphics.OpenGL/Pipeline.cs index 669cfe3e99..c9d8186f26 100644 --- a/Ryujinx.Graphics.OpenGL/Pipeline.cs +++ b/Ryujinx.Graphics.OpenGL/Pipeline.cs @@ -37,6 +37,11 @@ namespace Ryujinx.Graphics.OpenGL _clipDepthMode = ClipDepthMode.NegativeOneToOne; } + public void Barrier() + { + GL.MemoryBarrier(MemoryBarrierFlags.AllBarrierBits); + } + public void ClearRenderTargetColor(int index, uint componentMask, ColorF color) { GL.ColorMask( diff --git a/Ryujinx.Graphics.OpenGL/Renderer.cs b/Ryujinx.Graphics.OpenGL/Renderer.cs index 29a0ea2954..ccb53397d1 100644 --- a/Ryujinx.Graphics.OpenGL/Renderer.cs +++ b/Ryujinx.Graphics.OpenGL/Renderer.cs @@ -55,11 +55,6 @@ namespace Ryujinx.Graphics.OpenGL return new TextureStorage(this, info).CreateDefaultView(); } - public void FlushPipelines() - { - GL.Finish(); - } - public Capabilities GetCapabilities() { return new Capabilities(