Prechádzať zdrojové kódy

infra: Migrate to .NET 7 (#3795)

* Update readme to mention .NET 7

* infra: Migrate to .NET 7

.NET 7 is still in preview but this prepare for the release coming up
next month.

* Use Random.Shared in CreateRandom

* Move UInt128Utils.cs to Ryujinx.Common project

* Fix inverted parameters in System.UInt128 constructor

* Fix Visual Studio complains on  Ryujinx.Graphics.Vic

* time: Fix missing alignment enforcement in SystemClockContext

Fixes at least Smash

* time: Fix missing alignment enforcement in SteadyClockContext

Fix games (like recent version of Smash) using time shared memory

* Switch to .NET 7.0.100 release

* Enable Tiered PGO

* Ensure CreateId validity requirements are meet when doing random generation

Also enforce correct packing layout for other Mii structures.

This fix a Mario Kart 8 crashes related to the default Miis.
Mary-nyan 3 rokov pred
rodič
commit
c6d05301aa
71 zmenil súbory, kde vykonal 144 pridanie a 301 odobranie
  1. 1 1
      .github/workflows/build.yml
  2. 1 1
      .github/workflows/release.yml
  3. 1 1
      ARMeilleure/ARMeilleure.csproj
  4. 1 1
      README.md
  5. 1 1
      Ryujinx.Audio.Backends.OpenAL/Ryujinx.Audio.Backends.OpenAL.csproj
  6. 1 1
      Ryujinx.Audio.Backends.SDL2/Ryujinx.Audio.Backends.SDL2.csproj
  7. 1 1
      Ryujinx.Audio.Backends.SoundIo/Ryujinx.Audio.Backends.SoundIo.csproj
  8. 2 2
      Ryujinx.Audio/Renderer/Server/Splitter/SplitterContext.cs
  9. 1 1
      Ryujinx.Audio/Ryujinx.Audio.csproj
  10. 3 1
      Ryujinx.Ava/Ryujinx.Ava.csproj
  11. 6 0
      Ryujinx.Common/Extensions/BinaryReaderExtensions.cs
  12. 1 1
      Ryujinx.Common/Ryujinx.Common.csproj
  13. 8 8
      Ryujinx.Common/Utilities/SpanHelpers.cs
  14. 17 0
      Ryujinx.Common/Utilities/UInt128Utils.cs
  15. 1 1
      Ryujinx.Cpu/Ryujinx.Cpu.csproj
  16. 1 1
      Ryujinx.Graphics.Device/Ryujinx.Graphics.Device.csproj
  17. 1 1
      Ryujinx.Graphics.GAL/Ryujinx.Graphics.GAL.csproj
  18. 4 4
      Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs
  19. 1 1
      Ryujinx.Graphics.Gpu/Ryujinx.Graphics.Gpu.csproj
  20. 1 1
      Ryujinx.Graphics.Gpu/Shader/HashTable/PartitionHashTable.cs
  21. 1 1
      Ryujinx.Graphics.Gpu/Shader/HashTable/PartitionedHashTable.cs
  22. 5 5
      Ryujinx.Graphics.Gpu/Shader/ShaderSpecializationState.cs
  23. 1 1
      Ryujinx.Graphics.Host1x/Ryujinx.Graphics.Host1x.csproj
  24. 1 1
      Ryujinx.Graphics.Nvdec.FFmpeg/Ryujinx.Graphics.Nvdec.FFmpeg.csproj
  25. 1 1
      Ryujinx.Graphics.Nvdec.Vp9/Ryujinx.Graphics.Nvdec.Vp9.csproj
  26. 1 1
      Ryujinx.Graphics.Nvdec/Ryujinx.Graphics.Nvdec.csproj
  27. 1 1
      Ryujinx.Graphics.OpenGL/Ryujinx.Graphics.OpenGL.csproj
  28. 1 1
      Ryujinx.Graphics.Shader/Ryujinx.Graphics.Shader.csproj
  29. 1 1
      Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs
  30. 2 2
      Ryujinx.Graphics.Shader/Translation/Translator.cs
  31. 0 112
      Ryujinx.Graphics.Shader/Translation/UInt128.cs
  32. 1 1
      Ryujinx.Graphics.Texture/Ryujinx.Graphics.Texture.csproj
  33. 2 2
      Ryujinx.Graphics.Vic/Image/SurfaceReader.cs
  34. 1 1
      Ryujinx.Graphics.Vic/Ryujinx.Graphics.Vic.csproj
  35. 1 1
      Ryujinx.Graphics.Video/Ryujinx.Graphics.Video.csproj
  36. 1 1
      Ryujinx.Graphics.Vulkan/Ryujinx.Graphics.Vulkan.csproj
  37. 4 4
      Ryujinx.HLE/FileSystem/ContentManager.cs
  38. 2 2
      Ryujinx.HLE/HOS/Horizon.cs
  39. 1 2
      Ryujinx.HLE/HOS/Services/Account/Acc/Types/UserId.cs
  40. 2 2
      Ryujinx.HLE/HOS/Services/Mii/Helper.cs
  41. 1 1
      Ryujinx.HLE/HOS/Services/Mii/Types/CharInfo.cs
  42. 6 7
      Ryujinx.HLE/HOS/Services/Mii/Types/CreateId.cs
  43. 2 1
      Ryujinx.HLE/HOS/Services/Mii/Types/StoreData.cs
  44. 9 2
      Ryujinx.HLE/HOS/Services/Mii/UtilityImpl.cs
  45. 2 2
      Ryujinx.HLE/HOS/Services/Nifm/StaticService/IGeneralService.cs
  46. 1 8
      Ryujinx.HLE/HOS/Services/Nifm/StaticService/Types/DnsSetting.cs
  47. 3 2
      Ryujinx.HLE/HOS/Services/Nifm/StaticService/Types/IpAddressSetting.cs
  48. 1 1
      Ryujinx.HLE/HOS/Services/Nifm/StaticService/Types/NetworkProfileData.cs
  49. 2 4
      Ryujinx.HLE/HOS/Services/Settings/ISystemSettingsServer.cs
  50. 3 0
      Ryujinx.HLE/HOS/Services/Ssl/SslService/SslManagedSocketConnection.cs
  51. 3 3
      Ryujinx.HLE/HOS/Services/Time/Clock/SteadyClockCore.cs
  52. 3 3
      Ryujinx.HLE/HOS/Services/Time/Clock/Types/SteadyClockTimePoint.cs
  53. 1 1
      Ryujinx.HLE/HOS/Services/Time/Clock/Types/SystemClockContext.cs
  54. 1 1
      Ryujinx.HLE/HOS/Services/Time/TimeManager.cs
  55. 1 1
      Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneManager.cs
  56. 2 2
      Ryujinx.HLE/HOS/Services/Time/Types/SteadyClockContext.cs
  57. 1 1
      Ryujinx.HLE/Ryujinx.HLE.csproj
  58. 0 75
      Ryujinx.HLE/Utilities/UInt128.cs
  59. 3 1
      Ryujinx.Headless.SDL2/Ryujinx.Headless.SDL2.csproj
  60. 1 1
      Ryujinx.Input.SDL2/Ryujinx.Input.SDL2.csproj
  61. 2 2
      Ryujinx.Input/Ryujinx.Input.csproj
  62. 1 1
      Ryujinx.Memory.Tests/Ryujinx.Memory.Tests.csproj
  63. 1 1
      Ryujinx.Memory/Ryujinx.Memory.csproj
  64. 1 1
      Ryujinx.SDL2.Common/Ryujinx.SDL2.Common.csproj
  65. 1 1
      Ryujinx.ShaderTools/Ryujinx.ShaderTools.csproj
  66. 1 1
      Ryujinx.Tests.Unicorn/Ryujinx.Tests.Unicorn.csproj
  67. 1 1
      Ryujinx.Tests/Ryujinx.Tests.csproj
  68. 1 1
      Ryujinx.Ui.Common/Ryujinx.Ui.Common.csproj
  69. 3 1
      Ryujinx/Ryujinx.csproj
  70. 1 1
      Spv.Generator/Spv.Generator.csproj
  71. 1 1
      global.json

+ 1 - 1
.github/workflows/build.yml

@@ -51,7 +51,7 @@ jobs:
       - uses: actions/checkout@v3
       - uses: actions/setup-dotnet@v3
         with:
-          dotnet-version: 6.0.x
+          dotnet-version: 7.0.x
       - name: Ensure NuGet Source
         uses: fabriciomurta/ensure-nuget-source@v1
       - name: Get git short hash

+ 1 - 1
.github/workflows/release.yml

@@ -28,7 +28,7 @@ jobs:
       - uses: actions/checkout@v3
       - uses: actions/setup-dotnet@v3
         with:
-          dotnet-version: 6.0.x
+          dotnet-version: 7.0.x
       - name: Ensure NuGet Source
         uses: fabriciomurta/ensure-nuget-source@v1
       - name: Clear

+ 1 - 1
ARMeilleure/ARMeilleure.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
 

+ 1 - 1
README.md

@@ -62,7 +62,7 @@ The latest automatic build for Windows, macOS, and Linux can be found on the [Of
 If you wish to build the emulator yourself, follow these steps:
 
 ### Step 1
-Install the X64 version of [.NET 6.0 (or higher) SDK](https://dotnet.microsoft.com/download/dotnet/6.0).
+Install the X64 version of [.NET 7.0 (or higher) SDK](https://dotnet.microsoft.com/download/dotnet/7.0).
 
 ### Step 2
 Either use `git clone https://github.com/Ryujinx/Ryujinx` on the command line to clone the repository or use Code --> Download zip button to get the files.

+ 1 - 1
Ryujinx.Audio.Backends.OpenAL/Ryujinx.Audio.Backends.OpenAL.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
   </PropertyGroup>
 
   <ItemGroup>

+ 1 - 1
Ryujinx.Audio.Backends.SDL2/Ryujinx.Audio.Backends.SDL2.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
 

+ 1 - 1
Ryujinx.Audio.Backends.SoundIo/Ryujinx.Audio.Backends.SoundIo.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <RuntimeIdentifiers>win10-x64;linux-x64;osx-x64</RuntimeIdentifiers>
   </PropertyGroup>

+ 2 - 2
Ryujinx.Audio/Renderer/Server/Splitter/SplitterContext.cs

@@ -150,7 +150,7 @@ namespace Ryujinx.Audio.Renderer.Server.Splitter
         /// </summary>
         /// <param name="inputHeader">The splitter header.</param>
         /// <param name="input">The raw data after the splitter header.</param>
-        private void UpdateState(ref SplitterInParameterHeader inputHeader, ref ReadOnlySpan<byte> input)
+        private void UpdateState(scoped ref SplitterInParameterHeader inputHeader, ref ReadOnlySpan<byte> input)
         {
             for (int i = 0; i < inputHeader.SplitterCount; i++)
             {
@@ -177,7 +177,7 @@ namespace Ryujinx.Audio.Renderer.Server.Splitter
         /// </summary>
         /// <param name="inputHeader">The splitter header.</param>
         /// <param name="input">The raw data after the splitter header.</param>
-        private void UpdateData(ref SplitterInParameterHeader inputHeader, ref ReadOnlySpan<byte> input)
+        private void UpdateData(scoped ref SplitterInParameterHeader inputHeader, ref ReadOnlySpan<byte> input)
         {
             for (int i = 0; i < inputHeader.SplitterDestinationCount; i++)
             {

+ 1 - 1
Ryujinx.Audio/Ryujinx.Audio.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
 

+ 3 - 1
Ryujinx.Ava/Ryujinx.Ava.csproj

@@ -1,6 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
     <RuntimeIdentifiers>win10-x64;osx-x64;linux-x64</RuntimeIdentifiers>
     <OutputType>Exe</OutputType>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
@@ -8,11 +8,13 @@
     <DefineConstants Condition=" '$(ExtraDefineConstants)' != '' ">$(DefineConstants);$(ExtraDefineConstants)</DefineConstants>
     <RootNamespace>Ryujinx.Ava</RootNamespace>
     <ApplicationIcon>Ryujinx.ico</ApplicationIcon>
+    <TieredPGO>true</TieredPGO>
   </PropertyGroup>
 
   <PropertyGroup Condition="'$(RuntimeIdentifier)' != ''">
     <PublishSingleFile>true</PublishSingleFile>
     <PublishTrimmed>true</PublishTrimmed>
+    <TrimMode>partial</TrimMode>
   </PropertyGroup>
 
   <ItemGroup>

+ 6 - 0
Ryujinx.Common/Extensions/BinaryReaderExtensions.cs

@@ -53,5 +53,11 @@ namespace Ryujinx.Common
 
             writer.Write(data);
         }
+
+        public static void Write(this BinaryWriter writer, UInt128 value)
+        {
+            writer.Write((ulong)value);
+            writer.Write((ulong)(value >> 64));
+        }
     }
 }

+ 1 - 1
Ryujinx.Common/Ryujinx.Common.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
 

+ 8 - 8
Ryujinx.Common/Utilities/SpanHelpers.cs

@@ -7,19 +7,19 @@ namespace Ryujinx.Common.Utilities
     public static class SpanHelpers
     {
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
-        public static Span<T> CreateSpan<T>(ref T reference, int length)
+        public static Span<T> CreateSpan<T>(scoped ref T reference, int length)
         {
             return MemoryMarshal.CreateSpan(ref reference, length);
         }
 
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
-        public static Span<T> AsSpan<T>(ref T reference) where T : unmanaged
+        public static Span<T> AsSpan<T>(scoped ref T reference) where T : unmanaged
         {
             return CreateSpan(ref reference, 1);
         }
 
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
-        public static Span<TSpan> AsSpan<TStruct, TSpan>(ref TStruct reference)
+        public static Span<TSpan> AsSpan<TStruct, TSpan>(scoped ref TStruct reference)
             where TStruct : unmanaged where TSpan : unmanaged
         {
             return CreateSpan(ref Unsafe.As<TStruct, TSpan>(ref reference),
@@ -27,25 +27,25 @@ namespace Ryujinx.Common.Utilities
         }
 
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
-        public static Span<byte> AsByteSpan<T>(ref T reference) where T : unmanaged
+        public static Span<byte> AsByteSpan<T>(scoped ref T reference) where T : unmanaged
         {
             return CreateSpan(ref Unsafe.As<T, byte>(ref reference), Unsafe.SizeOf<T>());
         }
 
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
-        public static ReadOnlySpan<T> CreateReadOnlySpan<T>(ref T reference, int length)
+        public static ReadOnlySpan<T> CreateReadOnlySpan<T>(scoped ref T reference, int length)
         {
             return MemoryMarshal.CreateReadOnlySpan(ref reference, length);
         }
 
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
-        public static ReadOnlySpan<T> AsReadOnlySpan<T>(ref T reference) where T : unmanaged
+        public static ReadOnlySpan<T> AsReadOnlySpan<T>(scoped ref T reference) where T : unmanaged
         {
             return CreateReadOnlySpan(ref reference, 1);
         }
 
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
-        public static ReadOnlySpan<TSpan> AsReadOnlySpan<TStruct, TSpan>(ref TStruct reference)
+        public static ReadOnlySpan<TSpan> AsReadOnlySpan<TStruct, TSpan>(scoped ref TStruct reference)
             where TStruct : unmanaged where TSpan : unmanaged
         {
             return CreateReadOnlySpan(ref Unsafe.As<TStruct, TSpan>(ref reference),
@@ -53,7 +53,7 @@ namespace Ryujinx.Common.Utilities
         }
 
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
-        public static ReadOnlySpan<byte> AsReadOnlyByteSpan<T>(ref T reference) where T : unmanaged
+        public static ReadOnlySpan<byte> AsReadOnlyByteSpan<T>(scoped ref T reference) where T : unmanaged
         {
             return CreateReadOnlySpan(ref Unsafe.As<T, byte>(ref reference), Unsafe.SizeOf<T>());
         }

+ 17 - 0
Ryujinx.Common/Utilities/UInt128Utils.cs

@@ -0,0 +1,17 @@
+using System;
+
+namespace Ryujinx.Common.Utilities
+{
+    public static class UInt128Utils
+    {
+        public static UInt128 FromHex(string hex)
+        {
+            return new UInt128((ulong)Convert.ToInt64(hex.Substring(0, 16), 16), (ulong)Convert.ToInt64(hex.Substring(16), 16));
+        }
+
+        public static UInt128 CreateRandom()
+        {
+            return new UInt128((ulong)Random.Shared.NextInt64(), (ulong)Random.Shared.NextInt64());
+        }
+    }
+}

+ 1 - 1
Ryujinx.Cpu/Ryujinx.Cpu.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
 

+ 1 - 1
Ryujinx.Graphics.Device/Ryujinx.Graphics.Device.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
   </PropertyGroup>
 
 </Project>

+ 1 - 1
Ryujinx.Graphics.GAL/Ryujinx.Graphics.GAL.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
   </PropertyGroup>
 
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">

+ 4 - 4
Ryujinx.Graphics.Gpu/Image/TextureBindingsManager.cs

@@ -413,10 +413,10 @@ namespace Ryujinx.Graphics.Gpu.Image
         [MethodImpl(MethodImplOptions.AggressiveInlining)]
         private void UpdateCachedBuffer(
             int stageIndex,
-            ref int cachedTextureBufferIndex,
-            ref int cachedSamplerBufferIndex,
-            ref ReadOnlySpan<int> cachedTextureBuffer,
-            ref ReadOnlySpan<int> cachedSamplerBuffer,
+            scoped ref int cachedTextureBufferIndex,
+            scoped ref int cachedSamplerBufferIndex,
+            scoped ref ReadOnlySpan<int> cachedTextureBuffer,
+            scoped ref ReadOnlySpan<int> cachedSamplerBuffer,
             int textureBufferIndex,
             int samplerBufferIndex)
         {

+ 1 - 1
Ryujinx.Graphics.Gpu/Ryujinx.Graphics.Gpu.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
 

+ 1 - 1
Ryujinx.Graphics.Gpu/Shader/HashTable/PartitionHashTable.cs

@@ -350,7 +350,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.HashTable
         /// <param name="item">The item on the table, if found, otherwise unmodified</param>
         /// <param name="data">The data on the table, if found, otherwise unmodified</param>
         /// <returns>Table lookup result</returns>
-        public SearchResult TryFindItem(ref SmartDataAccessor dataAccessor, int size, ref T item, ref byte[] data)
+        public SearchResult TryFindItem(scoped ref SmartDataAccessor dataAccessor, int size, scoped ref T item, scoped ref byte[] data)
         {
             if (_count == 0)
             {

+ 1 - 1
Ryujinx.Graphics.Gpu/Shader/HashTable/PartitionedHashTable.cs

@@ -91,7 +91,7 @@ namespace Ryujinx.Graphics.Gpu.Shader.HashTable
             /// <param name="item">The item on the table, if found, otherwise unmodified</param>
             /// <param name="data">The data on the table, if found, otherwise unmodified</param>
             /// <returns>Table lookup result</returns>
-            public PartitionHashTable<T>.SearchResult TryFindItem(ref SmartDataAccessor dataAccessor, ref T item, ref byte[] data)
+            public PartitionHashTable<T>.SearchResult TryFindItem(scoped ref SmartDataAccessor dataAccessor, scoped ref T item, scoped ref byte[] data)
             {
                 return _table.TryFindItem(ref dataAccessor, Size, ref item, ref data);
             }

+ 5 - 5
Ryujinx.Graphics.Gpu/Shader/ShaderSpecializationState.cs

@@ -552,11 +552,11 @@ namespace Ryujinx.Graphics.Gpu.Shader
         private static void UpdateCachedBuffer(
             GpuChannel channel,
             bool isCompute,
-            ref int cachedTextureBufferIndex,
-            ref int cachedSamplerBufferIndex,
-            ref ReadOnlySpan<int> cachedTextureBuffer,
-            ref ReadOnlySpan<int> cachedSamplerBuffer,
-            ref int cachedStageIndex,
+            scoped ref int cachedTextureBufferIndex,
+            scoped ref int cachedSamplerBufferIndex,
+            scoped ref ReadOnlySpan<int> cachedTextureBuffer,
+            scoped ref ReadOnlySpan<int> cachedSamplerBuffer,
+            scoped ref int cachedStageIndex,
             int textureBufferIndex,
             int samplerBufferIndex,
             int stageIndex)

+ 1 - 1
Ryujinx.Graphics.Host1x/Ryujinx.Graphics.Host1x.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
   </PropertyGroup>
 
   <ItemGroup>

+ 1 - 1
Ryujinx.Graphics.Nvdec.FFmpeg/Ryujinx.Graphics.Nvdec.FFmpeg.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
 

+ 1 - 1
Ryujinx.Graphics.Nvdec.Vp9/Ryujinx.Graphics.Nvdec.Vp9.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
 

+ 1 - 1
Ryujinx.Graphics.Nvdec/Ryujinx.Graphics.Nvdec.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
 

+ 1 - 1
Ryujinx.Graphics.OpenGL/Ryujinx.Graphics.OpenGL.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
 

+ 1 - 1
Ryujinx.Graphics.Shader/Ryujinx.Graphics.Shader.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
   </PropertyGroup>
 
   <ItemGroup>

+ 1 - 1
Ryujinx.Graphics.Shader/Translation/ShaderConfig.cs

@@ -254,7 +254,7 @@ namespace Ryujinx.Graphics.Shader.Translation
 
             UsedInputAttributes |= mask;
             _thisUsedInputAttributes |= mask;
-            ThisInputAttributesComponents |= UInt128.Pow2(index * 4 + component);
+            ThisInputAttributesComponents |= UInt128.One << (index * 4 + component);
         }
 
         public void SetInputUserAttributePerPatch(int index)

+ 2 - 2
Ryujinx.Graphics.Shader/Translation/Translator.cs

@@ -190,10 +190,10 @@ namespace Ryujinx.Graphics.Shader.Translation
             UInt128 usedAttributes = context.Config.NextInputAttributesComponents;
             while (usedAttributes != UInt128.Zero)
             {
-                int index = usedAttributes.TrailingZeroCount();
+                int index = (int)UInt128.TrailingZeroCount(usedAttributes);
                 int vecIndex = index / 4;
 
-                usedAttributes &= ~UInt128.Pow2(index);
+                usedAttributes &= ~(UInt128.One << index);
 
                 // We don't need to initialize passthrough attributes.
                 if ((context.Config.PassthroughAttributes & (1 << vecIndex)) != 0)

+ 0 - 112
Ryujinx.Graphics.Shader/Translation/UInt128.cs

@@ -1,112 +0,0 @@
-using System;
-using System.Numerics;
-
-namespace Ryujinx.Graphics.Shader.Translation
-{
-    struct UInt128 : IEquatable<UInt128>
-    {
-        public static UInt128 Zero => new UInt128() { _v0 = 0, _v1 = 0 };
-
-        private ulong _v0;
-        private ulong _v1;
-
-        public UInt128(ulong low, ulong high)
-        {
-            _v0 = low;
-            _v1 = high;
-        }
-
-        public int TrailingZeroCount()
-        {
-            int count = BitOperations.TrailingZeroCount(_v0);
-            if (count == 64)
-            {
-                count += BitOperations.TrailingZeroCount(_v1);
-            }
-
-            return count;
-        }
-
-        public static UInt128 Pow2(int x)
-        {
-            if (x >= 64)
-            {
-                return new UInt128(0, 1UL << (x - 64));
-            }
-
-            return new UInt128(1UL << x, 0);
-        }
-
-        public static UInt128 operator ~(UInt128 x)
-        {
-            return new UInt128(~x._v0, ~x._v1);
-        }
-
-        public static UInt128 operator &(UInt128 x, UInt128 y)
-        {
-            return new UInt128(x._v0 & y._v0, x._v1 & y._v1);
-        }
-
-        public static UInt128 operator |(UInt128 x, UInt128 y)
-        {
-            return new UInt128(x._v0 | y._v0, x._v1 | y._v1);
-        }
-
-        public static UInt128 operator <<(UInt128 x, int shift)
-        {
-            if (shift == 0)
-            {
-                return new UInt128(x._v0, x._v1);
-            }
-            else if (shift >= 64)
-            {
-                return new UInt128(0, x._v0 << (shift - 64));
-            }
-
-            ulong shiftOut = x._v0 >> (64 - shift);
-
-            return new UInt128(x._v0 << shift, (x._v1 << shift) | shiftOut);
-        }
-
-        public static UInt128 operator >>(UInt128 x, int shift)
-        {
-            if (shift == 0)
-            {
-                return new UInt128(x._v0, x._v1);
-            }
-            else if (shift >= 64)
-            {
-                return new UInt128(x._v1 >> (shift - 64), 0);
-            }
-
-            ulong shiftOut = x._v1 & ((1UL << shift) - 1);
-
-            return new UInt128((x._v0 >> shift) | (shiftOut << (64 - shift)), x._v1 >> shift);
-        }
-
-        public static bool operator ==(UInt128 x, UInt128 y)
-        {
-            return x.Equals(y);
-        }
-
-        public static bool operator !=(UInt128 x, UInt128 y)
-        {
-            return !x.Equals(y);
-        }
-
-        public override bool Equals(object obj)
-        {
-            return obj is UInt128 other && Equals(other);
-        }
-
-        public bool Equals(UInt128 other)
-        {
-            return _v0 == other._v0 && _v1 == other._v1;
-        }
-
-        public override int GetHashCode()
-        {
-            return HashCode.Combine(_v0, _v1);
-        }
-    }
-}

+ 1 - 1
Ryujinx.Graphics.Texture/Ryujinx.Graphics.Texture.csproj

@@ -1,6 +1,6 @@
 <Project Sdk="Microsoft.NET.Sdk">
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
 

+ 2 - 2
Ryujinx.Graphics.Vic/Image/SurfaceReader.cs

@@ -229,8 +229,8 @@ namespace Ryujinx.Graphics.Vic.Image
 
         private static RentedBuffer ReadBuffer(
             ResourceManager rm,
-            ref SlotConfig config,
-            ref Array8<PlaneOffsets> offsets,
+            scoped ref SlotConfig config,
+            scoped ref Array8<PlaneOffsets> offsets,
             bool linear,
             int plane,
             int width,

+ 1 - 1
Ryujinx.Graphics.Vic/Ryujinx.Graphics.Vic.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
 

+ 1 - 1
Ryujinx.Graphics.Video/Ryujinx.Graphics.Video.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
   </PropertyGroup>
 
   <ItemGroup>

+ 1 - 1
Ryujinx.Graphics.Vulkan/Ryujinx.Graphics.Vulkan.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
   </PropertyGroup>
 
   <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">

+ 4 - 4
Ryujinx.HLE/FileSystem/ContentManager.cs

@@ -9,10 +9,10 @@ using LibHac.Tools.FsSystem;
 using LibHac.Tools.FsSystem.NcaUtils;
 using LibHac.Tools.Ncm;
 using Ryujinx.Common.Logging;
+using Ryujinx.Common.Utilities;
 using Ryujinx.HLE.Exceptions;
 using Ryujinx.HLE.HOS.Services.Ssl;
 using Ryujinx.HLE.HOS.Services.Time;
-using Ryujinx.HLE.Utilities;
 using System;
 using System.Collections.Generic;
 using System.IO;
@@ -293,7 +293,7 @@ namespace Ryujinx.HLE.FileSystem
                 }
 
                 aocStorage = new Nca(_virtualFileSystem.KeySet, ncaFile.Get.AsStorage()).OpenStorage(NcaSectionType.Data, integrityCheckLevel);
-                
+
                 return true;
             }
 
@@ -354,7 +354,7 @@ namespace Ryujinx.HLE.FileSystem
             {
                 if (_contentDictionary.ContainsKey((titleId, contentType)))
                 {
-                    return new UInt128(_contentDictionary[(titleId, contentType)]);
+                    return UInt128Utils.FromHex(_contentDictionary[(titleId, contentType)]);
                 }
             }
 
@@ -407,7 +407,7 @@ namespace Ryujinx.HLE.FileSystem
             {
                 return false;
             }
-            
+
             string installedPath = _virtualFileSystem.SwitchPathToSystemPath(locationEntry.ContentPath);
 
             if (!string.IsNullOrWhiteSpace(installedPath))

+ 2 - 2
Ryujinx.HLE/HOS/Horizon.cs

@@ -10,6 +10,7 @@ using Ryujinx.Audio.Integration;
 using Ryujinx.Audio.Output;
 using Ryujinx.Audio.Renderer.Device;
 using Ryujinx.Audio.Renderer.Server;
+using Ryujinx.Common.Utilities;
 using Ryujinx.Cpu;
 using Ryujinx.Cpu.Jit;
 using Ryujinx.HLE.FileSystem;
@@ -35,7 +36,6 @@ using Ryujinx.HLE.HOS.Services.SurfaceFlinger;
 using Ryujinx.HLE.HOS.Services.Time.Clock;
 using Ryujinx.HLE.HOS.SystemState;
 using Ryujinx.HLE.Loaders.Executables;
-using Ryujinx.HLE.Utilities;
 using System;
 using System.Collections.Generic;
 using System.IO;
@@ -201,7 +201,7 @@ namespace Ryujinx.HLE.HOS
 
             // TODO: use set:sys (and get external clock source id from settings)
             // TODO: use "time!standard_steady_clock_rtc_update_interval_minutes" and implement a worker thread to be accurate.
-            UInt128 clockSourceId = new UInt128(Guid.NewGuid().ToByteArray());
+            UInt128 clockSourceId = UInt128Utils.CreateRandom();
             IRtcManager.GetExternalRtcValue(out ulong rtcValue);
 
             // We assume the rtc is system time.

+ 1 - 2
Ryujinx.HLE/HOS/Services/Account/Acc/Types/UserId.cs

@@ -1,5 +1,4 @@
 using LibHac.Account;
-using Ryujinx.HLE.Utilities;
 using System;
 using System.IO;
 using System.Linq;
@@ -83,7 +82,7 @@ namespace Ryujinx.HLE.HOS.Services.Account.Acc
 
         public readonly UInt128 ToUInt128()
         {
-            return new UInt128(Low, High);
+            return new UInt128((ulong)High, (ulong)Low);
         }
     }
 }

+ 2 - 2
Ryujinx.HLE/HOS/Services/Mii/Helper.cs

@@ -1,4 +1,4 @@
-using Ryujinx.HLE.Utilities;
+using Ryujinx.Common.Utilities;
 using System;
 using System.Buffers.Binary;
 
@@ -36,7 +36,7 @@ namespace Ryujinx.HLE.HOS.Services.Mii
         public static UInt128 GetDeviceId()
         {
             // FIXME: call set:sys GetMiiAuthorId
-            return new UInt128("5279754d69694e780000000000000000"); // RyuMiiNx
+            return UInt128Utils.FromHex("5279754d69694e780000000000000000"); // RyuMiiNx
         }
 
         public static ReadOnlySpan<byte> Ver3FacelineColorTable => new byte[] { 0, 1, 2, 3, 4, 5 };

+ 1 - 1
Ryujinx.HLE/HOS/Services/Mii/Types/CharInfo.cs

@@ -3,7 +3,7 @@ using System.Runtime.InteropServices;
 
 namespace Ryujinx.HLE.HOS.Services.Mii.Types
 {
-    [StructLayout(LayoutKind.Sequential, Size = 0x58)]
+    [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 0x58)]
     struct CharInfo : IStoredData<CharInfo>
     {
         public CreateId CreateId;

+ 6 - 7
Ryujinx.HLE/HOS/Services/Mii/Types/CreateId.cs

@@ -1,20 +1,19 @@
-using Ryujinx.HLE.Utilities;
-using System;
+using System;
 using System.Runtime.InteropServices;
 
 namespace Ryujinx.HLE.HOS.Services.Mii.Types
 {
-    [StructLayout(LayoutKind.Sequential, Size = 0x10)]
+    [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 0x10)]
     struct CreateId : IEquatable<CreateId>
     {
         public UInt128 Raw;
 
-        public bool IsNull => Raw.IsNull;
-        public bool IsValid => !IsNull && (Raw.High & 0xC0) == 0x80;
+        public bool IsNull => Raw == UInt128.Zero;
+        public bool IsValid => !IsNull && ((Raw >> 64) & 0xC0) == 0x80;
 
-        public CreateId(byte[] data)
+        public CreateId(UInt128 raw)
         {
-            Raw = new UInt128(data);
+            Raw = raw;
         }
 
         public static bool operator ==(CreateId x, CreateId y)

+ 2 - 1
Ryujinx.HLE/HOS/Services/Mii/Types/StoreData.cs

@@ -1,11 +1,12 @@
 using LibHac.Common;
 using Ryujinx.HLE.Utilities;
 using System;
+using System.Diagnostics;
 using System.Runtime.InteropServices;
 
 namespace Ryujinx.HLE.HOS.Services.Mii.Types
 {
-    [StructLayout(LayoutKind.Sequential, Pack = 4, Size = Size)]
+    [StructLayout(LayoutKind.Sequential, Pack = 1, Size = Size)]
     struct StoreData : IStoredData<StoreData>
     {
         public const int Size = 0x44;

+ 9 - 2
Ryujinx.HLE/HOS/Services/Mii/UtilityImpl.cs

@@ -1,4 +1,5 @@
-using Ryujinx.Cpu;
+using Ryujinx.Common.Utilities;
+using Ryujinx.Cpu;
 using Ryujinx.HLE.HOS.Services.Mii.Types;
 using Ryujinx.HLE.HOS.Services.Time;
 using Ryujinx.HLE.HOS.Services.Time.Clock;
@@ -62,7 +63,13 @@ namespace Ryujinx.HLE.HOS.Services.Mii
 
         public CreateId MakeCreateId()
         {
-            return new CreateId(Guid.NewGuid().ToByteArray());
+            UInt128 value = UInt128Utils.CreateRandom();
+
+            // Ensure the random ID generated is valid as a create id.
+            value &= ~new UInt128(0xC0, 0);
+            value |= new UInt128(0x80, 0);
+
+            return new CreateId(value);
         }
     }
 }

+ 2 - 2
Ryujinx.HLE/HOS/Services/Nifm/StaticService/IGeneralService.cs

@@ -1,8 +1,8 @@
 using Ryujinx.Common;
 using Ryujinx.Common.Logging;
+using Ryujinx.Common.Utilities;
 using Ryujinx.HLE.HOS.Services.Nifm.StaticService.GeneralService;
 using Ryujinx.HLE.HOS.Services.Nifm.StaticService.Types;
-using Ryujinx.HLE.Utilities;
 using System;
 using System.Net.NetworkInformation;
 using System.Runtime.CompilerServices;
@@ -78,7 +78,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService
 
             NetworkProfileData networkProfile = new NetworkProfileData
             {
-                Uuid = new UInt128(Guid.NewGuid().ToByteArray())
+                Uuid = UInt128Utils.CreateRandom()
             };
 
             networkProfile.IpSettingData.IpAddressSetting = new IpAddressSetting(interfaceProperties, unicastAddress);

+ 1 - 8
Ryujinx.HLE/HOS/Services/Nifm/StaticService/Types/DnsSetting.cs

@@ -14,14 +14,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService.Types
 
         public DnsSetting(IPInterfaceProperties interfaceProperties)
         {
-            try
-            {
-                IsDynamicDnsEnabled = interfaceProperties.IsDynamicDnsEnabled;
-            }
-            catch (PlatformNotSupportedException)
-            {
-                IsDynamicDnsEnabled = false;
-            }
+            IsDynamicDnsEnabled = OperatingSystem.IsWindows() && interfaceProperties.IsDynamicDnsEnabled;
 
             if (interfaceProperties.DnsAddresses.Count == 0)
             {

+ 3 - 2
Ryujinx.HLE/HOS/Services/Nifm/StaticService/Types/IpAddressSetting.cs

@@ -1,4 +1,5 @@
-using System.Net.NetworkInformation;
+using System;
+using System.Net.NetworkInformation;
 using System.Runtime.InteropServices;
 
 namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService.Types
@@ -14,7 +15,7 @@ namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService.Types
 
         public IpAddressSetting(IPInterfaceProperties interfaceProperties, UnicastIPAddressInformation unicastIPAddressInformation)
         {
-            IsDhcpEnabled  = interfaceProperties.DhcpServerAddresses.Count != 0;
+            IsDhcpEnabled  = !OperatingSystem.IsMacOS() && interfaceProperties.DhcpServerAddresses.Count != 0;
             Address        = new IpV4Address(unicastIPAddressInformation.Address);
             IPv4Mask       = new IpV4Address(unicastIPAddressInformation.IPv4Mask);
             GatewayAddress = new IpV4Address(interfaceProperties.GatewayAddresses[0].Address);

+ 1 - 1
Ryujinx.HLE/HOS/Services/Nifm/StaticService/Types/NetworkProfileData.cs

@@ -1,5 +1,5 @@
 using Ryujinx.Common.Memory;
-using Ryujinx.HLE.Utilities;
+using System;
 using System.Runtime.InteropServices;
 
 namespace Ryujinx.HLE.HOS.Services.Nifm.StaticService.Types

+ 2 - 4
Ryujinx.HLE/HOS/Services/Settings/ISystemSettingsServer.cs

@@ -5,9 +5,9 @@ using LibHac.Fs.Fsa;
 using LibHac.FsSystem;
 using LibHac.Ncm;
 using LibHac.Tools.FsSystem.NcaUtils;
+using Ryujinx.Common;
 using Ryujinx.Common.Logging;
 using Ryujinx.HLE.HOS.SystemState;
-using Ryujinx.HLE.Utilities;
 using System;
 using System.IO;
 using System.Text;
@@ -290,9 +290,7 @@ namespace Ryujinx.HLE.HOS.Services.Settings
             // NOTE: If miiAuthorId is null ResultCode.NullMiiAuthorIdBuffer is returned.
             //       Doesn't occur in our case.
 
-            UInt128 miiAuthorId = Mii.Helper.GetDeviceId();
-
-            miiAuthorId.Write(context.ResponseData);
+            context.ResponseData.Write(Mii.Helper.GetDeviceId());
 
             return ResultCode.Success;
         }

+ 3 - 0
Ryujinx.HLE/HOS/Services/Ssl/SslService/SslManagedSocketConnection.cs

@@ -66,6 +66,8 @@ namespace Ryujinx.HLE.HOS.Services.Ssl.SslService
             EndSslOperation();
         }
 
+// NOTE: We silence warnings about TLS 1.0 and 1.1 as games will likely use it.
+#pragma warning disable SYSLIB0039
         private static SslProtocols TranslateSslVersion(SslVersion version)
         {
             switch (version & SslVersion.VersionMask)
@@ -84,6 +86,7 @@ namespace Ryujinx.HLE.HOS.Services.Ssl.SslService
                     throw new NotImplementedException(version.ToString());
             }
         }
+#pragma warning restore SYSLIB0039
 
         public ResultCode Handshake(string hostName)
         {

+ 3 - 3
Ryujinx.HLE/HOS/Services/Time/Clock/SteadyClockCore.cs

@@ -1,5 +1,5 @@
-using Ryujinx.Cpu;
-using Ryujinx.HLE.Utilities;
+using Ryujinx.Common.Utilities;
+using Ryujinx.Cpu;
 using System;
 
 namespace Ryujinx.HLE.HOS.Services.Time.Clock
@@ -12,7 +12,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.Clock
 
         public SteadyClockCore()
         {
-            _clockSourceId      = new UInt128(Guid.NewGuid().ToByteArray());
+            _clockSourceId      = UInt128Utils.CreateRandom();
             _isRtcResetDetected = false;
             _isInitialized      = false;
         }

+ 3 - 3
Ryujinx.HLE/HOS/Services/Time/Clock/Types/SteadyClockTimePoint.cs

@@ -1,10 +1,10 @@
-using Ryujinx.HLE.Utilities;
+using Ryujinx.Common.Utilities;
 using System;
 using System.Runtime.InteropServices;
 
 namespace Ryujinx.HLE.HOS.Services.Time.Clock
 {
-    [StructLayout(LayoutKind.Sequential)]
+    [StructLayout(LayoutKind.Sequential, Pack = 1)]
     struct SteadyClockTimePoint
     {
         public long    TimePoint;
@@ -36,7 +36,7 @@ namespace Ryujinx.HLE.HOS.Services.Time.Clock
             return new SteadyClockTimePoint
             {
                 TimePoint     = 0,
-                ClockSourceId = new UInt128(Guid.NewGuid().ToByteArray())
+                ClockSourceId = UInt128Utils.CreateRandom()
             };
         }
     }

+ 1 - 1
Ryujinx.HLE/HOS/Services/Time/Clock/Types/SystemClockContext.cs

@@ -2,7 +2,7 @@
 
 namespace Ryujinx.HLE.HOS.Services.Time.Clock
 {
-    [StructLayout(LayoutKind.Sequential)]
+    [StructLayout(LayoutKind.Sequential, Pack = 1)]
     struct SystemClockContext
     {
         public long                 Offset;

+ 1 - 1
Ryujinx.HLE/HOS/Services/Time/TimeManager.cs

@@ -3,7 +3,7 @@ using Ryujinx.HLE.Exceptions;
 using Ryujinx.HLE.HOS.Kernel.Memory;
 using Ryujinx.HLE.HOS.Services.Time.Clock;
 using Ryujinx.HLE.HOS.Services.Time.TimeZone;
-using Ryujinx.HLE.Utilities;
+using System;
 using System.IO;
 
 namespace Ryujinx.HLE.HOS.Services.Time

+ 1 - 1
Ryujinx.HLE/HOS/Services/Time/TimeZone/TimeZoneManager.cs

@@ -1,6 +1,6 @@
 using Ryujinx.Common.Memory;
 using Ryujinx.HLE.HOS.Services.Time.Clock;
-using Ryujinx.HLE.Utilities;
+using System;
 using System.IO;
 
 namespace Ryujinx.HLE.HOS.Services.Time.TimeZone

+ 2 - 2
Ryujinx.HLE/HOS/Services/Time/Types/SteadyClockContext.cs

@@ -1,9 +1,9 @@
-using Ryujinx.HLE.Utilities;
+using System;
 using System.Runtime.InteropServices;
 
 namespace Ryujinx.HLE.HOS.Services.Time.Types
 {
-    [StructLayout(LayoutKind.Sequential)]
+    [StructLayout(LayoutKind.Sequential, Pack = 1)]
     struct SteadyClockContext
     {
         public ulong   InternalOffset;

+ 1 - 1
Ryujinx.HLE/Ryujinx.HLE.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
   </PropertyGroup>
 
   <ItemGroup>

+ 0 - 75
Ryujinx.HLE/Utilities/UInt128.cs

@@ -1,75 +0,0 @@
-using System;
-using System.IO;
-using System.Linq;
-using System.Runtime.InteropServices;
-
-namespace Ryujinx.HLE.Utilities
-{
-    [StructLayout(LayoutKind.Sequential)]
-    public struct UInt128 : IEquatable<UInt128>
-    {
-        public readonly long Low;
-        public readonly long High;
-
-        public bool IsNull => (Low | High) == 0;
-
-        public UInt128(long low, long high)
-        {
-            Low  = low;
-            High = high;
-        }
-
-        public UInt128(byte[] bytes)
-        {
-            Low  = BitConverter.ToInt64(bytes, 0);
-            High = BitConverter.ToInt64(bytes, 8);
-        }
-
-        public UInt128(string hex)
-        {
-            if (hex == null || hex.Length != 32 || !hex.All("0123456789abcdefABCDEF".Contains))
-            {
-                throw new ArgumentException("Invalid Hex value!", nameof(hex));
-            }
-
-            Low  = Convert.ToInt64(hex.Substring(16), 16);
-            High = Convert.ToInt64(hex.Substring(0, 16), 16);
-        }
-
-        public void Write(BinaryWriter binaryWriter)
-        {
-            binaryWriter.Write(Low);
-            binaryWriter.Write(High);
-        }
-
-        public override string ToString()
-        {
-            return High.ToString("x16") + Low.ToString("x16");
-        }
-
-        public static bool operator ==(UInt128 x, UInt128 y)
-        {
-            return x.Equals(y);
-        }
-
-        public static bool operator !=(UInt128 x, UInt128 y)
-        {
-            return !x.Equals(y);
-        }
-
-        public override bool Equals(object obj)
-        {
-            return obj is UInt128 uint128 && Equals(uint128);
-        }
-
-        public bool Equals(UInt128 cmpObj)
-        {
-            return Low == cmpObj.Low && High == cmpObj.High;
-        }
-
-        public override int GetHashCode()
-        {
-            return HashCode.Combine(Low, High);
-        }
-    }
-}

+ 3 - 1
Ryujinx.Headless.SDL2/Ryujinx.Headless.SDL2.csproj

@@ -1,12 +1,13 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
     <RuntimeIdentifiers>win10-x64;osx-x64;linux-x64</RuntimeIdentifiers>
     <OutputType>Exe</OutputType>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <Version>1.0.0-dirty</Version>
     <DefineConstants Condition=" '$(ExtraDefineConstants)' != '' ">$(DefineConstants);$(ExtraDefineConstants)</DefineConstants>
+    <TieredPGO>true</TieredPGO>
   </PropertyGroup>
 
   <ItemGroup>
@@ -46,5 +47,6 @@
   <PropertyGroup Condition="'$(RuntimeIdentifier)' != ''">
     <PublishSingleFile>true</PublishSingleFile>
     <PublishTrimmed>true</PublishTrimmed>
+    <TrimMode>partial</TrimMode>
   </PropertyGroup>
 </Project>

+ 1 - 1
Ryujinx.Input.SDL2/Ryujinx.Input.SDL2.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
 

+ 2 - 2
Ryujinx.Input/Ryujinx.Input.csproj

@@ -1,14 +1,14 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
 
   <ItemGroup>
     <PackageReference Include="Crc32.NET" Version="1.2.0" />
   </ItemGroup>
-  
+
   <ItemGroup>
     <ProjectReference Include="..\Ryujinx.HLE\Ryujinx.HLE.csproj" />
     <ProjectReference Include="..\Ryujinx.Common\Ryujinx.Common.csproj" />

+ 1 - 1
Ryujinx.Memory.Tests/Ryujinx.Memory.Tests.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
     <IsPackable>false</IsPackable>
   </PropertyGroup>
 

+ 1 - 1
Ryujinx.Memory/Ryujinx.Memory.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
   </PropertyGroup>
 

+ 1 - 1
Ryujinx.SDL2.Common/Ryujinx.SDL2.Common.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
   </PropertyGroup>
 
   <ItemGroup>

+ 1 - 1
Ryujinx.ShaderTools/Ryujinx.ShaderTools.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
     <OutputType>Exe</OutputType>
     <Configurations>Debug;Release</Configurations>
   </PropertyGroup>

+ 1 - 1
Ryujinx.Tests.Unicorn/Ryujinx.Tests.Unicorn.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
     <Configurations>Debug;Release</Configurations>
   </PropertyGroup>

+ 1 - 1
Ryujinx.Tests/Ryujinx.Tests.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
     <OutputType>Exe</OutputType>
     <IsPackable>false</IsPackable>
 

+ 1 - 1
Ryujinx.Ui.Common/Ryujinx.Ui.Common.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
   </PropertyGroup>
 
   <ItemGroup>

+ 3 - 1
Ryujinx/Ryujinx.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
     <RuntimeIdentifiers>win10-x64;osx-x64;linux-x64</RuntimeIdentifiers>
     <OutputType>Exe</OutputType>
     <AllowUnsafeBlocks>true</AllowUnsafeBlocks>
@@ -9,11 +9,13 @@
     <DefineConstants Condition=" '$(ExtraDefineConstants)' != '' ">$(DefineConstants);$(ExtraDefineConstants)</DefineConstants>
     <!-- As we already provide GTK3 on Windows via GtkSharp.Dependencies this is redundant. -->
     <SkipGtkInstall>true</SkipGtkInstall>
+    <TieredPGO>true</TieredPGO>
   </PropertyGroup>
 
   <PropertyGroup Condition="'$(RuntimeIdentifier)' != ''">
     <PublishSingleFile>true</PublishSingleFile>
     <PublishTrimmed>true</PublishTrimmed>
+    <TrimMode>partial</TrimMode>
   </PropertyGroup>
 
   <ItemGroup>

+ 1 - 1
Spv.Generator/Spv.Generator.csproj

@@ -1,7 +1,7 @@
 <Project Sdk="Microsoft.NET.Sdk">
 
   <PropertyGroup>
-    <TargetFramework>net6.0</TargetFramework>
+    <TargetFramework>net7.0</TargetFramework>
   </PropertyGroup>
 
 </Project>

+ 1 - 1
global.json

@@ -1,6 +1,6 @@
 {
   "sdk": {
-    "version": "6.0.100",
+    "version": "7.0.100",
     "rollForward": "latestFeature"
   }
 }