From 5ce0ace1cdfdb77c924ca0442db633199c280bf2 Mon Sep 17 00:00:00 2001 From: zeromus Date: Sat, 26 Mar 2016 12:35:58 -0500 Subject: [PATCH] fix flashes of garbage while changing vsync toggle (includes when fast-forwarding) on d3d display method --- .../IGL_SlimDX9.cs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/Bizware/BizHawk.Bizware.BizwareGL.SlimDX/IGL_SlimDX9.cs b/Bizware/BizHawk.Bizware.BizwareGL.SlimDX/IGL_SlimDX9.cs index d1820cd181..b55a61d916 100644 --- a/Bizware/BizHawk.Bizware.BizwareGL.SlimDX/IGL_SlimDX9.cs +++ b/Bizware/BizHawk.Bizware.BizwareGL.SlimDX/IGL_SlimDX9.cs @@ -804,9 +804,9 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.SlimDX public void BeginControl(GLControlWrapper_SlimDX9 control) { _CurrentControl = control; - var bb = control.SwapChain.GetBackBuffer(0); - dev.SetRenderTarget(0, bb); - bb.Dispose(); + //don't dispose this backbuffer reference, even though it's tempting to. + //it results in weird flashes of corruption when changing the vsync setting (unproven; it's another similar code sequence that broke it) + dev.SetRenderTarget(0, _CurrentControl.SwapChain.GetBackBuffer(0)); } public void EndControl(GLControlWrapper_SlimDX9 control) @@ -814,9 +814,9 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.SlimDX if (control != _CurrentControl) throw new InvalidOperationException(); - var bb = dev.GetBackBuffer(0,0); - dev.SetRenderTarget(0,bb); - bb.Dispose(); + //don't dispose this backbuffer reference, even though it's tempting to. + //it results in weird flashes of corruption when changing the vsync setting (unproven; it's another similar code sequence that broke it) + dev.SetRenderTarget(0, dev.GetBackBuffer(0, 0)); _CurrentControl = null; } @@ -861,9 +861,9 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.SlimDX if (rt == null) { - var bb = _CurrentControl.SwapChain.GetBackBuffer(0); - dev.SetRenderTarget(0, bb); - bb.Dispose(); + //don't dispose this backbuffer reference, even though it's tempting to. + //it results in weird flashes of corruption when changing the vsync setting + dev.SetRenderTarget(0, _CurrentControl.SwapChain.GetBackBuffer(0)); dev.DepthStencilSurface = null; return; }