mirror of
https://github.com/GreemDev/Ryujinx.git
synced 2025-01-09 14:41:59 +00:00
metal: also disable vsync for custom refresh rates
This commit is contained in:
parent
9ee3f1ff36
commit
1fbb0d8e7d
1 changed files with 7 additions and 13 deletions
|
@ -23,12 +23,14 @@ namespace Ryujinx.Graphics.Metal
|
||||||
private int _requestedWidth;
|
private int _requestedWidth;
|
||||||
private int _requestedHeight;
|
private int _requestedHeight;
|
||||||
|
|
||||||
// private bool _vsyncEnabled;
|
|
||||||
private AntiAliasing _currentAntiAliasing;
|
private AntiAliasing _currentAntiAliasing;
|
||||||
private bool _updateEffect;
|
private bool _updateEffect;
|
||||||
private IPostProcessingEffect _effect;
|
private IPostProcessingEffect _effect;
|
||||||
private IScalingFilter _scalingFilter;
|
private IScalingFilter _scalingFilter;
|
||||||
private bool _isLinear;
|
private bool _isLinear;
|
||||||
|
|
||||||
|
public bool IsVSyncEnabled => _metalLayer.DisplaySyncEnabled;
|
||||||
|
|
||||||
// private float _scalingFilterLevel;
|
// private float _scalingFilterLevel;
|
||||||
private bool _updateScalingFilter;
|
private bool _updateScalingFilter;
|
||||||
private ScalingFilter _currentScalingFilter;
|
private ScalingFilter _currentScalingFilter;
|
||||||
|
@ -40,7 +42,7 @@ namespace Ryujinx.Graphics.Metal
|
||||||
_metalLayer = metalLayer;
|
_metalLayer = metalLayer;
|
||||||
}
|
}
|
||||||
|
|
||||||
private unsafe void ResizeIfNeeded()
|
private void ResizeIfNeeded()
|
||||||
{
|
{
|
||||||
if (_requestedWidth != 0 && _requestedHeight != 0)
|
if (_requestedWidth != 0 && _requestedHeight != 0)
|
||||||
{
|
{
|
||||||
|
@ -54,7 +56,7 @@ namespace Ryujinx.Graphics.Metal
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public unsafe void Present(ITexture texture, ImageCrop crop, Action swapBuffersCallback)
|
public void Present(ITexture texture, ImageCrop crop, Action swapBuffersCallback)
|
||||||
{
|
{
|
||||||
if (_renderer.Pipeline is Pipeline pipeline && texture is Texture tex)
|
if (_renderer.Pipeline is Pipeline pipeline && texture is Texture tex)
|
||||||
{
|
{
|
||||||
|
@ -141,15 +143,7 @@ namespace Ryujinx.Graphics.Metal
|
||||||
|
|
||||||
public void ChangeVSyncMode(VSyncMode vSyncMode)
|
public void ChangeVSyncMode(VSyncMode vSyncMode)
|
||||||
{
|
{
|
||||||
switch (vSyncMode)
|
_metalLayer.DisplaySyncEnabled = vSyncMode is VSyncMode.Switch;
|
||||||
{
|
|
||||||
case VSyncMode.Unbounded:
|
|
||||||
_metalLayer.DisplaySyncEnabled = false;
|
|
||||||
break;
|
|
||||||
case VSyncMode.Switch:
|
|
||||||
_metalLayer.DisplaySyncEnabled = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void SetAntiAliasing(AntiAliasing effect)
|
public void SetAntiAliasing(AntiAliasing effect)
|
||||||
|
|
Loading…
Reference in a new issue