Small OpenGL Renderer refactoring (#177)
* Call OpenGL functions directly, remove the pfifo thread, some refactoring * Fix PerformanceStatistics calculating the wrong host fps, remove wait event on PFIFO as this wasn't exactly was causing the freezes (may replace with an exception later) * Organized the Gpu folder a bit more, renamed a few things, address PR feedback * Make PerformanceStatistics thread safe * Remove unused constant * Use unlimited update rate for better pref
This commit is contained in:
parent
69697957e6
commit
e7559f128f
58 changed files with 518 additions and 633 deletions
|
@ -23,7 +23,7 @@ namespace Ryujinx
|
|||
private KeyboardState? Keyboard = null;
|
||||
|
||||
private MouseState? Mouse = null;
|
||||
|
||||
|
||||
public GLScreen(Switch Ns, IGalRenderer Renderer)
|
||||
: base(1280, 720,
|
||||
new GraphicsMode(), "Ryujinx", 0,
|
||||
|
@ -42,7 +42,7 @@ namespace Ryujinx
|
|||
{
|
||||
VSync = VSyncMode.On;
|
||||
|
||||
Renderer.SetWindowSize(Width, Height);
|
||||
Renderer.FrameBuffer.SetWindowSize(Width, Height);
|
||||
}
|
||||
|
||||
protected override void OnUpdateFrame(FrameEventArgs e)
|
||||
|
@ -55,7 +55,7 @@ namespace Ryujinx
|
|||
int LeftJoystickDY = 0;
|
||||
int RightJoystickDX = 0;
|
||||
int RightJoystickDY = 0;
|
||||
|
||||
|
||||
if (Keyboard.HasValue)
|
||||
{
|
||||
KeyboardState Keyboard = this.Keyboard.Value;
|
||||
|
@ -83,7 +83,7 @@ namespace Ryujinx
|
|||
if (Keyboard[(Key)Config.FakeJoyCon.Right.StickDown]) RightJoystickDY = -short.MaxValue;
|
||||
if (Keyboard[(Key)Config.FakeJoyCon.Right.StickLeft]) RightJoystickDX = -short.MaxValue;
|
||||
if (Keyboard[(Key)Config.FakeJoyCon.Right.StickRight]) RightJoystickDX = short.MaxValue;
|
||||
|
||||
|
||||
//RightButtons
|
||||
if (Keyboard[(Key)Config.FakeJoyCon.Right.StickButton]) CurrentButton |= HidControllerButtons.KEY_RSTICK;
|
||||
if (Keyboard[(Key)Config.FakeJoyCon.Right.ButtonA]) CurrentButton |= HidControllerButtons.KEY_A;
|
||||
|
@ -179,28 +179,31 @@ namespace Ryujinx
|
|||
CurrentButton,
|
||||
LeftJoystick,
|
||||
RightJoystick);
|
||||
|
||||
Ns.ProcessFrame();
|
||||
|
||||
Renderer.RunActions();
|
||||
}
|
||||
|
||||
protected override void OnRenderFrame(FrameEventArgs e)
|
||||
{
|
||||
Ns.Statistics.StartSystemFrame();
|
||||
Renderer.FrameBuffer.Render();
|
||||
|
||||
Title = $"Ryujinx Screen - (Vsync: {VSync} - FPS: {Ns.Statistics.SystemFrameRate:0} - Guest FPS: " +
|
||||
$"{Ns.Statistics.GameFrameRate:0})";
|
||||
Ns.Statistics.RecordSystemFrameTime();
|
||||
|
||||
Renderer.RunActions();
|
||||
Renderer.Render();
|
||||
double HostFps = Ns.Statistics.GetSystemFrameRate();
|
||||
double GameFps = Ns.Statistics.GetGameFrameRate();
|
||||
|
||||
Title = $"Ryujinx | Host FPS: {HostFps:0.0} | Game FPS: {GameFps:0.0}";
|
||||
|
||||
SwapBuffers();
|
||||
|
||||
Ns.Statistics.EndSystemFrame();
|
||||
|
||||
Ns.Os.SignalVsync();
|
||||
}
|
||||
|
||||
protected override void OnResize(EventArgs e)
|
||||
{
|
||||
Renderer.SetWindowSize(Width, Height);
|
||||
Renderer.FrameBuffer.SetWindowSize(Width, Height);
|
||||
}
|
||||
|
||||
protected override void OnKeyDown(KeyboardKeyEventArgs e)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue