diff --git a/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs b/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs index 34e3f946a2..0b0e2d57b6 100644 --- a/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs +++ b/BizHawk.Client.EmuHawk/DisplayManager/DisplayManager.cs @@ -311,7 +311,12 @@ TESTEROO: fPresent.GuiRenderer = Renderer; fPresent.GL = GL; - CurrentFilterProgram.Compile("default", chain_insize, chain_outsize); + CurrentFilterProgram.Compile("default", chain_insize, chain_outsize); + + //begin rendering on this context + //should this have been done earlier? + //do i need to check this on an intel video card to see if running excessively is a problem? (it used to be in the FinalTarget command below, shouldnt be a problem) + GraphicsControl.Begin(); //run filter chain Texture2d texCurr = null; @@ -351,7 +356,7 @@ TESTEROO: inFinalTarget = true; rtCurr = null; CurrentFilterProgram.CurrRenderTarget = null; - GraphicsControl.Begin(); + GL.BindRenderTarget(null); break; } } @@ -423,6 +428,7 @@ TESTEROO: var surf = LockLuaSurface(kvp.Key); surf.Clear(); UnlockLuaSurface(surf); + LuaSurfaceSets[kvp.Key].SetPending(null); } } diff --git a/BizHawk.Client.EmuHawk/DisplayManager/SwappableDisplaySurfaceSet.cs b/BizHawk.Client.EmuHawk/DisplayManager/SwappableDisplaySurfaceSet.cs index 41654b9ef2..e3119309fc 100644 --- a/BizHawk.Client.EmuHawk/DisplayManager/SwappableDisplaySurfaceSet.cs +++ b/BizHawk.Client.EmuHawk/DisplayManager/SwappableDisplaySurfaceSet.cs @@ -16,6 +16,7 @@ namespace BizHawk.Client.EmuHawk class SwappableDisplaySurfaceSet { DisplaySurface Pending, Current; + bool IsPending; Queue ReleasedSurfaces = new Queue(); /// @@ -50,6 +51,7 @@ namespace BizHawk.Client.EmuHawk { if (Pending != null) ReleasedSurfaces.Enqueue(Pending); Pending = newPending; + IsPending = true; } } @@ -65,11 +67,12 @@ namespace BizHawk.Client.EmuHawk { lock (this) { - if (Pending != null) + if (IsPending) { if (Current != null) ReleasedSurfaces.Enqueue(Current); Current = Pending; Pending = null; + IsPending = false; } } return Current;