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();
|
||||
|
||||
if (Context.Device.EnableVsync)
|
||||
{
|
||||
Context.Device.VsyncEvent.WaitOne();
|
||||
}
|
||||
|
||||
//TODO: Errors.
|
||||
int Slot = ParcelReader.ReadInt32();
|
||||
int Unknown4 = ParcelReader.ReadInt32();
|
||||
|
@ -204,6 +199,11 @@ namespace Ryujinx.HLE.HOS.Services.Android
|
|||
|
||||
SendFrameBuffer(Context, Slot);
|
||||
|
||||
if (Context.Device.EnableDeviceVsync)
|
||||
{
|
||||
Context.Device.VsyncEvent.WaitOne();
|
||||
}
|
||||
|
||||
return MakeReplyParcel(Context, 1280, 720, 0, 0, 0);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ namespace Ryujinx.HLE
|
|||
|
||||
public Hid Hid { get; private set; }
|
||||
|
||||
public bool EnableVsync { get; set; } = true;
|
||||
public bool EnableDeviceVsync { get; set; } = true;
|
||||
|
||||
public AutoResetEvent VsyncEvent { get; private set; }
|
||||
|
||||
|
|
|
@ -82,8 +82,6 @@ namespace Ryujinx
|
|||
|
||||
if (Ticks >= TicksPerFrame)
|
||||
{
|
||||
Device.VsyncEvent.Set();
|
||||
|
||||
RenderFrame();
|
||||
|
||||
//Queue max. 1 vsync
|
||||
|
@ -261,13 +259,15 @@ namespace Ryujinx
|
|||
double GameFps = Device.Statistics.GetGameFrameRate();
|
||||
|
||||
NewTitle = $"Ryujinx | Host FPS: {HostFps:0.0} | Game FPS: {GameFps:0.0} | Game Vsync: " +
|
||||
(Device.EnableVsync ? "On" : "Off");
|
||||
(Device.EnableDeviceVsync ? "On" : "Off");
|
||||
|
||||
TitleEvent = true;
|
||||
|
||||
SwapBuffers();
|
||||
|
||||
Device.System.SignalVsync();
|
||||
|
||||
Device.VsyncEvent.Set();
|
||||
}
|
||||
|
||||
protected override void OnUnload(EventArgs e)
|
||||
|
@ -315,7 +315,7 @@ namespace Ryujinx
|
|||
Keyboard = e.Keyboard;
|
||||
|
||||
if (e.Key == Key.Tab)
|
||||
Device.EnableVsync = !Device.EnableVsync;
|
||||
Device.EnableDeviceVsync = !Device.EnableDeviceVsync;
|
||||
}
|
||||
|
||||
protected override void OnMouseDown(MouseButtonEventArgs e)
|
||||
|
|
Loading…
Add table
Reference in a new issue