From 388906121158f39ce941b98494e8466a21c7d509 Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Wed, 24 Feb 2021 20:09:24 +0100 Subject: [PATCH] Refactored and moved the SwapChain sample project Also enabled the build in the CI --- .github/workflows/dotnet.yml | 3 +++ ComputeSharp.sln | 2 +- .../Backend/SwapChainApplication{T}.cs | 2 +- .../Backend/Win32Application.cs | 2 +- .../Backend/Win32ApplicationRunner.cs | 2 +- .../ComputeSharp.SwapChain.csproj} | 5 ++++- .../Program.cs | 6 +++--- .../Shaders/ColorfulInfinity.cs | 2 +- .../Shaders/FractalTiling.cs | 2 +- .../Shaders/MengerJourney.cs | 2 +- .../Shaders/TwoTiledTruchet.cs | 2 +- 11 files changed, 18 insertions(+), 12 deletions(-) rename samples/{ComputeSharp.Sample.SwapChain => ComputeSharp.SwapChain}/Backend/SwapChainApplication{T}.cs (99%) rename samples/{ComputeSharp.Sample.SwapChain => ComputeSharp.SwapChain}/Backend/Win32Application.cs (95%) rename samples/{ComputeSharp.Sample.SwapChain => ComputeSharp.SwapChain}/Backend/Win32ApplicationRunner.cs (99%) rename samples/{ComputeSharp.Sample.SwapChain/ComputeSharp.Sample.SwapChain.csproj => ComputeSharp.SwapChain/ComputeSharp.SwapChain.csproj} (62%) rename samples/{ComputeSharp.Sample.SwapChain => ComputeSharp.SwapChain}/Program.cs (91%) rename samples/{ComputeSharp.Sample.SwapChain => ComputeSharp.SwapChain}/Shaders/ColorfulInfinity.cs (98%) rename samples/{ComputeSharp.Sample.SwapChain => ComputeSharp.SwapChain}/Shaders/FractalTiling.cs (96%) rename samples/{ComputeSharp.Sample.SwapChain => ComputeSharp.SwapChain}/Shaders/MengerJourney.cs (99%) rename samples/{ComputeSharp.Sample.SwapChain => ComputeSharp.SwapChain}/Shaders/TwoTiledTruchet.cs (98%) diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 5a9af369..891bb15b 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -77,6 +77,9 @@ jobs: - name: Build ComputeSharp.Benchmark.csproj run: dotnet build samples\ComputeSharp.Benchmark\ComputeSharp.Benchmark.csproj -c Release shell: cmd + - name: Build ComputeSharp.SwapChain.csproj + run: dotnet build samples\ComputeSharp.SwapChain\ComputeSharp.SwapChain.csproj -c Release + shell: cmd # Buils the .msbuildproj project to generate the NuGet package. # This workflow also uploads the resulting package as an artifact. diff --git a/ComputeSharp.sln b/ComputeSharp.sln index 7e4f1344..fbb67c3b 100644 --- a/ComputeSharp.sln +++ b/ComputeSharp.sln @@ -47,7 +47,7 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Tests.Internal EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Tests.NativeLibrariesResolver", "tests\ComputeSharp.Tests.NativeLibrariesResolver\ComputeSharp.Tests.NativeLibrariesResolver.csproj", "{BF52326F-E415-49E6-8595-62762216762B}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComputeSharp.Sample.SwapChain", "samples\ComputeSharp.Sample.SwapChain\ComputeSharp.Sample.SwapChain.csproj", "{E7C9247D-016B-4819-AF9F-0E9B3591E04B}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.SwapChain", "samples\ComputeSharp.SwapChain\ComputeSharp.SwapChain.csproj", "{E7C9247D-016B-4819-AF9F-0E9B3591E04B}" EndProject Global GlobalSection(SharedMSBuildProjectFiles) = preSolution diff --git a/samples/ComputeSharp.Sample.SwapChain/Backend/SwapChainApplication{T}.cs b/samples/ComputeSharp.SwapChain/Backend/SwapChainApplication{T}.cs similarity index 99% rename from samples/ComputeSharp.Sample.SwapChain/Backend/SwapChainApplication{T}.cs rename to samples/ComputeSharp.SwapChain/Backend/SwapChainApplication{T}.cs index 0cfc25da..3340a9dd 100644 --- a/samples/ComputeSharp.Sample.SwapChain/Backend/SwapChainApplication{T}.cs +++ b/samples/ComputeSharp.SwapChain/Backend/SwapChainApplication{T}.cs @@ -4,7 +4,7 @@ using ComputeSharp.Interop; using TerraFX.Interop; using FX = TerraFX.Interop.Windows; -namespace ComputeSharp.Sample.SwapChain.Backend +namespace ComputeSharp.SwapChain.Backend { internal sealed class SwapChainApplication : Win32Application where T : struct, IComputeShader diff --git a/samples/ComputeSharp.Sample.SwapChain/Backend/Win32Application.cs b/samples/ComputeSharp.SwapChain/Backend/Win32Application.cs similarity index 95% rename from samples/ComputeSharp.Sample.SwapChain/Backend/Win32Application.cs rename to samples/ComputeSharp.SwapChain/Backend/Win32Application.cs index b207f3e8..733a64ed 100644 --- a/samples/ComputeSharp.Sample.SwapChain/Backend/Win32Application.cs +++ b/samples/ComputeSharp.SwapChain/Backend/Win32Application.cs @@ -2,7 +2,7 @@ using System.Drawing; using TerraFX.Interop; -namespace ComputeSharp.Sample.SwapChain.Backend +namespace ComputeSharp.SwapChain.Backend { /// /// A class representing a simple Win32 application. diff --git a/samples/ComputeSharp.Sample.SwapChain/Backend/Win32ApplicationRunner.cs b/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationRunner.cs similarity index 99% rename from samples/ComputeSharp.Sample.SwapChain/Backend/Win32ApplicationRunner.cs rename to samples/ComputeSharp.SwapChain/Backend/Win32ApplicationRunner.cs index 047e0c65..e7ca1c7a 100644 --- a/samples/ComputeSharp.Sample.SwapChain/Backend/Win32ApplicationRunner.cs +++ b/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationRunner.cs @@ -7,7 +7,7 @@ using System.Threading; using TerraFX.Interop; using FX = TerraFX.Interop.Windows; -namespace ComputeSharp.Sample.SwapChain.Backend +namespace ComputeSharp.SwapChain.Backend { /// /// A helper class to manage the creation and execution of Win32 applications. diff --git a/samples/ComputeSharp.Sample.SwapChain/ComputeSharp.Sample.SwapChain.csproj b/samples/ComputeSharp.SwapChain/ComputeSharp.SwapChain.csproj similarity index 62% rename from samples/ComputeSharp.Sample.SwapChain/ComputeSharp.Sample.SwapChain.csproj rename to samples/ComputeSharp.SwapChain/ComputeSharp.SwapChain.csproj index 333c078e..44b2ad45 100644 --- a/samples/ComputeSharp.Sample.SwapChain/ComputeSharp.Sample.SwapChain.csproj +++ b/samples/ComputeSharp.SwapChain/ComputeSharp.SwapChain.csproj @@ -7,7 +7,10 @@ - + diff --git a/samples/ComputeSharp.Sample.SwapChain/Program.cs b/samples/ComputeSharp.SwapChain/Program.cs similarity index 91% rename from samples/ComputeSharp.Sample.SwapChain/Program.cs rename to samples/ComputeSharp.SwapChain/Program.cs index e829766c..4fd79340 100644 --- a/samples/ComputeSharp.Sample.SwapChain/Program.cs +++ b/samples/ComputeSharp.SwapChain/Program.cs @@ -1,8 +1,8 @@ using System; -using ComputeSharp.Sample.SwapChain.Backend; -using ComputeSharp.Sample.SwapChain.Shaders; +using ComputeSharp.SwapChain.Backend; +using ComputeSharp.SwapChain.Shaders; -namespace ComputeSharp.Sample.SwapChain +namespace ComputeSharp.SwapChain { class Program { diff --git a/samples/ComputeSharp.Sample.SwapChain/Shaders/ColorfulInfinity.cs b/samples/ComputeSharp.SwapChain/Shaders/ColorfulInfinity.cs similarity index 98% rename from samples/ComputeSharp.Sample.SwapChain/Shaders/ColorfulInfinity.cs rename to samples/ComputeSharp.SwapChain/Shaders/ColorfulInfinity.cs index f5566663..7ab620e1 100644 --- a/samples/ComputeSharp.Sample.SwapChain/Shaders/ColorfulInfinity.cs +++ b/samples/ComputeSharp.SwapChain/Shaders/ColorfulInfinity.cs @@ -1,4 +1,4 @@ -namespace ComputeSharp.Sample.SwapChain.Shaders +namespace ComputeSharp.SwapChain.Shaders { /// /// A shader creating an abstract and colorful animation. diff --git a/samples/ComputeSharp.Sample.SwapChain/Shaders/FractalTiling.cs b/samples/ComputeSharp.SwapChain/Shaders/FractalTiling.cs similarity index 96% rename from samples/ComputeSharp.Sample.SwapChain/Shaders/FractalTiling.cs rename to samples/ComputeSharp.SwapChain/Shaders/FractalTiling.cs index a5be7ef9..ee97ff2e 100644 --- a/samples/ComputeSharp.Sample.SwapChain/Shaders/FractalTiling.cs +++ b/samples/ComputeSharp.SwapChain/Shaders/FractalTiling.cs @@ -1,4 +1,4 @@ -namespace ComputeSharp.Sample.SwapChain.Shaders +namespace ComputeSharp.SwapChain.Shaders { /// /// A shader creating a fractal tiling animation. diff --git a/samples/ComputeSharp.Sample.SwapChain/Shaders/MengerJourney.cs b/samples/ComputeSharp.SwapChain/Shaders/MengerJourney.cs similarity index 99% rename from samples/ComputeSharp.Sample.SwapChain/Shaders/MengerJourney.cs rename to samples/ComputeSharp.SwapChain/Shaders/MengerJourney.cs index b1f0e88f..024ef622 100644 --- a/samples/ComputeSharp.Sample.SwapChain/Shaders/MengerJourney.cs +++ b/samples/ComputeSharp.SwapChain/Shaders/MengerJourney.cs @@ -1,4 +1,4 @@ -namespace ComputeSharp.Sample.SwapChain.Shaders +namespace ComputeSharp.SwapChain.Shaders { /// /// A shader creating a flythrough in a Menger system. diff --git a/samples/ComputeSharp.Sample.SwapChain/Shaders/TwoTiledTruchet.cs b/samples/ComputeSharp.SwapChain/Shaders/TwoTiledTruchet.cs similarity index 98% rename from samples/ComputeSharp.Sample.SwapChain/Shaders/TwoTiledTruchet.cs rename to samples/ComputeSharp.SwapChain/Shaders/TwoTiledTruchet.cs index 176f330c..f56709a8 100644 --- a/samples/ComputeSharp.Sample.SwapChain/Shaders/TwoTiledTruchet.cs +++ b/samples/ComputeSharp.SwapChain/Shaders/TwoTiledTruchet.cs @@ -1,4 +1,4 @@ -namespace ComputeSharp.Sample.SwapChain.Shaders +namespace ComputeSharp.SwapChain.Shaders { /// /// A shader creating an animated two-tiles Truchet arrangement.