Compare commits

..

5 Commits

Author SHA1 Message Date
GreemDev
00ff3e6b1b chore: CI: oops missed another zsync reference 2025-09-14 01:35:05 -05:00
GreemDev
12510a5396 chore: CI: actually remove zsync files this time
I'm blind, the previous commit failed CI since it still thought they were being generated
2025-09-14 00:37:30 -05:00
GreemDev
ea30a0ed24 chore: ci: Remove .zsync 2025-09-14 00:26:09 -05:00
Coxxs
df40a69872 Fix headless mode (ryubing/ryujinx!146)
See merge request ryubing/ryujinx!146
2025-09-10 11:43:50 -05:00
LotP
b000f91dad Memory changes 2.2.1 (ryubing/ryujinx!144)
See merge request ryubing/ryujinx!144
2025-09-06 13:51:08 -05:00
7 changed files with 52 additions and 124 deletions

View File

@@ -134,16 +134,13 @@ jobs:
exit 1
fi
export UFLAG="gh-releases-zsync|${{ secrets.RC_OWNER }}${{ secrets.RC_CANARY_NAME }}|latest|*-$ARCH_NAME.AppImage.zsync"
BUILDDIR=publish OUTDIR=publish_appimage distribution/linux/appimage/build-appimage.sh
pushd publish_appimage
mv Ryujinx.AppImage ../release_output/ryujinx-canary-$BUILD_VERSION-$ARCH_NAME.AppImage
mv Ryujinx.AppImage.zsync ../release_output/ryujinx-canary-$BUILD_VERSION-$ARCH_NAME.AppImage.zsync
popd
gli --access-token=${{ secrets.GITLAB_TOKEN }} --project=ryubing/canary --command=UploadGenericPackage "Ryubing-Canary|${{ steps.version_info.outputs.build_version }}|release_output/ryujinx-canary-$BUILD_VERSION-$ARCH_NAME.AppImage"
gli --access-token=${{ secrets.GITLAB_TOKEN }} --project=ryubing/canary --command=UploadGenericPackage "Ryubing-Canary|${{ steps.version_info.outputs.build_version }}|release_output/ryujinx-canary-$BUILD_VERSION-$ARCH_NAME.AppImage.zsync"
shell: bash
macos_release:

View File

@@ -125,16 +125,13 @@ jobs:
exit 1
fi
export UFLAG="gh-releases-zsync|${{ github.repository_owner }}|${{ github.event.repository.name }}|latest|*-$ARCH_NAME.AppImage.zsync"
BUILDDIR=publish OUTDIR=publish_appimage distribution/linux/appimage/build-appimage.sh
pushd publish_appimage
mv Ryujinx.AppImage ../release_output/ryujinx-$BUILD_VERSION-$ARCH_NAME.AppImage
mv Ryujinx.AppImage.zsync ../release_output/ryujinx-$BUILD_VERSION-$ARCH_NAME.AppImage.zsync
popd
gli --access-token=${{ secrets.GITLAB_TOKEN }} --project=ryubing/ryujinx --command=UploadGenericPackage "Ryubing|${{ steps.version_info.outputs.build_version }}|release_output/ryujinx-$BUILD_VERSION-$ARCH_NAME.AppImage"
gli --access-token=${{ secrets.GITLAB_TOKEN }} --project=ryubing/ryujinx --command=UploadGenericPackage "Ryubing|${{ steps.version_info.outputs.build_version }}|release_output/ryujinx-$BUILD_VERSION-$ARCH_NAME.AppImage.zsync"
shell: bash
macos_release:

View File

