check for vsync signal after queue up framebuffer
This commit is contained in:
parent
a26e1bc0a9
commit
4b3fd9c3de
3 changed files with 10 additions and 10 deletions
|
@ -166,11 +166,6 @@ namespace Ryujinx.HLE.HOS.Services.Android
|
||||||
{
|
{
|
||||||
Context.Device.Statistics.RecordGameFrameTime();
|
Context.Device.Statistics.RecordGameFrameTime();
|
||||||
|
|
||||||
if (Context.Device.EnableVsync)
|
|
||||||
{
|
|
||||||
Context.Device.VsyncEvent.WaitOne();
|
|
||||||
}
|
|
||||||
|
|
||||||
//TODO: Errors.
|
//TODO: Errors.
|
||||||
int Slot = ParcelReader.ReadInt32();
|
int Slot = ParcelReader.ReadInt32();
|
||||||
int Unknown4 = ParcelReader.ReadInt32();
|
int Unknown4 = ParcelReader.ReadInt32();
|
||||||
|
@ -204,6 +199,11 @@ namespace Ryujinx.HLE.HOS.Services.Android
|
||||||
|
|
||||||
SendFrameBuffer(Context, Slot);
|
SendFrameBuffer(Context, Slot);
|
||||||
|
|
||||||
|
if (Context.Device.EnableDeviceVsync)
|
||||||
|
{
|
||||||
|
Context.Device.VsyncEvent.WaitOne();
|
||||||
|
}
|
||||||
|
|
||||||
return MakeReplyParcel(Context, 1280, 720, 0, 0, 0);
|
return MakeReplyParcel(Context, 1280, 720, 0, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,7 @@ namespace Ryujinx.HLE
|
||||||
|
|
||||||
public Hid Hid { get; private set; }
|
public Hid Hid { get; private set; }
|
||||||
|
|
||||||
public bool EnableVsync { get; set; } = true;
|
public bool EnableDeviceVsync { get; set; } = true;
|
||||||
|
|
||||||
public AutoResetEvent VsyncEvent { get; private set; }
|
public AutoResetEvent VsyncEvent { get; private set; }
|
||||||
|
|
||||||
|
|
|
@ -82,8 +82,6 @@ namespace Ryujinx
|
||||||
|
|
||||||
if (Ticks >= TicksPerFrame)
|
if (Ticks >= TicksPerFrame)
|
||||||
{
|
{
|
||||||
Device.VsyncEvent.Set();
|
|
||||||
|
|
||||||
RenderFrame();
|
RenderFrame();
|
||||||
|
|
||||||
//Queue max. 1 vsync
|
//Queue max. 1 vsync
|
||||||
|
@ -261,13 +259,15 @@ namespace Ryujinx
|
||||||
double GameFps = Device.Statistics.GetGameFrameRate();
|
double GameFps = Device.Statistics.GetGameFrameRate();
|
||||||
|
|
||||||
NewTitle = $"Ryujinx | Host FPS: {HostFps:0.0} | Game FPS: {GameFps:0.0} | Game Vsync: " +
|
NewTitle = $"Ryujinx | Host FPS: {HostFps:0.0} | Game FPS: {GameFps:0.0} | Game Vsync: " +
|
||||||
(Device.EnableVsync ? "On" : "Off");
|
(Device.EnableDeviceVsync ? "On" : "Off");
|
||||||
|
|
||||||
TitleEvent = true;
|
TitleEvent = true;
|
||||||
|
|
||||||
SwapBuffers();
|
SwapBuffers();
|
||||||
|
|
||||||
Device.System.SignalVsync();
|
Device.System.SignalVsync();
|
||||||
|
|
||||||
|
Device.VsyncEvent.Set();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnUnload(EventArgs e)
|
protected override void OnUnload(EventArgs e)
|
||||||
|
@ -315,7 +315,7 @@ namespace Ryujinx
|
||||||
Keyboard = e.Keyboard;
|
Keyboard = e.Keyboard;
|
||||||
|
|
||||||
if (e.Key == Key.Tab)
|
if (e.Key == Key.Tab)
|
||||||
Device.EnableVsync = !Device.EnableVsync;
|
Device.EnableDeviceVsync = !Device.EnableDeviceVsync;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnMouseDown(MouseButtonEventArgs e)
|
protected override void OnMouseDown(MouseButtonEventArgs e)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue