From b729cee02a8edfba8d5812e74423fba6bdbfd2c9 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Wed, 22 Nov 2023 12:03:52 +0100 Subject: [PATCH 1/5] Update Win2D to 1.1.1, remove RID graph workarounds --- .../ComputeSharp.SwapChain.D2D1.Cli.csproj | 3 --- .../ComputeSharp.SwapChain.WinUI.csproj | 12 ------------ .../ComputeSharp.D2D1.WinUI.csproj | 2 +- src/ComputeSharp.WinUI/ComputeSharp.WinUI.csproj | 2 +- .../ComputeSharp.D2D1.WinUI.Tests.csproj | 6 ------ 5 files changed, 2 insertions(+), 23 deletions(-) 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 ae847368..04195799 100644 --- a/samples/ComputeSharp.SwapChain.D2D1.Cli/ComputeSharp.SwapChain.D2D1.Cli.csproj +++ b/samples/ComputeSharp.SwapChain.D2D1.Cli/ComputeSharp.SwapChain.D2D1.Cli.csproj @@ -9,9 +9,6 @@ $(NoWarn);IDE0065 computesharp.d2d1.cli ..\..\assets\icon.ico - - - true diff --git a/samples/ComputeSharp.SwapChain.WinUI/ComputeSharp.SwapChain.WinUI.csproj b/samples/ComputeSharp.SwapChain.WinUI/ComputeSharp.SwapChain.WinUI.csproj index 274b6bdc..a3760bc9 100644 --- a/samples/ComputeSharp.SwapChain.WinUI/ComputeSharp.SwapChain.WinUI.csproj +++ b/samples/ComputeSharp.SwapChain.WinUI/ComputeSharp.SwapChain.WinUI.csproj @@ -9,9 +9,6 @@ win-$(Platform).pubxml true true - - - true @@ -32,15 +29,6 @@ - - - - diff --git a/src/ComputeSharp.D2D1.WinUI/ComputeSharp.D2D1.WinUI.csproj b/src/ComputeSharp.D2D1.WinUI/ComputeSharp.D2D1.WinUI.csproj index 5767bf8f..a3bb46c1 100644 --- a/src/ComputeSharp.D2D1.WinUI/ComputeSharp.D2D1.WinUI.csproj +++ b/src/ComputeSharp.D2D1.WinUI/ComputeSharp.D2D1.WinUI.csproj @@ -25,7 +25,7 @@ - + diff --git a/src/ComputeSharp.WinUI/ComputeSharp.WinUI.csproj b/src/ComputeSharp.WinUI/ComputeSharp.WinUI.csproj index c8f2a068..1e467774 100644 --- a/src/ComputeSharp.WinUI/ComputeSharp.WinUI.csproj +++ b/src/ComputeSharp.WinUI/ComputeSharp.WinUI.csproj @@ -7,7 +7,7 @@ - + diff --git a/tests/ComputeSharp.D2D1.WinUI.Tests/ComputeSharp.D2D1.WinUI.Tests.csproj b/tests/ComputeSharp.D2D1.WinUI.Tests/ComputeSharp.D2D1.WinUI.Tests.csproj index ed5fa712..ae3d7cdf 100644 --- a/tests/ComputeSharp.D2D1.WinUI.Tests/ComputeSharp.D2D1.WinUI.Tests.csproj +++ b/tests/ComputeSharp.D2D1.WinUI.Tests/ComputeSharp.D2D1.WinUI.Tests.csproj @@ -9,9 +9,6 @@ win-$(Platform).pubxml true true - - - true @@ -59,9 +56,6 @@ - - - From a8c7e029c9a67599449e322f9b05888202f89291 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Wed, 22 Nov 2023 12:04:55 +0100 Subject: [PATCH 2/5] Restore Win2D R2R test in Ci script --- .github/workflows/dotnet.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index b75d51e9..0833267a 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -271,9 +271,7 @@ jobs: /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}} # Just like for the DX12 sample, run it on x64 to validate it works correctly. - # Temporarily disabled due to https://github.com/microsoft/Win2D/issues/935. - - if: false # matrix.platform == 'x64' - name: Run ComputeSharp.SwapChain.D2D1.Cli + - name: Run ComputeSharp.SwapChain.D2D1.Cli run: > $process = (Start-Process samples\ComputeSharp.SwapChain.D2D1.Cli\bin\x64\Release\net8.0-windows10.0.22621\win-x64\publish\computesharp.d2d1.cli.exe -PassThru); sleep -Seconds 2; From e5c4c9902840e5ae23fbf6693f779066df4493ab Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Wed, 22 Nov 2023 12:10:33 +0100 Subject: [PATCH 3/5] Verify Win2D NAOT sample too in Ci script --- .github/workflows/dotnet.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 0833267a..03b0deb9 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -261,16 +261,17 @@ jobs: path: samples\ComputeSharp.SwapChain.Cli\bin\Release\net8.0\win-x64\publish\computesharp.cli.exe if-no-files-found: error - # Also publish the Win2D sample (without NativeAOT, see https://github.com/dotnet/runtime/issues/84908) + # Also publish the Win2D sample (with R2R) - if: matrix.platform == 'x64' name: Publish ComputeSharp.SwapChain.D2D1.Cli run: > $env:COMPUTESHARP_SWAPCHAIN_D2D1_PUBLISH_R2R='true'; $env:COMPUTESHARP_SWAPCHAIN_D2D1_PUBLISH_AOT='false'; + git clean -fdx; msbuild samples\ComputeSharp.SwapChain.D2D1.Cli\ComputeSharp.SwapChain.D2D1.Cli.csproj /restore -t:publish /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}} - # Just like for the DX12 sample, run it on x64 to validate it works correctly. + # Just like for the DX12 sample, run it on x64 to validate it works correctly - name: Run ComputeSharp.SwapChain.D2D1.Cli run: > $process = (Start-Process samples\ComputeSharp.SwapChain.D2D1.Cli\bin\x64\Release\net8.0-windows10.0.22621\win-x64\publish\computesharp.d2d1.cli.exe -PassThru); @@ -280,7 +281,7 @@ jobs: if ($process.ExitCode -lt 0 -and $process.ExitCode -ne -1073741510) { throw $process.ExitCode; } return $process.ExitCode; - # Publish the Win2D sample with NativeAOT (just verifying the build, can't run this yet, see above) + # Publish the Win2D sample again (with NativeAOT) - if: matrix.platform == 'x64' name: Publish ComputeSharp.SwapChain.D2D1.Cli with NativeAOT run: > @@ -289,6 +290,16 @@ jobs: git clean -fdx; msbuild samples\ComputeSharp.SwapChain.D2D1.Cli\ComputeSharp.SwapChain.D2D1.Cli.csproj /restore -t:publish /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}} + + # Verify that the Win2D NativeAOT sample also runs correctly + - name: Run ComputeSharp.SwapChain.D2D1.Cli + run: > + $process = (Start-Process samples\ComputeSharp.SwapChain.D2D1.Cli\bin\x64\Release\net8.0-windows10.0.22621\win-x64\publish\computesharp.d2d1.cli.exe -PassThru); + sleep -Seconds 2; + $process.CloseMainWindow() | Out-Null; + $process.WaitForExit(); + if ($process.ExitCode -lt 0 -and $process.ExitCode -ne -1073741510) { throw $process.ExitCode; } + return $process.ExitCode; # Publish the native library as a NativeAOT shared library - name: Publish ComputeSharp.NativeLibrary From dad6f34210428cf412273b2f1d38bfba00c2825f Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Wed, 22 Nov 2023 12:29:27 +0100 Subject: [PATCH 4/5] Always publish R2R/NAOT samples, only run on x64 Only build AOT samples on x64 --- .github/workflows/dotnet.yml | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 03b0deb9..6a65f2ee 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -261,9 +261,10 @@ jobs: path: samples\ComputeSharp.SwapChain.Cli\bin\Release\net8.0\win-x64\publish\computesharp.cli.exe if-no-files-found: error - # Also publish the Win2D sample (with R2R) + # Also publish the Win2D sample (with R2R). + # Only doing this on x64 (to avoid a Roslyn issue). - if: matrix.platform == 'x64' - name: Publish ComputeSharp.SwapChain.D2D1.Cli + name: Publish ComputeSharp.SwapChain.D2D1.Cli (R2R) run: > $env:COMPUTESHARP_SWAPCHAIN_D2D1_PUBLISH_R2R='true'; $env:COMPUTESHARP_SWAPCHAIN_D2D1_PUBLISH_AOT='false'; @@ -272,7 +273,8 @@ jobs: /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}} # Just like for the DX12 sample, run it on x64 to validate it works correctly - - name: Run ComputeSharp.SwapChain.D2D1.Cli + - if: matrix.platform == 'x64' + name: Run ComputeSharp.SwapChain.D2D1.Cli run: > $process = (Start-Process samples\ComputeSharp.SwapChain.D2D1.Cli\bin\x64\Release\net8.0-windows10.0.22621\win-x64\publish\computesharp.d2d1.cli.exe -PassThru); sleep -Seconds 2; @@ -283,7 +285,7 @@ jobs: # Publish the Win2D sample again (with NativeAOT) - if: matrix.platform == 'x64' - name: Publish ComputeSharp.SwapChain.D2D1.Cli with NativeAOT + name: Publish ComputeSharp.SwapChain.D2D1.Cli (NativeAOT) run: > $env:COMPUTESHARP_SWAPCHAIN_D2D1_PUBLISH_R2R='false'; $env:COMPUTESHARP_SWAPCHAIN_D2D1_PUBLISH_AOT='true'; @@ -292,7 +294,8 @@ jobs: /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}} # Verify that the Win2D NativeAOT sample also runs correctly - - name: Run ComputeSharp.SwapChain.D2D1.Cli + - if: matrix.platform == 'x64' + name: Run ComputeSharp.SwapChain.D2D1.Cli run: > $process = (Start-Process samples\ComputeSharp.SwapChain.D2D1.Cli\bin\x64\Release\net8.0-windows10.0.22621\win-x64\publish\computesharp.d2d1.cli.exe -PassThru); sleep -Seconds 2; From 1c304f7c2430069bf0924bf4558e8109274a5d8e Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Wed, 22 Nov 2023 12:51:24 +0100 Subject: [PATCH 5/5] Force release configuration for MSBuild publish --- .github/workflows/dotnet.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 6a65f2ee..f124a6d9 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -270,11 +270,11 @@ jobs: $env:COMPUTESHARP_SWAPCHAIN_D2D1_PUBLISH_AOT='false'; git clean -fdx; msbuild samples\ComputeSharp.SwapChain.D2D1.Cli\ComputeSharp.SwapChain.D2D1.Cli.csproj /restore -t:publish - /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}} + /p:Configuration=Release /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}} # Just like for the DX12 sample, run it on x64 to validate it works correctly - if: matrix.platform == 'x64' - name: Run ComputeSharp.SwapChain.D2D1.Cli + name: Run ComputeSharp.SwapChain.D2D1.Cli (R2R) run: > $process = (Start-Process samples\ComputeSharp.SwapChain.D2D1.Cli\bin\x64\Release\net8.0-windows10.0.22621\win-x64\publish\computesharp.d2d1.cli.exe -PassThru); sleep -Seconds 2; @@ -291,11 +291,11 @@ jobs: $env:COMPUTESHARP_SWAPCHAIN_D2D1_PUBLISH_AOT='true'; git clean -fdx; msbuild samples\ComputeSharp.SwapChain.D2D1.Cli\ComputeSharp.SwapChain.D2D1.Cli.csproj /restore -t:publish - /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}} + /p:Configuration=Release /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}} # Verify that the Win2D NativeAOT sample also runs correctly - if: matrix.platform == 'x64' - name: Run ComputeSharp.SwapChain.D2D1.Cli + name: Run ComputeSharp.SwapChain.D2D1.Cli (NativeAOT) run: > $process = (Start-Process samples\ComputeSharp.SwapChain.D2D1.Cli\bin\x64\Release\net8.0-windows10.0.22621\win-x64\publish\computesharp.d2d1.cli.exe -PassThru); sleep -Seconds 2;