mirror of
https://git.zaroz.cloud/nintendo-back-up/Ryujinx.git
synced 2025-12-27 12:43:00 +00:00
Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
22202be394 | ||
|
|
17ba217940 | ||
|
|
aae4595bdb |
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -27,6 +27,7 @@ jobs:
|
|||||||
build:
|
build:
|
||||||
name: ${{ matrix.OS_NAME }} (${{ matrix.configuration }})
|
name: ${{ matrix.OS_NAME }} (${{ matrix.configuration }})
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
timeout-minutes: 35
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, macOS-latest, windows-latest]
|
os: [ubuntu-latest, macOS-latest, windows-latest]
|
||||||
@@ -109,6 +110,7 @@ jobs:
|
|||||||
build_macos:
|
build_macos:
|
||||||
name: macOS Universal (${{ matrix.configuration }})
|
name: macOS Universal (${{ matrix.configuration }})
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 35
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
configuration: [ Debug, Release ]
|
configuration: [ Debug, Release ]
|
||||||
|
|||||||
1
.github/workflows/flatpak.yml
vendored
1
.github/workflows/flatpak.yml
vendored
@@ -12,6 +12,7 @@ concurrency: flatpak-release
|
|||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
|
timeout-minutes: 35
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
env:
|
env:
|
||||||
|
|||||||
1
.github/workflows/nightly_pr_comment.yml
vendored
1
.github/workflows/nightly_pr_comment.yml
vendored
@@ -7,6 +7,7 @@ jobs:
|
|||||||
pr_comment:
|
pr_comment:
|
||||||
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
|
if: github.event.workflow_run.event == 'pull_request' && github.event.workflow_run.conclusion == 'success'
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 35
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/github-script@v6
|
- uses: actions/github-script@v6
|
||||||
with:
|
with:
|
||||||
|
|||||||
2
.github/workflows/release.yml
vendored
2
.github/workflows/release.yml
vendored
@@ -46,6 +46,7 @@ jobs:
|
|||||||
release:
|
release:
|
||||||
name: Release ${{ matrix.OS_NAME }}
|
name: Release ${{ matrix.OS_NAME }}
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
|
timeout-minutes: 35
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ ubuntu-latest, windows-latest ]
|
os: [ ubuntu-latest, windows-latest ]
|
||||||
@@ -143,6 +144,7 @@ jobs:
|
|||||||
macos_release:
|
macos_release:
|
||||||
name: Release MacOS universal
|
name: Release MacOS universal
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
timeout-minutes: 35
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
|
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ namespace Ryujinx.Ava
|
|||||||
private KeyboardHotkeyState _prevHotkeyState;
|
private KeyboardHotkeyState _prevHotkeyState;
|
||||||
|
|
||||||
private long _lastCursorMoveTime;
|
private long _lastCursorMoveTime;
|
||||||
private bool _isCursorInRenderer;
|
private bool _isCursorInRenderer = true;
|
||||||
|
|
||||||
private bool _isStopped;
|
private bool _isStopped;
|
||||||
private bool _isActive;
|
private bool _isActive;
|
||||||
@@ -160,7 +160,9 @@ namespace Ryujinx.Ava
|
|||||||
|
|
||||||
ConfigurationState.Instance.HideCursor.Event += HideCursorState_Changed;
|
ConfigurationState.Instance.HideCursor.Event += HideCursorState_Changed;
|
||||||
|
|
||||||
_topLevel.PointerMoved += TopLevel_PointerMoved;
|
_topLevel.PointerMoved += TopLevel_PointerEnterOrMoved;
|
||||||
|
_topLevel.PointerEnter += TopLevel_PointerEnterOrMoved;
|
||||||
|
_topLevel.PointerLeave += TopLevel_PointerLeave;
|
||||||
|
|
||||||
if (OperatingSystem.IsWindows())
|
if (OperatingSystem.IsWindows())
|
||||||
{
|
{
|
||||||
@@ -183,7 +185,7 @@ namespace Ryujinx.Ava
|
|||||||
_gpuCancellationTokenSource = new CancellationTokenSource();
|
_gpuCancellationTokenSource = new CancellationTokenSource();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void TopLevel_PointerMoved(object sender, PointerEventArgs e)
|
private void TopLevel_PointerEnterOrMoved(object sender, PointerEventArgs e)
|
||||||
{
|
{
|
||||||
if (sender is MainWindow window)
|
if (sender is MainWindow window)
|
||||||
{
|
{
|
||||||
@@ -201,6 +203,12 @@ namespace Ryujinx.Ava
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void TopLevel_PointerLeave(object sender, PointerEventArgs e)
|
||||||
|
{
|
||||||
|
_isCursorInRenderer = false;
|
||||||
|
}
|
||||||
|
|
||||||
private void UpdateScalingFilterLevel(object sender, ReactiveEventArgs<int> e)
|
private void UpdateScalingFilterLevel(object sender, ReactiveEventArgs<int> e)
|
||||||
{
|
{
|
||||||
_renderer.Window?.SetScalingFilter((Graphics.GAL.ScalingFilter)ConfigurationState.Instance.Graphics.ScalingFilter.Value);
|
_renderer.Window?.SetScalingFilter((Graphics.GAL.ScalingFilter)ConfigurationState.Instance.Graphics.ScalingFilter.Value);
|
||||||
@@ -446,7 +454,9 @@ namespace Ryujinx.Ava
|
|||||||
ConfigurationState.Instance.Graphics.ScalingFilterLevel.Event -= UpdateScalingFilterLevel;
|
ConfigurationState.Instance.Graphics.ScalingFilterLevel.Event -= UpdateScalingFilterLevel;
|
||||||
ConfigurationState.Instance.Graphics.AntiAliasing.Event -= UpdateAntiAliasing;
|
ConfigurationState.Instance.Graphics.AntiAliasing.Event -= UpdateAntiAliasing;
|
||||||
|
|
||||||
_topLevel.PointerMoved -= TopLevel_PointerMoved;
|
_topLevel.PointerMoved -= TopLevel_PointerEnterOrMoved;
|
||||||
|
_topLevel.PointerEnter -= TopLevel_PointerEnterOrMoved;
|
||||||
|
_topLevel.PointerLeave -= TopLevel_PointerLeave;
|
||||||
|
|
||||||
_gpuCancellationTokenSource.Cancel();
|
_gpuCancellationTokenSource.Cancel();
|
||||||
_gpuCancellationTokenSource.Dispose();
|
_gpuCancellationTokenSource.Dispose();
|
||||||
|
|||||||
@@ -56,6 +56,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
private int _writeCount;
|
private int _writeCount;
|
||||||
private int _flushCount;
|
private int _flushCount;
|
||||||
private int _flushTemp;
|
private int _flushTemp;
|
||||||
|
private int _lastFlushWrite = -1;
|
||||||
|
|
||||||
private ReaderWriterLock _flushLock;
|
private ReaderWriterLock _flushLock;
|
||||||
private FenceHolder _flushFence;
|
private FenceHolder _flushFence;
|
||||||
@@ -200,14 +201,21 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
{
|
{
|
||||||
if (_baseType == BufferAllocationType.Auto)
|
if (_baseType == BufferAllocationType.Auto)
|
||||||
{
|
{
|
||||||
if (_writeCount >= WriteCountThreshold || _setCount >= SetCountThreshold || _flushCount >= FlushCountThreshold)
|
// When flushed, wait for a bit more info to make a decision.
|
||||||
|
bool wasFlushed = _flushTemp > 0;
|
||||||
|
int multiplier = wasFlushed ? 2 : 0;
|
||||||
|
if (_writeCount >= (WriteCountThreshold << multiplier) || _setCount >= (SetCountThreshold << multiplier) || _flushCount >= (FlushCountThreshold << multiplier))
|
||||||
{
|
{
|
||||||
if (_flushCount > 0 || _flushTemp-- > 0)
|
if (_flushCount > 0 || _flushTemp-- > 0)
|
||||||
{
|
{
|
||||||
// Buffers that flush should ideally be mapped in host address space for easy copies.
|
// Buffers that flush should ideally be mapped in host address space for easy copies.
|
||||||
// If the buffer is large it will do better on GPU memory, as there will be more writes than data flushes (typically individual pages).
|
// If the buffer is large it will do better on GPU memory, as there will be more writes than data flushes (typically individual pages).
|
||||||
// If it is small, then it's likely most of the buffer will be flushed so we want it on host memory, as access is cached.
|
// If it is small, then it's likely most of the buffer will be flushed so we want it on host memory, as access is cached.
|
||||||
DesiredType = Size > DeviceLocalSizeThreshold ? BufferAllocationType.DeviceLocalMapped : BufferAllocationType.HostMapped;
|
|
||||||
|
bool hostMappingSensitive = _gd.Vendor == Vendor.Nvidia;
|
||||||
|
bool deviceLocalMapped = Size > DeviceLocalSizeThreshold || (wasFlushed && _writeCount > _flushCount * 10 && hostMappingSensitive) || _currentType == BufferAllocationType.DeviceLocalMapped;
|
||||||
|
|
||||||
|
DesiredType = deviceLocalMapped ? BufferAllocationType.DeviceLocalMapped : BufferAllocationType.HostMapped;
|
||||||
|
|
||||||
// It's harder for a buffer that is flushed to revert to another type of mapping.
|
// It's harder for a buffer that is flushed to revert to another type of mapping.
|
||||||
if (_flushCount > 0)
|
if (_flushCount > 0)
|
||||||
@@ -215,17 +223,18 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
_flushTemp = 1000;
|
_flushTemp = 1000;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (_writeCount >= WriteCountThreshold)
|
else if (_writeCount >= (WriteCountThreshold << multiplier))
|
||||||
{
|
{
|
||||||
// Buffers that are written often should ideally be in the device local heap. (Storage buffers)
|
// Buffers that are written often should ideally be in the device local heap. (Storage buffers)
|
||||||
DesiredType = BufferAllocationType.DeviceLocal;
|
DesiredType = BufferAllocationType.DeviceLocal;
|
||||||
}
|
}
|
||||||
else if (_setCount > SetCountThreshold)
|
else if (_setCount > (SetCountThreshold << multiplier))
|
||||||
{
|
{
|
||||||
// Buffers that have their data set often should ideally be host mapped. (Constant buffers)
|
// Buffers that have their data set often should ideally be host mapped. (Constant buffers)
|
||||||
DesiredType = BufferAllocationType.HostMapped;
|
DesiredType = BufferAllocationType.HostMapped;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_lastFlushWrite = -1;
|
||||||
_flushCount = 0;
|
_flushCount = 0;
|
||||||
_writeCount = 0;
|
_writeCount = 0;
|
||||||
_setCount = 0;
|
_setCount = 0;
|
||||||
@@ -418,7 +427,12 @@ namespace Ryujinx.Graphics.Vulkan
|
|||||||
|
|
||||||
WaitForFlushFence();
|
WaitForFlushFence();
|
||||||
|
|
||||||
_flushCount++;
|
if (_lastFlushWrite != _writeCount)
|
||||||
|
{
|
||||||
|
// If it's on the same page as the last flush, ignore it.
|
||||||
|
_lastFlushWrite = _writeCount;
|
||||||
|
_flushCount++;
|
||||||
|
}
|
||||||
|
|
||||||
Span<byte> result;
|
Span<byte> result;
|
||||||
|
|
||||||
|
|||||||
@@ -321,27 +321,27 @@ namespace Ryujinx.Ui
|
|||||||
|
|
||||||
_toggleDockedMode = toggleDockedMode;
|
_toggleDockedMode = toggleDockedMode;
|
||||||
|
|
||||||
if (ConfigurationState.Instance.Hid.EnableMouse.Value)
|
if (_isMouseInClient)
|
||||||
{
|
{
|
||||||
if (_isMouseInClient)
|
if (ConfigurationState.Instance.Hid.EnableMouse.Value)
|
||||||
{
|
{
|
||||||
Window.Cursor = _invisibleCursor;
|
Window.Cursor = _invisibleCursor;
|
||||||
}
|
}
|
||||||
}
|
else
|
||||||
else
|
|
||||||
{
|
|
||||||
switch (_hideCursorMode)
|
|
||||||
{
|
{
|
||||||
case HideCursorMode.OnIdle:
|
switch (_hideCursorMode)
|
||||||
long cursorMoveDelta = Stopwatch.GetTimestamp() - _lastCursorMoveTime;
|
{
|
||||||
Window.Cursor = (cursorMoveDelta >= CursorHideIdleTime * Stopwatch.Frequency) ? _invisibleCursor : null;
|
case HideCursorMode.OnIdle:
|
||||||
break;
|
long cursorMoveDelta = Stopwatch.GetTimestamp() - _lastCursorMoveTime;
|
||||||
case HideCursorMode.Always:
|
Window.Cursor = (cursorMoveDelta >= CursorHideIdleTime * Stopwatch.Frequency) ? _invisibleCursor : null;
|
||||||
Window.Cursor = _invisibleCursor;
|
break;
|
||||||
break;
|
case HideCursorMode.Always:
|
||||||
case HideCursorMode.Never:
|
Window.Cursor = _invisibleCursor;
|
||||||
Window.Cursor = null;
|
break;
|
||||||
break;
|
case HideCursorMode.Never:
|
||||||
|
Window.Cursor = null;
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user