mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-06-29 02:16:24 +02:00
[Ryujinx.Graphics.Vulkan] Address dotnet-format issues (#5378)
* dotnet format style --severity info Some changes were manually reverted. * dotnet format analyzers --serverity info Some changes have been minimally adapted. * Restore a few unused methods and variables * Silence dotnet format IDE0060 warnings * Silence dotnet format IDE0059 warnings * Address dotnet format CA1816 warnings * Fix new dotnet-format issues after rebase * Address most dotnet format whitespace warnings * Apply dotnet format whitespace formatting A few of them have been manually reverted and the corresponding warning was silenced * Format if-blocks correctly * Another rebase, another dotnet format run * Run dotnet format whitespace after rebase * Run dotnet format style after rebase * Run dotnet format analyzers after rebase * Run dotnet format style after rebase * Run dotnet format after rebase and remove unused usings - analyzers - style - whitespace * Disable 'prefer switch expression' rule * Add comments to disabled warnings * Simplify properties and array initialization, Use const when possible, Remove trailing commas * Run dotnet format after rebase * Address IDE0251 warnings * Address a few disabled IDE0060 warnings * Silence IDE0060 in .editorconfig * Revert "Simplify properties and array initialization, Use const when possible, Remove trailing commas" This reverts commit 9462e4136c0a2100dc28b20cf9542e06790aa67e. * dotnet format whitespace after rebase * First dotnet format pass * Fix naming rule violations * Remove redundant code * Rename generics * Address review feedback * Remove SetOrigin
This commit is contained in:
parent
12c5f6ee89
commit
801b71a128
72 changed files with 1134 additions and 1230 deletions
|
@ -21,13 +21,13 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
}
|
||||
}
|
||||
|
||||
private ulong _firstHandle = 0;
|
||||
private ulong _firstHandle;
|
||||
|
||||
private readonly VulkanRenderer _gd;
|
||||
private readonly Device _device;
|
||||
private List<SyncHandle> _handles;
|
||||
private ulong FlushId;
|
||||
private long WaitTicks;
|
||||
private readonly List<SyncHandle> _handles;
|
||||
private ulong _flushId;
|
||||
private long _waitTicks;
|
||||
|
||||
public SyncManager(VulkanRenderer gd, Device device)
|
||||
{
|
||||
|
@ -38,13 +38,13 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
|
||||
public void RegisterFlush()
|
||||
{
|
||||
FlushId++;
|
||||
_flushId++;
|
||||
}
|
||||
|
||||
public void Create(ulong id, bool strict)
|
||||
{
|
||||
ulong flushId = FlushId;
|
||||
MultiFenceHolder waitable = new MultiFenceHolder();
|
||||
ulong flushId = _flushId;
|
||||
MultiFenceHolder waitable = new();
|
||||
if (strict || _gd.InterruptAction == null)
|
||||
{
|
||||
_gd.FlushAllCommands();
|
||||
|
@ -58,11 +58,11 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
_gd.CommandBufferPool.AddInUseWaitable(waitable);
|
||||
}
|
||||
|
||||
SyncHandle handle = new SyncHandle
|
||||
SyncHandle handle = new()
|
||||
{
|
||||
ID = id,
|
||||
Waitable = waitable,
|
||||
FlushId = flushId
|
||||
FlushId = flushId,
|
||||
};
|
||||
|
||||
lock (_handles)
|
||||
|
@ -132,11 +132,11 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
|
||||
long beforeTicks = Stopwatch.GetTimestamp();
|
||||
|
||||
if (result.NeedsFlush(FlushId))
|
||||
if (result.NeedsFlush(_flushId))
|
||||
{
|
||||
_gd.InterruptAction(() =>
|
||||
{
|
||||
if (result.NeedsFlush(FlushId))
|
||||
if (result.NeedsFlush(_flushId))
|
||||
{
|
||||
_gd.FlushAllCommands();
|
||||
}
|
||||
|
@ -158,7 +158,7 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
}
|
||||
else
|
||||
{
|
||||
WaitTicks += Stopwatch.GetTimestamp() - beforeTicks;
|
||||
_waitTicks += Stopwatch.GetTimestamp() - beforeTicks;
|
||||
result.Signalled = true;
|
||||
}
|
||||
}
|
||||
|
@ -177,7 +177,10 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
first = _handles.FirstOrDefault();
|
||||
}
|
||||
|
||||
if (first == null || first.NeedsFlush(FlushId)) break;
|
||||
if (first == null || first.NeedsFlush(_flushId))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
bool signaled = first.Waitable.WaitForFences(_gd.Api, _device, 0);
|
||||
if (signaled)
|
||||
|
@ -192,7 +195,8 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
first.Waitable = null;
|
||||
}
|
||||
}
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
// This sync handle and any following have not been reached yet.
|
||||
break;
|
||||
|
@ -202,8 +206,8 @@ namespace Ryujinx.Graphics.Vulkan
|
|||
|
||||
public long GetAndResetWaitTicks()
|
||||
{
|
||||
long result = WaitTicks;
|
||||
WaitTicks = 0;
|
||||
long result = _waitTicks;
|
||||
_waitTicks = 0;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue