From f96d0150b5da2ef88ff6a0e72c9ed174aa1b70a0 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Tue, 12 Nov 2024 17:21:29 -0800 Subject: [PATCH 1/4] Update to .NET 9 SDK --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index 1880a952..00b67cae 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "8.0.403", + "version": "9.0.100", "rollForward": "latestFeature", "allowPrerelease": false } From 7461a8eea7fe1a4ff9e18efa7ae3a4b62068f3ff Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Sun, 29 Sep 2024 19:56:50 -0700 Subject: [PATCH 2/4] Fix new .NET SDK warnings --- src/ComputeSharp.D2D1/Shaders/Translation/D3DCompiler.cs | 2 +- src/ComputeSharp.SourceGeneration/Helpers/HashCode.cs | 6 +++--- .../ComputeSharp.D2D1.Tests.SourceGenerators.csproj | 8 ++++++++ .../ComputeSharp.D2D1.WinUI.Tests.SourceGenerators.csproj | 3 +++ .../ComputeSharp.Tests.SourceGenerators.csproj | 3 +++ 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/src/ComputeSharp.D2D1/Shaders/Translation/D3DCompiler.cs b/src/ComputeSharp.D2D1/Shaders/Translation/D3DCompiler.cs index 7550b9a4..5a615899 100644 --- a/src/ComputeSharp.D2D1/Shaders/Translation/D3DCompiler.cs +++ b/src/ComputeSharp.D2D1/Shaders/Translation/D3DCompiler.cs @@ -261,7 +261,7 @@ internal static unsafe partial class D3DCompiler // We cannot use Regex (this method was originally using Regex.Replace(message, @"^[A-Z]:\\[^:]+: (\w+ \w+:)", ...)), because that // causes significant binary size increase, as it's the only thing rooting all the Regex stack across the whole library. So this // code reimplements equivalent logic in a simple way. Because this is a throw helper, allocating a little bit of garbage is fine. - string[] lines = message.Split(new[] { '\n', '\r' }, StringSplitOptions.RemoveEmptyEntries); + string[] lines = message.Split(['\n', '\r'], StringSplitOptions.RemoveEmptyEntries); // Go over each (non empty) line and look for the leading file path to trim away foreach (ref string line in lines.AsSpan()) diff --git a/src/ComputeSharp.SourceGeneration/Helpers/HashCode.cs b/src/ComputeSharp.SourceGeneration/Helpers/HashCode.cs index 7a8ae58b..d11d6d4c 100644 --- a/src/ComputeSharp.SourceGeneration/Helpers/HashCode.cs +++ b/src/ComputeSharp.SourceGeneration/Helpers/HashCode.cs @@ -4,7 +4,7 @@ using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Security.Cryptography; -#pragma warning disable CS0809, IDE0009, IDE1006, IDE0048 +#pragma warning disable CS0809, IDE0009, IDE1006, IDE0048, CA1065 namespace System; @@ -274,7 +274,7 @@ internal struct HashCode /// The type of the fifth value to combine into the hash code. /// The type of the sixth value to combine into the hash code. /// The type of the seventh value to combine into the hash code. - /// The type of the eigth value to combine into the hash code. + /// The type of the eighth value to combine into the hash code. /// The first value to combine into the hash code. /// The second value to combine into the hash code. /// The third value to combine into the hash code. @@ -282,7 +282,7 @@ internal struct HashCode /// The fifth value to combine into the hash code. /// The sixth value to combine into the hash code. /// The seventh value to combine into the hash code. - /// The eigth value to combine into the hash code. + /// The eighth value to combine into the hash code. /// The hash code that represents the values. public static int Combine(T1 value1, T2 value2, T3 value3, T4 value4, T5 value5, T6 value6, T7 value7, T8 value8) { diff --git a/tests/ComputeSharp.D2D1.Tests.SourceGenerators/ComputeSharp.D2D1.Tests.SourceGenerators.csproj b/tests/ComputeSharp.D2D1.Tests.SourceGenerators/ComputeSharp.D2D1.Tests.SourceGenerators.csproj index 39e8f601..3083a084 100644 --- a/tests/ComputeSharp.D2D1.Tests.SourceGenerators/ComputeSharp.D2D1.Tests.SourceGenerators.csproj +++ b/tests/ComputeSharp.D2D1.Tests.SourceGenerators/ComputeSharp.D2D1.Tests.SourceGenerators.csproj @@ -2,6 +2,14 @@ net8.0 $(DefineConstants);D2D1_TESTS + + + $(NoWarn);NU1903 diff --git a/tests/ComputeSharp.D2D1.WinUI.Tests.SourceGenerators/ComputeSharp.D2D1.WinUI.Tests.SourceGenerators.csproj b/tests/ComputeSharp.D2D1.WinUI.Tests.SourceGenerators/ComputeSharp.D2D1.WinUI.Tests.SourceGenerators.csproj index bb2b4c08..cc8100bd 100644 --- a/tests/ComputeSharp.D2D1.WinUI.Tests.SourceGenerators/ComputeSharp.D2D1.WinUI.Tests.SourceGenerators.csproj +++ b/tests/ComputeSharp.D2D1.WinUI.Tests.SourceGenerators/ComputeSharp.D2D1.WinUI.Tests.SourceGenerators.csproj @@ -6,6 +6,9 @@ x64;ARM64 win-x64;win-arm64 $(DefineConstants);D2D1_WINUI_TESTS + + + $(NoWarn);NU1902;NU1903 diff --git a/tests/ComputeSharp.Tests.SourceGenerators/ComputeSharp.Tests.SourceGenerators.csproj b/tests/ComputeSharp.Tests.SourceGenerators/ComputeSharp.Tests.SourceGenerators.csproj index 69beecfe..889625e7 100644 --- a/tests/ComputeSharp.Tests.SourceGenerators/ComputeSharp.Tests.SourceGenerators.csproj +++ b/tests/ComputeSharp.Tests.SourceGenerators/ComputeSharp.Tests.SourceGenerators.csproj @@ -1,6 +1,9 @@ net8.0 + + + $(NoWarn);NU1903 From 0e15f9193a9a5bbd9818aecc9edc30ea98d353e5 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Tue, 12 Nov 2024 17:53:40 -0800 Subject: [PATCH 3/4] Update UWP projects for .NET 9 SDK --- src/ComputeSharp.D2D1.Uwp/ComputeSharp.D2D1.Uwp.csproj | 5 ++++- src/ComputeSharp.Uwp/ComputeSharp.Uwp.csproj | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/ComputeSharp.D2D1.Uwp/ComputeSharp.D2D1.Uwp.csproj b/src/ComputeSharp.D2D1.Uwp/ComputeSharp.D2D1.Uwp.csproj index d3167e85..c7953036 100644 --- a/src/ComputeSharp.D2D1.Uwp/ComputeSharp.D2D1.Uwp.csproj +++ b/src/ComputeSharp.D2D1.Uwp/ComputeSharp.D2D1.Uwp.csproj @@ -3,9 +3,12 @@ net8.0-windows10.0.22621.0 10.0.17763.0 10.0.22621.54 + true x64;ARM64 win-x64;win-arm64 + en-US $(DefineConstants);WINDOWS_UWP + false @@ -19,7 +22,7 @@ - + diff --git a/src/ComputeSharp.Uwp/ComputeSharp.Uwp.csproj b/src/ComputeSharp.Uwp/ComputeSharp.Uwp.csproj index cd647349..208fb519 100644 --- a/src/ComputeSharp.Uwp/ComputeSharp.Uwp.csproj +++ b/src/ComputeSharp.Uwp/ComputeSharp.Uwp.csproj @@ -3,9 +3,12 @@ net8.0-windows10.0.22621.0 10.0.18362.0 10.0.22621.54 + true x64;ARM64 win-x64;win-arm64 + en-US $(DefineConstants);WINDOWS_UWP + false From f6ef5847ca6fe6d834b589628aaaef96faaec1d2 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Tue, 12 Nov 2024 18:19:52 -0800 Subject: [PATCH 4/4] Update NuGet packages and Windows SDK projections --- .../ComputeSharp.NativeLibrary.WinRT.csproj | 4 ++-- .../ComputeSharp.Sample.FSharp.fsproj | 2 +- .../ComputeSharp.SwapChain.Cli.csproj | 2 +- .../ComputeSharp.SwapChain.D2D1.Cli.csproj | 6 +++--- .../ComputeSharp.SwapChain.D2D1.Uwp.csproj | 4 ++-- .../ComputeSharp.SwapChain.WinUI.csproj | 4 ++-- .../ComputeSharp.SwapChain/ComputeSharp.SwapChain.csproj | 2 +- .../ComputeSharp.D2D1.WinUI.csproj | 2 +- src/ComputeSharp.WinUI/ComputeSharp.WinUI.csproj | 4 ++-- ...ComputeSharp.D2D1.Tests.AssemblyLevelAttributes.csproj | 4 ++-- .../ComputeSharp.D2D1.Tests.SourceGenerators.csproj | 4 ++-- .../ComputeSharp.D2D1.Tests.csproj | 6 +++--- .../ComputeSharp.D2D1.WinUI.Tests.SourceGenerators.csproj | 6 +++--- .../ComputeSharp.D2D1.WinUI.Tests.csproj | 8 ++++---- .../ComputeSharp.Tests.DeviceLost.csproj | 6 +++--- .../ComputeSharp.Tests.DisableDynamicCompilation.csproj | 4 ++-- .../ComputeSharp.Tests.Internals.csproj | 4 ++-- .../ComputeSharp.Tests.NativeLibrariesResolver.csproj | 4 ++-- .../ComputeSharp.Tests.SourceGenerators.csproj | 4 ++-- tests/ComputeSharp.Tests/ComputeSharp.Tests.csproj | 6 +++--- 20 files changed, 43 insertions(+), 43 deletions(-) diff --git a/samples/ComputeSharp.NativeLibrary.WinRT/ComputeSharp.NativeLibrary.WinRT.csproj b/samples/ComputeSharp.NativeLibrary.WinRT/ComputeSharp.NativeLibrary.WinRT.csproj index effc11c4..45df7ddc 100644 --- a/samples/ComputeSharp.NativeLibrary.WinRT/ComputeSharp.NativeLibrary.WinRT.csproj +++ b/samples/ComputeSharp.NativeLibrary.WinRT/ComputeSharp.NativeLibrary.WinRT.csproj @@ -1,7 +1,7 @@ net8.0-windows10.0.22621.0 - 10.0.22621.53 + 10.0.22621.57 x64;ARM64 win-x64;win-arm64 @@ -43,7 +43,7 @@ - + diff --git a/samples/ComputeSharp.Sample.FSharp/ComputeSharp.Sample.FSharp.fsproj b/samples/ComputeSharp.Sample.FSharp/ComputeSharp.Sample.FSharp.fsproj index 6d8db678..4f00f9da 100644 --- a/samples/ComputeSharp.Sample.FSharp/ComputeSharp.Sample.FSharp.fsproj +++ b/samples/ComputeSharp.Sample.FSharp/ComputeSharp.Sample.FSharp.fsproj @@ -8,7 +8,7 @@ - + diff --git a/samples/ComputeSharp.SwapChain.Cli/ComputeSharp.SwapChain.Cli.csproj b/samples/ComputeSharp.SwapChain.Cli/ComputeSharp.SwapChain.Cli.csproj index 0c0ea75e..48c19d52 100644 --- a/samples/ComputeSharp.SwapChain.Cli/ComputeSharp.SwapChain.Cli.csproj +++ b/samples/ComputeSharp.SwapChain.Cli/ComputeSharp.SwapChain.Cli.csproj @@ -58,7 +58,7 @@ - + diff --git a/samples/ComputeSharp.SwapChain.D2D1.Cli/ComputeSharp.SwapChain.D2D1.Cli.csproj b/samples/ComputeSharp.SwapChain.D2D1.Cli/ComputeSharp.SwapChain.D2D1.Cli.csproj index 8c93bbca..c15f2333 100644 --- a/samples/ComputeSharp.SwapChain.D2D1.Cli/ComputeSharp.SwapChain.D2D1.Cli.csproj +++ b/samples/ComputeSharp.SwapChain.D2D1.Cli/ComputeSharp.SwapChain.D2D1.Cli.csproj @@ -3,7 +3,7 @@ Exe WinExe net8.0-windows10.0.22621 - 10.0.22621.53 + 10.0.22621.57 app.manifest x64;ARM64 win-x64;win-arm64 @@ -60,13 +60,13 @@ - + - + diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/ComputeSharp.SwapChain.D2D1.Uwp.csproj b/samples/ComputeSharp.SwapChain.D2D1.Uwp/ComputeSharp.SwapChain.D2D1.Uwp.csproj index 33c04dca..a1109e4d 100644 --- a/samples/ComputeSharp.SwapChain.D2D1.Uwp/ComputeSharp.SwapChain.D2D1.Uwp.csproj +++ b/samples/ComputeSharp.SwapChain.D2D1.Uwp/ComputeSharp.SwapChain.D2D1.Uwp.csproj @@ -3,7 +3,7 @@ WinExe net8.0-windows10.0.22621.0 10.0.17763.0 - 10.0.22621.54 + 10.0.22621.57 true x64;arm64 win-x64;win-arm64 @@ -36,7 +36,7 @@ - + diff --git a/samples/ComputeSharp.SwapChain.WinUI/ComputeSharp.SwapChain.WinUI.csproj b/samples/ComputeSharp.SwapChain.WinUI/ComputeSharp.SwapChain.WinUI.csproj index 15e34a9b..aad835e7 100644 --- a/samples/ComputeSharp.SwapChain.WinUI/ComputeSharp.SwapChain.WinUI.csproj +++ b/samples/ComputeSharp.SwapChain.WinUI/ComputeSharp.SwapChain.WinUI.csproj @@ -3,7 +3,7 @@ WinExe net8.0-windows10.0.22621.0 10.0.17763.0 - 10.0.22621.53 + 10.0.22621.57 app.manifest x64;arm64 win-x64;win-arm64 @@ -66,7 +66,7 @@ - +