@@ -6,7 +6,6 @@ cd "$ROOTDIR"
BUILDDIR=${BUILDDIR:-publish}
OUTDIR=${OUTDIR:-publish_appimage}
UFLAG=${UFLAG:-"gh-releases-zsync|Ryubing|ryujinx|latest|*-x64.AppImage.zsync"}
rm -rf AppDir
mkdir -p AppDir/usr/bin
@@ -24,10 +23,4 @@ chmod +x AppDir/AppRun AppDir/usr/bin/Ryujinx*
mkdir -p "$OUTDIR"
appimagetool -n --comp zstd --mksquashfs-opt -Xcompression-level --mksquashfs-opt 21 \
-u "$UFLAG" \
AppDir "$OUTDIR"/Ryujinx.AppImage
# Move zsync file needed for delta updates
if [ "$RELEASE" = "1" ]; then
mv ./*.AppImage.zsync "$OUTDIR"
fi

View File

@@ -487,10 +487,12 @@ namespace Ryujinx.Graphics.Gpu.Memory
/// <param name="stage">The type of usage that created the buffer</param>
private void CreateBufferAligned(ulong address, ulong size, BufferStage stage)
{
Buffer newBuffer = null;
_buffers.Lock.EnterWriteLock();
Span<RangeItem<Buffer>> overlaps = _buffers.FindOverlapsAsSpan(address, size);
if (overlaps.Length > 0)
if (overlaps.Length != 0)
{
// The buffer already exists. We can just return the existing buffer
// if the buffer we need is fully contained inside the overlapping buffer.
@@ -530,13 +532,13 @@ namespace Ryujinx.Graphics.Gpu.Memory
address = Math.Min(address, overlaps[0].Address);
endAddress = Math.Max(endAddress, overlaps[^1].EndAddress);
RangeItem<Buffer>[] overlapsArray = overlaps.ToArray();
for (int i = 0; i < overlaps.Length; i++)
{
anySparseCompatible |= overlaps[i].Value.SparseCompatible;
}
RangeItem<Buffer>[] overlapsArray = overlaps.ToArray();
_buffers.RemoveRange(overlaps[0], overlaps[^1]);
@@ -544,22 +546,29 @@ namespace Ryujinx.Graphics.Gpu.Memory
ulong newSize = endAddress - address;
Buffer newBuffer = CreateBufferAligned(address, newSize, stage, anySparseCompatible, overlapsArray);
_buffers.Lock.EnterWriteLock();
_buffers.Add(newBuffer);
newBuffer = CreateBufferAligned(address, newSize, stage, anySparseCompatible, overlapsArray);
}
else
{
_buffers.Lock.ExitWriteLock();
}
}
else
{
_buffers.Lock.ExitWriteLock();
// No overlap, just create a new buffer.
Buffer buffer = new(_context, _physicalMemory, address, size, stage, sparseCompatible: false, []);
_buffers.Add(buffer);
newBuffer = new(_context, _physicalMemory, address, size, stage, sparseCompatible: false, []);
}
if (newBuffer is not null)
{
_buffers.Lock.EnterWriteLock();
_buffers.Add(newBuffer);
_buffers.Lock.ExitWriteLock();
}
_buffers.Lock.ExitWriteLock();
}
/// <summary>
@@ -574,11 +583,12 @@ namespace Ryujinx.Graphics.Gpu.Memory
private void CreateBufferAligned(ulong address, ulong size, BufferStage stage, ulong alignment)
{
bool sparseAligned = alignment >= SparseBufferAlignmentSize;
Buffer newBuffer = null;
_buffers.Lock.EnterWriteLock();
Span<RangeItem<Buffer>> overlaps = _buffers.FindOverlapsAsSpan(address, size);
if (overlaps.Length > 0)
if (overlaps.Length != 0)
{
// If the buffer already exists, make sure if covers the entire range,
// and make sure it is properly aligned, otherwise sparse mapping may fail.
@@ -595,19 +605,20 @@ namespace Ryujinx.Graphics.Gpu.Memory
// overlaps more buffers, so try again after each extension
// and ensure we cover all overlaps.
RangeItem<Buffer> oldFirst;
endAddress = Math.Max(endAddress, overlaps[^1].EndAddress);
int oldOverlapCount;
do
{
address = Math.Min(address, overlaps[0].Address);
endAddress = Math.Max(endAddress, overlaps[^1].EndAddress);
address &= ~(alignment - 1);
oldFirst = overlaps[0];
oldOverlapCount = overlaps.Length;
overlaps = _buffers.FindOverlapsAsSpan(address, endAddress - address);
}
while (oldFirst != overlaps[0]);
while (oldOverlapCount != overlaps.Length);
ulong newSize = endAddress - address;
@@ -617,22 +628,29 @@ namespace Ryujinx.Graphics.Gpu.Memory
_buffers.Lock.ExitWriteLock();
Buffer newBuffer = CreateBufferAligned(address, newSize, stage, sparseAligned, overlapsArray);
_buffers.Lock.EnterWriteLock();
_buffers.Add(newBuffer);
newBuffer = CreateBufferAligned(address, newSize, stage, sparseAligned, overlapsArray);
}
else
{
_buffers.Lock.ExitWriteLock();
}
}
else
{
_buffers.Lock.ExitWriteLock();
// No overlap, just create a new buffer.
Buffer buffer = new(_context, _physicalMemory, address, size, stage, sparseAligned, []);
_buffers.Add(buffer);
newBuffer = new(_context, _physicalMemory, address, size, stage, sparseAligned, []);
}
if (newBuffer is not null)
{
_buffers.Lock.EnterWriteLock();
_buffers.Add(newBuffer);
_buffers.Lock.ExitWriteLock();
}
_buffers.Lock.ExitWriteLock();
}
/// <summary>
@@ -879,7 +897,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
{
MemoryRange subRange = range.GetSubRange(i);
Buffer subBuffer = _buffers.FindOverlapFast(subRange.Address, subRange.Size).Value;
Buffer subBuffer = _buffers.FindOverlap(subRange.Address, subRange.Size).Value;
subBuffer.SynchronizeMemory(subRange.Address, subRange.Size);
@@ -977,7 +995,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
{
if (size != 0)
{
Buffer buffer = _buffers.FindOverlapFast(address, size).Value;
Buffer buffer = _buffers.FindOverlap(address, size).Value;
if (copyBackVirtual)
{

View File

@@ -473,6 +473,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
ranges._migrationTarget = this;
Lock.EnterWriteLock();
foreach (BufferModifiedRange range in inheritRanges)
{
Add(range);

View File

@@ -12,9 +12,6 @@ namespace Ryujinx.Memory.Range
/// <typeparam name="T">Type of the range.</typeparam>
public unsafe class NonOverlappingRangeList<T> : RangeListBase<T> where T : class, INonOverlappingRange
{
// private readonly Dictionary<ulong, RangeItem<T>> _quickAccess = new(AddressEqualityComparer.Comparer);
// private readonly Dictionary<ulong, RangeItem<T>> _fastQuickAccess = new(AddressEqualityComparer.Comparer);
public readonly ReaderWriterLockSlim Lock = new();
/// <summary>
@@ -44,8 +41,6 @@ namespace Ryujinx.Memory.Range
RangeItem<T> rangeItem = new(item);
Insert(index, rangeItem);
// _quickAccess.Add(item.Address, rangeItem);
}
/// <summary>
@@ -71,15 +66,7 @@ namespace Ryujinx.Memory.Range
Items[index + 1].Previous = rangeItem;
}
// foreach (ulong addr in Items[index].QuickAccessAddresses)
// {
// _quickAccess.Remove(addr);
// _fastQuickAccess.Remove(addr);
// }
Items[index] = rangeItem;
// _quickAccess[item.Address] = rangeItem;
return true;
}
@@ -108,19 +95,8 @@ namespace Ryujinx.Memory.Range
Items[index + 1].Previous = rangeItem;
}
// foreach (ulong addr in item.QuickAccessAddresses)
// {
// _quickAccess.Remove(addr);
// _fastQuickAccess.Remove(addr);
// }
Items[index] = rangeItem;
// if (item.Address != rangeItem.Address)
// _quickAccess.Remove(item.Address);
//
// _quickAccess[rangeItem.Address] = rangeItem;
return true;
}
@@ -196,14 +172,6 @@ namespace Ryujinx.Memory.Range
if (index >= 0 && Items[index].Value.Equals(item))
{
// _quickAccess.Remove(item.Address);
//
// foreach (ulong addr in Items[index].QuickAccessAddresses)
// {
// _quickAccess.Remove(addr);
// _fastQuickAccess.Remove(addr);
// }
RemoveAt(index);
return true;
@@ -232,16 +200,6 @@ namespace Ryujinx.Memory.Range
(int startIndex, int endIndex) = BinarySearchEdges(startItem.Address, endItem.EndAddress);
// for (int i = startIndex; i < endIndex; i++)
// {
// _quickAccess.Remove(Items[i].Address);
// foreach (ulong addr in Items[i].QuickAccessAddresses)
// {
// _quickAccess.Remove(addr);
// _fastQuickAccess.Remove(addr);
// }
// }
if (endIndex < Count)
{
Items[endIndex].Previous = startIndex > 0 ? Items[startIndex - 1] : null;
@@ -279,13 +237,6 @@ namespace Ryujinx.Memory.Range
while (Items[endIndex] is not null && Items[endIndex].Address < address + size)
{
// _quickAccess.Remove(Items[endIndex].Address);
// foreach (ulong addr in Items[endIndex].QuickAccessAddresses)
// {
// _quickAccess.Remove(addr);
// _fastQuickAccess.Remove(addr);
// }
if (endIndex == Count - 1)
{
break;
@@ -322,8 +273,6 @@ namespace Ryujinx.Memory.Range
Lock.EnterWriteLock();
Count = 0;
Lock.ExitWriteLock();
// _quickAccess.Clear();
// _fastQuickAccess.Clear();
}
/// <summary>
@@ -436,11 +385,6 @@ namespace Ryujinx.Memory.Range
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override RangeItem<T> FindOverlap(ulong address, ulong size)
{
// if (_quickAccess.TryGetValue(address, out RangeItem<T> overlap))
// {
// return overlap;
// }
int index = BinarySearchLeftEdge(address, address + size);
if (index < 0)
@@ -448,12 +392,6 @@ namespace Ryujinx.Memory.Range
return null;
}
// if (Items[index].Address < address)
// {
// _quickAccess.TryAdd(address, Items[index]);
// Items[index].QuickAccessAddresses.Add(address);
// }
return Items[index];
}
@@ -466,28 +404,12 @@ namespace Ryujinx.Memory.Range
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public override RangeItem<T> FindOverlapFast(ulong address, ulong size)
{
// if (_quickAccess.TryGetValue(address, out RangeItem<T> overlap) || _fastQuickAccess.TryGetValue(address, out overlap))
// {
// return overlap;
// }
int index = BinarySearch(address, address + size);
if (index < 0)
{
return null;
}
// if (Items[index].Address < address)
// {
// _quickAccess.TryAdd(address, Items[index]);
// }
// else
// {
// _fastQuickAccess.TryAdd(address, Items[index]);
// }
//
// Items[index].QuickAccessAddresses.Add(address);
return Items[index];
}

View File

@@ -428,7 +428,7 @@ namespace Ryujinx.Headless
[Option("enable-gdb-stub", Required = false, Default = false, HelpText = "Enables the GDB stub so that a developer can attach a debugger to the emulated process.")]
public bool EnableGdbStub { get; set; }
[Option("gdb-stub-port", Required = false, Default = 55555, HelpText = "Specifies which TCP port the GDB stub listens on.")]
[Option("gdb-stub-port", Required = false, Default = (ushort)55555, HelpText = "Specifies which TCP port the GDB stub listens on.")]
public ushort GdbStubPort { get; set; }
[Option("suspend-on-start", Required = false, Default = false, HelpText = "Suspend execution when starting an application.")]