Compare commits

...

11 Commits

Author SHA1 Message Date
TSRBerry
ede5b3c324 [Ryujinx.Audio.Backends.SoundIo] Address dotnet-format issues (#5360)
* dotnet format style --severity info

Some changes were manually reverted.

* Address dotnet format CA1816 warnings

* Address dotnet format CA1401 warnings

* Address most dotnet format whitespace warnings

* Run dotnet format after rebase and remove unused usings

- analyzers
- style
- whitespace

* Simplify properties and array initialization, Use const when possible, Remove trailing commas

* Revert "Simplify properties and array initialization, Use const when possible, Remove trailing commas"

This reverts commit 9462e4136c0a2100dc28b20cf9542e06790aa67e.

* dotnet format whitespace after rebase

* Address review feedback
2023-06-25 02:15:56 +02:00
TSRBerry
df5be5812f [Ryujinx.Audio.Backends.OpenAL] Address dotnet-format issues (#5359)
* dotnet format style --severity info

Some changes were manually reverted.

* Restore a few unused methods and variables

* Address dotnet format CA1816 warnings

* Address most dotnet format whitespace warnings

* Simplify properties and array initialization, Use const when possible, Remove trailing commas

* Revert "Simplify properties and array initialization, Use const when possible, Remove trailing commas"

This reverts commit 9462e4136c0a2100dc28b20cf9542e06790aa67e.

* dotnet format whitespace after rebase
2023-06-25 01:29:40 +02:00
Marco Carvalho
bc392e55df Empty "case" clauses that fall through to the "default" should be omitted (#5353)
* Empty "case" clauses that fall through to the "default" should be omitted

* default throw exception

* format
2023-06-24 12:06:58 +00:00
Marco Carvalho
fffc3ed193 Mutable fields should not be "public static" (#5352) 2023-06-24 12:01:59 +00:00
TSRBerry
7d160e98fd MemoryManagement: Change return types for Commit/Decommit to void (#5325)
* Replace return type with void for Commit/Decommit

* Small cleanup
2023-06-24 02:46:04 +02:00
Marco Carvalho
bf96bc84a8 "Where" should be used before "OrderBy" (#5346) 2023-06-23 00:51:44 +00:00
Marco Carvalho
91e4caaa69 "StartsWith" and "EndsWith" overloads that take a "char" should be used instead of the ones that take a "string" (#5347) 2023-06-23 02:15:14 +02:00
Marco Carvalho
efbd29463d "Find" method should be used instead of the "FirstOrDefault" extension (#5344) 2023-06-23 01:42:23 +02:00
Marco Carvalho
7608cb37ab "Exists" method should be used instead of the "Any" extension (#5345) 2023-06-23 01:37:25 +02:00
Kurochi51
d604e98227 Fix regression introduced by 1.1.1733 on Intel GPUs (#5311)
* Fix regression introduced by 1.1733 on Intel iGPUs

* Should have actually figured the variable, oops.

* maybe something goes wrong here? honestly lost

* Shader cache bump
2023-06-22 21:35:06 +02:00
Marco Carvalho
58907e2c29 GetHashCode should not reference mutable fields (#5331) 2023-06-22 18:36:07 +02:00
35 changed files with 160 additions and 130 deletions

View File

@@ -228,7 +228,6 @@ namespace ARMeilleure.Instructions
switch (context.Fpcr.GetRoundingMode()) switch (context.Fpcr.GetRoundingMode())
{ {
default:
case FPRoundingMode.ToNearest: case FPRoundingMode.ToNearest:
roundUp = (error > 0.5d || (error == 0.5d && (intMant & 1u) == 1u)); roundUp = (error > 0.5d || (error == 0.5d && (intMant & 1u) == 1u));
overflowToInf = true; overflowToInf = true;
@@ -248,6 +247,9 @@ namespace ARMeilleure.Instructions
roundUp = false; roundUp = false;
overflowToInf = false; overflowToInf = false;
break; break;
default:
throw new ArgumentException($"Invalid rounding mode \"{context.Fpcr.GetRoundingMode()}\".");
} }
if (roundUp) if (roundUp)
@@ -412,7 +414,6 @@ namespace ARMeilleure.Instructions
switch (context.Fpcr.GetRoundingMode()) switch (context.Fpcr.GetRoundingMode())
{ {
default:
case FPRoundingMode.ToNearest: case FPRoundingMode.ToNearest:
roundUp = (error > 0.5d || (error == 0.5d && (intMant & 1u) == 1u)); roundUp = (error > 0.5d || (error == 0.5d && (intMant & 1u) == 1u));
overflowToInf = true; overflowToInf = true;
@@ -432,6 +433,9 @@ namespace ARMeilleure.Instructions
roundUp = false; roundUp = false;
overflowToInf = false; overflowToInf = false;
break; break;
default:
throw new ArgumentException($"Invalid rounding mode \"{context.Fpcr.GetRoundingMode()}\".");
} }
if (roundUp) if (roundUp)
@@ -585,7 +589,6 @@ namespace ARMeilleure.Instructions
switch (context.Fpcr.GetRoundingMode()) switch (context.Fpcr.GetRoundingMode())
{ {
default:
case FPRoundingMode.ToNearest: case FPRoundingMode.ToNearest:
roundUp = (error > 0.5d || (error == 0.5d && (intMant & 1u) == 1u)); roundUp = (error > 0.5d || (error == 0.5d && (intMant & 1u) == 1u));
overflowToInf = true; overflowToInf = true;
@@ -605,6 +608,9 @@ namespace ARMeilleure.Instructions
roundUp = false; roundUp = false;
overflowToInf = false; overflowToInf = false;
break; break;
default:
throw new ArgumentException($"Invalid rounding mode \"{context.Fpcr.GetRoundingMode()}\".");
} }
if (roundUp) if (roundUp)
@@ -1433,11 +1439,24 @@ namespace ARMeilleure.Instructions
switch (fpcr.GetRoundingMode()) switch (fpcr.GetRoundingMode())
{ {
case FPRoundingMode.ToNearest:
overflowToInf = true;
break;
case FPRoundingMode.TowardsPlusInfinity:
overflowToInf = !sign;
break;
case FPRoundingMode.TowardsMinusInfinity:
overflowToInf = sign;
break;
case FPRoundingMode.TowardsZero:
overflowToInf = false;
break;
default: default:
case FPRoundingMode.ToNearest: overflowToInf = true; break; throw new ArgumentException($"Invalid rounding mode \"{fpcr.GetRoundingMode()}\".");
case FPRoundingMode.TowardsPlusInfinity: overflowToInf = !sign; break;
case FPRoundingMode.TowardsMinusInfinity: overflowToInf = sign; break;
case FPRoundingMode.TowardsZero: overflowToInf = false; break;
} }
result = overflowToInf ? FPInfinity(sign) : FPMaxNormal(sign); result = overflowToInf ? FPInfinity(sign) : FPMaxNormal(sign);
@@ -2845,11 +2864,24 @@ namespace ARMeilleure.Instructions
switch (fpcr.GetRoundingMode()) switch (fpcr.GetRoundingMode())
{ {
case FPRoundingMode.ToNearest:
overflowToInf = true;
break;
case FPRoundingMode.TowardsPlusInfinity:
overflowToInf = !sign;
break;
case FPRoundingMode.TowardsMinusInfinity:
overflowToInf = sign;
break;
case FPRoundingMode.TowardsZero:
overflowToInf = false;
break;
default: default:
case FPRoundingMode.ToNearest: overflowToInf = true; break; throw new ArgumentException($"Invalid rounding mode \"{fpcr.GetRoundingMode()}\".");
case FPRoundingMode.TowardsPlusInfinity: overflowToInf = !sign; break;
case FPRoundingMode.TowardsMinusInfinity: overflowToInf = sign; break;
case FPRoundingMode.TowardsZero: overflowToInf = false; break;
} }
result = overflowToInf ? FPInfinity(sign) : FPMaxNormal(sign); result = overflowToInf ? FPInfinity(sign) : FPMaxNormal(sign);

View File

@@ -6,9 +6,9 @@ namespace ARMeilleure.Memory
{ {
IntPtr Pointer { get; } IntPtr Pointer { get; }
bool Commit(ulong offset, ulong size); void Commit(ulong offset, ulong size);
void MapAsRx(ulong offset, ulong size); void MapAsRx(ulong offset, ulong size);
void MapAsRwx(ulong offset, ulong size); void MapAsRwx(ulong offset, ulong size);
} }
} }

View File

@@ -13,8 +13,8 @@ namespace ARMeilleure.State
// _e0 & _e1 could be marked as readonly, however they are not readonly because we modify them through the Unsafe // _e0 & _e1 could be marked as readonly, however they are not readonly because we modify them through the Unsafe
// APIs. This also means that one should be careful when changing the layout of this struct. // APIs. This also means that one should be careful when changing the layout of this struct.
private ulong _e0; private readonly ulong _e0;
private ulong _e1; private readonly ulong _e1;
/// <summary> /// <summary>
/// Gets a new <see cref="V128"/> with all bits set to zero. /// Gets a new <see cref="V128"/> with all bits set to zero.

View File

@@ -18,7 +18,7 @@ namespace Ryujinx.Audio.Backends.OpenAL
private readonly ManualResetEvent _pauseEvent; private readonly ManualResetEvent _pauseEvent;
private readonly ConcurrentDictionary<OpenALHardwareDeviceSession, byte> _sessions; private readonly ConcurrentDictionary<OpenALHardwareDeviceSession, byte> _sessions;
private bool _stillRunning; private bool _stillRunning;
private Thread _updaterThread; private readonly Thread _updaterThread;
public OpenALHardwareDeviceDriver() public OpenALHardwareDeviceDriver()
{ {
@@ -73,7 +73,7 @@ namespace Ryujinx.Audio.Backends.OpenAL
throw new ArgumentException($"{channelCount}"); throw new ArgumentException($"{channelCount}");
} }
OpenALHardwareDeviceSession session = new OpenALHardwareDeviceSession(this, memoryManager, sampleFormat, sampleRate, channelCount, volume); OpenALHardwareDeviceSession session = new(this, memoryManager, sampleFormat, sampleRate, channelCount, volume);
_sessions.TryAdd(session, 0); _sessions.TryAdd(session, 0);
@@ -123,6 +123,7 @@ namespace Ryujinx.Audio.Backends.OpenAL
public void Dispose() public void Dispose()
{ {
GC.SuppressFinalize(this);
Dispose(true); Dispose(true);
} }

View File

@@ -10,11 +10,11 @@ namespace Ryujinx.Audio.Backends.OpenAL
{ {
class OpenALHardwareDeviceSession : HardwareDeviceSessionOutputBase class OpenALHardwareDeviceSession : HardwareDeviceSessionOutputBase
{ {
private OpenALHardwareDeviceDriver _driver; private readonly OpenALHardwareDeviceDriver _driver;
private int _sourceId; private readonly int _sourceId;
private ALFormat _targetFormat; private readonly ALFormat _targetFormat;
private bool _isActive; private bool _isActive;
private Queue<OpenALAudioBuffer> _queuedBuffers; private readonly Queue<OpenALAudioBuffer> _queuedBuffers;
private ulong _playedSampleCount; private ulong _playedSampleCount;
private readonly object _lock = new(); private readonly object _lock = new();
@@ -32,23 +32,17 @@ namespace Ryujinx.Audio.Backends.OpenAL
private ALFormat GetALFormat() private ALFormat GetALFormat()
{ {
switch (RequestedSampleFormat) return RequestedSampleFormat switch
{ {
case SampleFormat.PcmInt16: SampleFormat.PcmInt16 => RequestedChannelCount switch
switch (RequestedChannelCount) {
{ 1 => ALFormat.Mono16,
case 1: 2 => ALFormat.Stereo16,
return ALFormat.Mono16; 6 => ALFormat.Multi51Chn16Ext,
case 2: _ => throw new NotImplementedException($"Unsupported channel config {RequestedChannelCount}"),
return ALFormat.Stereo16; },
case 6: _ => throw new NotImplementedException($"Unsupported sample format {RequestedSampleFormat}"),
return ALFormat.Multi51Chn16Ext; };
default:
throw new NotImplementedException($"Unsupported channel config {RequestedChannelCount}");
}
default:
throw new NotImplementedException($"Unsupported sample format {RequestedSampleFormat}");
}
} }
public override void PrepareToClose() { } public override void PrepareToClose() { }
@@ -69,7 +63,7 @@ namespace Ryujinx.Audio.Backends.OpenAL
{ {
lock (_lock) lock (_lock)
{ {
OpenALAudioBuffer driverBuffer = new OpenALAudioBuffer OpenALAudioBuffer driverBuffer = new()
{ {
DriverIdentifier = buffer.DataPointer, DriverIdentifier = buffer.DataPointer,
BufferId = AL.GenBuffer(), BufferId = AL.GenBuffer(),

View File

@@ -10,19 +10,19 @@ namespace Ryujinx.Audio.Backends.SoundIo.Native
private const string LibraryName = "libsoundio"; private const string LibraryName = "libsoundio";
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public unsafe delegate void OnDeviceChangeNativeDelegate(IntPtr ctx); public delegate void OnDeviceChangeNativeDelegate(IntPtr ctx);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public unsafe delegate void OnBackendDisconnectedDelegate(IntPtr ctx, SoundIoError err); public delegate void OnBackendDisconnectedDelegate(IntPtr ctx, SoundIoError err);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public unsafe delegate void OnEventsSignalDelegate(IntPtr ctx); public delegate void OnEventsSignalDelegate(IntPtr ctx);
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public unsafe delegate void EmitRtPrioWarningDelegate(); public delegate void EmitRtPrioWarningDelegate();
[UnmanagedFunctionPointer(CallingConvention.Cdecl)] [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
public unsafe delegate void JackCallbackDelegate(IntPtr msg); public delegate void JackCallbackDelegate(IntPtr msg);
[StructLayout(LayoutKind.Sequential)] [StructLayout(LayoutKind.Sequential)]
public struct SoundIoStruct public struct SoundIoStruct
@@ -110,69 +110,69 @@ namespace Ryujinx.Audio.Backends.SoundIo.Native
} }
[LibraryImport(LibraryName)] [LibraryImport(LibraryName)]
public static partial IntPtr soundio_create(); internal static partial IntPtr soundio_create();
[LibraryImport(LibraryName)] [LibraryImport(LibraryName)]
public static partial SoundIoError soundio_connect(IntPtr ctx); internal static partial SoundIoError soundio_connect(IntPtr ctx);
[LibraryImport(LibraryName)] [LibraryImport(LibraryName)]
public static partial void soundio_disconnect(IntPtr ctx); internal static partial void soundio_disconnect(IntPtr ctx);
[LibraryImport(LibraryName)] [LibraryImport(LibraryName)]
public static partial void soundio_flush_events(IntPtr ctx); internal static partial void soundio_flush_events(IntPtr ctx);
[LibraryImport(LibraryName)] [LibraryImport(LibraryName)]
public static partial int soundio_output_device_count(IntPtr ctx); internal static partial int soundio_output_device_count(IntPtr ctx);
[LibraryImport(LibraryName)] [LibraryImport(LibraryName)]
public static partial int soundio_default_output_device_index(IntPtr ctx); internal static partial int soundio_default_output_device_index(IntPtr ctx);
[LibraryImport(LibraryName)] [LibraryImport(LibraryName)]
public static partial IntPtr soundio_get_output_device(IntPtr ctx, int index); internal static partial IntPtr soundio_get_output_device(IntPtr ctx, int index);
[LibraryImport(LibraryName)] [LibraryImport(LibraryName)]
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
public static partial bool soundio_device_supports_format(IntPtr devCtx, SoundIoFormat format); internal static partial bool soundio_device_supports_format(IntPtr devCtx, SoundIoFormat format);
[LibraryImport(LibraryName)] [LibraryImport(LibraryName)]
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
public static partial bool soundio_device_supports_layout(IntPtr devCtx, IntPtr layout); internal static partial bool soundio_device_supports_layout(IntPtr devCtx, IntPtr layout);
[LibraryImport(LibraryName)] [LibraryImport(LibraryName)]
[return: MarshalAs(UnmanagedType.Bool)] [return: MarshalAs(UnmanagedType.Bool)]
public static partial bool soundio_device_supports_sample_rate(IntPtr devCtx, int sampleRate); internal static partial bool soundio_device_supports_sample_rate(IntPtr devCtx, int sampleRate);
[LibraryImport(LibraryName)] [LibraryImport(LibraryName)]
public static partial IntPtr soundio_outstream_create(IntPtr devCtx); internal static partial IntPtr soundio_outstream_create(IntPtr devCtx);
[LibraryImport(LibraryName)] [LibraryImport(LibraryName)]
public static partial SoundIoError soundio_outstream_open(IntPtr outStreamCtx); internal static partial SoundIoError soundio_outstream_open(IntPtr outStreamCtx);
[LibraryImport(LibraryName)] [LibraryImport(LibraryName)]
public static partial SoundIoError soundio_outstream_start(IntPtr outStreamCtx); internal static partial SoundIoError soundio_outstream_start(IntPtr outStreamCtx);
[LibraryImport(LibraryName)] [LibraryImport(LibraryName)]
public static partial SoundIoError soundio_outstream_begin_write(IntPtr outStreamCtx, IntPtr areas, IntPtr frameCount); internal static partial SoundIoError soundio_outstream_begin_write(IntPtr outStreamCtx, IntPtr areas, IntPtr frameCount);
[LibraryImport(LibraryName)] [LibraryImport(LibraryName)]
public static partial SoundIoError soundio_outstream_end_write(IntPtr outStreamCtx); internal static partial SoundIoError soundio_outstream_end_write(IntPtr outStreamCtx);
[LibraryImport(LibraryName)] [LibraryImport(LibraryName)]
public static partial SoundIoError soundio_outstream_pause(IntPtr devCtx, [MarshalAs(UnmanagedType.Bool)] bool pause); internal static partial SoundIoError soundio_outstream_pause(IntPtr devCtx, [MarshalAs(UnmanagedType.Bool)] bool pause);
[LibraryImport(LibraryName)] [LibraryImport(LibraryName)]
public static partial SoundIoError soundio_outstream_set_volume(IntPtr devCtx, double volume); internal static partial SoundIoError soundio_outstream_set_volume(IntPtr devCtx, double volume);
[LibraryImport(LibraryName)] [LibraryImport(LibraryName)]
public static partial void soundio_outstream_destroy(IntPtr streamCtx); internal static partial void soundio_outstream_destroy(IntPtr streamCtx);
[LibraryImport(LibraryName)] [LibraryImport(LibraryName)]
public static partial void soundio_destroy(IntPtr ctx); internal static partial void soundio_destroy(IntPtr ctx);
[LibraryImport(LibraryName)] [LibraryImport(LibraryName)]
public static partial IntPtr soundio_channel_layout_get_default(int channelCount); internal static partial IntPtr soundio_channel_layout_get_default(int channelCount);
[LibraryImport(LibraryName)] [LibraryImport(LibraryName)]
public static partial IntPtr soundio_strerror(SoundIoError err); internal static partial IntPtr soundio_strerror(SoundIoError err);
} }
} }

View File

@@ -1,5 +1,4 @@
using System; using System;
using System.Reflection.Metadata;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Threading; using System.Threading;

View File

@@ -141,7 +141,7 @@ namespace Ryujinx.Audio.Backends.SoundIo
throw new NotImplementedException("Input direction is currently not implemented on SoundIO backend!"); throw new NotImplementedException("Input direction is currently not implemented on SoundIO backend!");
} }
SoundIoHardwareDeviceSession session = new SoundIoHardwareDeviceSession(this, memoryManager, sampleFormat, sampleRate, channelCount, volume); SoundIoHardwareDeviceSession session = new(this, memoryManager, sampleFormat, sampleRate, channelCount, volume);
_sessions.TryAdd(session, 0); _sessions.TryAdd(session, 0);
@@ -162,7 +162,7 @@ namespace Ryujinx.Audio.Backends.SoundIo
SampleFormat.PcmInt24 => SoundIoFormat.S24LE, SampleFormat.PcmInt24 => SoundIoFormat.S24LE,
SampleFormat.PcmInt32 => SoundIoFormat.S32LE, SampleFormat.PcmInt32 => SoundIoFormat.S32LE,
SampleFormat.PcmFloat => SoundIoFormat.Float32LE, SampleFormat.PcmFloat => SoundIoFormat.Float32LE,
_ => throw new ArgumentException ($"Unsupported sample format {format}"), _ => throw new ArgumentException($"Unsupported sample format {format}"),
}; };
} }
@@ -202,6 +202,8 @@ namespace Ryujinx.Audio.Backends.SoundIo
public void Dispose() public void Dispose()
{ {
GC.SuppressFinalize(this);
if (Interlocked.CompareExchange(ref _disposeState, 1, 0) == 0) if (Interlocked.CompareExchange(ref _disposeState, 1, 0) == 0)
{ {
Dispose(true); Dispose(true);

View File

@@ -12,12 +12,12 @@ namespace Ryujinx.Audio.Backends.SoundIo
{ {
class SoundIoHardwareDeviceSession : HardwareDeviceSessionOutputBase class SoundIoHardwareDeviceSession : HardwareDeviceSessionOutputBase
{ {
private SoundIoHardwareDeviceDriver _driver; private readonly SoundIoHardwareDeviceDriver _driver;
private ConcurrentQueue<SoundIoAudioBuffer> _queuedBuffers; private readonly ConcurrentQueue<SoundIoAudioBuffer> _queuedBuffers;
private SoundIoOutStreamContext _outputStream; private SoundIoOutStreamContext _outputStream;
private DynamicRingBuffer _ringBuffer; private readonly DynamicRingBuffer _ringBuffer;
private ulong _playedSampleCount; private ulong _playedSampleCount;
private ManualResetEvent _updateRequiredEvent; private readonly ManualResetEvent _updateRequiredEvent;
private int _disposeState; private int _disposeState;
public SoundIoHardwareDeviceSession(SoundIoHardwareDeviceDriver driver, IVirtualMemoryManager memoryManager, SampleFormat requestedSampleFormat, uint requestedSampleRate, uint requestedChannelCount, float requestedVolume) : base(memoryManager, requestedSampleFormat, requestedSampleRate, requestedChannelCount) public SoundIoHardwareDeviceSession(SoundIoHardwareDeviceDriver driver, IVirtualMemoryManager memoryManager, SampleFormat requestedSampleFormat, uint requestedSampleRate, uint requestedChannelCount, float requestedVolume) : base(memoryManager, requestedSampleFormat, requestedSampleRate, requestedChannelCount)
@@ -54,7 +54,7 @@ namespace Ryujinx.Audio.Backends.SoundIo
public override void QueueBuffer(AudioBuffer buffer) public override void QueueBuffer(AudioBuffer buffer)
{ {
SoundIoAudioBuffer driverBuffer = new SoundIoAudioBuffer(buffer.DataPointer, GetSampleCount(buffer)); SoundIoAudioBuffer driverBuffer = new(buffer.DataPointer, GetSampleCount(buffer));
_ringBuffer.Write(buffer.Data, 0, buffer.Data.Length); _ringBuffer.Write(buffer.Data, 0, buffer.Data.Length);
@@ -81,7 +81,7 @@ namespace Ryujinx.Audio.Backends.SoundIo
_driver.FlushContextEvents(); _driver.FlushContextEvents();
} }
public override void UnregisterBuffer(AudioBuffer buffer) {} public override void UnregisterBuffer(AudioBuffer buffer) { }
public override bool WasBufferFullyConsumed(AudioBuffer buffer) public override bool WasBufferFullyConsumed(AudioBuffer buffer)
{ {

View File

@@ -164,7 +164,7 @@ namespace Ryujinx.Audio
/// <summary> /// <summary>
/// The default coefficients used for standard 5.1 surround to stereo downmixing. /// The default coefficients used for standard 5.1 surround to stereo downmixing.
/// </summary> /// </summary>
public static float[] DefaultSurroundToStereoCoefficients = new float[4] public static readonly float[] DefaultSurroundToStereoCoefficients = new float[4]
{ {
1.0f, 1.0f,
0.707f, 0.707f,

View File

@@ -264,7 +264,7 @@ namespace Ryujinx.Ava.UI.ViewModels
private void SelectLastScannedAmiibo() private void SelectLastScannedAmiibo()
{ {
AmiiboApi scanned = _amiiboList.FirstOrDefault(amiibo => amiibo.GetId() == LastScannedAmiiboId); AmiiboApi scanned = _amiiboList.Find(amiibo => amiibo.GetId() == LastScannedAmiiboId);
SeriesSelectedIndex = AmiiboSeries.IndexOf(scanned.AmiiboSeries); SeriesSelectedIndex = AmiiboSeries.IndexOf(scanned.AmiiboSeries);
AmiiboSelectedIndex = AmiiboList.IndexOf(scanned); AmiiboSelectedIndex = AmiiboList.IndexOf(scanned);
@@ -325,7 +325,7 @@ namespace Ryujinx.Ava.UI.ViewModels
AmiiboApi selected = _amiibos[_amiiboSelectedIndex]; AmiiboApi selected = _amiibos[_amiiboSelectedIndex];
string imageUrl = _amiiboList.FirstOrDefault(amiibo => amiibo.Equals(selected)).Image; string imageUrl = _amiiboList.Find(amiibo => amiibo.Equals(selected)).Image;
string usageString = ""; string usageString = "";

View File

@@ -15,10 +15,10 @@ namespace Ryujinx.Cpu.Jit
_impl = new MemoryBlock(size, flags); _impl = new MemoryBlock(size, flags);
} }
public bool Commit(ulong offset, ulong size) => _impl.Commit(offset, size); public void Commit(ulong offset, ulong size) => _impl.Commit(offset, size);
public void MapAsRx(ulong offset, ulong size) => _impl.Reprotect(offset, size, MemoryPermission.ReadAndExecute); public void MapAsRx(ulong offset, ulong size) => _impl.Reprotect(offset, size, MemoryPermission.ReadAndExecute);
public void MapAsRwx(ulong offset, ulong size) => _impl.Reprotect(offset, size, MemoryPermission.ReadWriteExecute); public void MapAsRwx(ulong offset, ulong size) => _impl.Reprotect(offset, size, MemoryPermission.ReadWriteExecute);
public void Dispose() => _impl.Dispose(); public void Dispose() => _impl.Dispose();
} }
} }

View File

@@ -512,7 +512,7 @@ namespace Ryujinx.Graphics.Gpu.Image
/// <returns>True if at least one of the handles is dirty</returns> /// <returns>True if at least one of the handles is dirty</returns>
private bool CheckDirty() private bool CheckDirty()
{ {
return Handles.Any(handle => handle.Dirty); return Array.Exists(Handles, handle => handle.Dirty);
} }
/// <summary> /// <summary>

View File

@@ -22,7 +22,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.DiskCache
private const ushort FileFormatVersionMajor = 1; private const ushort FileFormatVersionMajor = 1;
private const ushort FileFormatVersionMinor = 2; private const ushort FileFormatVersionMinor = 2;
private const uint FileFormatVersionPacked = ((uint)FileFormatVersionMajor << 16) | FileFormatVersionMinor; private const uint FileFormatVersionPacked = ((uint)FileFormatVersionMajor << 16) | FileFormatVersionMinor;
private const uint CodeGenVersion = 5241; private const uint CodeGenVersion = 5311;
private const string SharedTocFileName = "shared.toc"; private const string SharedTocFileName = "shared.toc";
private const string SharedDataFileName = "shared.data"; private const string SharedDataFileName = "shared.data";

View File

@@ -166,7 +166,7 @@ namespace Ryujinx.Graphics.Shader.Instructions
{ {
// gl_FrontFacing sometimes has incorrect (flipped) values depending how it is accessed on Intel GPUs. // gl_FrontFacing sometimes has incorrect (flipped) values depending how it is accessed on Intel GPUs.
// This weird trick makes it behave. // This weird trick makes it behave.
res = context.ICompareLess(context.INegate(context.IConvertS32ToFP32(res)), Const(0)); res = context.ICompareLess(context.INegate(context.FP32ConvertToS32(context.ConditionalSelect(res, ConstF(1f), ConstF(0f)))), Const(0));
} }
} }

View File

@@ -140,7 +140,7 @@ namespace Ryujinx.Graphics.Shader.Translation
FunctionMatch.RunPass(program); FunctionMatch.RunPass(program);
foreach (DecodedFunction function in program.OrderBy(x => x.Address).Where(x => !x.IsCompilerGenerated)) foreach (DecodedFunction function in program.Where(x => !x.IsCompilerGenerated).OrderBy(x => x.Address))
{ {
program.AddFunctionAndSetId(function); program.AddFunctionAndSetId(function);
} }

View File

@@ -256,7 +256,7 @@ namespace Ryujinx.Graphics.Vulkan
{ {
await Task.WhenAll(_shaders.Select(shader => shader.CompileTask)); await Task.WhenAll(_shaders.Select(shader => shader.CompileTask));
if (_shaders.Any(shader => shader.CompileStatus == ProgramLinkStatus.Failure)) if (Array.Exists(_shaders, shader => shader.CompileStatus == ProgramLinkStatus.Failure))
{ {
LinkStatus = ProgramLinkStatus.Failure; LinkStatus = ProgramLinkStatus.Failure;

View File

@@ -15,7 +15,7 @@ namespace Ryujinx.HLE.HOS.Diagnostics.Demangler.Ast
writer.Write(Params); writer.Write(Params);
if (Params.EndsWith(">")) if (Params.EndsWith('>'))
{ {
writer.Write(" "); writer.Write(" ");
} }

View File

@@ -206,7 +206,7 @@ namespace Ryujinx.HLE.HOS.Kernel.Threading
WakeThreads(_condVarThreads, count, TryAcquireMutex, x => x.CondVarAddress == address); WakeThreads(_condVarThreads, count, TryAcquireMutex, x => x.CondVarAddress == address);
if (!_condVarThreads.Any(x => x.CondVarAddress == address)) if (!_condVarThreads.Exists(x => x.CondVarAddress == address))
{ {
KernelTransfer.KernelToUser(address, 0); KernelTransfer.KernelToUser(address, 0);
} }

View File

@@ -6,7 +6,7 @@ namespace Ryujinx.HLE.HOS.Services.Mii.Types
[StructLayout(LayoutKind.Sequential, Pack = 1, Size = 0x10)] [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 0x10)]
struct CreateId : IEquatable<CreateId> struct CreateId : IEquatable<CreateId>
{ {
public UInt128 Raw; public readonly UInt128 Raw;
public bool IsNull => Raw == UInt128.Zero; public bool IsNull => Raw == UInt128.Zero;
public bool IsValid => !IsNull && ((Raw >> 64) & 0xC0) == 0x80; public bool IsValid => !IsNull && ((Raw >> 64) & 0xC0) == 0x80;

View File

@@ -95,7 +95,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.Nfp
{ {
VirtualAmiiboFile virtualAmiiboFile = LoadAmiiboFile(amiiboId); VirtualAmiiboFile virtualAmiiboFile = LoadAmiiboFile(amiiboId);
if (virtualAmiiboFile.ApplicationAreas.Any(item => item.ApplicationAreaId == applicationAreaId)) if (virtualAmiiboFile.ApplicationAreas.Exists(item => item.ApplicationAreaId == applicationAreaId))
{ {
_openedApplicationAreaId = applicationAreaId; _openedApplicationAreaId = applicationAreaId;
@@ -124,7 +124,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.Nfp
{ {
VirtualAmiiboFile virtualAmiiboFile = LoadAmiiboFile(amiiboId); VirtualAmiiboFile virtualAmiiboFile = LoadAmiiboFile(amiiboId);
if (virtualAmiiboFile.ApplicationAreas.Any(item => item.ApplicationAreaId == applicationAreaId)) if (virtualAmiiboFile.ApplicationAreas.Exists(item => item.ApplicationAreaId == applicationAreaId))
{ {
return false; return false;
} }
@@ -144,7 +144,7 @@ namespace Ryujinx.HLE.HOS.Services.Nfc.Nfp
{ {
VirtualAmiiboFile virtualAmiiboFile = LoadAmiiboFile(amiiboId); VirtualAmiiboFile virtualAmiiboFile = LoadAmiiboFile(amiiboId);
if (virtualAmiiboFile.ApplicationAreas.Any(item => item.ApplicationAreaId == _openedApplicationAreaId)) if (virtualAmiiboFile.ApplicationAreas.Exists(item => item.ApplicationAreaId == _openedApplicationAreaId))
{ {
for (int i = 0; i < virtualAmiiboFile.ApplicationAreas.Count; i++) for (int i = 0; i < virtualAmiiboFile.ApplicationAreas.Count; i++)
{ {

View File

@@ -39,7 +39,7 @@ namespace Ryujinx.HLE.HOS.Services.Sockets.Sfdnsres.Proxy
} }
// Ignore comments and empty lines // Ignore comments and empty lines
if (line.StartsWith("#") || line.Trim().Length == 0) if (line.StartsWith('#') || line.Trim().Length == 0)
{ {
continue; continue;
} }

View File

@@ -8,6 +8,7 @@ using Ryujinx.Common.Configuration;
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using Ryujinx.HLE.Loaders.Executables; using Ryujinx.HLE.Loaders.Executables;
using Ryujinx.Memory; using Ryujinx.Memory;
using System;
using System.Linq; using System.Linq;
using static Ryujinx.HLE.HOS.ModLoader; using static Ryujinx.HLE.HOS.ModLoader;
@@ -99,7 +100,7 @@ namespace Ryujinx.HLE.Loaders.Processes.Extensions
if (string.IsNullOrWhiteSpace(programName)) if (string.IsNullOrWhiteSpace(programName))
{ {
programName = nacpData.Value.Title.ItemsRo.ToArray().FirstOrDefault(x => x.Name[0] != 0).NameString.ToString(); programName = Array.Find(nacpData.Value.Title.ItemsRo.ToArray(), x => x.Name[0] != 0).NameString.ToString();
} }
} }

View File

@@ -9,6 +9,7 @@ using LibHac.Tools.FsSystem.NcaUtils;
using Ryujinx.Common.Logging; using Ryujinx.Common.Logging;
using Ryujinx.HLE.Loaders.Executables; using Ryujinx.HLE.Loaders.Executables;
using Ryujinx.HLE.Loaders.Processes.Extensions; using Ryujinx.HLE.Loaders.Processes.Extensions;
using System;
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
@@ -176,7 +177,7 @@ namespace Ryujinx.HLE.Loaders.Processes
if (string.IsNullOrWhiteSpace(programName)) if (string.IsNullOrWhiteSpace(programName))
{ {
programName = nacpData.Value.Title.ItemsRo.ToArray().FirstOrDefault(x => x.Name[0] != 0).NameString.ToString(); programName = Array.Find(nacpData.Value.Title.ItemsRo.ToArray(), x => x.Name[0] != 0).NameString.ToString();
} }
if (nacpData.Value.PresenceGroupId != 0) if (nacpData.Value.PresenceGroupId != 0)

View File

@@ -6,6 +6,7 @@ using Ryujinx.Cpu;
using Ryujinx.HLE.HOS.SystemState; using Ryujinx.HLE.HOS.SystemState;
using Ryujinx.HLE.Loaders.Processes.Extensions; using Ryujinx.HLE.Loaders.Processes.Extensions;
using Ryujinx.Horizon.Common; using Ryujinx.Horizon.Common;
using System;
using System.Linq; using System.Linq;
namespace Ryujinx.HLE.Loaders.Processes namespace Ryujinx.HLE.Loaders.Processes
@@ -59,7 +60,7 @@ namespace Ryujinx.HLE.Loaders.Processes
if (string.IsNullOrWhiteSpace(Name)) if (string.IsNullOrWhiteSpace(Name))
{ {
Name = ApplicationControlProperties.Title.ItemsRo.ToArray().FirstOrDefault(x => x.Name[0] != 0).NameString.ToString(); Name = Array.Find(ApplicationControlProperties.Title.ItemsRo.ToArray(), x => x.Name[0] != 0).NameString.ToString();
} }
DisplayVersion = ApplicationControlProperties.DisplayVersionString.ToString(); DisplayVersion = ApplicationControlProperties.DisplayVersionString.ToString();

View File

@@ -1,6 +1,5 @@
using System; using System;
using System.Runtime.CompilerServices; using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Threading; using System.Threading;
namespace Ryujinx.Memory namespace Ryujinx.Memory
@@ -101,12 +100,12 @@ namespace Ryujinx.Memory
/// </summary> /// </summary>
/// <param name="offset">Starting offset of the range to be committed</param> /// <param name="offset">Starting offset of the range to be committed</param>
/// <param name="size">Size of the range to be committed</param> /// <param name="size">Size of the range to be committed</param>
/// <returns>True if the operation was successful, false otherwise</returns> /// <exception cref="SystemException">Throw when the operation was not successful</exception>
/// <exception cref="ObjectDisposedException">Throw when the memory block has already been disposed</exception> /// <exception cref="ObjectDisposedException">Throw when the memory block has already been disposed</exception>
/// <exception cref="InvalidMemoryRegionException">Throw when either <paramref name="offset"/> or <paramref name="size"/> are out of range</exception> /// <exception cref="InvalidMemoryRegionException">Throw when either <paramref name="offset"/> or <paramref name="size"/> are out of range</exception>
public bool Commit(ulong offset, ulong size) public void Commit(ulong offset, ulong size)
{ {
return MemoryManagement.Commit(GetPointerInternal(offset, size), size, _forJit); MemoryManagement.Commit(GetPointerInternal(offset, size), size, _forJit);
} }
/// <summary> /// <summary>
@@ -115,12 +114,12 @@ namespace Ryujinx.Memory
/// </summary> /// </summary>
/// <param name="offset">Starting offset of the range to be decommitted</param> /// <param name="offset">Starting offset of the range to be decommitted</param>
/// <param name="size">Size of the range to be decommitted</param> /// <param name="size">Size of the range to be decommitted</param>
/// <returns>True if the operation was successful, false otherwise</returns> /// <exception cref="SystemException">Throw when the operation was not successful</exception>
/// <exception cref="ObjectDisposedException">Throw when the memory block has already been disposed</exception> /// <exception cref="ObjectDisposedException">Throw when the memory block has already been disposed</exception>
/// <exception cref="InvalidMemoryRegionException">Throw when either <paramref name="offset"/> or <paramref name="size"/> are out of range</exception> /// <exception cref="InvalidMemoryRegionException">Throw when either <paramref name="offset"/> or <paramref name="size"/> are out of range</exception>
public bool Decommit(ulong offset, ulong size) public void Decommit(ulong offset, ulong size)
{ {
return MemoryManagement.Decommit(GetPointerInternal(offset, size), size); MemoryManagement.Decommit(GetPointerInternal(offset, size), size);
} }
/// <summary> /// <summary>

View File

@@ -36,15 +36,15 @@ namespace Ryujinx.Memory
} }
} }
public static bool Commit(IntPtr address, ulong size, bool forJit) public static void Commit(IntPtr address, ulong size, bool forJit)
{ {
if (OperatingSystem.IsWindows()) if (OperatingSystem.IsWindows())
{ {
return MemoryManagementWindows.Commit(address, (IntPtr)size); MemoryManagementWindows.Commit(address, (IntPtr)size);
} }
else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS()) else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS())
{ {
return MemoryManagementUnix.Commit(address, size, forJit); MemoryManagementUnix.Commit(address, size, forJit);
} }
else else
{ {
@@ -52,15 +52,15 @@ namespace Ryujinx.Memory
} }
} }
public static bool Decommit(IntPtr address, ulong size) public static void Decommit(IntPtr address, ulong size)
{ {
if (OperatingSystem.IsWindows()) if (OperatingSystem.IsWindows())
{ {
return MemoryManagementWindows.Decommit(address, (IntPtr)size); MemoryManagementWindows.Decommit(address, (IntPtr)size);
} }
else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS()) else if (OperatingSystem.IsLinux() || OperatingSystem.IsMacOS())
{ {
return MemoryManagementUnix.Decommit(address, size); MemoryManagementUnix.Decommit(address, size);
} }
else else
{ {

View File

@@ -2,8 +2,6 @@
using System.Collections.Concurrent; using System.Collections.Concurrent;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
using System.Runtime.Versioning; using System.Runtime.Versioning;
using System.Text;
using static Ryujinx.Memory.MemoryManagerUnixHelper; using static Ryujinx.Memory.MemoryManagerUnixHelper;
namespace Ryujinx.Memory namespace Ryujinx.Memory
@@ -12,7 +10,7 @@ namespace Ryujinx.Memory
[SupportedOSPlatform("macos")] [SupportedOSPlatform("macos")]
static class MemoryManagementUnix static class MemoryManagementUnix
{ {
private static readonly ConcurrentDictionary<IntPtr, ulong> _allocations = new ConcurrentDictionary<IntPtr, ulong>(); private static readonly ConcurrentDictionary<IntPtr, ulong> _allocations = new();
public static IntPtr Allocate(ulong size, bool forJit) public static IntPtr Allocate(ulong size, bool forJit)
{ {
@@ -68,7 +66,7 @@ namespace Ryujinx.Memory
return ptr; return ptr;
} }
public static bool Commit(IntPtr address, ulong size, bool forJit) public static void Commit(IntPtr address, ulong size, bool forJit)
{ {
MmapProts prot = MmapProts.PROT_READ | MmapProts.PROT_WRITE; MmapProts prot = MmapProts.PROT_READ | MmapProts.PROT_WRITE;
@@ -81,11 +79,9 @@ namespace Ryujinx.Memory
{ {
throw new SystemException(Marshal.GetLastPInvokeErrorMessage()); throw new SystemException(Marshal.GetLastPInvokeErrorMessage());
} }
return true;
} }
public static bool Decommit(IntPtr address, ulong size) public static void Decommit(IntPtr address, ulong size)
{ {
// Must be writable for madvise to work properly. // Must be writable for madvise to work properly.
if (mprotect(address, size, MmapProts.PROT_READ | MmapProts.PROT_WRITE) != 0) if (mprotect(address, size, MmapProts.PROT_READ | MmapProts.PROT_WRITE) != 0)
@@ -102,8 +98,6 @@ namespace Ryujinx.Memory
{ {
throw new SystemException(Marshal.GetLastPInvokeErrorMessage()); throw new SystemException(Marshal.GetLastPInvokeErrorMessage());
} }
return true;
} }
public static bool Reprotect(IntPtr address, ulong size, MemoryPermission permission) public static bool Reprotect(IntPtr address, ulong size, MemoryPermission permission)
@@ -146,7 +140,7 @@ namespace Ryujinx.Memory
if (OperatingSystem.IsMacOS()) if (OperatingSystem.IsMacOS())
{ {
byte[] memName = Encoding.ASCII.GetBytes("Ryujinx-XXXXXX"); byte[] memName = "Ryujinx-XXXXXX"u8.ToArray();
fixed (byte* pMemName = memName) fixed (byte* pMemName = memName)
{ {
@@ -164,7 +158,7 @@ namespace Ryujinx.Memory
} }
else else
{ {
byte[] fileName = Encoding.ASCII.GetBytes("/dev/shm/Ryujinx-XXXXXX"); byte[] fileName = "/dev/shm/Ryujinx-XXXXXX"u8.ToArray();
fixed (byte* pFileName = fileName) fixed (byte* pFileName = fileName)
{ {

View File

@@ -10,7 +10,7 @@ namespace Ryujinx.Memory
{ {
public const int PageSize = 0x1000; public const int PageSize = 0x1000;
private static readonly PlaceholderManager _placeholders = new PlaceholderManager(); private static readonly PlaceholderManager _placeholders = new();
public static IntPtr Allocate(IntPtr size) public static IntPtr Allocate(IntPtr size)
{ {
@@ -55,14 +55,20 @@ namespace Ryujinx.Memory
return ptr; return ptr;
} }
public static bool Commit(IntPtr location, IntPtr size) public static void Commit(IntPtr location, IntPtr size)
{ {
return WindowsApi.VirtualAlloc(location, size, AllocationType.Commit, MemoryProtection.ReadWrite) != IntPtr.Zero; if (WindowsApi.VirtualAlloc(location, size, AllocationType.Commit, MemoryProtection.ReadWrite) == IntPtr.Zero)
{
throw new SystemException(Marshal.GetLastPInvokeErrorMessage());
}
} }
public static bool Decommit(IntPtr location, IntPtr size) public static void Decommit(IntPtr location, IntPtr size)
{ {
return WindowsApi.VirtualFree(location, size, AllocationType.Decommit); if (!WindowsApi.VirtualFree(location, size, AllocationType.Decommit))
{
throw new SystemException(Marshal.GetLastPInvokeErrorMessage());
}
} }
public static void MapView(IntPtr sharedMemory, ulong srcOffset, IntPtr location, IntPtr size, MemoryBlock owner) public static void MapView(IntPtr sharedMemory, ulong srcOffset, IntPtr location, IntPtr size, MemoryBlock owner)

View File

@@ -4,8 +4,8 @@ namespace Ryujinx.Tests.Unicorn
{ {
public struct SimdValue : IEquatable<SimdValue> public struct SimdValue : IEquatable<SimdValue>
{ {
private ulong _e0; private readonly ulong _e0;
private ulong _e1; private readonly ulong _e1;
public SimdValue(ulong e0, ulong e1) public SimdValue(ulong e0, ulong e1)
{ {

View File

@@ -163,7 +163,7 @@ namespace Ryujinx.Ui.Windows
private void SelectLastScannedAmiibo() private void SelectLastScannedAmiibo()
{ {
bool isSet = _amiiboSeriesComboBox.SetActiveId(_amiiboList.FirstOrDefault(amiibo => amiibo.Head + amiibo.Tail == LastScannedAmiiboId).AmiiboSeries); bool isSet = _amiiboSeriesComboBox.SetActiveId(_amiiboList.Find(amiibo => amiibo.Head + amiibo.Tail == LastScannedAmiiboId).AmiiboSeries);
isSet = _amiiboCharsComboBox.SetActiveId(LastScannedAmiiboId); isSet = _amiiboCharsComboBox.SetActiveId(LastScannedAmiiboId);
if (isSet == false) if (isSet == false)
@@ -305,7 +305,7 @@ namespace Ryujinx.Ui.Windows
_amiiboImage.Pixbuf = new Gdk.Pixbuf(_amiiboLogoBytes); _amiiboImage.Pixbuf = new Gdk.Pixbuf(_amiiboLogoBytes);
string imageUrl = _amiiboList.FirstOrDefault(amiibo => amiibo.Head + amiibo.Tail == _amiiboCharsComboBox.ActiveId).Image; string imageUrl = _amiiboList.Find(amiibo => amiibo.Head + amiibo.Tail == _amiiboCharsComboBox.ActiveId).Image;
var usageStringBuilder = new StringBuilder(); var usageStringBuilder = new StringBuilder();

View File

@@ -5,7 +5,7 @@ namespace Spv.Generator
{ {
internal struct ConstantKey : IEquatable<ConstantKey> internal struct ConstantKey : IEquatable<ConstantKey>
{ {
private Instruction _constant; private readonly Instruction _constant;
public ConstantKey(Instruction constant) public ConstantKey(Instruction constant)
{ {

View File

@@ -5,7 +5,7 @@ namespace Spv.Generator
{ {
internal class DeterministicStringKey : IEquatable<DeterministicStringKey> internal class DeterministicStringKey : IEquatable<DeterministicStringKey>
{ {
private string _value; private readonly string _value;
public DeterministicStringKey(string value) public DeterministicStringKey(string value)
{ {

View File

@@ -8,7 +8,7 @@ namespace Spv.Generator
{ {
public OperandType Type => OperandType.String; public OperandType Type => OperandType.String;
private string _value; private readonly string _value;
public LiteralString(string value) public LiteralString(string value)
{ {

View File

@@ -5,7 +5,7 @@ namespace Spv.Generator
{ {
internal struct TypeDeclarationKey : IEquatable<TypeDeclarationKey> internal struct TypeDeclarationKey : IEquatable<TypeDeclarationKey>
{ {
private Instruction _typeDeclaration; private readonly Instruction _typeDeclaration;
public TypeDeclarationKey(Instruction typeDeclaration) public TypeDeclarationKey(Instruction typeDeclaration)
{ {