Просмотр исходного кода

Replace glFinish with barrier for WaitForIdle (#878)

gdkchan 6 лет назад
Родитель
Сommit
2bb39ff03e

+ 2 - 0
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(

+ 0 - 2
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);

+ 1 - 1
Ryujinx.Graphics.Gpu/NvGpuFifo.cs

@@ -154,7 +154,7 @@ namespace Ryujinx.Graphics.Gpu
                     {
                         _context.Methods.PerformDeferredDraws();
 
-                        _context.Renderer.FlushPipelines();
+                        _context.Renderer.Pipeline.Barrier();
 
                         break;
                     }

+ 5 - 0
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(

+ 0 - 5
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(