workarounds for lousy intel gpus
This commit is contained in:
parent
2661fe08c0
commit
ca6f993b7c
|
@ -359,11 +359,13 @@ TESTEROO:
|
||||||
|
|
||||||
//apply the vsync setting (should probably try to avoid repeating this)
|
//apply the vsync setting (should probably try to avoid repeating this)
|
||||||
bool vsync = Global.Config.VSyncThrottle || Global.Config.VSync;
|
bool vsync = Global.Config.VSyncThrottle || Global.Config.VSync;
|
||||||
presentationPanel.GraphicsControl.SetVsync(vsync);
|
//presentationPanel.GraphicsControl.SetVsync(vsync);
|
||||||
|
|
||||||
//present and conclude drawing
|
//present and conclude drawing
|
||||||
presentationPanel.GraphicsControl.SwapBuffers();
|
presentationPanel.GraphicsControl.SwapBuffers();
|
||||||
presentationPanel.GraphicsControl.End();
|
|
||||||
|
//nope. dont do this. workaround for slow context switching on intel GPUs. just switch to another context when necessary before doing anything
|
||||||
|
//presentationPanel.GraphicsControl.End();
|
||||||
|
|
||||||
//cleanup:
|
//cleanup:
|
||||||
if(bb != null) bb.Dispose();
|
if(bb != null) bb.Dispose();
|
||||||
|
|
|
@ -474,13 +474,14 @@ namespace BizHawk.Client.EmuHawk
|
||||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||||
protected override void Dispose(bool disposing)
|
protected override void Dispose(bool disposing)
|
||||||
{
|
{
|
||||||
|
//NOTE: this gets called twice sometimes. once by using() in Program.cs and once from winforms internals when the form is closed...
|
||||||
|
|
||||||
if (GlobalWin.DisplayManager != null)
|
if (GlobalWin.DisplayManager != null)
|
||||||
{
|
{
|
||||||
GlobalWin.DisplayManager.Dispose();
|
GlobalWin.DisplayManager.Dispose();
|
||||||
|
GlobalWin.DisplayManager = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
GlobalWin.DisplayManager = null;
|
|
||||||
|
|
||||||
if (disposing && (components != null))
|
if (disposing && (components != null))
|
||||||
{
|
{
|
||||||
components.Dispose();
|
components.Dispose();
|
||||||
|
@ -2520,6 +2521,7 @@ namespace BizHawk.Client.EmuHawk
|
||||||
}
|
}
|
||||||
|
|
||||||
GlobalWin.OSD.FPS = fps_string;
|
GlobalWin.OSD.FPS = fps_string;
|
||||||
|
Text = fps_string;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!suppressCaptureRewind && Global.Rewinder.RewindActive)
|
if (!suppressCaptureRewind && Global.Rewinder.RewindActive)
|
||||||
|
|
|
@ -36,8 +36,11 @@ namespace BizHawk.Client.EmuHawk
|
||||||
GraphicsControl.MouseClick += (o, e) => GlobalWin.MainForm.MainForm_MouseClick(o, e);
|
GraphicsControl.MouseClick += (o, e) => GlobalWin.MainForm.MainForm_MouseClick(o, e);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsDisposed = false;
|
||||||
public void Dispose()
|
public void Dispose()
|
||||||
{
|
{
|
||||||
|
if (IsDisposed) return;
|
||||||
|
IsDisposed = true;
|
||||||
GraphicsControl.Dispose();
|
GraphicsControl.Dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,8 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.OpenTK
|
||||||
|
|
||||||
public void Begin()
|
public void Begin()
|
||||||
{
|
{
|
||||||
Owner.MakeContextCurrent(GLControl.Context, GLControl.WindowInfo);
|
if (!GLControl.Context.IsCurrent)
|
||||||
|
Owner.MakeContextCurrent(GLControl.Context, GLControl.WindowInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void End()
|
public void End()
|
||||||
|
@ -51,10 +52,9 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.OpenTK
|
||||||
|
|
||||||
public new void SwapBuffers()
|
public new void SwapBuffers()
|
||||||
{
|
{
|
||||||
//IGraphicsContext curr = global::OpenTK.Graphics.GraphicsContext.CurrentContext;
|
if (!GLControl.Context.IsCurrent)
|
||||||
base.MakeCurrent();
|
MakeCurrent();
|
||||||
base.SwapBuffers();
|
base.SwapBuffers();
|
||||||
//Owner.MakeContextCurrent(curr, Owner.NativeWindowsForContexts[curr]);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -506,11 +506,12 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.OpenTK
|
||||||
public void SetViewport(int x, int y, int width, int height)
|
public void SetViewport(int x, int y, int width, int height)
|
||||||
{
|
{
|
||||||
GL.Viewport(x, y, width, height);
|
GL.Viewport(x, y, width, height);
|
||||||
|
GL.Scissor(x, y, width, height); //hack for mupen[rice]+intel: at least the rice plugin leaves the scissor rectangle scrambled, and we're trying to run it in the main graphics context for intel
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetViewport(int width, int height)
|
public void SetViewport(int width, int height)
|
||||||
{
|
{
|
||||||
GL.Viewport(0, 0, width, height);
|
SetViewport(0, 0, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetViewport(sd.Size size)
|
public void SetViewport(sd.Size size)
|
||||||
|
@ -521,7 +522,7 @@ namespace BizHawk.Bizware.BizwareGL.Drivers.OpenTK
|
||||||
public void SetViewport(swf.Control control)
|
public void SetViewport(swf.Control control)
|
||||||
{
|
{
|
||||||
var r = control.ClientRectangle;
|
var r = control.ClientRectangle;
|
||||||
GL.Viewport(r.Left, r.Top, r.Width, r.Height);
|
SetViewport(r.Left, r.Top, r.Width, r.Height);
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------
|
//------------------
|
||||||
|
|
Loading…
Reference in New Issue