diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml
index dfc9c58e..345c92e6 100644
--- a/.github/workflows/dotnet.yml
+++ b/.github/workflows/dotnet.yml
@@ -62,19 +62,7 @@ jobs:
run: dotnet pack src\ComputeSharp.Dxc\ComputeSharp.Dxc.csproj -c Release
- name: Build ComputeSharp.D3D12MemoryAllocator package
run: dotnet pack src\ComputeSharp.D3D12MemoryAllocator\ComputeSharp.D3D12MemoryAllocator.csproj -c Release
- - name: Build ComputeSharp.D2D1 package
- run: dotnet pack src\ComputeSharp.D2D1\ComputeSharp.D2D1.csproj -c Release
- - name: Build ComputeSharp.Pix package
- run: dotnet pack src\ComputeSharp.Pix\ComputeSharp.Pix.csproj -c Release
- - name: Build ComputeSharp.Uwp package
- run: msbuild src\ComputeSharp.Uwp\ComputeSharp.Uwp.csproj /restore -t:pack /p:Configuration=Release
- - name: Build ComputeSharp.WinUI package
- run: msbuild src\ComputeSharp.WinUI\ComputeSharp.WinUI.csproj /restore -t:pack /p:Configuration=Release
- - name: Build ComputeSharp.D2D1.Uwp package
- run: msbuild src\ComputeSharp.D2D1.Uwp\ComputeSharp.D2D1.Uwp.csproj /restore -t:pack /p:Configuration=Release
- - name: Build ComputeSharp.D2D1.WinUI package
- run: msbuild src\ComputeSharp.D2D1.WinUI\ComputeSharp.D2D1.WinUI.csproj /restore -t:pack /p:Configuration=Release
-
+
# Upload the packages to the pipeline artifacts
- name: Upload package artifacts
uses: actions/upload-artifact@v4
@@ -99,37 +87,9 @@ jobs:
# DirectX 12 unit tests
- name: Run ComputeSharp.Tests
run: dotnet test tests\ComputeSharp.Tests\ComputeSharp.Tests.csproj -c Release /p:Platform=x64 -v n -l "console;verbosity=detailed"
- - name: Run ComputeSharp.Tests.DisableDynamicCompilation
- run: dotnet test tests\ComputeSharp.Tests.DisableDynamicCompilation\ComputeSharp.Tests.DisableDynamicCompilation.csproj -c Release /p:Platform=x64 -v n -l "console;verbosity=detailed"
- - name: Run ComputeSharp.Tests.GlobalStatements
- run: dotnet run --project tests\ComputeSharp.Tests.GlobalStatements\ComputeSharp.Tests.GlobalStatements.csproj -c Release /p:Platform=x64 -v n -l "console;verbosity=detailed"
- name: Run ComputeSharp.Tests.Internals
run: dotnet test tests\ComputeSharp.Tests.Internals\ComputeSharp.Tests.Internals.csproj -c Release /p:Platform=x64 -v n -l "console;verbosity=detailed"
- # Run the source generator tests as well (even though they're not really runtime specific)
- - name: Run ComputeSharp.Tests.SourceGenerators
- run: dotnet test tests\ComputeSharp.Tests.SourceGenerators\ComputeSharp.Tests.SourceGenerators.csproj -v n -l "console;verbosity=detailed"
-
- # DirectX 12 device lost unit tests.
- # These tests are run one class at a time to ensure there's no accidental conflicts between any of them. This is because
- # the code paths being tested in this project are heavily dependent on process-wide mutable state (ie. DirectX 12 devices).
- - name: Run ComputeSharp.Tests.DeviceLost "DeviceDisposal"
- run: dotnet test tests\ComputeSharp.Tests.DeviceLost\ComputeSharp.Tests.DeviceLost.csproj --filter "TestCategory=DeviceDisposal" -c Release -v n -l "console;verbosity=detailed"
- - name: Run ComputeSharp.Tests.DeviceLost "DeviceLost"
- run: dotnet test tests\ComputeSharp.Tests.DeviceLost\ComputeSharp.Tests.DeviceLost.csproj --filter "TestCategory=DeviceLost" -c Release -v n -l "console;verbosity=detailed"
- - name: Run ComputeSharp.Tests.DeviceLost "GetDefaultDevice"
- run: dotnet test tests\ComputeSharp.Tests.DeviceLost\ComputeSharp.Tests.DeviceLost.csproj --filter "TestCategory=GetDefaultDevice" -c Release -v n -l "console;verbosity=detailed"
-
- # D2D1 unit tests
- - name: Run ComputeSharp.D2D1.Tests
- run: dotnet test tests\ComputeSharp.D2D1.Tests\ComputeSharp.D2D1.Tests.csproj -c Release -v n -l "console;verbosity=detailed"
- - name: Run ComputeSharp.D2D1.Tests.AssemblyLevelAttributes
- run: dotnet test tests\ComputeSharp.D2D1.Tests.AssemblyLevelAttributes\ComputeSharp.D2D1.Tests.AssemblyLevelAttributes.csproj -c Release -v n -l "console;verbosity=detailed"
-
- # Run the D2D1 source generators tests as well
- - name: Run ComputeSharp.D2D1.Tests.SourceGenerators
- run: dotnet test tests\ComputeSharp.D2D1.Tests.SourceGenerators\ComputeSharp.D2D1.Tests.SourceGenerators.csproj -v n -l "console;verbosity=detailed"
-
# Run all unit tests using D3D12MA
run-tests-d3d12ma:
needs: [build-solution]
@@ -140,277 +100,15 @@ jobs:
- name: Git checkout
uses: actions/checkout@v4
- # D3D12MA tests (main ComputeSharp tests, as well as the device lost ones)
+ # D3D12MA tests (main ComputeSharp tests)
- name: Run ComputeSharp.Tests
run: dotnet test tests\ComputeSharp.Tests\ComputeSharp.Tests.csproj -c Release /p:Platform=x64 /p:UseD3D12MemoryAllocator=true -v n -l "console;verbosity=detailed"
- - name: Run ComputeSharp.Tests.DeviceLost "DeviceDisposal"
- run: dotnet test tests\ComputeSharp.Tests.DeviceLost\ComputeSharp.Tests.DeviceLost.csproj --filter "TestCategory=DeviceDisposal" -c Release /p:UseD3D12MemoryAllocator=true -v n -l "console;verbosity=detailed"
- - name: Run ComputeSharp.Tests.DeviceLost "DeviceLost"
- run: dotnet test tests\ComputeSharp.Tests.DeviceLost\ComputeSharp.Tests.DeviceLost.csproj --filter "TestCategory=DeviceLost" -c Release /p:UseD3D12MemoryAllocator=true -v n -l "console;verbosity=detailed"
- - name: Run ComputeSharp.Tests.DeviceLost "GetDefaultDevice"
- run: dotnet test tests\ComputeSharp.Tests.DeviceLost\ComputeSharp.Tests.DeviceLost.csproj --filter "TestCategory=GetDefaultDevice" -c Release /p:UseD3D12MemoryAllocator=true -v n -l "console;verbosity=detailed"
-
- # Run all Win2D tests (separately, as they need VS Test)
- run-tests-win2d:
- needs: [build-solution]
- runs-on: windows-2022
- steps:
- - name: Git checkout
- uses: actions/checkout@v4
- - name: Add msbuild to PATH
- uses: microsoft/setup-msbuild@v2
-
- # Build the D2D1 WinAppSDK unit tests
- - name: Build ComputeSharp.D2D1.WinUI.Tests
- run: msbuild tests\ComputeSharp.D2D1.WinUI.Tests\ComputeSharp.D2D1.WinUI.Tests.csproj /restore -t:build /p:Configuration=Release /p:Platform=x64
-
- # Run the D2D1 WinAppSDK unit tests with VS Test
- - name: Run ComputeSharp.D2D1.WinUI.Tests
- run: >
- $vs_path = vswhere -latest -products * -requires Microsoft.VisualStudio.Workload.ManagedDesktop -requiresAny -property installationPath;
- $vstest_path = join-path $vs_path 'Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe';
- & $vstest_path /Platform:x64 tests\ComputeSharp.D2D1.WinUI.Tests\bin\x64\Release\net8.0-windows10.0.22621.0\win-x64\ComputeSharp.D2D1.WinUI.Tests.build.appxrecipe
-
- # Build the D2D1 WinAppSDK source generators tests
- - name: Build ComputeSharp.D2D1.WinUI.Tests.SourceGenerators
- run: msbuild tests\ComputeSharp.D2D1.WinUI.Tests.SourceGenerators\ComputeSharp.D2D1.WinUI.Tests.SourceGenerators.csproj /restore -t:build /p:Configuration=Release /p:Platform=x64
-
- # Run the D2D1 WinAppSDK source generators tests (same as above)
- - name: Run ComputeSharp.D2D1.WinUI.Tests.SourceGenerators
- run: >
- $vs_path = vswhere -latest -products * -requires Microsoft.VisualStudio.Workload.ManagedDesktop -requiresAny -property installationPath;
- $vstest_path = join-path $vs_path 'Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe';
- & $vstest_path /Platform:x64 tests\ComputeSharp.D2D1.WinUI.Tests.SourceGenerators\bin\x64\Release\net8.0-windows10.0.22621.0\ComputeSharp.D2D1.WinUI.Tests.SourceGenerators.dll
-
- # Run all the local samples to ensure they build and run with no errors
- run-samples:
- needs: [build-solution]
- runs-on: windows-2022
- steps:
- - name: Git checkout
- uses: actions/checkout@v4
- - name: Build and run ComputeSharp.Sample
- run: >
- dotnet build samples\ComputeSharp.Sample\ComputeSharp.Sample.csproj -c Release -r win-x64 --no-self-contained -p:Platform=x64 -v n;
- samples\ComputeSharp.Sample\bin\x64\Release\net8.0\win-x64\ComputeSharp.Sample.exe
- - name: Build and run ComputeSharp.Sample.FSharp
- run: >
- dotnet build samples\ComputeSharp.Sample.FSharp\ComputeSharp.Sample.FSharp.fsproj -c Release -r win-x64 --no-self-contained -p:Platform=x64 -v n;
- samples\ComputeSharp.Sample.FSharp\bin\x64\Release\net8.0\win-x64\ComputeSharp.Sample.FSharp.exe
- - name: Build and run ComputeSharp.ImageProcessing.csproj
- run: >
- dotnet build samples\ComputeSharp.ImageProcessing\ComputeSharp.ImageProcessing.csproj -c Release -r win-x64 --no-self-contained -p:Platform=x64 -v n;
- samples\ComputeSharp.ImageProcessing\bin\x64\Release\net8.0\win-x64\ComputeSharp.ImageProcessing.exe
-
- # Run the NativeAOT samples as well
- run-samples-aot:
- needs: [build-solution]
- strategy:
- matrix:
- platform: [x64, arm64]
- runs-on: windows-2022
- env:
- CI_RUNNER_SAMPLES_INTEGRATION_TESTS: true
- steps:
- - name: Git checkout
- uses: actions/checkout@v4
- - name: Add msbuild to PATH
- uses: microsoft/setup-msbuild@v2
-
- # Publish the NativeAOT CLI sample (optimized for speed)
- - name: Publish ComputeSharp.SwapChain.Cli with NativeAOT (speed)
- run: >
- $env:COMPUTESHARP_SWAPCHAIN_CLI_PUBLISH_AOT='true';
- dotnet publish samples\ComputeSharp.SwapChain.Cli\ComputeSharp.SwapChain.Cli.csproj -r win-${{matrix.platform}} -v n
-
- # If on x64, also run it (this script will launch it and let it run for 2 seconds, before closing it).
- # Note: for this and all other equivalent tests below, we're only throwing on failures that are not
- # -1073741510 (STATUS_CONTROL_C_EXIT). That error is sometimes thrown when running the test in the CI.
- # We don't want to fail in that case, as it still means the sample has in fact ran with no problems.
- - if: matrix.platform == 'x64'
- name: Run ComputeSharp.SwapChain.Cli (speed)
- run: >
- $process = (Start-Process samples\ComputeSharp.SwapChain.Cli\bin\Release\net8.0\win-x64\publish\computesharp.cli.exe -PassThru);
- sleep -Seconds 2;
- try
- {
- $process.CloseMainWindow() | Out-Null;
- $process.WaitForExit();
- }
- catch { }
- if ($process.ExitCode -ne 0 -and $process.ExitCode -ne -1073741510) { throw $process.ExitCode; }
-
- # Upload the binary (to track binary size trends)
- - if: matrix.platform == 'x64'
- name: Upload NativeAOT CLI sample (speed)
- uses: actions/upload-artifact@v4
- with:
- name: computesharp.cli.opt-speed.exe
- path: samples\ComputeSharp.SwapChain.Cli\bin\Release\net8.0\win-x64\publish\computesharp.cli.exe
- if-no-files-found: error
-
- # Publish the NativeAOT CLI sample (optimized for size, and reflection-free)
- - name: Publish ComputeSharp.SwapChain.Cli with NativeAOT (size)
- run: >
- $env:COMPUTESHARP_SWAPCHAIN_CLI_PUBLISH_AOT='true';
- $env:COMPUTESHARP_SWAPCHAIN_CLI_SIZE_OPTIMIZED='true';
- $env:COMPUTESHARP_SWAPCHAIN_CLI_DISABLE_REFLECTION='true';
- git clean -fdx;
- dotnet publish samples\ComputeSharp.SwapChain.Cli\ComputeSharp.SwapChain.Cli.csproj -r win-${{matrix.platform}} -v n
-
- # Again only on x64, also run the sample and validate it works correctly
- - if: matrix.platform == 'x64'
- name: Run ComputeSharp.SwapChain.Cli (size)
- run: >
- $process = (Start-Process samples\ComputeSharp.SwapChain.Cli\bin\Release\net8.0\win-x64\publish\computesharp.cli.exe -PassThru);
- sleep -Seconds 2;
- try
- {
- $process.CloseMainWindow() | Out-Null;
- $process.WaitForExit();
- }
- catch { }
- if ($process.ExitCode -ne 0 -and $process.ExitCode -ne -1073741510) { throw $process.ExitCode; }
-
- # Upload the binary again (with a different name)
- - if: matrix.platform == 'x64'
- name: Upload NativeAOT CLI sample (size)
- uses: actions/upload-artifact@v4
- with:
- name: computesharp.cli.opt-size.exe
- 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)
- - name: Publish ComputeSharp.SwapChain.D2D1.Cli (R2R)
- 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: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 (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;
- try
- {
- $process.CloseMainWindow() | Out-Null;
- $process.WaitForExit();
- }
- catch { }
- if ($process.ExitCode -ne 0 -and $process.ExitCode -ne -1073741510) { throw $process.ExitCode; }
-
- # Publish the Win2D sample again (with NativeAOT)
- - name: Publish ComputeSharp.SwapChain.D2D1.Cli (NativeAOT)
- run: >
- $env:COMPUTESHARP_SWAPCHAIN_D2D1_PUBLISH_R2R='false';
- $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: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 (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;
- try
- {
- $process.CloseMainWindow() | Out-Null;
- $process.WaitForExit();
- }
- catch { }
- if ($process.ExitCode -ne 0 -and $process.ExitCode -ne -1073741510) { throw $process.ExitCode; }
-
- # Publish the native library as a NativeAOT shared library
- - name: Publish ComputeSharp.NativeLibrary
- run: dotnet publish samples\ComputeSharp.NativeLibrary\ComputeSharp.NativeLibrary.csproj -r win-${{matrix.platform}} -v n
-
- # Publish the WinRT component with NativeAOT as well
- - if: matrix.platform == 'x64'
- name: Publish ComputeSharp.NativeLibrary.WinRT
- run: >
- msbuild samples\ComputeSharp.NativeLibrary.WinRT\ComputeSharp.NativeLibrary.WinRT.csproj /restore -t:publish
- /p:Configuration=Release /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}}
-
- # Publish the WinUI 3 sample app with NativeAOT
- - if: matrix.platform == 'x64'
- name: Publish ComputeSharp.SwapChain.WinUI
- run: >
- msbuild samples\ComputeSharp.SwapChain.WinUI\ComputeSharp.SwapChain.WinUI.csproj /restore -t:publish
- /p:Configuration=Release /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}}
-
- # Publish the D2D1 UWP (CoreApplication) sample app with NativeAOT
- - if: matrix.platform == 'x64'
- name: Publish ComputeSharp.SwapChain.D2D1.Uwp
- run: >
- msbuild samples\ComputeSharp.SwapChain.D2D1.Uwp\ComputeSharp.SwapChain.D2D1.Uwp.csproj /restore -t:publish
- /p:Configuration=Release /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}}
-
- # Publish the D2D1 UWP sample app again with NativeAOT, with Xbox support
- - if: matrix.platform == 'x64'
- name: Publish ComputeSharp.SwapChain.D2D1.Uwp (Xbox)
- run: >
- $env:EXPERIMENTAL_XBOX_SUPPORT='true';
- msbuild samples\ComputeSharp.SwapChain.D2D1.Uwp\ComputeSharp.SwapChain.D2D1.Uwp.csproj /restore -t:publish
- /p:Configuration=Release /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}}
-
- # Download the NuGet packages generated in the previous job and use them
- # to build and run the sample project referencing them. This is used as
- # a test to ensure the NuGet packages work in a consuming project.
- verify-packages:
- needs: [build-packages]
- runs-on: windows-2022
- steps:
- - name: Git checkout
- uses: actions/checkout@v4
- - name: Create local NuGet feed
- run: mkdir artifacts
- - name: Download package artifacts
- uses: actions/download-artifact@v4
- with:
- name: nuget_packages
- path: artifacts
- - name: Build and run ComputeSharp.NuGet
- run: dotnet run --project tests\ComputeSharp.NuGet\ComputeSharp.NuGet.csproj -c Release -r win-x64 --no-self-contained -v n
- - name: Build and run ComputeSharp.Dxc.NuGet
- run: dotnet run --project tests\ComputeSharp.Dxc.NuGet\ComputeSharp.Dxc.NuGet.csproj -c Release -r win-x64 --no-self-contained -v n
- - name: Build and run ComputeSharp.Pix.NuGet
- run: dotnet run --project tests\ComputeSharp.Pix.NuGet\ComputeSharp.Pix.NuGet.csproj -c Release -r win-x64 --no-self-contained -v n
-
- # Run the extra tests to validate a number of build and publishing configurations.
- # This is used to ensure the native dependencies can always be loaded correctly
- # regardless of whether the app is shipping with R2R, self-contained, etc.
- - name: Run ComputeSharp.Tests.NativeLibrariesResolver
- run: dotnet test tests\ComputeSharp.Tests.NativeLibrariesResolver\ComputeSharp.Tests.NativeLibrariesResolver.csproj -v n -l "console;verbosity=detailed"
-
- # Also run the NativeAOT publishing tests
- - name: Publish and run ComputeSharp.NuGet with NativeAOT
- run: >
- $env:COMPUTESHARP_NUGET_TESTS_PUBLISH_AOT='true';
- dotnet publish tests\ComputeSharp.NuGet\ComputeSharp.NuGet.csproj -r win-x64 -v n;
- tests\ComputeSharp.NuGet\bin\Release\net8.0\win-x64\publish\ComputeSharp.NuGet.exe
- - name: Publish and run ComputeSharp.Dxc.NuGet with NativeAOT
- run: >
- $env:COMPUTESHARP_NUGET_TESTS_PUBLISH_AOT='true';
- dotnet publish tests\ComputeSharp.Dxc.NuGet\ComputeSharp.Dxc.NuGet.csproj -r win-x64 -v n;
- tests\ComputeSharp.Dxc.NuGet\bin\Release\net8.0\win-x64\publish\ComputeSharp.Dxc.NuGet.exe
- - name: Publish and run ComputeSharp.Pix.NuGet with NativeAOT
- run: >
- $env:COMPUTESHARP_NUGET_TESTS_PUBLISH_AOT='true';
- dotnet publish tests\ComputeSharp.Pix.NuGet\ComputeSharp.Pix.NuGet.csproj -r win-x64 -v n;
- tests\ComputeSharp.Pix.NuGet\bin\Release\net8.0\win-x64\publish\ComputeSharp.Pix.NuGet.exe
# ビルドした NuGet パッケージ(.nupkg)を GitHub Release として公開する。
# GitHub Packages や Azure DevOps への push はフォークでは認証できず失敗する(403)ため、
# 代わりに自動生成のリリースノートを付けたリリースを作成し、.nupkg を資産として添付する。
publish-release:
- needs: [run-tests, run-tests-d3d12ma, run-tests-win2d, run-samples, run-samples-aot, verify-packages]
+ needs: [run-tests, run-tests-d3d12ma, build-packages]
runs-on: windows-2022
if: ${{github.event_name == 'push'}}
permissions:
diff --git a/ComputeSharp.sln b/ComputeSharp.sln
index 08b74376..60c7a7a7 100644
--- a/ComputeSharp.sln
+++ b/ComputeSharp.sln
@@ -6,10 +6,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp", "src\Compute
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Benchmark", "samples\ComputeSharp.Benchmark\ComputeSharp.Benchmark.csproj", "{34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.ImageProcessing", "samples\ComputeSharp.ImageProcessing\ComputeSharp.ImageProcessing.csproj", "{524CC5DD-1DEE-4A30-9515-AB90965E5207}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Tests", "tests\ComputeSharp.Tests\ComputeSharp.Tests.csproj", "{E91F4D24-922A-4921-A8D7-9C45A143C45D}"
@@ -32,74 +28,20 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_SolutionItems", "_Solution
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.SourceGenerators", "src\ComputeSharp.SourceGenerators\ComputeSharp.SourceGenerators.csproj", "{EB52CB67-4162-4722-874B-44EA8DA5450E}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Sample", "samples\ComputeSharp.Sample\ComputeSharp.Sample.csproj", "{7048DEEA-0A6F-46A0-B951-B682A8F1CB75}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Tests.SourceGenerators", "tests\ComputeSharp.Tests.SourceGenerators\ComputeSharp.Tests.SourceGenerators.csproj", "{BBBD0ADD-F2F9-49A3-BD5E-D223F0735D8B}"
-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("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.SwapChain", "samples\ComputeSharp.SwapChain\ComputeSharp.SwapChain.csproj", "{E7C9247D-016B-4819-AF9F-0E9B3591E04B}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.SwapChain.Cli", "samples\ComputeSharp.SwapChain.Cli\ComputeSharp.SwapChain.Cli.csproj", "{C12D7ACE-98ED-4813-8118-6667C34F484F}"
-EndProject
-Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "ComputeSharp.Sample.FSharp", "samples\ComputeSharp.Sample.FSharp\ComputeSharp.Sample.FSharp.fsproj", "{7C625EC4-F599-4350-A915-F046DF2406D3}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Sample.FSharp.Shaders", "samples\ComputeSharp.Sample.FSharp.Shaders\ComputeSharp.Sample.FSharp.Shaders.csproj", "{1F37A704-3CDF-45BB-8114-ED9137E5F2CF}"
-EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.Win32.D3D12", "src\ComputeSharp.Win32.D3D12\ComputeSharp.Win32.D3D12.shproj", "{514FF00E-BBF0-4D55-A47C-EEEB6208ADCE}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.WinUI", "src\ComputeSharp.WinUI\ComputeSharp.WinUI.csproj", "{FA18BA9F-76BF-4DE0-8D24-02FC7657E6CB}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.SwapChain.WinUI", "samples\ComputeSharp.SwapChain.WinUI\ComputeSharp.SwapChain.WinUI.csproj", "{0071701E-B9C5-4098-BE5F-EF556C4553C6}"
-EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.SwapChain.Shaders", "samples\ComputeSharp.SwapChain.Shaders\ComputeSharp.SwapChain.Shaders.shproj", "{0800BD51-499D-44C2-9417-FD1F7FDFE9C4}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Tests.DisableDynamicCompilation", "tests\ComputeSharp.Tests.DisableDynamicCompilation\ComputeSharp.Tests.DisableDynamicCompilation.csproj", "{4A8FCE22-851C-442A-8BC9-3EC3FD00B637}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Dxc", "src\ComputeSharp.Dxc\ComputeSharp.Dxc.csproj", "{76C66257-FDAA-47AB-85E7-EF757EAB10C0}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.D2D1", "src\ComputeSharp.D2D1\ComputeSharp.D2D1.csproj", "{4D7D9BA8-A821-4B1C-9EE2-CBCF5849906E}"
-EndProject
-Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.Win32.D2D1", "src\ComputeSharp.Win32.D2D1\ComputeSharp.Win32.D2D1.shproj", "{9DA1DA9F-F8B2-4B25-BE80-C21F773029E3}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Core", "src\ComputeSharp.Core\ComputeSharp.Core.csproj", "{764BC0F5-0C5E-49AD-ABAA-E3874C0F3286}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Core.SourceGenerators", "src\ComputeSharp.Core.SourceGenerators\ComputeSharp.Core.SourceGenerators.csproj", "{BFB003D1-788B-48DE-8065-39479C162CB0}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.D2D1.SourceGenerators", "src\ComputeSharp.D2D1.SourceGenerators\ComputeSharp.D2D1.SourceGenerators.csproj", "{E44053BD-A761-47FB-AA78-087A599672EA}"
-EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.SourceGeneration", "src\ComputeSharp.SourceGeneration\ComputeSharp.SourceGeneration.shproj", "{51D5A422-D3A5-4C4D-8A6D-A048940BF279}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.SourceGeneration.Hlsl", "src\ComputeSharp.SourceGeneration.Hlsl\ComputeSharp.SourceGeneration.Hlsl.shproj", "{9AC496A3-BBF0-4C8F-A50D-A20BF01C5E05}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.D2D1.Tests", "tests\ComputeSharp.D2D1.Tests\ComputeSharp.D2D1.Tests.csproj", "{209C95A3-FA53-431B-B688-3299CA6C29D2}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.D2D1.Tests.AssemblyLevelAttributes", "tests\ComputeSharp.D2D1.Tests.AssemblyLevelAttributes\ComputeSharp.D2D1.Tests.AssemblyLevelAttributes.csproj", "{94178D51-0097-4AD2-B3D0-827E40D62F2E}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Pix", "src\ComputeSharp.Pix\ComputeSharp.Pix.csproj", "{14EF12A3-90E6-4683-BD71-9896AF87026B}"
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ComputeSharp.Dxc.NuGet", "ComputeSharp.Dxc.NuGet", "{CBA545B4-31EF-4E9F-A1A8-2A1290B54046}"
- ProjectSection(SolutionItems) = preProject
- tests\ComputeSharp.Dxc.NuGet\ComputeSharp.Dxc.NuGet.csproj = tests\ComputeSharp.Dxc.NuGet\ComputeSharp.Dxc.NuGet.csproj
- tests\ComputeSharp.Dxc.NuGet\Program.cs = tests\ComputeSharp.Dxc.NuGet\Program.cs
- EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ComputeSharp.Pix.NuGet", "ComputeSharp.Pix.NuGet", "{C0B903AA-F32C-4760-B4B6-199AC4FE1C5A}"
- ProjectSection(SolutionItems) = preProject
- tests\ComputeSharp.Pix.NuGet\ComputeSharp.Pix.NuGet.csproj = tests\ComputeSharp.Pix.NuGet\ComputeSharp.Pix.NuGet.csproj
- tests\ComputeSharp.Pix.NuGet\Program.cs = tests\ComputeSharp.Pix.NuGet\Program.cs
- EndProjectSection
-EndProject
-Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ComputeSharp.NuGet", "ComputeSharp.NuGet", "{E3403F19-A0D8-4317-8A54-322C7A13F2A2}"
- ProjectSection(SolutionItems) = preProject
- tests\ComputeSharp.NuGet\ComputeSharp.NuGet.csproj = tests\ComputeSharp.NuGet\ComputeSharp.NuGet.csproj
- tests\ComputeSharp.NuGet\Program.cs = tests\ComputeSharp.NuGet\Program.cs
- EndProjectSection
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Tests.DeviceLost", "tests\ComputeSharp.Tests.DeviceLost\ComputeSharp.Tests.DeviceLost.csproj", "{5DE90C85-ED26-4B5A-A0D7-2FF966A210AC}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Tests.GlobalStatements", "tests\ComputeSharp.Tests.GlobalStatements\ComputeSharp.Tests.GlobalStatements.csproj", "{669A414F-3B46-4B55-B587-061AF63C3067}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{B86A48A7-18BD-4946-B995-3CE26B092DDF}"
ProjectSection(SolutionItems) = preProject
src\Directory.Build.BeforeMicrosoftNETSdkTargets.targets = src\Directory.Build.BeforeMicrosoftNETSdkTargets.targets
@@ -107,10 +49,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{B86A48A7-18B
src\Directory.Build.targets = src\Directory.Build.targets
EndProjectSection
EndProject
-Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.SwapChain.Shaders.D2D1", "samples\ComputeSharp.SwapChain.Shaders.D2D1\ComputeSharp.SwapChain.Shaders.D2D1.shproj", "{F8BF7666-7CCF-4FE4-B055-2EBA4BCD4564}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.D2D1.WinUI", "src\ComputeSharp.D2D1.WinUI\ComputeSharp.D2D1.WinUI.csproj", "{BD9E6556-357E-4C20-BFCD-FB131F9372FA}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{568E7009-5C13-4153-9C94-0AC7A3E6883C}"
ProjectSection(SolutionItems) = preProject
samples\Directory.Build.props = samples\Directory.Build.props
@@ -124,8 +62,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{B54B6DCA
tests\Directory.Build.targets = tests\Directory.Build.targets
EndProjectSection
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.SwapChain.D2D1.Cli", "samples\ComputeSharp.SwapChain.D2D1.Cli\ComputeSharp.SwapChain.D2D1.Cli.csproj", "{9EA5AE9D-C39A-4F43-B03E-0A848EA2558A}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Assets", "Assets", "{345F62CF-5320-4531-A087-DA5B488FDDE6}"
ProjectSection(SolutionItems) = preProject
assets\icon.ico = assets\icon.ico
@@ -133,14 +69,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Assets", "Assets", "{345F62
assets\icon_highres.png = assets\icon_highres.png
EndProjectSection
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.D2D1.WinUI.Tests", "tests\ComputeSharp.D2D1.WinUI.Tests\ComputeSharp.D2D1.WinUI.Tests.csproj", "{73C32D0F-64DB-4674-84E9-8FCC41228474}"
-EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.D3D12MemoryAllocator", "src\ComputeSharp.D3D12MemoryAllocator\ComputeSharp.D3D12MemoryAllocator.csproj", "{E017B3B6-C7D3-4E53-A7F6-1036178E98C3}"
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.D2D1.CodeFixers", "src\ComputeSharp.D2D1.CodeFixers\ComputeSharp.D2D1.CodeFixers.csproj", "{54654960-54B5-4E19-B3ED-993591CA39E5}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.D2D1.Tests.SourceGenerators", "tests\ComputeSharp.D2D1.Tests.SourceGenerators\ComputeSharp.D2D1.Tests.SourceGenerators.csproj", "{59A17380-24A0-4BD7-9012-B105A9E7D46F}"
-EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Win32", "Win32", "{D991153C-A34D-4042-B76F-822ADB111DD0}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.CodeFixing", "src\ComputeSharp.CodeFixing\ComputeSharp.CodeFixing.shproj", "{29F6E256-BA0E-4F3B-854E-50839D67C6DD}"
@@ -165,38 +95,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "arm64", "arm64", "{B4F6A41C
libs\arm64\WinPixEventRuntime_UAP.dll = libs\arm64\WinPixEventRuntime_UAP.dll
EndProjectSection
EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.NativeLibrary", "samples\ComputeSharp.NativeLibrary\ComputeSharp.NativeLibrary.csproj", "{1A3E20B3-F711-41C0-82EA-3B53A575955C}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.NativeLibrary.WinRT", "samples\ComputeSharp.NativeLibrary.WinRT\ComputeSharp.NativeLibrary.WinRT.csproj", "{551EF4FB-F34F-412A-B3E6-E345797560ED}"
-EndProject
-Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.UI", "src\ComputeSharp.UI\ComputeSharp.UI.shproj", "{1CD1D9C5-7E00-43FB-A8C3-CFE98A885D3B}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Uwp", "src\ComputeSharp.Uwp\ComputeSharp.Uwp.csproj", "{2C4C1A6B-7E38-41EC-84D9-007676571441}"
-EndProject
-Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.D2D1.UI", "src\ComputeSharp.D2D1.UI\ComputeSharp.D2D1.UI.shproj", "{A2A2171B-0BAF-4A2A-BFB3-3357EF714BF0}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.D2D1.Uwp", "src\ComputeSharp.D2D1.Uwp\ComputeSharp.D2D1.Uwp.csproj", "{716DF19E-69BA-4A9C-9CA4-BFD196152F46}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.SwapChain.D2D1.Uwp", "samples\ComputeSharp.SwapChain.D2D1.Uwp\ComputeSharp.SwapChain.D2D1.Uwp.csproj", "{9FBE070E-A210-4CEF-9F04-61C2B269C600}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComputeSharp.D2D1.WinUI.SourceGenerators", "src\ComputeSharp.D2D1.WinUI.SourceGenerators\ComputeSharp.D2D1.WinUI.SourceGenerators.csproj", "{FEBEC83A-FE70-4D4B-9B00-76DB31E75F17}"
-EndProject
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.D2D1.WinUI.Tests.SourceGenerators", "tests\ComputeSharp.D2D1.WinUI.Tests.SourceGenerators\ComputeSharp.D2D1.WinUI.Tests.SourceGenerators.csproj", "{916331A5-1EA6-41D7-B199-2E50C513EFDE}"
-EndProject
-Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.D2D1.UI.SourceGenerators", "src\ComputeSharp.D2D1.UI.SourceGenerators\ComputeSharp.D2D1.UI.SourceGenerators.shproj", "{D20E610F-EB37-46E7-B028-04784D7400D5}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComputeSharp.D2D1.Uwp.SourceGenerators", "src\ComputeSharp.D2D1.Uwp.SourceGenerators\ComputeSharp.D2D1.Uwp.SourceGenerators.csproj", "{690C4014-A06B-44DB-B717-AEA4CAFA9D68}"
-EndProject
-Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.D2D1.UI.CodeFixers", "src\ComputeSharp.D2D1.UI.CodeFixers\ComputeSharp.D2D1.UI.CodeFixers.shproj", "{CE85DC5A-E455-42FE-9B64-0D5F0D7EE366}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComputeSharp.D2D1.WinUI.CodeFixers", "src\ComputeSharp.D2D1.WinUI.CodeFixers\ComputeSharp.D2D1.WinUI.CodeFixers.csproj", "{9D3C872E-D64E-47E7-BDC8-077A151DBB7D}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComputeSharp.D2D1.Uwp.CodeFixers", "src\ComputeSharp.D2D1.Uwp.CodeFixers\ComputeSharp.D2D1.Uwp.CodeFixers.csproj", "{8BE73DB3-16E0-41F4-A87F-0C2AB43856A2}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComputeSharp.SwapChain.Uwp", "samples\ComputeSharp.SwapChain.Uwp\ComputeSharp.SwapChain.Uwp.csproj", "{6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}"
-EndProject
-Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.SwapChain.UI", "samples\ComputeSharp.SwapChain.UI\ComputeSharp.SwapChain.UI.shproj", "{6BC471C6-72F9-43CF-AE1E-F6D3E5ED3129}"
-EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x64 = Debug|x64
@@ -213,22 +111,6 @@ Global
{314EB353-E7E3-4146-8111-685CC83EC1DE}.Release|ARM64.Build.0 = Release|Any CPU
{314EB353-E7E3-4146-8111-685CC83EC1DE}.Release|x64.ActiveCfg = Release|Any CPU
{314EB353-E7E3-4146-8111-685CC83EC1DE}.Release|x64.Build.0 = Release|Any CPU
- {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Debug|ARM64.ActiveCfg = Debug|Any CPU
- {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Debug|ARM64.Build.0 = Debug|Any CPU
- {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Debug|x64.ActiveCfg = Debug|Any CPU
- {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Debug|x64.Build.0 = Debug|Any CPU
- {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Release|ARM64.ActiveCfg = Release|Any CPU
- {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Release|ARM64.Build.0 = Release|Any CPU
- {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Release|x64.ActiveCfg = Release|Any CPU
- {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Release|x64.Build.0 = Release|Any CPU
- {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Debug|ARM64.ActiveCfg = Debug|Any CPU
- {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Debug|ARM64.Build.0 = Debug|Any CPU
- {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Debug|x64.ActiveCfg = Debug|Any CPU
- {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Debug|x64.Build.0 = Debug|Any CPU
- {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Release|ARM64.ActiveCfg = Release|Any CPU
- {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Release|ARM64.Build.0 = Release|Any CPU
- {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Release|x64.ActiveCfg = Release|Any CPU
- {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Release|x64.Build.0 = Release|Any CPU
{E91F4D24-922A-4921-A8D7-9C45A143C45D}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{E91F4D24-922A-4921-A8D7-9C45A143C45D}.Debug|ARM64.Build.0 = Debug|Any CPU
{E91F4D24-922A-4921-A8D7-9C45A143C45D}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -253,90 +135,6 @@ Global
{EB52CB67-4162-4722-874B-44EA8DA5450E}.Release|ARM64.Build.0 = Release|Any CPU
{EB52CB67-4162-4722-874B-44EA8DA5450E}.Release|x64.ActiveCfg = Release|Any CPU
{EB52CB67-4162-4722-874B-44EA8DA5450E}.Release|x64.Build.0 = Release|Any CPU
- {7048DEEA-0A6F-46A0-B951-B682A8F1CB75}.Debug|ARM64.ActiveCfg = Debug|Any CPU
- {7048DEEA-0A6F-46A0-B951-B682A8F1CB75}.Debug|ARM64.Build.0 = Debug|Any CPU
- {7048DEEA-0A6F-46A0-B951-B682A8F1CB75}.Debug|x64.ActiveCfg = Debug|Any CPU
- {7048DEEA-0A6F-46A0-B951-B682A8F1CB75}.Debug|x64.Build.0 = Debug|Any CPU
- {7048DEEA-0A6F-46A0-B951-B682A8F1CB75}.Release|ARM64.ActiveCfg = Release|Any CPU
- {7048DEEA-0A6F-46A0-B951-B682A8F1CB75}.Release|ARM64.Build.0 = Release|Any CPU
- {7048DEEA-0A6F-46A0-B951-B682A8F1CB75}.Release|x64.ActiveCfg = Release|Any CPU
- {7048DEEA-0A6F-46A0-B951-B682A8F1CB75}.Release|x64.Build.0 = Release|Any CPU
- {BBBD0ADD-F2F9-49A3-BD5E-D223F0735D8B}.Debug|ARM64.ActiveCfg = Debug|Any CPU
- {BBBD0ADD-F2F9-49A3-BD5E-D223F0735D8B}.Debug|ARM64.Build.0 = Debug|Any CPU
- {BBBD0ADD-F2F9-49A3-BD5E-D223F0735D8B}.Debug|x64.ActiveCfg = Debug|Any CPU
- {BBBD0ADD-F2F9-49A3-BD5E-D223F0735D8B}.Debug|x64.Build.0 = Debug|Any CPU
- {BBBD0ADD-F2F9-49A3-BD5E-D223F0735D8B}.Release|ARM64.ActiveCfg = Release|Any CPU
- {BBBD0ADD-F2F9-49A3-BD5E-D223F0735D8B}.Release|ARM64.Build.0 = Release|Any CPU
- {BBBD0ADD-F2F9-49A3-BD5E-D223F0735D8B}.Release|x64.ActiveCfg = Release|Any CPU
- {BBBD0ADD-F2F9-49A3-BD5E-D223F0735D8B}.Release|x64.Build.0 = Release|Any CPU
- {BF52326F-E415-49E6-8595-62762216762B}.Debug|ARM64.ActiveCfg = Debug|Any CPU
- {BF52326F-E415-49E6-8595-62762216762B}.Debug|ARM64.Build.0 = Debug|Any CPU
- {BF52326F-E415-49E6-8595-62762216762B}.Debug|x64.ActiveCfg = Debug|Any CPU
- {BF52326F-E415-49E6-8595-62762216762B}.Debug|x64.Build.0 = Debug|Any CPU
- {BF52326F-E415-49E6-8595-62762216762B}.Release|ARM64.ActiveCfg = Release|Any CPU
- {BF52326F-E415-49E6-8595-62762216762B}.Release|ARM64.Build.0 = Release|Any CPU
- {BF52326F-E415-49E6-8595-62762216762B}.Release|x64.ActiveCfg = Release|Any CPU
- {BF52326F-E415-49E6-8595-62762216762B}.Release|x64.Build.0 = Release|Any CPU
- {E7C9247D-016B-4819-AF9F-0E9B3591E04B}.Debug|ARM64.ActiveCfg = Debug|ARM64
- {E7C9247D-016B-4819-AF9F-0E9B3591E04B}.Debug|ARM64.Build.0 = Debug|ARM64
- {E7C9247D-016B-4819-AF9F-0E9B3591E04B}.Debug|x64.ActiveCfg = Debug|x64
- {E7C9247D-016B-4819-AF9F-0E9B3591E04B}.Debug|x64.Build.0 = Debug|x64
- {E7C9247D-016B-4819-AF9F-0E9B3591E04B}.Release|ARM64.ActiveCfg = Release|ARM64
- {E7C9247D-016B-4819-AF9F-0E9B3591E04B}.Release|ARM64.Build.0 = Release|ARM64
- {E7C9247D-016B-4819-AF9F-0E9B3591E04B}.Release|x64.ActiveCfg = Release|x64
- {E7C9247D-016B-4819-AF9F-0E9B3591E04B}.Release|x64.Build.0 = Release|x64
- {C12D7ACE-98ED-4813-8118-6667C34F484F}.Debug|ARM64.ActiveCfg = Debug|ARM64
- {C12D7ACE-98ED-4813-8118-6667C34F484F}.Debug|ARM64.Build.0 = Debug|ARM64
- {C12D7ACE-98ED-4813-8118-6667C34F484F}.Debug|x64.ActiveCfg = Debug|x64
- {C12D7ACE-98ED-4813-8118-6667C34F484F}.Debug|x64.Build.0 = Debug|x64
- {C12D7ACE-98ED-4813-8118-6667C34F484F}.Release|ARM64.ActiveCfg = Release|ARM64
- {C12D7ACE-98ED-4813-8118-6667C34F484F}.Release|ARM64.Build.0 = Release|ARM64
- {C12D7ACE-98ED-4813-8118-6667C34F484F}.Release|x64.ActiveCfg = Release|x64
- {C12D7ACE-98ED-4813-8118-6667C34F484F}.Release|x64.Build.0 = Release|x64
- {7C625EC4-F599-4350-A915-F046DF2406D3}.Debug|ARM64.ActiveCfg = Debug|Any CPU
- {7C625EC4-F599-4350-A915-F046DF2406D3}.Debug|ARM64.Build.0 = Debug|Any CPU
- {7C625EC4-F599-4350-A915-F046DF2406D3}.Debug|x64.ActiveCfg = Debug|Any CPU
- {7C625EC4-F599-4350-A915-F046DF2406D3}.Debug|x64.Build.0 = Debug|Any CPU
- {7C625EC4-F599-4350-A915-F046DF2406D3}.Release|ARM64.ActiveCfg = Release|Any CPU
- {7C625EC4-F599-4350-A915-F046DF2406D3}.Release|ARM64.Build.0 = Release|Any CPU
- {7C625EC4-F599-4350-A915-F046DF2406D3}.Release|x64.ActiveCfg = Release|Any CPU
- {7C625EC4-F599-4350-A915-F046DF2406D3}.Release|x64.Build.0 = Release|Any CPU
- {1F37A704-3CDF-45BB-8114-ED9137E5F2CF}.Debug|ARM64.ActiveCfg = Debug|Any CPU
- {1F37A704-3CDF-45BB-8114-ED9137E5F2CF}.Debug|ARM64.Build.0 = Debug|Any CPU
- {1F37A704-3CDF-45BB-8114-ED9137E5F2CF}.Debug|x64.ActiveCfg = Debug|Any CPU
- {1F37A704-3CDF-45BB-8114-ED9137E5F2CF}.Debug|x64.Build.0 = Debug|Any CPU
- {1F37A704-3CDF-45BB-8114-ED9137E5F2CF}.Release|ARM64.ActiveCfg = Release|Any CPU
- {1F37A704-3CDF-45BB-8114-ED9137E5F2CF}.Release|ARM64.Build.0 = Release|Any CPU
- {1F37A704-3CDF-45BB-8114-ED9137E5F2CF}.Release|x64.ActiveCfg = Release|Any CPU
- {1F37A704-3CDF-45BB-8114-ED9137E5F2CF}.Release|x64.Build.0 = Release|Any CPU
- {FA18BA9F-76BF-4DE0-8D24-02FC7657E6CB}.Debug|ARM64.ActiveCfg = Debug|ARM64
- {FA18BA9F-76BF-4DE0-8D24-02FC7657E6CB}.Debug|ARM64.Build.0 = Debug|ARM64
- {FA18BA9F-76BF-4DE0-8D24-02FC7657E6CB}.Debug|x64.ActiveCfg = Debug|x64
- {FA18BA9F-76BF-4DE0-8D24-02FC7657E6CB}.Debug|x64.Build.0 = Debug|x64
- {FA18BA9F-76BF-4DE0-8D24-02FC7657E6CB}.Release|ARM64.ActiveCfg = Release|ARM64
- {FA18BA9F-76BF-4DE0-8D24-02FC7657E6CB}.Release|ARM64.Build.0 = Release|ARM64
- {FA18BA9F-76BF-4DE0-8D24-02FC7657E6CB}.Release|x64.ActiveCfg = Release|x64
- {FA18BA9F-76BF-4DE0-8D24-02FC7657E6CB}.Release|x64.Build.0 = Release|x64
- {0071701E-B9C5-4098-BE5F-EF556C4553C6}.Debug|ARM64.ActiveCfg = Debug|ARM64
- {0071701E-B9C5-4098-BE5F-EF556C4553C6}.Debug|ARM64.Build.0 = Debug|ARM64
- {0071701E-B9C5-4098-BE5F-EF556C4553C6}.Debug|ARM64.Deploy.0 = Debug|ARM64
- {0071701E-B9C5-4098-BE5F-EF556C4553C6}.Debug|x64.ActiveCfg = Debug|x64
- {0071701E-B9C5-4098-BE5F-EF556C4553C6}.Debug|x64.Build.0 = Debug|x64
- {0071701E-B9C5-4098-BE5F-EF556C4553C6}.Debug|x64.Deploy.0 = Debug|x64
- {0071701E-B9C5-4098-BE5F-EF556C4553C6}.Release|ARM64.ActiveCfg = Release|ARM64
- {0071701E-B9C5-4098-BE5F-EF556C4553C6}.Release|ARM64.Build.0 = Release|ARM64
- {0071701E-B9C5-4098-BE5F-EF556C4553C6}.Release|ARM64.Deploy.0 = Release|ARM64
- {0071701E-B9C5-4098-BE5F-EF556C4553C6}.Release|x64.ActiveCfg = Release|x64
- {0071701E-B9C5-4098-BE5F-EF556C4553C6}.Release|x64.Build.0 = Release|x64
- {0071701E-B9C5-4098-BE5F-EF556C4553C6}.Release|x64.Deploy.0 = Release|x64
- {4A8FCE22-851C-442A-8BC9-3EC3FD00B637}.Debug|ARM64.ActiveCfg = Debug|Any CPU
- {4A8FCE22-851C-442A-8BC9-3EC3FD00B637}.Debug|ARM64.Build.0 = Debug|Any CPU
- {4A8FCE22-851C-442A-8BC9-3EC3FD00B637}.Debug|x64.ActiveCfg = Debug|Any CPU
- {4A8FCE22-851C-442A-8BC9-3EC3FD00B637}.Debug|x64.Build.0 = Debug|Any CPU
- {4A8FCE22-851C-442A-8BC9-3EC3FD00B637}.Release|ARM64.ActiveCfg = Release|Any CPU
- {4A8FCE22-851C-442A-8BC9-3EC3FD00B637}.Release|ARM64.Build.0 = Release|Any CPU
- {4A8FCE22-851C-442A-8BC9-3EC3FD00B637}.Release|x64.ActiveCfg = Release|Any CPU
- {4A8FCE22-851C-442A-8BC9-3EC3FD00B637}.Release|x64.Build.0 = Release|Any CPU
{76C66257-FDAA-47AB-85E7-EF757EAB10C0}.Debug|ARM64.ActiveCfg = Debug|ARM64
{76C66257-FDAA-47AB-85E7-EF757EAB10C0}.Debug|ARM64.Build.0 = Debug|ARM64
{76C66257-FDAA-47AB-85E7-EF757EAB10C0}.Debug|x64.ActiveCfg = Debug|x64
@@ -345,14 +143,6 @@ Global
{76C66257-FDAA-47AB-85E7-EF757EAB10C0}.Release|ARM64.Build.0 = Release|ARM64
{76C66257-FDAA-47AB-85E7-EF757EAB10C0}.Release|x64.ActiveCfg = Release|x64
{76C66257-FDAA-47AB-85E7-EF757EAB10C0}.Release|x64.Build.0 = Release|x64
- {4D7D9BA8-A821-4B1C-9EE2-CBCF5849906E}.Debug|ARM64.ActiveCfg = Debug|Any CPU
- {4D7D9BA8-A821-4B1C-9EE2-CBCF5849906E}.Debug|ARM64.Build.0 = Debug|Any CPU
- {4D7D9BA8-A821-4B1C-9EE2-CBCF5849906E}.Debug|x64.ActiveCfg = Debug|Any CPU
- {4D7D9BA8-A821-4B1C-9EE2-CBCF5849906E}.Debug|x64.Build.0 = Debug|Any CPU
- {4D7D9BA8-A821-4B1C-9EE2-CBCF5849906E}.Release|ARM64.ActiveCfg = Release|Any CPU
- {4D7D9BA8-A821-4B1C-9EE2-CBCF5849906E}.Release|ARM64.Build.0 = Release|Any CPU
- {4D7D9BA8-A821-4B1C-9EE2-CBCF5849906E}.Release|x64.ActiveCfg = Release|Any CPU
- {4D7D9BA8-A821-4B1C-9EE2-CBCF5849906E}.Release|x64.Build.0 = Release|Any CPU
{764BC0F5-0C5E-49AD-ABAA-E3874C0F3286}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{764BC0F5-0C5E-49AD-ABAA-E3874C0F3286}.Debug|ARM64.Build.0 = Debug|Any CPU
{764BC0F5-0C5E-49AD-ABAA-E3874C0F3286}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -369,82 +159,6 @@ Global
{BFB003D1-788B-48DE-8065-39479C162CB0}.Release|ARM64.Build.0 = Release|Any CPU
{BFB003D1-788B-48DE-8065-39479C162CB0}.Release|x64.ActiveCfg = Release|Any CPU
{BFB003D1-788B-48DE-8065-39479C162CB0}.Release|x64.Build.0 = Release|Any CPU
- {E44053BD-A761-47FB-AA78-087A599672EA}.Debug|ARM64.ActiveCfg = Debug|Any CPU
- {E44053BD-A761-47FB-AA78-087A599672EA}.Debug|ARM64.Build.0 = Debug|Any CPU
- {E44053BD-A761-47FB-AA78-087A599672EA}.Debug|x64.ActiveCfg = Debug|Any CPU
- {E44053BD-A761-47FB-AA78-087A599672EA}.Debug|x64.Build.0 = Debug|Any CPU
- {E44053BD-A761-47FB-AA78-087A599672EA}.Release|ARM64.ActiveCfg = Release|Any CPU
- {E44053BD-A761-47FB-AA78-087A599672EA}.Release|ARM64.Build.0 = Release|Any CPU
- {E44053BD-A761-47FB-AA78-087A599672EA}.Release|x64.ActiveCfg = Release|Any CPU
- {E44053BD-A761-47FB-AA78-087A599672EA}.Release|x64.Build.0 = Release|Any CPU
- {209C95A3-FA53-431B-B688-3299CA6C29D2}.Debug|ARM64.ActiveCfg = Debug|Any CPU
- {209C95A3-FA53-431B-B688-3299CA6C29D2}.Debug|ARM64.Build.0 = Debug|Any CPU
- {209C95A3-FA53-431B-B688-3299CA6C29D2}.Debug|x64.ActiveCfg = Debug|Any CPU
- {209C95A3-FA53-431B-B688-3299CA6C29D2}.Debug|x64.Build.0 = Debug|Any CPU
- {209C95A3-FA53-431B-B688-3299CA6C29D2}.Release|ARM64.ActiveCfg = Release|Any CPU
- {209C95A3-FA53-431B-B688-3299CA6C29D2}.Release|ARM64.Build.0 = Release|Any CPU
- {209C95A3-FA53-431B-B688-3299CA6C29D2}.Release|x64.ActiveCfg = Release|Any CPU
- {209C95A3-FA53-431B-B688-3299CA6C29D2}.Release|x64.Build.0 = Release|Any CPU
- {94178D51-0097-4AD2-B3D0-827E40D62F2E}.Debug|ARM64.ActiveCfg = Debug|Any CPU
- {94178D51-0097-4AD2-B3D0-827E40D62F2E}.Debug|ARM64.Build.0 = Debug|Any CPU
- {94178D51-0097-4AD2-B3D0-827E40D62F2E}.Debug|x64.ActiveCfg = Debug|Any CPU
- {94178D51-0097-4AD2-B3D0-827E40D62F2E}.Debug|x64.Build.0 = Debug|Any CPU
- {94178D51-0097-4AD2-B3D0-827E40D62F2E}.Release|ARM64.ActiveCfg = Release|Any CPU
- {94178D51-0097-4AD2-B3D0-827E40D62F2E}.Release|ARM64.Build.0 = Release|Any CPU
- {94178D51-0097-4AD2-B3D0-827E40D62F2E}.Release|x64.ActiveCfg = Release|Any CPU
- {94178D51-0097-4AD2-B3D0-827E40D62F2E}.Release|x64.Build.0 = Release|Any CPU
- {14EF12A3-90E6-4683-BD71-9896AF87026B}.Debug|ARM64.ActiveCfg = Debug|Any CPU
- {14EF12A3-90E6-4683-BD71-9896AF87026B}.Debug|ARM64.Build.0 = Debug|Any CPU
- {14EF12A3-90E6-4683-BD71-9896AF87026B}.Debug|x64.ActiveCfg = Debug|Any CPU
- {14EF12A3-90E6-4683-BD71-9896AF87026B}.Debug|x64.Build.0 = Debug|Any CPU
- {14EF12A3-90E6-4683-BD71-9896AF87026B}.Release|ARM64.ActiveCfg = Release|Any CPU
- {14EF12A3-90E6-4683-BD71-9896AF87026B}.Release|ARM64.Build.0 = Release|Any CPU
- {14EF12A3-90E6-4683-BD71-9896AF87026B}.Release|x64.ActiveCfg = Release|Any CPU
- {14EF12A3-90E6-4683-BD71-9896AF87026B}.Release|x64.Build.0 = Release|Any CPU
- {5DE90C85-ED26-4B5A-A0D7-2FF966A210AC}.Debug|ARM64.ActiveCfg = Debug|Any CPU
- {5DE90C85-ED26-4B5A-A0D7-2FF966A210AC}.Debug|ARM64.Build.0 = Debug|Any CPU
- {5DE90C85-ED26-4B5A-A0D7-2FF966A210AC}.Debug|x64.ActiveCfg = Debug|Any CPU
- {5DE90C85-ED26-4B5A-A0D7-2FF966A210AC}.Debug|x64.Build.0 = Debug|Any CPU
- {5DE90C85-ED26-4B5A-A0D7-2FF966A210AC}.Release|ARM64.ActiveCfg = Release|Any CPU
- {5DE90C85-ED26-4B5A-A0D7-2FF966A210AC}.Release|ARM64.Build.0 = Release|Any CPU
- {5DE90C85-ED26-4B5A-A0D7-2FF966A210AC}.Release|x64.ActiveCfg = Release|Any CPU
- {5DE90C85-ED26-4B5A-A0D7-2FF966A210AC}.Release|x64.Build.0 = Release|Any CPU
- {669A414F-3B46-4B55-B587-061AF63C3067}.Debug|ARM64.ActiveCfg = Debug|Any CPU
- {669A414F-3B46-4B55-B587-061AF63C3067}.Debug|ARM64.Build.0 = Debug|Any CPU
- {669A414F-3B46-4B55-B587-061AF63C3067}.Debug|x64.ActiveCfg = Debug|Any CPU
- {669A414F-3B46-4B55-B587-061AF63C3067}.Debug|x64.Build.0 = Debug|Any CPU
- {669A414F-3B46-4B55-B587-061AF63C3067}.Release|ARM64.ActiveCfg = Release|Any CPU
- {669A414F-3B46-4B55-B587-061AF63C3067}.Release|ARM64.Build.0 = Release|Any CPU
- {669A414F-3B46-4B55-B587-061AF63C3067}.Release|x64.ActiveCfg = Release|Any CPU
- {669A414F-3B46-4B55-B587-061AF63C3067}.Release|x64.Build.0 = Release|Any CPU
- {BD9E6556-357E-4C20-BFCD-FB131F9372FA}.Debug|ARM64.ActiveCfg = Debug|ARM64
- {BD9E6556-357E-4C20-BFCD-FB131F9372FA}.Debug|ARM64.Build.0 = Debug|ARM64
- {BD9E6556-357E-4C20-BFCD-FB131F9372FA}.Debug|x64.ActiveCfg = Debug|x64
- {BD9E6556-357E-4C20-BFCD-FB131F9372FA}.Debug|x64.Build.0 = Debug|x64
- {BD9E6556-357E-4C20-BFCD-FB131F9372FA}.Release|ARM64.ActiveCfg = Release|ARM64
- {BD9E6556-357E-4C20-BFCD-FB131F9372FA}.Release|ARM64.Build.0 = Release|ARM64
- {BD9E6556-357E-4C20-BFCD-FB131F9372FA}.Release|x64.ActiveCfg = Release|x64
- {BD9E6556-357E-4C20-BFCD-FB131F9372FA}.Release|x64.Build.0 = Release|x64
- {9EA5AE9D-C39A-4F43-B03E-0A848EA2558A}.Debug|ARM64.ActiveCfg = Debug|ARM64
- {9EA5AE9D-C39A-4F43-B03E-0A848EA2558A}.Debug|ARM64.Build.0 = Debug|ARM64
- {9EA5AE9D-C39A-4F43-B03E-0A848EA2558A}.Debug|x64.ActiveCfg = Debug|x64
- {9EA5AE9D-C39A-4F43-B03E-0A848EA2558A}.Debug|x64.Build.0 = Debug|x64
- {9EA5AE9D-C39A-4F43-B03E-0A848EA2558A}.Release|ARM64.ActiveCfg = Release|ARM64
- {9EA5AE9D-C39A-4F43-B03E-0A848EA2558A}.Release|ARM64.Build.0 = Release|ARM64
- {9EA5AE9D-C39A-4F43-B03E-0A848EA2558A}.Release|x64.ActiveCfg = Release|x64
- {9EA5AE9D-C39A-4F43-B03E-0A848EA2558A}.Release|x64.Build.0 = Release|x64
- {73C32D0F-64DB-4674-84E9-8FCC41228474}.Debug|ARM64.ActiveCfg = Debug|ARM64
- {73C32D0F-64DB-4674-84E9-8FCC41228474}.Debug|ARM64.Build.0 = Debug|ARM64
- {73C32D0F-64DB-4674-84E9-8FCC41228474}.Debug|ARM64.Deploy.0 = Debug|ARM64
- {73C32D0F-64DB-4674-84E9-8FCC41228474}.Debug|x64.ActiveCfg = Debug|x64
- {73C32D0F-64DB-4674-84E9-8FCC41228474}.Debug|x64.Build.0 = Debug|x64
- {73C32D0F-64DB-4674-84E9-8FCC41228474}.Debug|x64.Deploy.0 = Debug|x64
- {73C32D0F-64DB-4674-84E9-8FCC41228474}.Release|ARM64.ActiveCfg = Release|ARM64
- {73C32D0F-64DB-4674-84E9-8FCC41228474}.Release|ARM64.Build.0 = Release|ARM64
- {73C32D0F-64DB-4674-84E9-8FCC41228474}.Release|ARM64.Deploy.0 = Release|ARM64
- {73C32D0F-64DB-4674-84E9-8FCC41228474}.Release|x64.ActiveCfg = Release|x64
- {73C32D0F-64DB-4674-84E9-8FCC41228474}.Release|x64.Build.0 = Release|x64
- {73C32D0F-64DB-4674-84E9-8FCC41228474}.Release|x64.Deploy.0 = Release|x64
{E017B3B6-C7D3-4E53-A7F6-1036178E98C3}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{E017B3B6-C7D3-4E53-A7F6-1036178E98C3}.Debug|ARM64.Build.0 = Debug|Any CPU
{E017B3B6-C7D3-4E53-A7F6-1036178E98C3}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -453,22 +167,6 @@ Global
{E017B3B6-C7D3-4E53-A7F6-1036178E98C3}.Release|ARM64.Build.0 = Release|Any CPU
{E017B3B6-C7D3-4E53-A7F6-1036178E98C3}.Release|x64.ActiveCfg = Release|Any CPU
{E017B3B6-C7D3-4E53-A7F6-1036178E98C3}.Release|x64.Build.0 = Release|Any CPU
- {54654960-54B5-4E19-B3ED-993591CA39E5}.Debug|ARM64.ActiveCfg = Debug|Any CPU
- {54654960-54B5-4E19-B3ED-993591CA39E5}.Debug|ARM64.Build.0 = Debug|Any CPU
- {54654960-54B5-4E19-B3ED-993591CA39E5}.Debug|x64.ActiveCfg = Debug|Any CPU
- {54654960-54B5-4E19-B3ED-993591CA39E5}.Debug|x64.Build.0 = Debug|Any CPU
- {54654960-54B5-4E19-B3ED-993591CA39E5}.Release|ARM64.ActiveCfg = Release|Any CPU
- {54654960-54B5-4E19-B3ED-993591CA39E5}.Release|ARM64.Build.0 = Release|Any CPU
- {54654960-54B5-4E19-B3ED-993591CA39E5}.Release|x64.ActiveCfg = Release|Any CPU
- {54654960-54B5-4E19-B3ED-993591CA39E5}.Release|x64.Build.0 = Release|Any CPU
- {59A17380-24A0-4BD7-9012-B105A9E7D46F}.Debug|ARM64.ActiveCfg = Debug|Any CPU
- {59A17380-24A0-4BD7-9012-B105A9E7D46F}.Debug|ARM64.Build.0 = Debug|Any CPU
- {59A17380-24A0-4BD7-9012-B105A9E7D46F}.Debug|x64.ActiveCfg = Debug|Any CPU
- {59A17380-24A0-4BD7-9012-B105A9E7D46F}.Debug|x64.Build.0 = Debug|Any CPU
- {59A17380-24A0-4BD7-9012-B105A9E7D46F}.Release|ARM64.ActiveCfg = Release|Any CPU
- {59A17380-24A0-4BD7-9012-B105A9E7D46F}.Release|ARM64.Build.0 = Release|Any CPU
- {59A17380-24A0-4BD7-9012-B105A9E7D46F}.Release|x64.ActiveCfg = Release|Any CPU
- {59A17380-24A0-4BD7-9012-B105A9E7D46F}.Release|x64.Build.0 = Release|Any CPU
{9B4448B1-200F-4966-8A13-A508691B3003}.Debug|ARM64.ActiveCfg = Debug|Any CPU
{9B4448B1-200F-4966-8A13-A508691B3003}.Debug|ARM64.Build.0 = Debug|Any CPU
{9B4448B1-200F-4966-8A13-A508691B3003}.Debug|x64.ActiveCfg = Debug|Any CPU
@@ -477,145 +175,20 @@ Global
{9B4448B1-200F-4966-8A13-A508691B3003}.Release|ARM64.Build.0 = Release|Any CPU
{9B4448B1-200F-4966-8A13-A508691B3003}.Release|x64.ActiveCfg = Release|Any CPU
{9B4448B1-200F-4966-8A13-A508691B3003}.Release|x64.Build.0 = Release|Any CPU
- {1A3E20B3-F711-41C0-82EA-3B53A575955C}.Debug|ARM64.ActiveCfg = Debug|Any CPU
- {1A3E20B3-F711-41C0-82EA-3B53A575955C}.Debug|ARM64.Build.0 = Debug|Any CPU
- {1A3E20B3-F711-41C0-82EA-3B53A575955C}.Debug|x64.ActiveCfg = Debug|Any CPU
- {1A3E20B3-F711-41C0-82EA-3B53A575955C}.Debug|x64.Build.0 = Debug|Any CPU
- {1A3E20B3-F711-41C0-82EA-3B53A575955C}.Release|ARM64.ActiveCfg = Release|Any CPU
- {1A3E20B3-F711-41C0-82EA-3B53A575955C}.Release|ARM64.Build.0 = Release|Any CPU
- {1A3E20B3-F711-41C0-82EA-3B53A575955C}.Release|x64.ActiveCfg = Release|Any CPU
- {1A3E20B3-F711-41C0-82EA-3B53A575955C}.Release|x64.Build.0 = Release|Any CPU
- {551EF4FB-F34F-412A-B3E6-E345797560ED}.Debug|ARM64.ActiveCfg = Debug|ARM64
- {551EF4FB-F34F-412A-B3E6-E345797560ED}.Debug|ARM64.Build.0 = Debug|ARM64
- {551EF4FB-F34F-412A-B3E6-E345797560ED}.Debug|x64.ActiveCfg = Debug|x64
- {551EF4FB-F34F-412A-B3E6-E345797560ED}.Debug|x64.Build.0 = Debug|x64
- {551EF4FB-F34F-412A-B3E6-E345797560ED}.Release|ARM64.ActiveCfg = Release|ARM64
- {551EF4FB-F34F-412A-B3E6-E345797560ED}.Release|ARM64.Build.0 = Release|ARM64
- {551EF4FB-F34F-412A-B3E6-E345797560ED}.Release|x64.ActiveCfg = Release|x64
- {551EF4FB-F34F-412A-B3E6-E345797560ED}.Release|x64.Build.0 = Release|x64
- {2C4C1A6B-7E38-41EC-84D9-007676571441}.Debug|ARM64.ActiveCfg = Debug|ARM64
- {2C4C1A6B-7E38-41EC-84D9-007676571441}.Debug|ARM64.Build.0 = Debug|ARM64
- {2C4C1A6B-7E38-41EC-84D9-007676571441}.Debug|x64.ActiveCfg = Debug|x64
- {2C4C1A6B-7E38-41EC-84D9-007676571441}.Debug|x64.Build.0 = Debug|x64
- {2C4C1A6B-7E38-41EC-84D9-007676571441}.Release|ARM64.ActiveCfg = Release|ARM64
- {2C4C1A6B-7E38-41EC-84D9-007676571441}.Release|ARM64.Build.0 = Release|ARM64
- {2C4C1A6B-7E38-41EC-84D9-007676571441}.Release|x64.ActiveCfg = Release|x64
- {2C4C1A6B-7E38-41EC-84D9-007676571441}.Release|x64.Build.0 = Release|x64
- {716DF19E-69BA-4A9C-9CA4-BFD196152F46}.Debug|ARM64.ActiveCfg = Debug|ARM64
- {716DF19E-69BA-4A9C-9CA4-BFD196152F46}.Debug|ARM64.Build.0 = Debug|ARM64
- {716DF19E-69BA-4A9C-9CA4-BFD196152F46}.Debug|x64.ActiveCfg = Debug|x64
- {716DF19E-69BA-4A9C-9CA4-BFD196152F46}.Debug|x64.Build.0 = Debug|x64
- {716DF19E-69BA-4A9C-9CA4-BFD196152F46}.Release|ARM64.ActiveCfg = Release|ARM64
- {716DF19E-69BA-4A9C-9CA4-BFD196152F46}.Release|ARM64.Build.0 = Release|ARM64
- {716DF19E-69BA-4A9C-9CA4-BFD196152F46}.Release|x64.ActiveCfg = Release|x64
- {716DF19E-69BA-4A9C-9CA4-BFD196152F46}.Release|x64.Build.0 = Release|x64
- {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Debug|ARM64.ActiveCfg = Debug|ARM64
- {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Debug|ARM64.Build.0 = Debug|ARM64
- {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Debug|ARM64.Deploy.0 = Debug|ARM64
- {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Debug|x64.ActiveCfg = Debug|x64
- {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Debug|x64.Build.0 = Debug|x64
- {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Debug|x64.Deploy.0 = Debug|x64
- {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Release|ARM64.ActiveCfg = Release|ARM64
- {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Release|ARM64.Build.0 = Release|ARM64
- {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Release|ARM64.Deploy.0 = Release|ARM64
- {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Release|x64.ActiveCfg = Release|x64
- {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Release|x64.Build.0 = Release|x64
- {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Release|x64.Deploy.0 = Release|x64
- {FEBEC83A-FE70-4D4B-9B00-76DB31E75F17}.Debug|ARM64.ActiveCfg = Debug|Any CPU
- {FEBEC83A-FE70-4D4B-9B00-76DB31E75F17}.Debug|ARM64.Build.0 = Debug|Any CPU
- {FEBEC83A-FE70-4D4B-9B00-76DB31E75F17}.Debug|x64.ActiveCfg = Debug|Any CPU
- {FEBEC83A-FE70-4D4B-9B00-76DB31E75F17}.Debug|x64.Build.0 = Debug|Any CPU
- {FEBEC83A-FE70-4D4B-9B00-76DB31E75F17}.Release|ARM64.ActiveCfg = Release|Any CPU
- {FEBEC83A-FE70-4D4B-9B00-76DB31E75F17}.Release|ARM64.Build.0 = Release|Any CPU
- {FEBEC83A-FE70-4D4B-9B00-76DB31E75F17}.Release|x64.ActiveCfg = Release|Any CPU
- {FEBEC83A-FE70-4D4B-9B00-76DB31E75F17}.Release|x64.Build.0 = Release|Any CPU
- {916331A5-1EA6-41D7-B199-2E50C513EFDE}.Debug|ARM64.ActiveCfg = Debug|ARM64
- {916331A5-1EA6-41D7-B199-2E50C513EFDE}.Debug|ARM64.Build.0 = Debug|ARM64
- {916331A5-1EA6-41D7-B199-2E50C513EFDE}.Debug|x64.ActiveCfg = Debug|x64
- {916331A5-1EA6-41D7-B199-2E50C513EFDE}.Debug|x64.Build.0 = Debug|x64
- {916331A5-1EA6-41D7-B199-2E50C513EFDE}.Release|ARM64.ActiveCfg = Release|ARM64
- {916331A5-1EA6-41D7-B199-2E50C513EFDE}.Release|ARM64.Build.0 = Release|ARM64
- {916331A5-1EA6-41D7-B199-2E50C513EFDE}.Release|x64.ActiveCfg = Release|x64
- {916331A5-1EA6-41D7-B199-2E50C513EFDE}.Release|x64.Build.0 = Release|x64
- {690C4014-A06B-44DB-B717-AEA4CAFA9D68}.Debug|ARM64.ActiveCfg = Debug|Any CPU
- {690C4014-A06B-44DB-B717-AEA4CAFA9D68}.Debug|ARM64.Build.0 = Debug|Any CPU
- {690C4014-A06B-44DB-B717-AEA4CAFA9D68}.Debug|x64.ActiveCfg = Debug|Any CPU
- {690C4014-A06B-44DB-B717-AEA4CAFA9D68}.Debug|x64.Build.0 = Debug|Any CPU
- {690C4014-A06B-44DB-B717-AEA4CAFA9D68}.Release|ARM64.ActiveCfg = Release|Any CPU
- {690C4014-A06B-44DB-B717-AEA4CAFA9D68}.Release|ARM64.Build.0 = Release|Any CPU
- {690C4014-A06B-44DB-B717-AEA4CAFA9D68}.Release|x64.ActiveCfg = Release|Any CPU
- {690C4014-A06B-44DB-B717-AEA4CAFA9D68}.Release|x64.Build.0 = Release|Any CPU
- {9D3C872E-D64E-47E7-BDC8-077A151DBB7D}.Debug|ARM64.ActiveCfg = Debug|Any CPU
- {9D3C872E-D64E-47E7-BDC8-077A151DBB7D}.Debug|ARM64.Build.0 = Debug|Any CPU
- {9D3C872E-D64E-47E7-BDC8-077A151DBB7D}.Debug|x64.ActiveCfg = Debug|Any CPU
- {9D3C872E-D64E-47E7-BDC8-077A151DBB7D}.Debug|x64.Build.0 = Debug|Any CPU
- {9D3C872E-D64E-47E7-BDC8-077A151DBB7D}.Release|ARM64.ActiveCfg = Release|Any CPU
- {9D3C872E-D64E-47E7-BDC8-077A151DBB7D}.Release|ARM64.Build.0 = Release|Any CPU
- {9D3C872E-D64E-47E7-BDC8-077A151DBB7D}.Release|x64.ActiveCfg = Release|Any CPU
- {9D3C872E-D64E-47E7-BDC8-077A151DBB7D}.Release|x64.Build.0 = Release|Any CPU
- {8BE73DB3-16E0-41F4-A87F-0C2AB43856A2}.Debug|ARM64.ActiveCfg = Debug|Any CPU
- {8BE73DB3-16E0-41F4-A87F-0C2AB43856A2}.Debug|ARM64.Build.0 = Debug|Any CPU
- {8BE73DB3-16E0-41F4-A87F-0C2AB43856A2}.Debug|x64.ActiveCfg = Debug|Any CPU
- {8BE73DB3-16E0-41F4-A87F-0C2AB43856A2}.Debug|x64.Build.0 = Debug|Any CPU
- {8BE73DB3-16E0-41F4-A87F-0C2AB43856A2}.Release|ARM64.ActiveCfg = Release|Any CPU
- {8BE73DB3-16E0-41F4-A87F-0C2AB43856A2}.Release|ARM64.Build.0 = Release|Any CPU
- {8BE73DB3-16E0-41F4-A87F-0C2AB43856A2}.Release|x64.ActiveCfg = Release|Any CPU
- {8BE73DB3-16E0-41F4-A87F-0C2AB43856A2}.Release|x64.Build.0 = Release|Any CPU
- {6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Debug|ARM64.ActiveCfg = Debug|ARM64
- {6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Debug|ARM64.Build.0 = Debug|ARM64
- {6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Debug|ARM64.Deploy.0 = Debug|ARM64
- {6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Debug|x64.ActiveCfg = Debug|x64
- {6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Debug|x64.Build.0 = Debug|x64
- {6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Debug|x64.Deploy.0 = Debug|x64
- {6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Release|ARM64.ActiveCfg = Release|ARM64
- {6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Release|ARM64.Build.0 = Release|ARM64
- {6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Release|ARM64.Deploy.0 = Release|ARM64
- {6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Release|x64.ActiveCfg = Release|x64
- {6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Release|x64.Build.0 = Release|x64
- {6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Release|x64.Deploy.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
- {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1}
- {524CC5DD-1DEE-4A30-9515-AB90965E5207} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1}
{E91F4D24-922A-4921-A8D7-9C45A143C45D} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7}
{E889E6D6-A814-4950-AAC1-68F1ECFC5BD6} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7}
- {7048DEEA-0A6F-46A0-B951-B682A8F1CB75} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1}
- {BBBD0ADD-F2F9-49A3-BD5E-D223F0735D8B} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7}
- {BF52326F-E415-49E6-8595-62762216762B} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7}
- {E7C9247D-016B-4819-AF9F-0E9B3591E04B} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1}
- {C12D7ACE-98ED-4813-8118-6667C34F484F} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1}
- {7C625EC4-F599-4350-A915-F046DF2406D3} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1}
- {1F37A704-3CDF-45BB-8114-ED9137E5F2CF} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1}
{514FF00E-BBF0-4D55-A47C-EEEB6208ADCE} = {D991153C-A34D-4042-B76F-822ADB111DD0}
- {0071701E-B9C5-4098-BE5F-EF556C4553C6} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1}
{0800BD51-499D-44C2-9417-FD1F7FDFE9C4} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1}
- {4A8FCE22-851C-442A-8BC9-3EC3FD00B637} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7}
- {9DA1DA9F-F8B2-4B25-BE80-C21F773029E3} = {D991153C-A34D-4042-B76F-822ADB111DD0}
- {209C95A3-FA53-431B-B688-3299CA6C29D2} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7}
- {94178D51-0097-4AD2-B3D0-827E40D62F2E} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7}
- {CBA545B4-31EF-4E9F-A1A8-2A1290B54046} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7}
- {C0B903AA-F32C-4760-B4B6-199AC4FE1C5A} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7}
- {E3403F19-A0D8-4317-8A54-322C7A13F2A2} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7}
- {5DE90C85-ED26-4B5A-A0D7-2FF966A210AC} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7}
- {669A414F-3B46-4B55-B587-061AF63C3067} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7}
{B86A48A7-18BD-4946-B995-3CE26B092DDF} = {1A9C4108-F61A-4ABE-B5CF-F524521EAE2D}
- {F8BF7666-7CCF-4FE4-B055-2EBA4BCD4564} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1}
{568E7009-5C13-4153-9C94-0AC7A3E6883C} = {1A9C4108-F61A-4ABE-B5CF-F524521EAE2D}
{B54B6DCA-6EAB-46A8-83D3-15154659F47F} = {1A9C4108-F61A-4ABE-B5CF-F524521EAE2D}
- {9EA5AE9D-C39A-4F43-B03E-0A848EA2558A} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1}
- {73C32D0F-64DB-4674-84E9-8FCC41228474} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7}
- {59A17380-24A0-4BD7-9012-B105A9E7D46F} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7}
{79FD7862-4707-4DE0-8777-3872558E4C1C} = {A5013F9B-92EC-419F-B0B3-3D6B721E7104}
{B4F6A41C-AA9A-4302-92B3-AC64CF2E30F5} = {A5013F9B-92EC-419F-B0B3-3D6B721E7104}
- {1A3E20B3-F711-41C0-82EA-3B53A575955C} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1}
- {551EF4FB-F34F-412A-B3E6-E345797560ED} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1}
- {9FBE070E-A210-4CEF-9F04-61C2B269C600} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1}
- {916331A5-1EA6-41D7-B199-2E50C513EFDE} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7}
- {6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1}
- {6BC471C6-72F9-43CF-AE1E-F6D3E5ED3129} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4664C5E3-0340-4E22-BCFD-98AAEDF5F2DC}
diff --git a/samples/ComputeSharp.Benchmark/Blas/BlasBenchmark.cs b/samples/ComputeSharp.Benchmark/Blas/BlasBenchmark.cs
deleted file mode 100644
index 95ed9cbd..00000000
--- a/samples/ComputeSharp.Benchmark/Blas/BlasBenchmark.cs
+++ /dev/null
@@ -1,163 +0,0 @@
-using System;
-using System.Buffers;
-using BenchmarkDotNet.Attributes;
-using BenchmarkDotNet.Engines;
-
-#pragma warning disable CA1063
-
-namespace ComputeSharp.Benchmark.Blas;
-
-///
-/// A that benchmarks the APIs in the class, on both CPU and GPU.
-///
-[SimpleJob(RunStrategy.Monitoring)]
-public class BlasBenchmark : IDisposable
-{
- ///
- /// The number of samples.
- ///
- private const int C = 128;
-
- ///
- /// The nummber of rows in the matrix.
- ///
- private const int N = 512;
-
- ///
- /// The number of columns in the matrix (same as the number of rows in the matrix)
- ///
- private const int M = 512;
-
- ///
- /// The number of columns in the matrix.
- ///
- private const int P = 256;
-
- ///
- /// The input tensor.
- ///
- private float[]? x;
-
- ///
- /// The weights tensor.
- ///
- private float[]? w;
-
- ///
- /// The bias tensor.
- ///
- private float[]? b;
-
- ///
- /// The result tensor.
- ///
- private float[]? y;
-
- ///
- /// The input tensor (GPU).
- ///
- private ReadOnlyBuffer? bufferX;
-
- ///
- /// The weights tensor (GPU).
- ///
- private ReadOnlyBuffer? bufferW;
-
- ///
- /// The bias tensor (GPU).
- ///
- private ReadOnlyBuffer? bufferB;
-
- ///
- /// The result tensor (GPU).
- ///
- private ReadWriteBuffer? bufferY;
-
- ///
- /// A instance to initialize the tensors.
- ///
- private readonly Random random = new();
-
- ///
- /// Initial setup for a benchmarking session.
- ///
- [GlobalSetup]
- public void Setup()
- {
- // Creates a new random normalized float[] array of a given size
- float[] CreateRandomArray(int size)
- {
- float[] array = ArrayPool.Shared.Rent(size);
-
- foreach (ref float x in array.AsSpan())
- {
- x = (float)this.random.NextDouble();
- }
-
- return array;
- }
-
- this.x = CreateRandomArray(C * N * M);
- this.w = CreateRandomArray(M * P);
- this.b = CreateRandomArray(P);
- this.y = CreateRandomArray(C * N * P);
-
- this.bufferX = GraphicsDevice.GetDefault().AllocateReadOnlyBuffer(this.x);
- this.bufferW = GraphicsDevice.GetDefault().AllocateReadOnlyBuffer(this.w);
- this.bufferB = GraphicsDevice.GetDefault().AllocateReadOnlyBuffer(this.b);
- this.bufferY = GraphicsDevice.GetDefault().AllocateReadWriteBuffer(this.y);
-
- Cpu();
- GpuWithNoTemporaryBuffers();
- GpuWithTemporaryBuffers();
- }
-
- ///
- [GlobalCleanup]
- public void Dispose()
- {
- ArrayPool.Shared.Return(this.x!);
- ArrayPool.Shared.Return(this.w!);
- ArrayPool.Shared.Return(this.b!);
- ArrayPool.Shared.Return(this.y!);
-
- this.bufferX!.Dispose();
- this.bufferW!.Dispose();
- this.bufferB!.Dispose();
- this.bufferY!.Dispose();
- }
-
- ///
- /// Runs a fully connected forward operation on the CPU.
- ///
- [Benchmark(Baseline = true)]
- public void Cpu()
- {
- BlasHelpers.FullyConnectedForwardCpu(C, N, M, P, this.x!, this.w!, this.b!, this.y!);
- }
-
- ///
- /// Runs a fully connected forward operation on the GPU.
- ///
- [Benchmark]
- public void GpuWithNoTemporaryBuffers()
- {
- BlasHelpers.FullyConnectedForwardGpu(GraphicsDevice.GetDefault(), C, N, M, P, this.bufferX!, this.bufferW!, this.bufferB!, this.bufferY!);
- }
-
- ///
- /// Runs a fully connected forward operation on the GPU, creating temporary GPU buffers to perform the operations.
- ///
- [Benchmark]
- public void GpuWithTemporaryBuffers()
- {
- using ReadOnlyBuffer x = GraphicsDevice.GetDefault().AllocateReadOnlyBuffer(this.x!);
- using ReadOnlyBuffer w = GraphicsDevice.GetDefault().AllocateReadOnlyBuffer(this.w!);
- using ReadOnlyBuffer b = GraphicsDevice.GetDefault().AllocateReadOnlyBuffer(this.b!);
- using ReadWriteBuffer y = GraphicsDevice.GetDefault().AllocateReadWriteBuffer(this.y!.Length);
-
- BlasHelpers.FullyConnectedForwardGpu(GraphicsDevice.GetDefault(), C, N, M, P, x, w, b, y);
-
- y.CopyTo(this.y);
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.Benchmark/Blas/BlasHelpers.cs b/samples/ComputeSharp.Benchmark/Blas/BlasHelpers.cs
deleted file mode 100644
index 8c9e68d2..00000000
--- a/samples/ComputeSharp.Benchmark/Blas/BlasHelpers.cs
+++ /dev/null
@@ -1,108 +0,0 @@
-using System.Runtime.CompilerServices;
-using System.Threading.Tasks;
-
-namespace ComputeSharp.Benchmark.Blas;
-
-///
-/// A that contains primitives to run certain operations of a neural network.
-///
-internal static partial class BlasHelpers
-{
- ///
- /// Executes the forward pass on a fully connected layer on the CPU.
- ///
- /// The number of samples in the input tensor.
- /// The number of rows in the input matrix.
- /// The number of columns in the input matrix.
- /// The number of columns in the output matrix.
- /// The input tensor.
- /// The weights tensor.
- /// The bias tensor.
- /// The result tensor.
- public static void FullyConnectedForwardCpu(int c, int n, int m, int p, float[] x, float[] w, float[] b, float[] y)
- {
- void Kernel(int s)
- {
- ref float rx = ref x[s * n * m];
- ref float rw = ref w[0];
- ref float rb = ref b[0];
- ref float ry = ref y[s * n * p];
-
- for (int i = 0; i < n; i++)
- {
- int x_offset = i * m;
- int y_offset = i * p;
-
- for (int j = 0; j < p; j++)
- {
- float result = 0f;
-
- for (int k = 0; k < m; k++)
- {
- result += Unsafe.Add(ref rx, x_offset + k) * Unsafe.Add(ref rw, (k * p) + j);
- }
-
- Unsafe.Add(ref ry, y_offset + j) = result + Unsafe.Add(ref rb, j);
- }
- }
- }
-
- _ = Parallel.For(0, c, Kernel);
- }
-
- ///
- /// Executes the forward pass on a fully connected layer on the GPU.
- ///
- /// The device to run the computation on.
- /// The number of samples in the input tensor.
- /// The number of rows in the input matrix.
- /// The number of columns in the input matrix.
- /// The number of columns in the output matrix.
- /// The input tensor.
- /// The weights tensor.
- /// The bias tensor.
- /// The result tensor.
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- public static void FullyConnectedForwardGpu(
- GraphicsDevice device,
- int c,
- int n,
- int m,
- int p,
- ReadOnlyBuffer x,
- ReadOnlyBuffer w,
- ReadOnlyBuffer b,
- ReadWriteBuffer y)
- {
- device.For(c, n, p, new FullyConnectedForwardKernel(n, m, p, x, w, b, y));
- }
-
- ///
- /// Kernel for .
- ///
- [ThreadGroupSize(DefaultThreadGroupSizes.XYZ)]
- [GeneratedComputeShaderDescriptor]
- public readonly partial struct FullyConnectedForwardKernel(
- int n,
- int m,
- int p,
- ReadOnlyBuffer x,
- ReadOnlyBuffer w,
- ReadOnlyBuffer b,
- ReadWriteBuffer y) : IComputeShader
- {
- ///
- public void Execute()
- {
- int x_offset = (ThreadIds.X * n * m) + (ThreadIds.Y * m);
- float result = 0f;
-
- for (int k = 0; k < m; k++)
- {
- result += x[x_offset + k] * w[(k * p) + ThreadIds.Z];
- }
-
- y[(ThreadIds.X * n * p) + (ThreadIds.Y * p) + ThreadIds.Z] = result + b[ThreadIds.Z];
- }
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.Benchmark/ComputeSharp.Benchmark.csproj b/samples/ComputeSharp.Benchmark/ComputeSharp.Benchmark.csproj
deleted file mode 100644
index 01a18046..00000000
--- a/samples/ComputeSharp.Benchmark/ComputeSharp.Benchmark.csproj
+++ /dev/null
@@ -1,31 +0,0 @@
-
-
- Exe
- net8.0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/samples/ComputeSharp.Benchmark/Dispatching/DispatchingBenchmark.cs b/samples/ComputeSharp.Benchmark/Dispatching/DispatchingBenchmark.cs
deleted file mode 100644
index 541c21aa..00000000
--- a/samples/ComputeSharp.Benchmark/Dispatching/DispatchingBenchmark.cs
+++ /dev/null
@@ -1,122 +0,0 @@
-using System;
-using System.Threading.Tasks;
-using BenchmarkDotNet.Attributes;
-using BenchmarkDotNet.Configs;
-
-#pragma warning disable CA1063, IDE0052
-
-namespace ComputeSharp.Benchmark.Blas;
-
-///
-/// A that benchmarks the shader dispatch times.
-///
-[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)]
-[MemoryDiagnoser]
-public partial class DispatchingBenchmark : IDisposable
-{
- ///
- /// The test buffer.
- ///
- private ReadWriteBuffer? buffer;
-
- ///
- /// Initial setup for a benchmarking session.
- ///
- [GlobalSetup]
- public void Setup()
- {
- this.buffer = GraphicsDevice.GetDefault().AllocateReadWriteBuffer(128);
- }
-
- ///
- [GlobalCleanup]
- public void Dispose()
- {
- this.buffer!.Dispose();
- }
-
- ///
- /// Invokes a single shader, manually.
- ///
- [Benchmark(Baseline = true)]
- [BenchmarkCategory("SINGLE")]
- public void Compute_Single()
- {
- GraphicsDevice.GetDefault().For(64, new TestShader(this.buffer!));
- }
-
- ///
- /// Invokes a single shader through a compute context.
- ///
- [Benchmark]
- [BenchmarkCategory("SINGLE")]
- public void Compute_Single_WithContext()
- {
- using ComputeContext context = GraphicsDevice.GetDefault().CreateComputeContext();
-
- context.For(64, new TestShader(this.buffer!));
- }
-
- ///
- /// Invokes a single shader through a compute context, asynchronously.
- ///
- [Benchmark]
- [BenchmarkCategory("SINGLE")]
- public async Task Compute_Single_WithContext_Async()
- {
- await using ComputeContext context = GraphicsDevice.GetDefault().CreateComputeContext();
-
- context.For(64, new TestShader(this.buffer!));
- }
-
- ///
- /// Invokes two empty compute shaders one by one.
- ///
- [Benchmark(Baseline = true)]
- [BenchmarkCategory("MULTIPLE")]
- public void Compute_Multiple()
- {
- GraphicsDevice.GetDefault().For(64, new TestShader(this.buffer!));
- GraphicsDevice.GetDefault().For(64, new TestShader(this.buffer!));
- }
-
- ///
- /// Invokes two empty compute shaders in a batch.
- ///
- [Benchmark]
- [BenchmarkCategory("MULTIPLE")]
- public void Compute_Multiple_WithContext()
- {
- using ComputeContext context = GraphicsDevice.GetDefault().CreateComputeContext();
-
- context.For(64, new TestShader(this.buffer!));
- context.Barrier(this.buffer!);
- context.For(64, new TestShader(this.buffer!));
- }
-
- ///
- /// Invokes two empty compute shaders in a batch, asynchronously.
- ///
- [Benchmark]
- [BenchmarkCategory("MULTIPLE")]
- public async Task Compute_Multiple_WithContext_Async()
- {
- await using ComputeContext context = GraphicsDevice.GetDefault().CreateComputeContext();
-
- context.For(64, new TestShader(this.buffer!));
- context.Barrier(this.buffer!);
- context.For(64, new TestShader(this.buffer!));
- }
-
- [ThreadGroupSize(DefaultThreadGroupSizes.X)]
- [GeneratedComputeShaderDescriptor]
- internal readonly partial struct TestShader(ReadWriteBuffer buffer) : IComputeShader
- {
- private readonly ReadWriteBuffer buffer = buffer;
-
- ///
- public void Execute()
- {
- }
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.Benchmark/Imaging/ImagingBenchmark.cs b/samples/ComputeSharp.Benchmark/Imaging/ImagingBenchmark.cs
deleted file mode 100644
index 84ef323f..00000000
--- a/samples/ComputeSharp.Benchmark/Imaging/ImagingBenchmark.cs
+++ /dev/null
@@ -1,94 +0,0 @@
-using System;
-using System.IO;
-using System.Reflection;
-using BenchmarkDotNet.Attributes;
-using BenchmarkDotNet.Configs;
-using BenchmarkDotNet.Engines;
-using ComputeSharp.BokehBlur.Processors;
-using SixLabors.ImageSharp;
-using SixLabors.ImageSharp.Processing;
-using SixLabors.ImageSharp.Processing.Processors.Convolution;
-using ImageSharpRgba32 = SixLabors.ImageSharp.PixelFormats.Rgba32;
-
-#pragma warning disable CA1063
-
-namespace ComputeSharp.Benchmark.Imaging;
-
-///
-/// A that benchmarks the image processors against the reference in ImageSharp.
-///
-[SimpleJob(RunStrategy.Monitoring)]
-[CategoriesColumn]
-[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)]
-public class ImagingBenchmark : IDisposable
-{
- ///
- /// The loaded image.
- ///
- private Image? image;
-
- ///
- /// Initial setup for a benchmarking session.
- ///
- [GlobalSetup]
- public void Setup()
- {
- Configuration.Default.PreferContiguousImageBuffers = true;
-
- string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Imaging", "city.jpg");
-
- this.image = Image.Load(path);
-
- Bokeh_Cpu();
- Bokeh_Gpu();
- Gaussian_Cpu();
- Gaussian_Gpu();
- }
-
- ///
- [GlobalCleanup]
- public void Dispose()
- {
- this.image!.Dispose();
- }
-
- ///
- /// Runs a bokeh blur effect on the CPU.
- ///
- [Benchmark(Baseline = true)]
- [BenchmarkCategory("BOKEH")]
- public void Bokeh_Cpu()
- {
- this.image!.Mutate(c => c.ApplyProcessor(new BokehBlurProcessor(80, 2, 3)));
- }
-
- ///
- /// Runs a bokeh blur effect on the GPU.
- ///
- [Benchmark]
- [BenchmarkCategory("BOKEH")]
- public void Bokeh_Gpu()
- {
- this.image!.Mutate(c => c.ApplyProcessor(new HlslBokehBlurProcessor(80, 2)));
- }
-
- ///
- /// Runs a gaussian blur effect on the CPU.
- ///
- [Benchmark(Baseline = true)]
- [BenchmarkCategory("GAUSSIAN")]
- public void Gaussian_Cpu()
- {
- this.image!.Mutate(c => c.ApplyProcessor(new GaussianBlurProcessor(80)));
- }
-
- ///
- /// Runs a gaussian blur effect on the GPU.
- ///
- [Benchmark]
- [BenchmarkCategory("GAUSSIAN")]
- public void Gaussian_Gpu()
- {
- this.image!.Mutate(c => c.ApplyProcessor(new HlslGaussianBlurProcessor(80)));
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.Benchmark/Program.cs b/samples/ComputeSharp.Benchmark/Program.cs
deleted file mode 100644
index ee6b7824..00000000
--- a/samples/ComputeSharp.Benchmark/Program.cs
+++ /dev/null
@@ -1,11 +0,0 @@
-using System.Reflection;
-using BenchmarkDotNet.Running;
-
-// =================
-// BenchmarkDotNet
-// ================
-// In order to run this benchmark, switch to Release mode and either run select
-// it as the startup project for the solution and run it without the debugger
-// (CTRL + F5), or compile it and then go to its bin\Release\net8.0 folder,
-// open a cmd prompt and run "dotnet ComputeSharp.Benchmark.dll".
-BenchmarkSwitcher.FromAssembly(Assembly.GetExecutingAssembly()).Run(args);
\ No newline at end of file
diff --git a/samples/ComputeSharp.ImageProcessing/ComputeSharp.ImageProcessing.csproj b/samples/ComputeSharp.ImageProcessing/ComputeSharp.ImageProcessing.csproj
deleted file mode 100644
index 211fbc4b..00000000
--- a/samples/ComputeSharp.ImageProcessing/ComputeSharp.ImageProcessing.csproj
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
- Exe
- net8.0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/ComputeSharp.ImageProcessing/Program.cs b/samples/ComputeSharp.ImageProcessing/Program.cs
deleted file mode 100644
index 7b764178..00000000
--- a/samples/ComputeSharp.ImageProcessing/Program.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using System;
-using System.IO;
-using System.Reflection;
-using ComputeSharp.BokehBlur.Processors;
-using SixLabors.ImageSharp;
-using SixLabors.ImageSharp.Processing;
-using SixLabors.ImageSharp.Processing.Processors;
-using ImageSharpRgba32 = SixLabors.ImageSharp.PixelFormats.Rgba32;
-
-Configuration.Default.PreferContiguousImageBuffers = true;
-
-Console.WriteLine(">> Loading image");
-
-string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "city.jpg");
-using Image image = Image.Load(path);
-
-// Apply a series of processors and save the results
-foreach ((string Name, IImageProcessor Processor) effect in new (string Name, IImageProcessor Processor)[]
-{
- ("bokeh", new HlslBokehBlurProcessor(80, 2)),
- ("gaussian", new HlslGaussianBlurProcessor(80))
-})
-{
- Console.WriteLine($">> Applying {effect.Name}");
-
- using Image copy = image.Clone(c => c.ApplyProcessor(effect.Processor));
-
- Console.WriteLine($">> Saving {effect.Name} to disk");
-
- string targetPath = Path.GetDirectoryName(path)!;
-
- while (Path.GetFileName(targetPath) != "ComputeSharp.ImageProcessing")
- {
- targetPath = Path.GetDirectoryName(targetPath)!;
- }
-
- targetPath = Path.Combine(targetPath, $"{Path.GetFileNameWithoutExtension(path)}_{effect.Name}{Path.GetExtension(path)}");
-
- copy.Save(targetPath);
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.NativeLibrary.WinRT/ComputeSharp.NativeLibrary.WinRT.csproj b/samples/ComputeSharp.NativeLibrary.WinRT/ComputeSharp.NativeLibrary.WinRT.csproj
deleted file mode 100644
index 86efff1b..00000000
--- a/samples/ComputeSharp.NativeLibrary.WinRT/ComputeSharp.NativeLibrary.WinRT.csproj
+++ /dev/null
@@ -1,56 +0,0 @@
-
-
- net8.0-windows10.0.22621.0
- x64;ARM64
- win-x64;win-arm64
-
-
-
- true
-
-
- ComputeSharp.NativeLibrary
-
-
- false
- true
- false
- false
- false
- false
-
-
- $(NoWarn);LNK4104
-
-
-
-
- true
- true
- true
- Size
- false
- false
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/ComputeSharp.NativeLibrary.WinRT/HelloWorldEffect.cs b/samples/ComputeSharp.NativeLibrary.WinRT/HelloWorldEffect.cs
deleted file mode 100644
index 4c8de82a..00000000
--- a/samples/ComputeSharp.NativeLibrary.WinRT/HelloWorldEffect.cs
+++ /dev/null
@@ -1,70 +0,0 @@
-using ComputeSharp.D2D1;
-using ComputeSharp.D2D1.WinUI;
-using Windows.Foundation;
-
-namespace ComputeSharp.NativeLibrary;
-
-///
-/// A hello world effect that displays a color gradient.
-///
-public sealed partial class HelloWorldEffect : CanvasEffect
-{
- ///
- /// The node in use.
- ///
- private static readonly CanvasEffectNode> EffectNode = new();
-
- ///
- /// Gets or sets the current time since the start of the application.
- ///
- [GeneratedCanvasEffectProperty]
- public partial float Time { get; set; }
-
- ///
- /// Gets or sets the dispatch area for the current output.
- ///
- [GeneratedCanvasEffectProperty]
- public partial Rect DispatchArea { get; set; }
-
- ///
- protected override void BuildEffectGraph(CanvasEffectGraph effectGraph)
- {
- effectGraph.RegisterOutputNode(EffectNode, new PixelShaderEffect());
- }
-
- ///
- protected override void ConfigureEffectGraph(CanvasEffectGraph effectGraph)
- {
- effectGraph.GetNode(EffectNode).ConstantBuffer = new Shader(
- time: Time,
- dispatchSize: new int2(
- x: (int)double.Round(DispatchArea.Width),
- y: (int)double.Round(DispatchArea.Height)));
- }
-
- ///
- /// A hello world effect that displays a color gradient.
- ///
- /// The current time since the start of the application.
- /// The dispatch size for the current output.
- [D2DEffectDisplayName(nameof(HelloWorldEffect))]
- [D2DEffectDescription("A hello world effect that displays a color gradient.")]
- [D2DEffectCategory("Render")]
- [D2DEffectAuthor("ComputeSharp.D2D1")]
- [D2DInputCount(0)]
- [D2DRequiresScenePosition]
- [D2DShaderProfile(D2D1ShaderProfile.PixelShader50)]
- [D2DGeneratedPixelShaderDescriptor]
- internal readonly partial struct Shader(float time, int2 dispatchSize) : ID2D1PixelShader
- {
- ///
- public float4 Execute()
- {
- int2 xy = (int2)D2D.GetScenePosition().XY;
- float2 uv = xy / (float2)dispatchSize;
- float3 color = 0.5f + (0.5f * Hlsl.Cos(time + new float3(uv, uv.X) + new float3(0, 2, 4)));
-
- return new(color, 1f);
- }
- }
-}
diff --git a/samples/ComputeSharp.NativeLibrary/ComputeSharp.NativeLibrary.csproj b/samples/ComputeSharp.NativeLibrary/ComputeSharp.NativeLibrary.csproj
deleted file mode 100644
index f65a84fe..00000000
--- a/samples/ComputeSharp.NativeLibrary/ComputeSharp.NativeLibrary.csproj
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
- net8.0
-
-
-
-
- true
- true
- true
- Size
- false
-
-
- false
- false
-
-
- true
- true
-
-
-
-
-
-
-
-
-
diff --git a/samples/ComputeSharp.NativeLibrary/NativeLibrary.cs b/samples/ComputeSharp.NativeLibrary/NativeLibrary.cs
deleted file mode 100644
index ce1c77a3..00000000
--- a/samples/ComputeSharp.NativeLibrary/NativeLibrary.cs
+++ /dev/null
@@ -1,84 +0,0 @@
-using System;
-using System.Runtime.InteropServices;
-using System.Runtime.Versioning;
-using ComputeSharp;
-using ComputeSharp.D2D1;
-using ComputeSharp.D2D1.Interop;
-
-[assembly: SupportedOSPlatform("windows6.1")]
-
-///
-/// Native exports for the library.
-///
-public static unsafe class Library
-{
- ///
- /// Registers the effect into a target ID2D1Factory1 instance.
- ///
- ///
- ///
- /// The HRESULT for the operation.
- [UnmanagedCallersOnly(EntryPoint = nameof(RegisterHelloWorldEffect))]
- public static int RegisterHelloWorldEffect(void* d2D1Factory1, Guid* effectId)
- {
- try
- {
- D2D1PixelShaderEffect.RegisterForD2D1Factory1(d2D1Factory1, out *effectId);
-
- return 0;
- }
- catch (Exception e)
- {
- return Marshal.GetHRForException(e);
- }
- }
-
- ///
- /// Sets the constant buffer for the input ID2D1Effect (assumed to be ).
- ///
- ///
- ///
- /// The horizontal dispatch size for the current output.
- /// The vertical dispatch size for the current output.
- ///
- [UnmanagedCallersOnly(EntryPoint = nameof(SetHelloWorldEffectConstantBuffer))]
- public static int SetHelloWorldEffectConstantBuffer(void* d2D1Effect, float time, int dispatchWidth, int dispatchHeight)
- {
- try
- {
- D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(d2D1Effect, new HelloWorld(time, new int2(dispatchWidth, dispatchHeight)));
-
- return 0;
- }
- catch (Exception e)
- {
- return Marshal.GetHRForException(e);
- }
- }
-}
-
-///
-/// A hello world effect that displays a color gradient.
-///
-/// The current time since the start of the application.
-/// The dispatch size for the current output.
-[D2DEffectDisplayName(nameof(HelloWorld))]
-[D2DEffectDescription("A hello world effect that displays a color gradient.")]
-[D2DEffectCategory("Render")]
-[D2DEffectAuthor("ComputeSharp.D2D1")]
-[D2DInputCount(0)]
-[D2DRequiresScenePosition]
-[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)]
-[D2DGeneratedPixelShaderDescriptor]
-internal readonly partial struct HelloWorld(float time, int2 dispatchSize) : ID2D1PixelShader
-{
- ///
- public float4 Execute()
- {
- int2 xy = (int2)D2D.GetScenePosition().XY;
- float2 uv = xy / (float2)dispatchSize;
- float3 color = 0.5f + (0.5f * Hlsl.Cos(time + new float3(uv, uv.X) + new float3(0, 2, 4)));
-
- return new(color, 1f);
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.Sample.FSharp.Shaders/ComputeSharp.Sample.FSharp.Shaders.csproj b/samples/ComputeSharp.Sample.FSharp.Shaders/ComputeSharp.Sample.FSharp.Shaders.csproj
deleted file mode 100644
index 65efaf2c..00000000
--- a/samples/ComputeSharp.Sample.FSharp.Shaders/ComputeSharp.Sample.FSharp.Shaders.csproj
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
- net8.0
-
-
-
-
-
-
-
-
-
diff --git a/samples/ComputeSharp.Sample.FSharp.Shaders/MultiplyByTwo.cs b/samples/ComputeSharp.Sample.FSharp.Shaders/MultiplyByTwo.cs
deleted file mode 100644
index 545a2736..00000000
--- a/samples/ComputeSharp.Sample.FSharp.Shaders/MultiplyByTwo.cs
+++ /dev/null
@@ -1,15 +0,0 @@
-namespace ComputeSharp.Sample.FSharp.Shaders;
-
-///
-/// A sample shader thaat just multiplies items in a buffer by two.
-///
-[ThreadGroupSize(DefaultThreadGroupSizes.X)]
-[GeneratedComputeShaderDescriptor]
-public readonly partial struct MultiplyByTwo(ReadWriteBuffer buffer) : IComputeShader
-{
- ///
- public void Execute()
- {
- buffer[ThreadIds.X] *= 2;
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.Sample.FSharp/ComputeSharp.Sample.FSharp.fsproj b/samples/ComputeSharp.Sample.FSharp/ComputeSharp.Sample.FSharp.fsproj
deleted file mode 100644
index 11b6816d..00000000
--- a/samples/ComputeSharp.Sample.FSharp/ComputeSharp.Sample.FSharp.fsproj
+++ /dev/null
@@ -1,25 +0,0 @@
-
-
-
- Exe
- net8.0
- 9.0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/ComputeSharp.Sample.FSharp/Program.fs b/samples/ComputeSharp.Sample.FSharp/Program.fs
deleted file mode 100644
index aa376b86..00000000
--- a/samples/ComputeSharp.Sample.FSharp/Program.fs
+++ /dev/null
@@ -1,51 +0,0 @@
-// Learn more about F# at http://docs.microsoft.com/dotnet/fsharp
-
-open System
-open System.Globalization
-open System.Linq
-open ComputeSharp
-open ComputeSharp.Sample.FSharp.Shaders
-
-/// Prints a matrix in a properly formatted way.
-/// The input array representing the matrix to print.
-/// The width of the array to print.
-/// The height of the array to print.
-/// The name of the matrix to print.
-let printMatrix (array : float32[]) width height (name : string) =
- let pad = 48 - name.Length
- let title = $"%s{new string('=', pad / 2)} %s{name} %s{new string('=', (pad + 1) / 2)}"
- let numberWidth = Math.Max(array.Max().ToString(CultureInfo.InvariantCulture).Length, 4)
-
- printfn "%s" title
-
- for i in 0 .. height - 1 do
- let row = array.[i * width .. (i + 1) * width - 1]
- let text = String.Join(",", [for x in row -> x.ToString(CultureInfo.InvariantCulture).PadLeft(numberWidth)])
-
- printfn "%s" text
-
- printfn "%s" (new string('=', 50))
-
-[]
-let main _ =
-
- let array = [| for i in 1 .. 100 -> (float32)i |]
-
- // Create the graphics buffer
- use buffer = GraphicsDevice.GetDefault().AllocateReadWriteBuffer(array)
-
- let shader = new MultiplyByTwo(buffer)
-
- // Run the shader (passed by reference)
- GraphicsDevice.GetDefault().For(100, &shader)
-
- // Print the initial matrix
- printMatrix array 10 10 "BEFORE"
-
- // Get the data back
- buffer.CopyTo array
-
- // Print the updated matrix
- printMatrix array 10 10 "AFTER"
-
- 0
diff --git a/samples/ComputeSharp.Sample/ComputeSharp.Sample.csproj b/samples/ComputeSharp.Sample/ComputeSharp.Sample.csproj
deleted file mode 100644
index 7f09f68a..00000000
--- a/samples/ComputeSharp.Sample/ComputeSharp.Sample.csproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
- Exe
- net8.0
-
-
-
-
-
-
-
-
-
diff --git a/samples/ComputeSharp.Sample/Helpers/Formatting.cs b/samples/ComputeSharp.Sample/Helpers/Formatting.cs
deleted file mode 100644
index 076512e2..00000000
--- a/samples/ComputeSharp.Sample/Helpers/Formatting.cs
+++ /dev/null
@@ -1,38 +0,0 @@
-using System;
-using System.Globalization;
-using System.Linq;
-
-namespace ComputeSharp.Sample;
-
-///
-/// Internal helpers for the sample to format values.
-///
-internal static class Formatting
-{
- ///
- /// Prints a matrix in a properly formatted way.
- ///
- /// The input array representing the matrix to print.
- /// The width of the array to print.
- /// The height of the array to print.
- /// The name of the matrix to print.
- public static void PrintMatrix(float[] array, int width, int height, string name)
- {
- int pad = 48 - name.Length;
- string title = $"{new string('=', pad / 2)} {name} {new string('=', (pad + 1) / 2)}";
-
- Console.WriteLine(title);
-
- int numberWidth = Math.Max(array.Max().ToString(CultureInfo.InvariantCulture).Length, 4);
-
- for (int i = 0; i < height; i++)
- {
- float[] row = [.. array.AsSpan(i * width, width)];
- string text = string.Join(",", row.Select(x => x.ToString(CultureInfo.InvariantCulture).PadLeft(numberWidth)));
-
- Console.WriteLine(text);
- }
-
- Console.WriteLine(new string('=', 50));
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.Sample/Program.cs b/samples/ComputeSharp.Sample/Program.cs
deleted file mode 100644
index 9daa34fe..00000000
--- a/samples/ComputeSharp.Sample/Program.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-using System;
-using System.Linq;
-using ComputeSharp;
-using ComputeSharp.Sample;
-
-float[] array = [.. Enumerable.Range(1, 100)];
-
-// Create the graphics buffer
-using ReadWriteBuffer gpuBuffer = GraphicsDevice.GetDefault().AllocateReadWriteBuffer(array);
-
-// Run the shader
-GraphicsDevice.GetDefault().For(100, new MultiplyByTwo(gpuBuffer));
-
-// Print the initial matrix
-Formatting.PrintMatrix(array, 10, 10, "BEFORE");
-
-// Get the data back
-gpuBuffer.CopyTo(array);
-
-// Print the updated matrix
-Formatting.PrintMatrix(array, 10, 10, "AFTER");
-
-///
-/// The sample kernel that multiples all items by two.
-///
-[ThreadGroupSize(DefaultThreadGroupSizes.X)]
-[GeneratedComputeShaderDescriptor]
-internal readonly partial struct MultiplyByTwo(ReadWriteBuffer buffer) : IComputeShader
-{
- ///
- public void Execute()
- {
- buffer[ThreadIds.X] *= 2;
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.Cli/ComputeSharp.SwapChain.Cli.csproj b/samples/ComputeSharp.SwapChain.Cli/ComputeSharp.SwapChain.Cli.csproj
deleted file mode 100644
index 5eae7e40..00000000
--- a/samples/ComputeSharp.SwapChain.Cli/ComputeSharp.SwapChain.Cli.csproj
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
- Exe
- WinExe
- net8.0
- x64;ARM64
- computesharp.cli
-
-
- ..\..\assets\icon.ico
-
-
-
-
- true
- true
- true
- false
- Size
- Speed
- true
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/ComputeSharp.SwapChain.Cli/Program.cs b/samples/ComputeSharp.SwapChain.Cli/Program.cs
deleted file mode 100644
index 23c5da40..00000000
--- a/samples/ComputeSharp.SwapChain.Cli/Program.cs
+++ /dev/null
@@ -1,64 +0,0 @@
-using System;
-using ComputeSharp;
-using ComputeSharp.SwapChain.Backend;
-using ComputeSharp.SwapChain.Shaders;
-using TerraFX.Interop.Windows;
-
-// Accepted inputs:
-// - []
-// - []
-if (args is [] or [_])
-{
- // If there are no args, just run the default shader
- if (args is not [string shaderName])
- {
- shaderName = nameof(ColorfulInfinity);
- }
-
- // This CLI shader is heavily tuned for the smallest binary size possible when doing NativeAOT publish builds.
- // As a result, the code is intentionally not really standard, and pulling all sorts of tricks to minimize the
- // final binary size. These are callback functions to draw a shader, which are passed to the shared Win32 runner
- // as function pointers. This is done to avoid the additional binary size increase due to delegate instantiations.
- // Similarly, there is a single type hosting all rendering code to avoid per-shader reified generic instantiations.
- static void _0(IReadWriteNormalizedTexture2D texture, TimeSpan time) => texture.GraphicsDevice.ForEach(texture, new HelloWorld((float)time.TotalSeconds));
- static void _1(IReadWriteNormalizedTexture2D texture, TimeSpan time) => texture.GraphicsDevice.ForEach(texture, new ColorfulInfinity((float)time.TotalSeconds));
- static void _2(IReadWriteNormalizedTexture2D texture, TimeSpan time) => texture.GraphicsDevice.ForEach(texture, new FractalTiling((float)time.TotalSeconds));
- static void _3(IReadWriteNormalizedTexture2D texture, TimeSpan time) => texture.GraphicsDevice.ForEach(texture, new TwoTiledTruchet((float)time.TotalSeconds));
- static void _4(IReadWriteNormalizedTexture2D texture, TimeSpan time) => texture.GraphicsDevice.ForEach(texture, new MengerJourney((float)time.TotalSeconds));
- static void _5(IReadWriteNormalizedTexture2D texture, TimeSpan time) => texture.GraphicsDevice.ForEach(texture, new Octagrams((float)time.TotalSeconds));
- static void _6(IReadWriteNormalizedTexture2D texture, TimeSpan time) => texture.GraphicsDevice.ForEach(texture, new ProteanClouds((float)time.TotalSeconds));
- static void _7(IReadWriteNormalizedTexture2D texture, TimeSpan time) => texture.GraphicsDevice.ForEach(texture, new ExtrudedTruchetPattern((float)time.TotalSeconds));
- static void _8(IReadWriteNormalizedTexture2D texture, TimeSpan time) => texture.GraphicsDevice.ForEach(texture, new PyramidPattern((float)time.TotalSeconds));
- static void _9(IReadWriteNormalizedTexture2D texture, TimeSpan time) => texture.GraphicsDevice.ForEach(texture, new TriangleGridContouring((float)time.TotalSeconds));
- static void _A(IReadWriteNormalizedTexture2D texture, TimeSpan time) => texture.GraphicsDevice.ForEach(texture, new TerracedHills((float)time.TotalSeconds));
-
- unsafe
- {
- // Get the requested shader, if possible
- delegate*, TimeSpan, void> shaderCallback = shaderName.ToLowerInvariant() switch
- {
- "helloworld" => &_0,
- "colorfulinfinity" => &_1,
- "fractaltiling" => &_2,
- "twotiledtruchet" => &_3,
- "mengerjourney" => &_4,
- "octagrams" => &_5,
- "proteanclouds" => &_6,
- "extrudedtruchetpattern" => &_7,
- "pyramidpattern" => &_8,
- "trianglegridcontouring" => &_9,
- "terracedhills" => &_A,
- _ => null
- };
-
- // Initialize the application instance and run it
- if (shaderCallback is not null)
- {
- Win32Application? application = new(shaderCallback);
-
- return Win32ApplicationRunner.Run(application, "ComputeSharp", "ComputeSharp");
- }
- }
-}
-
-return E.E_INVALIDARG;
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.D2D1.Cli/Backend/PixelShaderEffect.cs b/samples/ComputeSharp.SwapChain.D2D1.Cli/Backend/PixelShaderEffect.cs
deleted file mode 100644
index 73b56c59..00000000
--- a/samples/ComputeSharp.SwapChain.D2D1.Cli/Backend/PixelShaderEffect.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-using System;
-using ComputeSharp.D2D1;
-using ComputeSharp.D2D1.Descriptors;
-using ComputeSharp.D2D1.WinUI;
-
-namespace ComputeSharp.SwapChain.D2D1.Backend;
-
-///
-/// An base effect for an animated pixel shader.
-///
-internal abstract partial class PixelShaderEffect : CanvasEffect
-{
- ///
- /// Gets or sets the total elapsed time.
- ///
- [GeneratedCanvasEffectProperty]
- public partial TimeSpan ElapsedTime { get; set; }
-
- ///
- /// Gets or sets the screen width in raw pixels.
- ///
- [GeneratedCanvasEffectProperty]
- public partial int ScreenWidth { get; set; }
-
- ///
- /// Gets or sets the screen height in raw pixels.
- ///
- [GeneratedCanvasEffectProperty]
- public partial int ScreenHeight { get; set; }
-
- ///
- /// An effect for an animated pixel shader.
- ///
- /// The type of pixel shader to render.
- /// The input factory.
- public sealed partial class For(For.Factory factory) : PixelShaderEffect
- where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor
- {
- ///
- /// The node in use.
- ///
- private static readonly CanvasEffectNode> Effect = new();
-
- ///
- protected override void BuildEffectGraph(CanvasEffectGraph effectGraph)
- {
- effectGraph.RegisterOutputNode(Effect, new PixelShaderEffect());
- }
-
- ///
- protected override void ConfigureEffectGraph(CanvasEffectGraph effectGraph)
- {
- effectGraph.GetNode(Effect).ConstantBuffer = factory(ElapsedTime, ScreenWidth, ScreenHeight);
- }
-
- ///
- /// A factory of a given shader instance.
- ///
- /// The total elapsed time.
- /// The screen width in raw pixels.
- /// The screen height in raw pixels.
- /// A shader instance to render.
- public delegate T Factory(TimeSpan elapsedTime, int screenWidth, int screenHeight);
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.D2D1.Cli/Backend/Win32Application.cs b/samples/ComputeSharp.SwapChain.D2D1.Cli/Backend/Win32Application.cs
deleted file mode 100644
index 1ac88d0c..00000000
--- a/samples/ComputeSharp.SwapChain.D2D1.Cli/Backend/Win32Application.cs
+++ /dev/null
@@ -1,149 +0,0 @@
-using System;
-using System.Diagnostics.CodeAnalysis;
-using Microsoft.UI.Windowing;
-
-namespace ComputeSharp.SwapChain.D2D1.Backend;
-
-using BitmapSize = Windows.Graphics.Imaging.BitmapSize;
-using CanvasDevice = Microsoft.Graphics.Canvas.CanvasDevice;
-using CanvasDrawingSession = Microsoft.Graphics.Canvas.CanvasDrawingSession;
-using CanvasSwapChain = Microsoft.Graphics.Canvas.CanvasSwapChain;
-using DirectXPixelFormat = Windows.Graphics.DirectX.DirectXPixelFormat;
-
-///
-/// A simple Win32 application handling a D2D swapchain.
-///
-internal sealed class Win32Application
-{
- ///
- /// The instance to use.
- ///
- private CanvasDevice? canvasDevice;
-
- ///
- /// The instance to use to render frames.
- ///
- private CanvasSwapChain? canvasSwapChain;
-
- ///
- /// Whether or not the window has been resized and requires the buffers to be updated.
- ///
- private volatile bool isResizePending;
-
- ///
- /// The current screen width in raw pixels.
- ///
- private uint screenWidth;
-
- ///
- /// The current screen height in raw pixels.
- ///
- private uint screenHeight;
-
- ///
- /// Raised whenever a draw operation can be performed.
- ///
- public event EventHandler? Draw;
-
- ///
- /// Initializes the current application.
- ///
- /// The window to show.
- [MemberNotNull(nameof(canvasDevice))]
- [MemberNotNull(nameof(canvasSwapChain))]
- public unsafe void OnInitialize(AppWindow appWindow)
- {
- // Create a new canvas device, which will handle DX11/D2D initialization
- CanvasDevice canvasDevice = new();
- CanvasSwapChain canvasSwapChain = CanvasSwapChain.CreateForWindowId(
- resourceCreator: canvasDevice,
- windowId: appWindow.Id,
- width: this.screenWidth = 1,
- height: this.screenHeight = 1,
- dpi: 96.0f);
-
- // Save the Win2D objects for later use
- this.canvasDevice = canvasDevice;
- this.canvasSwapChain = canvasSwapChain;
-
- // Request a resize before the first draw operation
- this.isResizePending = true;
- }
-
- ///
- /// Resizes the current application.
- ///
- public void OnResize()
- {
- this.isResizePending = true;
- }
-
- ///
- /// Updates the current application.
- ///
- /// The current time since the start of the application.
- public void OnUpdate(TimeSpan time)
- {
- if (this.isResizePending)
- {
- // Resize the swapchain if needed (the size is calculated automatically)
- this.canvasSwapChain!.ResizeBuffers(
- newWidth: 0,
- newHeight: 0,
- newDpi: 96.0f,
- newFormat: DirectXPixelFormat.Unknown,
- bufferCount: 0);
-
- BitmapSize bitmapSize = this.canvasSwapChain!.SizeInPixels;
-
- this.screenWidth = bitmapSize.Width;
- this.screenHeight = bitmapSize.Height;
-
- this.isResizePending = false;
- }
-
- // Create the drawing session and invoke all registered draw handler
- using (CanvasDrawingSession canvasDrawingSession = this.canvasSwapChain!.CreateDrawingSession(default))
- {
- Draw?.Invoke(this, new DrawEventArgs
- {
- ScreenWidth = this.screenWidth,
- ScreenHeight = this.screenHeight,
- TotalTime = time,
- DrawingSession = canvasDrawingSession
- });
- }
-
- // Wait for v-sync
- this.canvasSwapChain.WaitForVerticalBlank();
-
- // Present the new frame
- this.canvasSwapChain.Present(syncInterval: 1);
- }
-
- ///
- /// Arguments for .
- ///
- public sealed class DrawEventArgs : EventArgs
- {
- ///
- /// Gets the screen width in raw pixels.
- ///
- public required uint ScreenWidth { get; init; }
-
- ///
- /// Gets the screen height in raw pixels.
- ///
- public required uint ScreenHeight { get; init; }
-
- ///
- /// Gets the total time for the rendering loop.
- ///
- public required TimeSpan TotalTime { get; init; }
-
- ///
- /// Gets the instance to use.
- ///
- public required CanvasDrawingSession DrawingSession { get; init; }
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.D2D1.Cli/Backend/Win32ApplicationRunner.cs b/samples/ComputeSharp.SwapChain.D2D1.Cli/Backend/Win32ApplicationRunner.cs
deleted file mode 100644
index c31266e7..00000000
--- a/samples/ComputeSharp.SwapChain.D2D1.Cli/Backend/Win32ApplicationRunner.cs
+++ /dev/null
@@ -1,96 +0,0 @@
-using System.Diagnostics;
-using System.Threading;
-using Microsoft.UI;
-using Microsoft.UI.Dispatching;
-using Microsoft.UI.Windowing;
-using Windows.UI;
-
-namespace ComputeSharp.SwapChain.D2D1.Backend;
-
-///
-/// A helper class to manage the creation and execution of Win32 applications.
-///
-internal static unsafe class Win32ApplicationRunner
-{
- ///
- /// Runs a specified application and starts the main loop to update its state. This is the entry point for a given application,
- /// and it should be called as soon as the process is launched, excluding any other additional initialization needed.
- ///
- /// The input application instance to run.
- /// The title to use for the window being opened.
- public static void Run(Win32Application application, string windowTitle)
- {
- // Create the 'AppWindow' instance (a thin wrapper for an 'HWND')
- AppWindow appWindow = AppWindow.Create();
-
- appWindow.Title = windowTitle;
- appWindow.TitleBar.ExtendsContentIntoTitleBar = true;
-
- // Transparent colors for the title bar
- appWindow.TitleBar.ForegroundColor = Colors.Transparent;
- appWindow.TitleBar.BackgroundColor = Colors.Transparent;
- appWindow.TitleBar.ButtonBackgroundColor = Colors.Transparent;
- appWindow.TitleBar.InactiveBackgroundColor = Colors.Transparent;
- appWindow.TitleBar.ButtonInactiveBackgroundColor = Colors.Transparent;
-
- // Theme aware colors for the title bar
- appWindow.TitleBar.ButtonForegroundColor = Colors.White;
- appWindow.TitleBar.ButtonHoverForegroundColor = Colors.White;
- appWindow.TitleBar.ButtonPressedForegroundColor = Colors.White;
- appWindow.TitleBar.ButtonHoverBackgroundColor = Color.FromArgb(0x20, 0xFF, 0xFF, 0xFF);
- appWindow.TitleBar.ButtonPressedBackgroundColor = Color.FromArgb(0x40, 0xFF, 0xFF, 0xFF);
- appWindow.TitleBar.ButtonInactiveForegroundColor = Color.FromArgb(0xC0, 0xFF, 0xFF, 0xFF);
- appWindow.TitleBar.InactiveForegroundColor = Color.FromArgb(0xA0, 0xA0, 0xA0, 0xA0);
-
- // Initialize the application
- application.OnInitialize(appWindow);
-
- // Setup the render thread that enables smooth resizing of the window
- Thread renderThread = new(static args =>
- {
- (Win32Application application, CancellationToken token) = ((Win32Application, CancellationToken))args!;
-
- Stopwatch stopwatch = Stopwatch.StartNew();
-
- while (!token.IsCancellationRequested)
- {
- application.OnUpdate(stopwatch.Elapsed);
- }
- });
-
- CancellationTokenSource tokenSource = new();
-
- // Start the render thread before activating the window.
- // This allows the app to show up while already drawing.
- renderThread.Start((application, tokenSource.Token));
-
- // Register a callback to monitor resize operations
- appWindow.Changed += (s, e) =>
- {
- if (e.DidSizeChange)
- {
- application.OnResize();
- }
- };
-
- DispatcherQueueController dispatcherQueueController = DispatcherQueueController.CreateOnCurrentThread();
-
- // Bind the window to a 'DispatcherQueue' instance, so it can flow the exit message
- appWindow.AssociateWithDispatcherQueue(dispatcherQueueController.DispatcherQueue);
-
- // Enqueue the exit message when the window is closed. This ensures that
- // the process actually terminates after closing the window, as expected.
- appWindow.Closing += static (s, e) => s.DispatcherQueue.EnqueueEventLoopExit();
-
- // Display the window
- appWindow.Show(activateWindow: true);
-
- // Process any messages in the queue
- dispatcherQueueController.DispatcherQueue.RunEventLoop(DispatcherRunOptions.QuitOnlyLocalLoop, deferral: null);
-
- tokenSource.Cancel();
-
- // Wait for the render thread to stop before terminating
- renderThread.Join();
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.D2D1.Cli/ComputeSharp.SwapChain.D2D1.Cli.csproj b/samples/ComputeSharp.SwapChain.D2D1.Cli/ComputeSharp.SwapChain.D2D1.Cli.csproj
deleted file mode 100644
index a50d58cc..00000000
--- a/samples/ComputeSharp.SwapChain.D2D1.Cli/ComputeSharp.SwapChain.D2D1.Cli.csproj
+++ /dev/null
@@ -1,82 +0,0 @@
-
-
- Exe
- WinExe
- net8.0-windows10.0.22621
- app.manifest
- x64;ARM64
- win-x64;win-arm64
- computesharp.d2d1.cli
- ..\..\assets\icon.ico
-
-
- true
- None
-
-
-
-
-
- full
-
-
- $(NoWarn);IDE0065
-
-
-
-
- false
- true
- false
- false
- false
-
-
-
-
- true
- true
- true
- true
-
-
- true
-
-
-
-
- true
- true
- true
- false
- Speed
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/ComputeSharp.SwapChain.D2D1.Cli/Program.cs b/samples/ComputeSharp.SwapChain.D2D1.Cli/Program.cs
deleted file mode 100644
index 629eea49..00000000
--- a/samples/ComputeSharp.SwapChain.D2D1.Cli/Program.cs
+++ /dev/null
@@ -1,76 +0,0 @@
-using System;
-using ComputeSharp.SwapChain.D2D1.Backend;
-using ComputeSharp.SwapChain.Shaders.D2D1;
-using TerraFX.Interop.Windows;
-
-// Accepted inputs:
-// - []
-// - []
-if (args is [] or [_])
-{
- // If there are no args, just run the default shader
- if (args is not [string shaderName])
- {
- shaderName = nameof(ColorfulInfinity);
- }
-
- // Get the requested shader, if possible
- PixelShaderEffect? effect = shaderName.ToLowerInvariant() switch
- {
- "helloworld" => new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))),
- "colorfulinfinity" => new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))),
- "fractaltiling" => new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))),
- "twotiledtruchet" => new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))),
- "mengerjourney" => new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))),
- "octagrams" => new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))),
- "proteanclouds" => new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))),
- "pyramidpattern" => new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))),
- "trianglegridcontouring" => new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))),
- "terracedhills" => new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))),
- _ => null
- };
-
- // If a shader is found, run it
- if (effect is not null)
- {
- Win32Application application = new();
-
- application.Draw += (_, e) =>
- {
- // Set the effect properties
- effect.ElapsedTime = e.TotalTime;
- effect.ScreenWidth = (int)e.ScreenWidth;
- effect.ScreenHeight = (int)e.ScreenHeight;
-
- // Draw the effect
- e.DrawingSession.DrawImage(effect);
- };
-
- Win32ApplicationRunner.Run(application, "ComputeSharp.D2D1");
-
- return S.S_OK;
- }
-
- // If no shader matches, check if help was requested
- if (shaderName is "-h")
- {
- Console.WriteLine($"""
- Available shaders:
-
- - {nameof(HelloWorld)}
- - {nameof(ColorfulInfinity)}
- - {nameof(FractalTiling)}
- - {nameof(TwoTiledTruchet)}
- - {nameof(MengerJourney)}
- - {nameof(Octagrams)}
- - {nameof(ProteanClouds)}
- - {nameof(PyramidPattern)}
- - {nameof(TriangleGridContouring)}
- - {nameof(TerracedHills)}
- """);
-
- return S.S_OK;
- }
-}
-
-return E.E_INVALIDARG;
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.D2D1.Cli/app.manifest b/samples/ComputeSharp.SwapChain.D2D1.Cli/app.manifest
deleted file mode 100644
index 526a6e63..00000000
--- a/samples/ComputeSharp.SwapChain.D2D1.Cli/app.manifest
+++ /dev/null
@@ -1,9 +0,0 @@
-
-
-
-
- true
- PerMonitorV2
-
-
-
diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/App.cs b/samples/ComputeSharp.SwapChain.D2D1.Uwp/App.cs
deleted file mode 100644
index 1b3ffd11..00000000
--- a/samples/ComputeSharp.SwapChain.D2D1.Uwp/App.cs
+++ /dev/null
@@ -1,120 +0,0 @@
-using System.Diagnostics.CodeAnalysis;
-using ComputeSharp.SwapChain.D2D1.Backend;
-using ComputeSharp.SwapChain.D2D1.Extensions;
-using ComputeSharp.SwapChain.Shaders.D2D1;
-using Windows.ApplicationModel.Core;
-using Windows.UI.Core;
-using Windows.UI.ViewManagement;
-
-namespace ComputeSharp.SwapChain.D2D1;
-
-///
-/// A sample app rendering D2D shaders into a instance.
-///
-public sealed partial class App : IFrameworkViewSource, IFrameworkView
-{
- ///
- /// The collection of available pixel shader effects.
- ///
- private static readonly PixelShaderEffect[] Effects =
- [
- new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))),
- new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))),
- new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))),
- new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))),
- new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))),
- new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))),
- new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))),
- new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))),
- new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))
- ];
-
- ///
- /// The for the current app instance.
- ///
- private CoreApplicationView? applicationView;
-
- ///
- /// The used to display the app content.
- ///
- private CoreWindow? window;
-
- ///
- /// The currently selected effect (one of the items in ).
- ///
- private PixelShaderEffect selectedEffect = Effects[0];
-
- ///
- /// The entry point for the application.
- ///
- public static void Main()
- {
- CoreApplication.Run(new App());
- }
-
- ///
- public IFrameworkView CreateView()
- {
- return this;
- }
-
- ///
- [MemberNotNull(nameof(applicationView))]
- public void Initialize(CoreApplicationView applicationView)
- {
- this.applicationView = applicationView;
- }
-
- ///
- [MemberNotNull(nameof(window))]
- public void SetWindow(CoreWindow window)
- {
- this.window = window;
- }
-
- ///
- public void Load(string entryPoint)
- {
- }
-
- ///
- public void Run()
- {
- this.applicationView!.TitleBar.ExtendViewIntoTitleBar = true;
-
- ApplicationView.GetForCurrentView().TitleBar.StyleTitleBarForExtendedIntoViewMode();
-
- // Switch the shader to use when pressing the number keys
- this.window!.CharacterReceived += (s, e) =>
- {
- if (e.KeyCode is >= '1' and <= '9')
- {
- this.selectedEffect = Effects[(int)(e.KeyCode - '1')];
-
- e.Handled = true;
- }
- };
-
- CoreWindowApplication application = new();
-
- application.Draw += (s, e) =>
- {
- PixelShaderEffect effect = this.selectedEffect;
-
- // Set the effect properties
- effect.ElapsedTime = e.TotalTime;
- effect.ScreenWidth = (int)e.ScreenWidth;
- effect.ScreenHeight = (int)e.ScreenHeight;
-
- // Draw the effect
- e.DrawingSession.DrawImage(effect);
- };
-
- CoreWindowApplicationRunner.Run(application, this.window);
- }
-
- ///
- public void Uninitialize()
- {
- }
-}
diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/LockScreenLogo.scale-200.png b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/LockScreenLogo.scale-200.png
deleted file mode 100644
index 7440f0d4..00000000
Binary files a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/LockScreenLogo.scale-200.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/SplashScreen.scale-200.png b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/SplashScreen.scale-200.png
deleted file mode 100644
index 1df2cb62..00000000
Binary files a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/SplashScreen.scale-200.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/Square150x150Logo.scale-200.png b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/Square150x150Logo.scale-200.png
deleted file mode 100644
index 84faf5ff..00000000
Binary files a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/Square150x150Logo.scale-200.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/Square44x44Logo.scale-200.png b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/Square44x44Logo.scale-200.png
deleted file mode 100644
index f02661b2..00000000
Binary files a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/Square44x44Logo.scale-200.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
deleted file mode 100644
index 3e58e5b6..00000000
Binary files a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/StoreLogo.scale-200.png b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/StoreLogo.scale-200.png
deleted file mode 100644
index 7bc22428..00000000
Binary files a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/StoreLogo.scale-200.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/Wide310x150Logo.scale-200.png b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/Wide310x150Logo.scale-200.png
deleted file mode 100644
index d800c4a0..00000000
Binary files a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/Wide310x150Logo.scale-200.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Backend/CoreWindowApplication.cs b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Backend/CoreWindowApplication.cs
deleted file mode 100644
index 4640c165..00000000
--- a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Backend/CoreWindowApplication.cs
+++ /dev/null
@@ -1,142 +0,0 @@
-using System;
-using System.Diagnostics.CodeAnalysis;
-using Microsoft.Graphics.Canvas;
-using Windows.Graphics.Display;
-using Windows.Graphics.Imaging;
-using Windows.UI.Core;
-
-namespace ComputeSharp.SwapChain.D2D1.Backend;
-
-///
-/// A simple application handling a D2D swapchain.
-///
-internal sealed class CoreWindowApplication
-{
- ///
- /// The instance to use.
- ///
- private CanvasDevice? canvasDevice;
-
- ///
- /// The instance to use to render frames.
- ///
- private CanvasSwapChain? canvasSwapChain;
-
- ///
- /// Whether or not the window has been resized and requires the buffers to be updated.
- ///
- private volatile bool isResizePending;
-
- ///
- /// The current screen width in raw pixels.
- ///
- private uint screenWidth;
-
- ///
- /// The current screen height in raw pixels.
- ///
- private uint screenHeight;
-
- ///
- /// Raised whenever a draw operation can be performed.
- ///
- public event EventHandler? Draw;
-
- ///
- /// Initializes the current application.
- ///
- /// The instance.
- [MemberNotNull(nameof(canvasDevice))]
- [MemberNotNull(nameof(canvasSwapChain))]
- public unsafe void OnInitialize(CoreWindow window)
- {
- // Create a new canvas device, which will handle DX11/D2D initialization
- CanvasDevice canvasDevice = new();
-
- // Create the swapchain for rendering (it is automatically tied to the window)
- CanvasSwapChain canvasSwapChain = CanvasSwapChain.CreateForCoreWindow(
- resourceCreator: canvasDevice,
- coreWindow: window,
- dpi: DisplayInformation.GetForCurrentView().LogicalDpi);
-
- // Save the Win2D objects for later use
- this.canvasDevice = canvasDevice;
- this.canvasSwapChain = canvasSwapChain;
-
- // Store the initial size of the screen
- this.screenWidth = canvasSwapChain.SizeInPixels.Width;
- this.screenHeight = canvasSwapChain.SizeInPixels.Height;
- }
-
- ///
- /// Resizes the current application.
- ///
- public void OnResize()
- {
- this.isResizePending = true;
- }
-
- ///
- /// Updates the current application.
- ///
- /// The current time since the start of the application.
- public void OnUpdate(TimeSpan time)
- {
- if (this.isResizePending)
- {
- // Resize the swapchain if needed (the size is calculated automatically)
- this.canvasSwapChain!.ResizeBuffers(0, 0);
-
- BitmapSize bitmapSize = this.canvasSwapChain!.SizeInPixels;
-
- this.screenWidth = bitmapSize.Width;
- this.screenHeight = bitmapSize.Height;
-
- this.isResizePending = false;
- }
-
- // Create the drawing session and invoke all registered draw handler
- using (CanvasDrawingSession canvasDrawingSession = this.canvasSwapChain!.CreateDrawingSession(default))
- {
- Draw?.Invoke(this, new DrawEventArgs
- {
- ScreenWidth = this.screenWidth,
- ScreenHeight = this.screenHeight,
- TotalTime = time,
- DrawingSession = canvasDrawingSession
- });
- }
-
- // Wait for v-sync
- this.canvasSwapChain.WaitForVerticalBlank();
-
- // Present the new frame
- this.canvasSwapChain.Present(syncInterval: 1);
- }
-
- ///
- /// Arguments for .
- ///
- public sealed class DrawEventArgs : EventArgs
- {
- ///
- /// Gets the screen width in raw pixels.
- ///
- public required uint ScreenWidth { get; init; }
-
- ///
- /// Gets the screen height in raw pixels.
- ///
- public required uint ScreenHeight { get; init; }
-
- ///
- /// Gets the total time for the rendering loop.
- ///
- public required TimeSpan TotalTime { get; init; }
-
- ///
- /// Gets the instance to use.
- ///
- public required CanvasDrawingSession DrawingSession { get; init; }
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Backend/CoreWindowApplicationRunner.cs b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Backend/CoreWindowApplicationRunner.cs
deleted file mode 100644
index 4d1a868d..00000000
--- a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Backend/CoreWindowApplicationRunner.cs
+++ /dev/null
@@ -1,56 +0,0 @@
-using System.Diagnostics;
-using System.Threading;
-using Windows.UI.Core;
-
-namespace ComputeSharp.SwapChain.D2D1.Backend;
-
-///
-/// A helper class to manage the creation and execution of applications.
-///
-internal static class CoreWindowApplicationRunner
-{
- ///
- /// Runs a specified application and starts the main loop to update its state. This is the entry point for a given application,
- /// and it should be called as soon as the process is launched, excluding any other additional initialization needed.
- ///
- /// The input application instance to run.
- /// The instance.
- public static void Run(CoreWindowApplication application, CoreWindow window)
- {
- // Initialize the application
- application.OnInitialize(window);
-
- // Setup the render thread that enables smooth resizing of the window
- Thread renderThread = new(static args =>
- {
- (CoreWindowApplication application, CancellationToken token) = ((CoreWindowApplication, CancellationToken))args!;
-
- Stopwatch stopwatch = Stopwatch.StartNew();
-
- while (!token.IsCancellationRequested)
- {
- application.OnUpdate(stopwatch.Elapsed);
- }
- });
-
- CancellationTokenSource tokenSource = new();
-
- // Start the render thread before activating the window.
- // This allows the app to show up while already drawing.
- renderThread.Start((application, tokenSource.Token));
-
- // Register a callback to monitor resize operations
- window.ResizeCompleted += (s, e) => application.OnResize();
-
- // Activate the window
- window.Activate();
-
- // Process any messages in the queue
- window.Dispatcher.ProcessEvents(CoreProcessEventsOption.ProcessUntilQuit);
-
- tokenSource.Cancel();
-
- // Wait for the render thread to stop before terminating
- renderThread.Join();
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Backend/PixelShaderEffect.cs b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Backend/PixelShaderEffect.cs
deleted file mode 100644
index 904dbe4b..00000000
--- a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Backend/PixelShaderEffect.cs
+++ /dev/null
@@ -1,65 +0,0 @@
-using System;
-using ComputeSharp.D2D1;
-using ComputeSharp.D2D1.Descriptors;
-using ComputeSharp.D2D1.Uwp;
-
-namespace ComputeSharp.SwapChain.D2D1.Backend;
-
-///
-/// An base effect for an animated pixel shader.
-///
-internal abstract partial class PixelShaderEffect : CanvasEffect
-{
- ///
- /// Gets or sets the total elapsed time.
- ///
- [GeneratedCanvasEffectProperty]
- public partial TimeSpan ElapsedTime { get; set; }
-
- ///
- /// Gets or sets the screen width in raw pixels.
- ///
- [GeneratedCanvasEffectProperty]
- public partial int ScreenWidth { get; set; }
-
- ///
- /// Gets or sets the screen height in raw pixels.
- ///
- [GeneratedCanvasEffectProperty]
- public partial int ScreenHeight { get; set; }
-
- ///
- /// An effect for an animated pixel shader.
- ///
- /// The type of pixel shader to render.
- /// The input factory.
- public sealed partial class For(For.Factory factory) : PixelShaderEffect
- where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor
- {
- ///
- /// The node in use.
- ///
- private static readonly CanvasEffectNode> Effect = new();
-
- ///
- protected override void BuildEffectGraph(CanvasEffectGraph effectGraph)
- {
- effectGraph.RegisterOutputNode(Effect, new PixelShaderEffect());
- }
-
- ///
- protected override void ConfigureEffectGraph(CanvasEffectGraph effectGraph)
- {
- effectGraph.GetNode(Effect).ConstantBuffer = factory(ElapsedTime, ScreenWidth, ScreenHeight);
- }
-
- ///
- /// A factory of a given shader instance.
- ///
- /// The total elapsed time.
- /// The screen width in raw pixels.
- /// The screen height in raw pixels.
- /// A shader instance to render.
- public delegate T Factory(TimeSpan elapsedTime, int screenWidth, int screenHeight);
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/ComputeSharp.SwapChain.D2D1.Uwp.csproj b/samples/ComputeSharp.SwapChain.D2D1.Uwp/ComputeSharp.SwapChain.D2D1.Uwp.csproj
deleted file mode 100644
index d3e34c58..00000000
--- a/samples/ComputeSharp.SwapChain.D2D1.Uwp/ComputeSharp.SwapChain.D2D1.Uwp.csproj
+++ /dev/null
@@ -1,54 +0,0 @@
-
-
- WinExe
- net8.0-windows10.0.22621.0
- 10.0.17763.0
- true
- x64;ARM64
- win-x64;win-arm64
- en-US
- win-$(Platform).pubxml
- true
- false
-
-
- 1.3.20250314.1
-
-
-
-
- true
- true
- true
- false
- Speed
- false
- true
- false
- false
- false
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Extensions/ApplicationViewTitleBarExtensions.cs b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Extensions/ApplicationViewTitleBarExtensions.cs
deleted file mode 100644
index 5e8325b1..00000000
--- a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Extensions/ApplicationViewTitleBarExtensions.cs
+++ /dev/null
@@ -1,33 +0,0 @@
-using Windows.UI;
-using Windows.UI.ViewManagement;
-
-namespace ComputeSharp.SwapChain.D2D1.Extensions;
-
-///
-/// Extensions for .
-///
-internal static class ApplicationViewTitleBarExtensions
-{
- ///
- /// Styles the title bar to look correctly when the view is expanded into it.
- ///
- /// The input title bar.
- public static void StyleTitleBarForExtendedIntoViewMode(this ApplicationViewTitleBar titleBar)
- {
- // Transparent colors
- titleBar.ForegroundColor = Colors.Transparent;
- titleBar.BackgroundColor = Colors.Transparent;
- titleBar.ButtonBackgroundColor = Colors.Transparent;
- titleBar.InactiveBackgroundColor = Colors.Transparent;
- titleBar.ButtonInactiveBackgroundColor = Colors.Transparent;
-
- // Theme aware colors
- titleBar.ButtonForegroundColor = Colors.White;
- titleBar.ButtonHoverForegroundColor = Colors.White;
- titleBar.ButtonPressedForegroundColor = Colors.White;
- titleBar.ButtonHoverBackgroundColor = Color.FromArgb(0x20, 0xFF, 0xFF, 0xFF);
- titleBar.ButtonPressedBackgroundColor = Color.FromArgb(0x40, 0xFF, 0xFF, 0xFF);
- titleBar.ButtonInactiveForegroundColor = Color.FromArgb(0xC0, 0xFF, 0xFF, 0xFF);
- titleBar.InactiveForegroundColor = Color.FromArgb(0xA0, 0xA0, 0xA0, 0xA0);
- }
-}
diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Package.appxmanifest b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Package.appxmanifest
deleted file mode 100644
index 71dd299a..00000000
--- a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Package.appxmanifest
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-
-
-
-
-
- ComputeSharp Sample App (Core)
- Sergio Pedri
- Assets\StoreLogo.png
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Properties/PublishProfiles/win-arm64.pubxml b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Properties/PublishProfiles/win-arm64.pubxml
deleted file mode 100644
index 5de0b991..00000000
--- a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Properties/PublishProfiles/win-arm64.pubxml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
- FileSystem
- ARM64
- win-arm64
- bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\
- true
- true
-
-
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Properties/PublishProfiles/win-x64.pubxml b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Properties/PublishProfiles/win-x64.pubxml
deleted file mode 100644
index 89844a87..00000000
--- a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Properties/PublishProfiles/win-x64.pubxml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
- FileSystem
- x64
- win-x64
- bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\
- true
- true
-
-
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Properties/launchSettings.json b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Properties/launchSettings.json
deleted file mode 100644
index 2dcd9bf6..00000000
--- a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Properties/launchSettings.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "profiles": {
- "ComputeSharp.SwapChain.D2D1.Uwp": {
- "commandName": "MsixPackage"
- }
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.Shaders.D2D1/ColorfulInfinity.cs b/samples/ComputeSharp.SwapChain.Shaders.D2D1/ColorfulInfinity.cs
deleted file mode 100644
index f47a7c8a..00000000
--- a/samples/ComputeSharp.SwapChain.Shaders.D2D1/ColorfulInfinity.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-using ComputeSharp.D2D1;
-
-namespace ComputeSharp.SwapChain.Shaders.D2D1;
-
-///
-/// A shader creating an abstract and colorful animation.
-/// Ported from .
-/// Created by Benoit Marini.
-/// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
-///
-/// The current time since the start of the application.
-/// The dispatch size for the current output.
-[D2DInputCount(0)]
-[D2DRequiresScenePosition]
-[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)]
-[D2DGeneratedPixelShaderDescriptor]
-internal readonly partial struct ColorfulInfinity(float time, int2 dispatchSize) : ID2D1PixelShader
-{
- ///
- /// The total number of layers for the final animation.
- ///
- private const float NumberOfLayers = 16.0f;
-
- ///
- /// The number of iterations to calculate a texel value.
- ///
- private const int NumberOfIterations = 23;
-
- ///
- /// Makes some magic happen.
- ///
- private float4 Tex(float3 p)
- {
- float t = time + 78.0f;
- float4 o = new(p.X, p.Y, p.Z, 3.0f * Hlsl.Sin(t * 0.1f));
- float4 dec =
- new float4(1.0f, 0.9f, 0.1f, 0.15f) +
- new float4(0.06f * Hlsl.Cos(t * 0.1f), 0, 0, 0.14f * Hlsl.Cos(t * 0.23f));
-
- for (int i = 0; i++ < NumberOfIterations;)
- {
- o.XZYW = Hlsl.Abs((o / Hlsl.Dot(o, o)) - dec);
- }
-
- return o;
- }
-
- ///
- public float4 Execute()
- {
- int2 xy = (int2)D2D.GetScenePosition().XY;
- float2 uv = (xy - ((float2)dispatchSize * 0.5f)) / dispatchSize.Y;
- float3 col = 0;
- float t = time * 0.3f;
-
- for (float i = 0.0f; i <= 1.0f; i += 1.0f / NumberOfLayers)
- {
- float d = Hlsl.Frac(i + t);
- float s = Hlsl.Lerp(5.0f, 0.5f, d);
- float f = d * Hlsl.SmoothStep(1.0f, 0.9f, d);
-
- col += Tex(new float3(uv.X * s, uv.Y * s, i * 4.0f)).XYZ * f;
- }
-
- col /= NumberOfLayers;
- col *= new float3(2, 1.0f, 2.0f);
- col = Hlsl.Pow(col, 0.5f);
-
- return new(col.X, col.Y, col.Z, 1.0f);
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.Shaders.D2D1/ComputeSharp.SwapChain.Shaders.D2D1.projitems b/samples/ComputeSharp.SwapChain.Shaders.D2D1/ComputeSharp.SwapChain.Shaders.D2D1.projitems
deleted file mode 100644
index 68e39943..00000000
--- a/samples/ComputeSharp.SwapChain.Shaders.D2D1/ComputeSharp.SwapChain.Shaders.D2D1.projitems
+++ /dev/null
@@ -1,24 +0,0 @@
-
-
-
- $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
- true
- f8bf7666-7ccf-4fe4-b055-2eba4bcd4564
-
-
- ComputeSharp.SwapChain.Shaders.D2D1
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.Shaders.D2D1/ComputeSharp.SwapChain.Shaders.D2D1.shproj b/samples/ComputeSharp.SwapChain.Shaders.D2D1/ComputeSharp.SwapChain.Shaders.D2D1.shproj
deleted file mode 100644
index c2c2af49..00000000
--- a/samples/ComputeSharp.SwapChain.Shaders.D2D1/ComputeSharp.SwapChain.Shaders.D2D1.shproj
+++ /dev/null
@@ -1,12 +0,0 @@
-
-
-
- f8bf7666-7ccf-4fe4-b055-2eba4bcd4564
- 14.0
-
-
-
-
-
-
-
diff --git a/samples/ComputeSharp.SwapChain.Shaders.D2D1/ContouredLayers.cs b/samples/ComputeSharp.SwapChain.Shaders.D2D1/ContouredLayers.cs
deleted file mode 100644
index 4a5c165d..00000000
--- a/samples/ComputeSharp.SwapChain.Shaders.D2D1/ContouredLayers.cs
+++ /dev/null
@@ -1,203 +0,0 @@
-using ComputeSharp.D2D1;
-
-namespace ComputeSharp.SwapChain.Shaders.D2D1;
-
-///
-/// Constructing some concise contoured layers, then applying various edge and shading effects to produce some faux depth.
-/// Ported from .
-/// Created by Shane.
-///
-/// The current time since the start of the application.
-/// The dispatch size for the current output.
-[D2DInputCount(0)]
-[D2DRequiresScenePosition]
-[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)]
-[D2DGeneratedPixelShaderDescriptor]
-internal readonly partial struct ContouredLayers(float time, int2 dispatchSize) : ID2D1PixelShader
-{
- ///
- /// The background texture to sample.
- ///
- [D2DResourceTextureIndex(0)]
- private readonly D2D1ResourceTexture2D texture;
-
- // float3 to float hash.
- private static float Hash21(float2 p)
- {
- return Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(p, new float2(41, 289))) * 45758.5453f);
- }
-
- // float2 to float2 hash.
- private float2 Hash22(float2 p)
- {
- float n = Hlsl.Sin(Hlsl.Dot(p, new float2(1, 113)));
-
- p = Hlsl.Frac(new float2(262144, 32768) * n);
-
- return Hlsl.Sin((p * 6.2831853f) + time);
- }
-
- // float2 to float2 hash.
- private static float2 Hash22B(float2 p)
- {
- float n = Hlsl.Sin(Hlsl.Dot(p, new float2(41, 289)));
-
- return (Hlsl.Frac(new float2(262144, 32768) * n) * 2.0f) - 1.0f;
- }
-
- // Smooth 2D noise
- private static float Noise2D(float2 p)
- {
- float2 i = Hlsl.Floor(p);
-
- p -= i;
-
- float4 v = default;
-
- v.X = Hlsl.Dot(Hash22B(i), p);
- v.Y = Hlsl.Dot(Hash22B(i + float2.UnitX), p - float2.UnitX);
- v.Z = Hlsl.Dot(Hash22B(i + float2.UnitY), p - float2.UnitY);
- v.W = Hlsl.Dot(Hash22B(i + 1.0f), p - 1.0f);
-
- p = p * p * (3.0f - (2.0f * p));
-
- return Hlsl.Lerp(Hlsl.Lerp(v.X, v.Y, p.X), Hlsl.Lerp(v.Z, v.W, p.X), p.Y);
- }
-
- // Based on IQ's gradient noise formula.
- private float Noise2D3G(float2 p)
- {
- float2 i = Hlsl.Floor(p);
-
- p -= i;
-
- float4 v = default;
-
- v.X = Hlsl.Dot(Hash22(i), p);
- v.Y = Hlsl.Dot(Hash22(i + float2.UnitX), p - float2.UnitX);
- v.Z = Hlsl.Dot(Hash22(i + float2.UnitY), p - float2.UnitY);
- v.W = Hlsl.Dot(Hash22(i + 1.0f), p - 1.0f);
-
- p = p * p * p * ((p * ((p * 6.0f) - 15.0f)) + 10.0f);
-
- return Hlsl.Lerp(Hlsl.Lerp(v.X, v.Y, p.X), Hlsl.Lerp(v.Z, v.W, p.X), p.Y);
- }
-
- // Map function with noise layers
- private float MapNoise(float3 p, float i)
- {
- return (Noise2D3G(p.XY * 3.0f) * 0.66f) + (Noise2D3G(p.XY * 6.0f) * 0.34f) + (i / 10.0f * 1.0f) - 0.15f;
- }
-
- // 2D derivative function.
- private float3 GetNormal(in float3 p, float m, float i)
- {
- float2 e = new(0.001f, 0);
-
- return new float3(m - MapNoise(p - e.XYY, i), m - MapNoise(p - e.YXY, i), 0.0f) / e.X * 1.4142f;
- }
-
- // The map layer and its derivative
- private float4 MapLayer(in float3 p, float i)
- {
- float4 d = default;
-
- d.X = MapNoise(p, i);
- d.YZW = GetNormal(p, d.X, i);
-
- return d;
- }
-
- // Layer color. Based on the shade, layer number and smoothing factor.
- private float3 GetColor(float2 p, float sh, float fi)
- {
- float3 tx = this.texture.Sample(p + Hash21(new float2(sh, fi))).XYZ;
-
- tx *= tx;
-
- float3 col;
-
- col = (float3)1.0f * (1.0f - (0.75f / (1.0f + (sh * sh * 2.0f))));
- col = Hlsl.Min(col * tx * 3.0f, 1.0f);
-
- return col;
- }
-
- // A hatch-like algorithm, or a stipple... or some kind of textured pattern.
- private float Hatch(float2 p, float res)
- {
- p *= res / 16.0f;
-
- float hatch = Hlsl.Clamp((Hlsl.Sin((p.X - p.Y) * 3.14159f * 200.0f) * 2.0f) + 0.5f, 0.0f, 1.0f);
-
- float hRnd = Hash21(Hlsl.Floor(p * 6.0f) + 0.73f);
- if (hRnd > 0.66f)
- {
- hatch = hRnd;
- }
-
- hatch = (hatch * 0.75f) + 0.5f;
-
- return hatch;
- }
-
- ///
- public float4 Execute()
- {
- int2 xy = (int2)D2D.GetScenePosition().XY;
- float2 fragCoord = new(xy.X, dispatchSize.Y - xy.Y);
- float res = Hlsl.Min(dispatchSize.Y, 700.0f);
- float2 uv = (fragCoord - ((float2)dispatchSize * 0.5f)) / res;
- float sf = 1.0f / dispatchSize.Y;
- float3 col = GetColor(uv, 0.0f, 0.0f);
- float pL = 0.0f;
- float hatch = Hatch(uv, res);
-
- col *= hatch;
-
- const int lNum = 5;
- float flNum = lNum;
-
- for (int i = 0; i < lNum; i++)
- {
- float fi = i;
-
- hatch = Hatch(uv + Hlsl.Sin(new float2(41.0f, 289.0f) * (fi + 1.0f)), res);
-
- float4 c = MapLayer(new float3(uv, 1.0f), fi);
- float4 cSh = MapLayer(new float3(uv - (new float2(0.03f, -0.03f) * (((flNum - fi) / flNum * 0.5f) + 0.5f)), 1.0f), fi);
- float sh = (fi + 1.0f) / flNum;
- float3 lCol = GetColor(uv, sh, fi + 1.0f);
- float3 ld = Hlsl.Normalize(new float3(-1, 1, -0.25f));
- float3 n = Hlsl.Normalize(new float3(0.0f, 0.0f, -1.0f) + c.YZW);
- float diff = Hlsl.Max(Hlsl.Dot(ld, n), 0.0f);
-
- diff *= 2.5f;
-
- float3 eCol = lCol * (diff + 1.0f);
- float sfL = sf * Hlsl.Length(c.YZX) * 2.0f;
- float sfLSh = sf * Hlsl.Length(cSh.YZX) * 6.0f;
- const float shF = 0.5f;
-
- col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sfLSh, Hlsl.Max(cSh.X, pL))) * shF);
- col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sfL * 3.0f, c.X)) * 0.25f);
- col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sfL, c.X)) * 0.85f);
- col = Hlsl.Lerp(col, eCol * hatch, 1.0f - Hlsl.SmoothStep(0.0f, sfL, c.X + (Hlsl.Length(c.YZX) * 0.003f)));
- col = Hlsl.Lerp(col, lCol * hatch, 1.0f - Hlsl.SmoothStep(0.0f, sfL, c.X + (Hlsl.Length(c.YZX) * 0.006f)));
-
- pL = c.X;
- }
-
- col *= Hlsl.Lerp(new float3(1.8f, 1, 0.7f).ZYX, new float3(1.8f, 1, 0.7f).XZY, Noise2D(uv * 2.0f));
-
- float3 rn3 = Noise2D((uv * dispatchSize.Y / 1.0f) + 1.7f) - Noise2D((uv * dispatchSize.Y / 1.0f) + 3.4f);
-
- col *= 0.93f + (0.07f * rn3.XYZ) + (0.07f * Hlsl.Dot(rn3, new float3(0.299f, 0.587f, 0.114f)));
-
- uv = fragCoord / dispatchSize.XY;
-
- col *= Hlsl.Pow(Hlsl.Abs(16.0f * uv.X * uv.Y * (1.0f - uv.X) * (1.0f - uv.Y)), 0.0625f);
-
- return new float4(Hlsl.Sqrt(Hlsl.Max(col, 0.0f)), 1);
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.Shaders.D2D1/FractalTiling.cs b/samples/ComputeSharp.SwapChain.Shaders.D2D1/FractalTiling.cs
deleted file mode 100644
index 68f0a79a..00000000
--- a/samples/ComputeSharp.SwapChain.Shaders.D2D1/FractalTiling.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-using ComputeSharp.D2D1;
-
-namespace ComputeSharp.SwapChain.Shaders.D2D1;
-
-///
-/// A shader creating a fractal tiling animation.
-/// Ported from .
-/// Created by Inigo Quilez.
-/// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
-///
-/// The current time since the start of the application.
-/// The dispatch size for the current output.
-[D2DInputCount(0)]
-[D2DRequiresScenePosition]
-[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)]
-[D2DGeneratedPixelShaderDescriptor]
-internal readonly partial struct FractalTiling(float time, int2 dispatchSize) : ID2D1PixelShader
-{
- ///
- public float4 Execute()
- {
- int2 xy = (int2)D2D.GetScenePosition().XY;
- float2 position = (((float2)(256 * xy)) / dispatchSize.X) + time;
- float4 color = 0;
-
- for (int i = 0; i < 6; i++)
- {
- float2 a = Hlsl.Floor(position);
- float2 b = Hlsl.Frac(position);
- float4 w = Hlsl.Frac(
- (Hlsl.Sin((a.X * 7) + (31.0f * a.Y) + (0.01f * time)) +
- new float4(0.035f, 0.01f, 0, 0.7f))
- * 13.545317f);
-
- color.XYZ += w.XYZ *
- 2.0f * Hlsl.SmoothStep(0.45f, 0.55f, w.W) *
- Hlsl.Sqrt(16.0f * b.X * b.Y * (1.0f - b.X) * (1.0f - b.Y));
-
- position /= 2.0f;
- color /= 2.0f;
- }
-
- color.XYZ = Hlsl.Pow(color.XYZ, new float3(0.7f, 0.8f, 0.5f));
- color.W = 1.0f;
-
- return color;
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.Shaders.D2D1/HelloWorld.cs b/samples/ComputeSharp.SwapChain.Shaders.D2D1/HelloWorld.cs
deleted file mode 100644
index a6f021e0..00000000
--- a/samples/ComputeSharp.SwapChain.Shaders.D2D1/HelloWorld.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-using ComputeSharp.D2D1;
-
-namespace ComputeSharp.SwapChain.Shaders.D2D1;
-
-///
-/// A simple shader to get started with based on shadertoy new shader template.
-/// Ported from .
-///
-/// The current time since the start of the application.
-/// The dispatch size for the current output.
-[D2DInputCount(0)]
-[D2DRequiresScenePosition]
-[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)]
-[D2DGeneratedPixelShaderDescriptor]
-internal readonly partial struct HelloWorld(float time, int2 dispatchSize) : ID2D1PixelShader
-{
- ///
- public float4 Execute()
- {
- int2 xy = (int2)D2D.GetScenePosition().XY;
-
- // Normalized screen space UV coordinates from 0.0 to 1.0
- float2 uv = xy / (float2)dispatchSize;
-
- // Time varying pixel color
- float3 col = 0.5f + (0.5f * Hlsl.Cos(time + new float3(uv, uv.X) + new float3(0, 2, 4)));
-
- // Output to screen
- return new(col, 1f);
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.Shaders.D2D1/MengerJourney.cs b/samples/ComputeSharp.SwapChain.Shaders.D2D1/MengerJourney.cs
deleted file mode 100644
index 159d64a3..00000000
--- a/samples/ComputeSharp.SwapChain.Shaders.D2D1/MengerJourney.cs
+++ /dev/null
@@ -1,177 +0,0 @@
-using ComputeSharp.D2D1;
-
-namespace ComputeSharp.SwapChain.Shaders.D2D1;
-
-///
-/// A shader creating a flythrough in a Menger system.
-/// Ported from .
-/// Created by Syntopia.
-///
-/// The current time since the start of the application.
-/// The dispatch size for the current output.
-[D2DInputCount(0)]
-[D2DRequiresScenePosition]
-[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)]
-[D2DGeneratedPixelShaderDescriptor]
-internal readonly partial struct MengerJourney(float time, int2 dispatchSize) : ID2D1PixelShader
-{
- private const int MaxSteps = 30;
- private const float MinimumDistance = 0.0009f;
- private const float NormalDistance = 0.0002f;
- private const int Iterations = 7;
- private const float Scale = 3.0f;
- private const float FieldOfView = 1.0f;
- private const float Jitter = 0.05f;
- private const float FudgeFactor = 0.7f;
- private const float NonLinearPerspective = 2.0f;
- private const float Ambient = 0.32184f;
- private const float Diffuse = 0.5f;
-
- private static readonly float3 LightDir = 1.0f;
- private static readonly float3 LightColor = new(1.0f, 1.0f, 0.858824f);
- private static readonly float3 LightDir2 = new(1.0f, -1.0f, 1.0f);
- private static readonly float3 LightColor2 = new(0, 0.333333f, 1.0f);
- private static readonly float3 Offset = new(0.92858f, 0.92858f, 0.32858f);
-
- ///
- /// Rotates a given value by a specified amount.
- ///
- private static float2 Rotate(float2 v, float a)
- {
- return new((Hlsl.Cos(a) * v.X) + (Hlsl.Sin(a) * v.Y), (-Hlsl.Sin(a) * v.X) + (Hlsl.Cos(a) * v.Y));
- }
-
- ///
- /// Calculates the light at a specified normal and starting color.
- /// Uses two light sources and no specular lights.
- ///
- private static float3 GetLight(in float3 color, in float3 normal)
- {
- float3 lightDir = Hlsl.Normalize(LightDir);
- float diffuse = Hlsl.Max(0.0f, Hlsl.Dot(-normal, lightDir));
-
- float3 lightDir2 = Hlsl.Normalize(LightDir2);
- float diffuse2 = Hlsl.Max(0.0f, Hlsl.Dot(-normal, lightDir2));
-
- return
- (diffuse * Diffuse * (LightColor * color)) +
- (diffuse2 * Diffuse * (LightColor2 * color));
- }
-
- ///
- /// DE: Infinitely tiled Menger IFS.
- /// For more info on KIFS, see
- ///
- private float DE(float3 z)
- {
- // Performs the GLSL mod function.
- static float3 Mod(float3 x, float y)
- {
- return x - (y * Hlsl.Floor(x / y));
- }
-
- z = Hlsl.Abs(1.0f - Mod(z, 2.0f));
-
- float d = 1000.0f;
-
- for (int n = 0; n < Iterations; n++)
- {
- z.XY = Rotate(z.XY, 4.0f + (2.0f * Hlsl.Cos(time / 8.0f)));
- z = Hlsl.Abs(z);
-
- if (z.X < z.Y) { z.XY = z.YX; }
-
- if (z.X < z.Z) { z.XZ = z.ZX; }
-
- if (z.Y < z.Z) { z.YZ = z.ZY; }
-
- z = (Scale * z) - (Offset * (Scale - 1.0f));
-
- if (z.Z < -0.5f * Offset.Z * (Scale - 1.0f))
- {
- z.Z += Offset.Z * (Scale - 1.0f);
- }
-
- d = Hlsl.Min(d, Hlsl.Length(z) * Hlsl.Pow(Scale, -n - 1.0f));
- }
-
- return d - 0.001f;
- }
-
- ///
- /// Calculates the finite difference normal at a given position.
- ///
- private float3 GetNormal(in float3 pos)
- {
- float3 e = new(0.0f, NormalDistance, 0.0f);
-
- return Hlsl.Normalize(new float3(
- DE(pos + e.YXX) - DE(pos - e.YXX),
- DE(pos + e.XYX) - DE(pos - e.XYX),
- DE(pos + e.XXY) - DE(pos - e.XXY)));
- }
-
- ///
- /// Performs a ray march operation on a specific position.
- ///
- private float4 RayMarch(in float3 from, float3 dir, in float2 fragCoord)
- {
- // Computes a pseudo-random number
- static float Rand(float2 co)
- {
- return Hlsl.Frac(Hlsl.Cos(Hlsl.Dot(co, new float2(4.898f, 7.23f))) * 23421.631f);
- }
-
- float totalDistance = Jitter * Rand(fragCoord.XY + time);
- float3 dir2 = dir;
- float distance = 0;
- int steps = 0;
- float3 pos = 0;
-
- for (int i = 0; i < MaxSteps; i++)
- {
- dir.ZY = Rotate(dir2.ZY, totalDistance * Hlsl.Cos(time / 4.0f) * NonLinearPerspective);
- pos = from + (totalDistance * dir);
- distance = DE(pos) * FudgeFactor;
- totalDistance += distance;
-
- if (distance < MinimumDistance)
- {
- break;
- }
-
- steps = i;
- }
-
- float smoothStep = steps + (distance / MinimumDistance);
- float ao = 1.1f - (smoothStep / MaxSteps);
- float3 normal = GetNormal(pos - (dir * NormalDistance * 3.0f));
- float3 color = 1.0f;
- float3 light = GetLight(color, normal);
-
- color = ((color * Ambient) + light) * ao;
-
- return new(color.X, color.Y, color.Z, 1.0f);
- }
-
- ///
- public float4 Execute()
- {
- int2 xy = (int2)D2D.GetScenePosition().XY;
- float3 camPos = 0.5f * time * new float3(1.0f, 0.0f, 0.0f);
- float3 target = camPos + new float3(1.0f, 0.0f * Hlsl.Cos(time), 0.0f * Hlsl.Sin(0.4f * time));
- float3 camDir = Hlsl.Normalize(target - camPos);
- float3 camUp = new(0.0f, 1.0f, 0.0f);
-
- camUp = Hlsl.Normalize(camUp - (Hlsl.Dot(camDir, camUp) * camDir));
-
- float3 camRight = Hlsl.Normalize(Hlsl.Cross(camDir, camUp));
- float2 coord = -1.0f + (2.0f * (float2)xy / (float2)dispatchSize);
-
- coord.X *= dispatchSize.X / (float)dispatchSize.Y;
-
- float3 rayDir = Hlsl.Normalize(camDir + (((coord.X * camRight) + (coord.Y * camUp)) * FieldOfView));
-
- return RayMarch(camPos, rayDir, xy);
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.Shaders.D2D1/Octagrams.cs b/samples/ComputeSharp.SwapChain.Shaders.D2D1/Octagrams.cs
deleted file mode 100644
index ddcbcd45..00000000
--- a/samples/ComputeSharp.SwapChain.Shaders.D2D1/Octagrams.cs
+++ /dev/null
@@ -1,126 +0,0 @@
-using ComputeSharp.D2D1;
-
-namespace ComputeSharp.SwapChain.Shaders.D2D1;
-
-///
-/// A shader creating an octagram animation, inspired by arabesque.
-/// Ported from .
-/// Created by whisky_shusuky.
-///
-/// The current time since the start of the application.
-/// The dispatch size for the current output.
-[D2DInputCount(0)]
-[D2DRequiresScenePosition]
-[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)]
-[D2DGeneratedPixelShaderDescriptor]
-internal readonly partial struct Octagrams(float time, int2 dispatchSize) : ID2D1PixelShader
-{
- private static float2x2 Rotate(float a)
- {
- float c = Hlsl.Cos(a);
- float s = Hlsl.Sin(a);
-
- return new(c, s, -s, c);
- }
-
- private static float Box(float3 pos, float scale)
- {
- static float SDBox(float3 p, float3 b)
- {
- float3 q = Hlsl.Abs(p) - b;
-
- return Hlsl.Length(Hlsl.Max(q, 0.0f)) +
- Hlsl.Min(Hlsl.Max(q.X, Hlsl.Max(q.Y, q.Z)), 0.0f);
- }
-
- pos *= scale;
-
- float b = SDBox(pos, new(0.4f, 0.4f, 0.1f)) / 1.5f;
-
- pos.XY *= 5.0f;
- pos.Y -= 3.5f;
- pos.XY = Hlsl.Mul(pos.XY, Rotate(0.75f));
-
- return -b;
- }
-
- private static float BoxSet(float3 pos, float gTime)
- {
- float3 pos_origin = pos;
-
- pos = pos_origin;
- pos.Y += Hlsl.Sin(gTime * 0.4f) * 2.5f;
- pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f));
-
- float box1 = Box(pos, 2.0f - (Hlsl.Abs(Hlsl.Sin(gTime * 0.4f)) * 1.5f));
-
- pos = pos_origin;
- pos.Y -= Hlsl.Sin(gTime * 0.4f) * 2.5f;
- pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f));
-
- float box2 = Box(pos, 2.0f - (Hlsl.Abs(Hlsl.Sin(gTime * 0.4f)) * 1.5f));
-
- pos = pos_origin;
- pos.X += Hlsl.Sin(gTime * 0.4f) * 2.5f;
- pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f));
-
- float box3 = Box(pos, 2.0f - (Hlsl.Abs(Hlsl.Sin(gTime * 0.4f)) * 1.5f));
-
- pos = pos_origin;
- pos.X -= Hlsl.Sin(gTime * 0.4f) * 2.5f;
- pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f));
-
- float box4 = Box(pos, 2.0f - (Hlsl.Abs(Hlsl.Sin(gTime * 0.4f)) * 1.5f));
-
- pos = pos_origin;
- pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f));
-
- float box5 = Box(pos, 0.5f) * 6.0f;
-
- pos = pos_origin;
-
- float box6 = Box(pos, 0.5f) * 6.0f;
- float result = Hlsl.Max(Hlsl.Max(Hlsl.Max(Hlsl.Max(Hlsl.Max(box1, box2), box3), box4), box5), box6);
-
- return result;
- }
-
- ///
- public float4 Execute()
- {
- int2 xy = (int2)D2D.GetScenePosition().XY;
- float2 p = (((float2)xy * 2.0f) - dispatchSize) / Hlsl.Min(dispatchSize.X, dispatchSize.Y);
- float3 ro = new(0.0f, -0.2f, time * 4.0f);
- float3 ray = Hlsl.Normalize(new float3(p, 1.5f));
-
- ray.XY = Hlsl.Mul(ray.XY, Rotate(Hlsl.Sin(time * 0.03f) * 5.0f));
- ray.YZ = Hlsl.Mul(ray.YZ, Rotate(Hlsl.Sin(time * 0.05f) * 0.2f));
-
- float t = 0.1f;
- float ac = 0.0f;
-
- for (int i = 0; i < 99; i++)
- {
- static float3 Mod(float3 x, float y)
- {
- return x - (y * Hlsl.Floor(x / y));
- }
-
- float3 pos = ro + (ray * t);
-
- pos = Mod(pos - 2.0f, 4.0f) - 2.0f;
-
- float gTime = time - (i * 0.01f);
- float d = BoxSet(pos, gTime);
-
- d = Hlsl.Max(Hlsl.Abs(d), 0.01f);
- ac += Hlsl.Exp(-d * 23.0f);
- t += d * 0.55f;
- }
-
- float3 col = (ac * 0.02f) + new float3(0.0f, 0.2f * Hlsl.Abs(Hlsl.Sin(time)), 0.5f + (Hlsl.Sin(time) * 0.2f));
- float4 color = new(col, 1);
-
- return color;
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.Shaders.D2D1/ProteanClouds.cs b/samples/ComputeSharp.SwapChain.Shaders.D2D1/ProteanClouds.cs
deleted file mode 100644
index b77f1b67..00000000
--- a/samples/ComputeSharp.SwapChain.Shaders.D2D1/ProteanClouds.cs
+++ /dev/null
@@ -1,174 +0,0 @@
-using ComputeSharp.D2D1;
-
-namespace ComputeSharp.SwapChain.Shaders.D2D1;
-
-///
-/// Fully procedural 3D animated volume with three evaluations per step (for shading).
-/// Ported from .
-/// Created by nimitz (twitter: @stormoid).
-/// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.
-///
-/// The current time since the start of the application.
-/// The dispatch size for the current output.
-[D2DInputCount(0)]
-[D2DRequiresScenePosition]
-[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)]
-[D2DGeneratedPixelShaderDescriptor]
-internal readonly partial struct ProteanClouds(float time, int2 dispatchSize) : ID2D1PixelShader
-{
- private static readonly float3x3 M3 = new float3x3(0.33338f, 0.56034f, -0.71817f, -0.87887f, 0.32651f, -0.15323f, 0.15162f, 0.69596f, 0.61339f) * 1.93f;
-
- private static float2x2 Rotate(in float a)
- {
- float c = Hlsl.Cos(a);
- float s = Hlsl.Sin(a);
-
- return new(c, s, -s, c);
- }
-
- private static float LinStep(in float mn, in float mx, in float x)
- {
- return Hlsl.Clamp((x - mn) / (mx - mn), 0.0f, 1.0f);
- }
-
- private static float2 Disp(float t)
- {
- return new float2(Hlsl.Sin(t * 0.22f) * 1.0f, Hlsl.Cos(t * 0.175f) * 1.0f) * 2.0f;
- }
-
- private float2 Map(float3 p, float prm1, float2 bsMo)
- {
- float3 p2 = p;
-
- p2.XY -= Disp(p.Z).XY;
- p.XY = Hlsl.Mul(p.XY, Rotate((Hlsl.Sin(p.Z + time) * (0.1f + (prm1 * 0.05f))) + (time * 0.09f)));
-
- float cl = Hlsl.Dot(p2.XY, p2.XY);
- float d = 0.0f;
-
- p *= 0.61f;
-
- float z = 1.0f;
- float trk = 1.0f;
- float dspAmp = 0.1f + (prm1 * 0.2f);
-
- for (int i = 0; i < 5; i++)
- {
- p += Hlsl.Sin((p.ZXY * 0.75f * trk) + (time * trk * 0.8f)) * dspAmp;
- d -= Hlsl.Abs(Hlsl.Dot(Hlsl.Cos(p), Hlsl.Sin(p.YZX)) * z);
- z *= 0.57f;
- trk *= 1.4f;
-
- p = Hlsl.Mul(p, M3);
- }
-
- d = Hlsl.Abs(d + (prm1 * 3.0f)) + (prm1 * 0.3f) - 2.5f + bsMo.Y;
-
- return new float2(d + (cl * 0.2f) + 0.25f, cl);
- }
-
- private float4 Render(float3 ro, float3 rd, float prm1, float2 bsMo)
- {
- float4 rez = 0;
- float t = 1.5f;
- float fogT = 0;
-
- for (int i = 0; i < 130; i++)
- {
- if (rez.A > 0.99f)
- {
- break;
- }
-
- float3 pos = ro + (t * rd);
- float2 mpv = Map(pos, prm1, bsMo);
- float den = Hlsl.Clamp(mpv.X - 0.3f, 0.0f, 1.0f) * 1.12f;
- float dn = Hlsl.Clamp(mpv.X + 2.0f, 0.0f, 3.0f);
- float4 col = 0f;
-
- if (mpv.X > 0.6f)
- {
-
- col = new float4((Hlsl.Sin(new float3(5.0f, 0.4f, 0.2f) + (mpv.Y * 0.1f) + (Hlsl.Sin(pos.Z * 0.4f) * 0.5f) + 1.8f) * 0.5f) + 0.5f, 0.08f);
- col *= den * den * den;
- col.RGB *= LinStep(4.0f, -2.5f, mpv.X) * 2.3f;
-
- float dif = Hlsl.Clamp((den - Map(pos + 0.8f, prm1, bsMo).X) / 9.0f, 0.001f, 1.0f);
-
- dif += Hlsl.Clamp((den - Map(pos + 0.35f, prm1, bsMo).X) / 2.5f, 0.001f, 1.0f);
- col.XYZ *= den * (new float3(0.005f, 0.045f, 0.075f) + (1.5f * new float3(0.033f, 0.07f, 0.03f) * dif));
- }
-
- float fogC = Hlsl.Exp((t * 0.2f) - 2.2f);
-
- col += new float4(0.06f, 0.11f, 0.11f, 0.1f) * Hlsl.Clamp(fogC - fogT, 0.0f, 1.0f);
- fogT = fogC;
- rez += col * (1.0f - rez.A);
- t += Hlsl.Clamp(0.5f - (dn * dn * 0.05f), 0.09f, 0.3f);
- }
-
- return Hlsl.Clamp(rez, 0.0f, 1.0f);
- }
-
- private static float GetSaturation(float3 c)
- {
- float mi = Hlsl.Min(Hlsl.Min(c.X, c.Y), c.Z);
- float ma = Hlsl.Max(Hlsl.Max(c.X, c.Y), c.Z);
-
- return (ma - mi) / (ma + (float)1e-7);
- }
-
- private static float3 ILerp(in float3 a, in float3 b, in float x)
- {
- float3 ic = Hlsl.Lerp(a, b, x) + new float3((float)1e-6, 0.0f, 0.0f);
- float sd = Hlsl.Abs(GetSaturation(ic) - Hlsl.Lerp(GetSaturation(a), GetSaturation(b), x));
- float3 dir = Hlsl.Normalize(new float3((2.0f * ic.X) - ic.Y - ic.Z, (2.0f * ic.Y) - ic.X - ic.Z, (2.0f * ic.Z) - ic.Y - ic.X));
- float lgt = Hlsl.Dot(1.0f, ic);
- float ff = Hlsl.Dot(dir, Hlsl.Normalize(ic));
-
- ic += 1.5f * dir * sd * ff * lgt;
-
- return Hlsl.Clamp(ic, 0.0f, 1.0f);
- }
-
- ///
- public float4 Execute()
- {
- int2 xy = (int2)D2D.GetScenePosition().XY;
- float2 q = (float2)xy / dispatchSize;
- float2 p = (xy - (0.5f * (float2)dispatchSize)) / dispatchSize.Y;
- float2 bsMo = -0.5f * (float2)dispatchSize / dispatchSize.Y;
- float scaledTime = time * 3.0f;
- float3 ro = new(0, 0, scaledTime);
-
- ro += new float3(Hlsl.Sin(time) * 0.5f, Hlsl.Sin(time * 1.0f) * 0.0f, 0);
-
- float dspAmp = 0.85f;
-
- ro.XY += Disp(ro.Z) * dspAmp;
-
- float tgtDst = 3.5f;
- float3 target = Hlsl.Normalize(ro - new float3(Disp(scaledTime + tgtDst) * dspAmp, scaledTime + tgtDst));
-
- ro.X -= bsMo.X * 2.0f;
-
- float3 rightdir = Hlsl.Normalize(Hlsl.Cross(target, new float3(0, 1, 0)));
- float3 updir = Hlsl.Normalize(Hlsl.Cross(rightdir, target));
-
- rightdir = Hlsl.Normalize(Hlsl.Cross(updir, target));
-
- float3 rd = Hlsl.Normalize((((p.X * rightdir) + (p.Y * updir)) * 1.0f) - target);
-
- rd.XY = Hlsl.Mul(rd.XY, Rotate((-Disp(scaledTime + 3.5f).X * 0.2f) + bsMo.X));
-
- float prm1 = Hlsl.SmoothStep(-0.4f, 0.4f, Hlsl.Sin(time * 0.3f));
- float4 scn = Render(ro, rd, prm1, bsMo);
- float3 col = scn.RGB;
-
- col = ILerp(col.BGR, col.RGB, Hlsl.Clamp(1.0f - prm1, 0.05f, 1.0f));
- col = Hlsl.Pow(col, new float3(0.55f, 0.65f, 0.6f)) * new float3(1.0f, 0.97f, 0.9f);
- col *= (Hlsl.Pow(Hlsl.Abs(16.0f * q.X * q.Y * (1.0f - q.X) * (1.0f - q.Y)), 0.12f) * 0.7f) + 0.3f;
-
- return new(col, 1.0f);
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.Shaders.D2D1/PyramidPattern.cs b/samples/ComputeSharp.SwapChain.Shaders.D2D1/PyramidPattern.cs
deleted file mode 100644
index c0d2bef3..00000000
--- a/samples/ComputeSharp.SwapChain.Shaders.D2D1/PyramidPattern.cs
+++ /dev/null
@@ -1,191 +0,0 @@
-using ComputeSharp.D2D1;
-
-namespace ComputeSharp.SwapChain.Shaders.D2D1;
-
-///
-/// An offset grid of square-based pyramids whose tips have been offset according to an underlying directional noise field.
-/// The faux lighting is provided via bump mapping. No raymarching was harmed during the making of this example.
-/// Ported from .
-/// Created by Shane.
-///
-/// The current time since the start of the application.
-/// The dispatch size for the current output.
-[D2DInputCount(0)]
-[D2DRequiresScenePosition]
-[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)]
-[D2DGeneratedPixelShaderDescriptor]
-internal readonly partial struct PyramidPattern(float time, int2 dispatchSize) : ID2D1PixelShader
-{
- // Standard 2D rotation formula.
- private static float2x2 Rotate2x2(in float a)
- {
- float c = Hlsl.Cos(a);
- float s = Hlsl.Sin(a);
-
- return new(c, -s, s, c);
- }
-
- // IQ's float2 to float hash.
- private static float Hash21(float2 p)
- {
- return Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(p, new float2(27.619f, 57.583f))) * 43758.5453f);
- }
-
- // float2 to float2 hash.
- private static float2 Hash22B(float2 p)
- {
- float n = Hlsl.Sin(Hlsl.Dot(p, new float2(41, 289)));
-
- return (Hlsl.Frac(new float2(262144, 32768) * n) * 2.0f) - 1.0f;
- }
-
- // Based on IQ's gradient noise formula.
- private static float N2D3G(float2 p)
- {
- float2 i = Hlsl.Floor(p);
-
- p -= i;
-
- float4 v = default;
-
- v.X = Hlsl.Dot(Hash22B(i), p);
- v.Y = Hlsl.Dot(Hash22B(i + float2.UnitX), p - float2.UnitX);
- v.Z = Hlsl.Dot(Hash22B(i + float2.UnitY), p - float2.UnitY);
- v.W = Hlsl.Dot(Hash22B(i + 1.0f), p - 1.0f);
-
- p = p * p * (3.0f - (2.0f * p));
-
- return Hlsl.Lerp(Hlsl.Lerp(v.X, v.Y, p.X), Hlsl.Lerp(v.Z, v.W, p.X), p.Y);
- }
-
- // Two layers of noise.
- private static float FBM(float2 p)
- {
- return (N2D3G(p) * 0.66f) + (N2D3G(p * 2.0f) * 0.34f);
- }
-
- // HLSL mod from GLSL
- private static float Mod(float x, float y)
- {
- return x - (y * Hlsl.Floor(x / y));
- }
-
- private float BMap(float2 p)
- {
- p = Hlsl.Mul(p, Rotate2x2(-3.14159f / 5.0f));
-
- if (Mod(Hlsl.Floor(p.Y), 2.0f) < 0.5f)
- {
- p.X += 0.5f;
- }
-
- float2 ip = Hlsl.Floor(p);
-
- p -= ip + 0.5f;
-
- float ang = (-3.14159f * 3.0f / 5.0f) + (FBM((ip / 8.0f) + (time / 3.0f)) * 6.2831f * 2.0f);
-
- float2 offs = new float2(Hlsl.Cos(ang), Hlsl.Sin(ang)) * 0.35f;
-
- if (p.X < offs.X)
- {
- p.X = 1.0f - ((p.X + 0.5f) / Hlsl.Abs(offs.X + 0.5f));
- }
- else
- {
- p.X = (p.X - offs.X) / (0.5f - offs.X);
- }
-
- if (p.Y < offs.Y)
- {
- p.Y = 1.0f - ((p.Y + 0.5f) / Hlsl.Abs(offs.Y + 0.5f));
- }
- else
- {
- p.Y = (p.Y - offs.Y) / (0.5f - offs.Y);
- }
-
- return 1.0f - Hlsl.Max(p.X, p.Y);
- }
-
- // Standard function-based bump mapping function, with an edge value included for good measure
- private float3 DoBumpMap(in float2 p, in float3 n, float bumpfactor, ref float edge)
- {
- float2 e = new(0.025f, 0);
-
- float f = BMap(p);
- float fx = BMap(p - e.XY);
- float fy = BMap(p - e.YX);
- float fx2 = BMap(p + e.XY);
- float fy2 = BMap(p + e.YX);
-
- float3 grad = new float3(fx - fx2, fy - fx2, 0) / e.X / 2.0f;
-
- edge = Hlsl.Length(new float2(fx, fy) + new float2(fx2, fy2) - (f * 2.0f));
- edge = Hlsl.SmoothStep(0.0f, 1.0f, edge / e.X);
-
- grad -= n * Hlsl.Dot(n, grad);
-
- return Hlsl.Normalize(n + (grad * bumpfactor));
- }
-
- // A hatch-like algorithm, or a stipple... or some kind of textured pattern
- private float DoHatch(float2 p, float res)
- {
- p *= res / 16.0f;
-
- float hatch = Hlsl.Clamp((Hlsl.Sin((p.X - p.Y) * 3.14159f * 200.0f) * 2.0f) + 0.5f, 0.0f, 1.0f);
-
- float hRnd = Hash21(Hlsl.Floor(p * 6.0f) + 0.73f);
- if (hRnd > 0.66f)
- {
- hatch = hRnd;
- }
-
- return hatch;
- }
-
- ///
- public float4 Execute()
- {
- int2 xy = (int2)D2D.GetScenePosition().XY;
- int2 coordinate = new(xy.X, dispatchSize.Y - xy.Y);
- float iRes = Hlsl.Min(dispatchSize.Y, 800.0f);
- float2 uv = (coordinate - ((float2)dispatchSize * 0.5f)) / iRes;
- float3 rd = Hlsl.Normalize(new float3(uv, 0.5f));
- const float gSc = 10.0f;
- float2 p = (uv * gSc) + new float2(0, time / 2.0f);
- float2 oP = p;
- float m = BMap(p);
- float3 n = new(0, 0, -1);
- float edge = 0.0f;
- float bumpFactor = 0.25f;
-
- n = DoBumpMap(p, n, bumpFactor, ref edge);
-
- float3 lp = new float3(-0.0f + (Hlsl.Sin(time) * 0.3f), 0.0f + (Hlsl.Cos(time * 1.3f) * 0.3f), -1) - new float3(uv, 0);
- float lDist = Hlsl.Max(Hlsl.Length(lp), 0.001f);
- float3 ld = lp / lDist;
- float diff = Hlsl.Max(Hlsl.Dot(n, ld), 0.0f);
-
- diff = Hlsl.Pow(diff, 4.0f);
-
- float spec = Hlsl.Pow(Hlsl.Max(Hlsl.Dot(Hlsl.Reflect(-ld, n), -rd), 0.0f), 16.0f);
- float fre = Hlsl.Min(Hlsl.Pow(Hlsl.Max(1.0f + Hlsl.Dot(n, rd), 0.0f), 4.0f), 3.0f);
- float3 col = 0.15f * (diff + 0.251f + (spec * new float3(1, 0.7f, 0.3f) * 9.0f) + (fre * new float3(0.1f, 0.3f, 1) * 12.0f));
- float rf = Hlsl.SmoothStep(0.0f, 0.35f, (BMap(Hlsl.Reflect(rd, n).XY * 2.0f) * FBM(Hlsl.Reflect(rd, n).XY * 3.0f)) + 0.1f);
-
- col += col * col * rf * rf * new float3(1, 0.1f, 0.1f) * 15.0f;
-
- float shade = (m * 0.83f) + 0.17f;
-
- col *= shade;
- col *= 1.0f - (edge * 0.8f);
-
- float hatch = DoHatch(oP / gSc, iRes);
-
- col *= (hatch * 0.5f) + 0.7f;
-
- return new(Hlsl.Sqrt(Hlsl.Max(col, 0.0f)), 1);
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.Shaders.D2D1/TerracedHills.cs b/samples/ComputeSharp.SwapChain.Shaders.D2D1/TerracedHills.cs
deleted file mode 100644
index 79c62167..00000000
--- a/samples/ComputeSharp.SwapChain.Shaders.D2D1/TerracedHills.cs
+++ /dev/null
@@ -1,124 +0,0 @@
-using ComputeSharp.D2D1;
-
-namespace ComputeSharp.SwapChain.Shaders.D2D1;
-
-///
-/// An abstract representation of some terraced hills. In essence, just a very basic terrain layout with a small code footprint.
-/// Ported from .
-/// Created by Shane.
-///
-/// The current time since the start of the application.
-/// The dispatch size for the current output.
-[D2DInputCount(0)]
-[D2DRequiresScenePosition]
-[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)]
-[D2DGeneratedPixelShaderDescriptor]
-internal readonly partial struct TerracedHills(float time, int2 dispatchSize) : ID2D1PixelShader
-{
- // 2x2 matrix rotation. Angle vector, courtesy of Fabrice
- private static float2x2 Rot2(float th)
- {
- float2 a = Hlsl.Sin(new float2(1.5707963f, 0) + th);
-
- return new(a.X, -a.Y, a.Y, a.X);
- }
-
- // The triangle function that Shadertoy user Nimitz has used in various triangle noise demonstrations
- private static float Tri(in float x)
- {
- return Hlsl.Abs(x - Hlsl.Floor(x) - 0.5f);
- }
-
- // 2D variant of the triangle function
- private static float2 Tri(in float2 x)
- {
- return Hlsl.Abs(x - Hlsl.Floor(x) - 0.5f);
- }
-
- // A simple noisey layer made up of a sawtooth combination
- private static float HLayer(float2 p)
- {
- return Hlsl.Dot(Tri((p / 1.5f) + Tri((p.YX / 3.0f) + 0.25f)), 1);
- }
-
- // Combine layers to create surfaces to render
- private static float HMap(float2 p)
- {
- float ret = 0, a = 1;
-
- for (int i = 0; i < 3; i++)
- {
- ret += Hlsl.Abs(a) * HLayer(p / a);
- p = new float2x2(0.866025f, -0.57735f, 0.57735f, 0.866025f) * p;
- a *= -0.3f;
- }
-
- ret = Hlsl.SmoothStep(-0.2f, 1.0f, ret * ret / 1.39f / 1.39f);
-
- return (ret * 0.975f) + (Tri(ret * 12.0f) * 0.05f);
- }
-
- // Distance function. A flat plane perturbed by a height function of some kind.
- private static float Map(float3 p)
- {
- return (p.Y - (HMap(p.XZ) * 0.35f)) * 0.75f;
- }
-
- // Tetrahedral normal - courtesy of IQ
- private static float3 Normal(in float3 p, ref float edge, float dispatchHeight)
- {
- float2 e = new float2(-1.0f, 1.0f) * 0.5f / dispatchHeight;
- float d1 = Map(p + e.YXX), d2 = Map(p + e.XXY);
- float d3 = Map(p + e.XYX), d4 = Map(p + e.YYY);
- float d = Map(p);
-
- edge = Hlsl.Abs(d1 + d2 + d3 + d4 - (d * 4.0f));
- edge = Hlsl.SmoothStep(0.0f, 1.0f, Hlsl.Sqrt(edge / e.Y * 2.0f));
- e = new float2(-1.0f, 1.0f) * 0.001f;
- d1 = Map(p + e.YXX);
- d2 = Map(p + e.XXY);
- d3 = Map(p + e.XYX);
- d4 = Map(p + e.YYY);
-
- return Hlsl.Normalize((e.YXX * d1) + (e.XXY * d2) + (e.XYX * d3) + (e.YYY * d4));
- }
-
- ///
- public float4 Execute()
- {
- int2 xy = (int2)D2D.GetScenePosition().XY;
- int2 coordinate = new(xy.X, dispatchSize.Y - xy.Y);
-
- float3 rd = Hlsl.Normalize(new float3((float2)coordinate - (dispatchSize.Y * 0.5f), dispatchSize.Y));
-
- rd.YZ = Rot2(0.35f) * rd.YZ;
-
- float3 ro = new(time * 0.4f, 0.5f, time * 0.2f);
-
- float t = 0, d;
- for (int i = 0; i < 96; i++)
- {
- d = Map(ro + (rd * t));
-
- if (Hlsl.Abs(d) < 0.001f * ((t * 0.125f) + 1.0f) || t > 20.0f)
- {
- break;
- }
-
- t += ((Hlsl.Step(1.0f, t) * 0.3f) + 0.7f) * d;
- }
-
- float3 sp = ro + (rd * t);
- float3 ld = new(-0.676f, 0.408f, 0.613f);
- float edge = 0;
- float3 n = Normal(sp, ref edge, dispatchSize.Y);
- float dif = Hlsl.Max(Hlsl.Dot(ld, n), 0.0f);
- float spe = Hlsl.Pow(Hlsl.Max(Hlsl.Dot(Hlsl.Reflect(rd, n), ld), 0.0f), 16.0f);
- float sh = HMap(sp.XZ);
- float rnd = (Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(Hlsl.Floor(sp.XZ * 512.0f), new float2(41.73f, 289.67f))) * 43758.5453f) * 0.5f) + 0.5f;
- float3 fog = Hlsl.Lerp(new float3(0.75f, 0.77f, 0.78f), new float3(1.04f, 0.95f, 0.87f), Hlsl.Pow(1.0f + Hlsl.Dot(rd, ld), 3.0f) * 0.35f);
- float3 c = Hlsl.Lerp(((new float3(1.1f, 1.05f, 1) * rnd * (dif + 0.1f) * sh) + (fog * spe)) * (1.0f - (edge * 0.7f)), fog * fog, Hlsl.Min(1.0f, t * 0.3f));
-
- return new(c, 1);
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.Shaders.D2D1/TriangleGridContouring.cs b/samples/ComputeSharp.SwapChain.Shaders.D2D1/TriangleGridContouring.cs
deleted file mode 100644
index ec84aa37..00000000
--- a/samples/ComputeSharp.SwapChain.Shaders.D2D1/TriangleGridContouring.cs
+++ /dev/null
@@ -1,302 +0,0 @@
-using ComputeSharp.D2D1;
-
-namespace ComputeSharp.SwapChain.Shaders.D2D1;
-
-///
-/// Utilizing a 2D simplex grid to construct the isolines of a noise function.
-/// Ported from .
-/// Created by Shane.
-///
-/// The current time since the start of the application.
-/// The dispatch size for the current output.
-[D2DInputCount(0)]
-[D2DRequiresScenePosition]
-[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)]
-[D2DGeneratedPixelShaderDescriptor]
-internal readonly partial struct TriangleGridContouring(float time, int2 dispatchSize) : ID2D1PixelShader
-{
- // Standard 2D rotation formula.
- private static float2x2 Rotate2x2(in float a)
- {
- float c = Hlsl.Cos(a);
- float s = Hlsl.Sin(a);
-
- return new(c, -s, s, c);
- }
-
- // float2 to float2 hash.
- private float2 Hash22(float2 p)
- {
- float n = Hlsl.Sin(Hlsl.Dot(p, new float2(41, 289)));
-
- p = Hlsl.Frac(new float2(262144, 32768) * n);
-
- return Hlsl.Sin((p * 6.2831853f) + time);
- }
-
- // Based on IQ's gradient noise formula.
- private float N2D3G(float2 p)
- {
- float2 i = Hlsl.Floor(p);
-
- p -= i;
-
- float4 v = default;
-
- v.X = Hlsl.Dot(Hash22(i), p);
- v.Y = Hlsl.Dot(Hash22(i + float2.UnitX), p - float2.UnitX);
- v.Z = Hlsl.Dot(Hash22(i + float2.UnitY), p - float2.UnitY);
- v.W = Hlsl.Dot(Hash22(i + 1.0f), p - 1.0f);
-
- p = p * p * p * ((p * ((p * 6.0f) - 15.0f)) + 10.0f);
-
- return Hlsl.Lerp(Hlsl.Lerp(v.X, v.Y, p.X), Hlsl.Lerp(v.Z, v.W, p.X), p.Y);
- }
-
- // The isofunction. Just a Hlsl.Single noise function, but it can be more elaborate.
- private float IsoFunction(in float2 p)
- {
- return N2D3G((p / 4.0f) + 0.07f);
- }
-
- // Unsigned distance to the segment joining "a" and "b".
- private static float DistLine(float2 a, float2 b)
- {
- b = a - b;
-
- float h = Hlsl.Clamp(Hlsl.Dot(a, b) / Hlsl.Dot(b, b), 0.0f, 1.0f);
-
- return Hlsl.Length(a - (b * h));
- }
-
- // Based on IQ's signed distance to the segment joining "a" and "b".
- private static float DistEdge(float2 a, float2 b)
- {
- return Hlsl.Dot((a + b) * 0.5f, Hlsl.Normalize((b - a).YX * new float2(-1, 1)));
- }
-
- // Interpolating along the edge connecting vertices v1 and v2 with respect to the isovalue.
- private static float2 Interpolate(in float2 p1, in float2 p2, float v1, float v2, float isovalue)
- {
- return Hlsl.Lerp(p1, p2, ((isovalue - v1) / (v2 - v1) * 0.75f) + (0.25f / 2.0f));
- }
-
- // Isoline function.
- private static int IsoLine(
- float3 n3,
- float2 ip0,
- float2 ip1,
- float2 ip2,
- float isovalue,
- float i,
- ref float2 p0,
- ref float2 p1)
- {
- p0 = 1e5f;
- p1 = 1e5f;
-
- int iTh = 0;
-
- if (n3.X > isovalue)
- {
- iTh += 4;
- }
-
- if (n3.Y > isovalue)
- {
- iTh += 2;
- }
-
- if (n3.Z > isovalue)
- {
- iTh += 1;
- }
-
- if (iTh == 1 || iTh == 6)
- {
- p0 = Interpolate(ip1, ip2, n3.Y, n3.Z, isovalue);
- p1 = Interpolate(ip2, ip0, n3.Z, n3.X, isovalue);
-
- }
- else if (iTh == 2 || iTh == 5)
- {
- p0 = Interpolate(ip0, ip1, n3.X, n3.Y, isovalue);
- p1 = Interpolate(ip1, ip2, n3.Y, n3.Z, isovalue);
-
- }
- else if (iTh == 3 || iTh == 4)
- {
- p0 = Interpolate(ip0, ip1, n3.X, n3.Y, isovalue);
- p1 = Interpolate(ip2, ip0, n3.Z, n3.X, isovalue);
- }
-
- if (iTh >= 4 && iTh <= 6)
- {
- float2 tmp = p0;
-
- p0 = p1;
- p1 = tmp;
- }
-
- if (i == 0.0f)
- {
- float2 tmp = p0;
-
- p0 = p1;
- p1 = tmp;
- }
-
- return iTh;
- }
-
- private float3 SimplexContour(float2 p)
- {
- const float gSc = 8.0f;
-
- p *= gSc;
-
- float2 oP = p;
-
- p += new float2(N2D3G(p * 3.5f), N2D3G((p * 3.5f) + 7.3f)) * 0.015f;
-
- float2 s = Hlsl.Floor(p + ((p.X + p.Y) * 0.36602540378f));
-
- p -= s - ((s.X + s.Y) * 0.211324865f);
-
- float i = p.X < p.Y ? 1.0f : 0.0f;
- float2 ioffs = new(1.0f - i, i);
- float2 ip0 = 0;
- float2 ip1 = ioffs - 0.2113248654f;
- float2 ip2 = 0.577350269f;
- float2 ctr = (ip0 + ip1 + ip2) / 3.0f;
-
- ip0 -= ctr;
- ip1 -= ctr;
- ip2 -= ctr;
- p -= ctr;
-
- float3 n3 = default;
-
- n3.X = IsoFunction(s);
- n3.Y = IsoFunction(s + ioffs);
- n3.Z = IsoFunction(s + 1.0f);
-
- float d = 1e5f;
- float d2 = 1e5f;
- float d3 = 1e5f;
- float d4 = 1e5f;
- float d5 = 1e5f;
- float isovalue = 0;
- float2 p0 = default;
- float2 p1 = default;
- int iTh = IsoLine(n3, ip0, ip1, ip2, isovalue, i, ref p0, ref p1);
-
- d = Hlsl.Min(d, DistEdge(p - p0, p - p1));
-
- if (iTh == 7)
- {
- d = 0;
- }
-
- d3 = Hlsl.Min(d3, DistLine(p - p0, p - p1));
- d4 = Hlsl.Min(d4, Hlsl.Min(Hlsl.Length(p - p0), Hlsl.Length(p - p1)));
-
- float tri = Hlsl.Min(Hlsl.Min(DistLine(p - ip0, p - ip1), DistLine(p - ip1, p - ip2)), DistLine(p - ip2, p - ip0));
-
- d5 = Hlsl.Min(d5, tri);
- d5 = Hlsl.Min(d5, Hlsl.Length(p) - 0.02f);
- isovalue = -0.15f;
-
- int iTh2 = IsoLine(n3, ip0, ip1, ip2, isovalue, i, ref p0, ref p1);
-
- d2 = Hlsl.Min(d2, DistEdge(p - p0, p - p1));
-
- if (iTh2 == 7)
- {
- d2 = 0.0f;
- }
-
- if (iTh == 7)
- {
- d2 = 1e5f;
- }
-
- d2 = Hlsl.Max(d2, -d);
- d3 = Hlsl.Min(d3, DistLine(p - p0, p - p1));
- d4 = Hlsl.Min(d4, Hlsl.Min(Hlsl.Length(p - p0), Hlsl.Length(p - p1)));
- d4 -= 0.075f;
- d3 -= 0.0125f;
- d /= gSc;
- d2 /= gSc;
- d3 /= gSc;
- d4 /= gSc;
- d5 /= gSc;
-
- float3 col = new(1, 0.85f, 0.6f);
- float sf = 0.004f;
-
- if (d > 0.0f && d2 > 0.0f)
- {
- col = new float3(1, 1.8f, 3) * 0.45f;
- }
-
- if (d > 0.0f)
- {
- col = Hlsl.Lerp(col, new float3(1, 1.85f, 3) * 0.3f, 1.0f - Hlsl.SmoothStep(0.0f, sf, d2 - 0.012f));
- }
-
- col = Hlsl.Lerp(col, new float3(1.1f, 0.85f, 0.6f), 1.0f - Hlsl.SmoothStep(0.0f, sf, d2));
- col = Hlsl.Lerp(col, new float3(1.5f, 0.9f, 0.6f) * 0.6f, 1.0f - Hlsl.SmoothStep(0.0f, sf, d - 0.012f));
- col = Hlsl.Lerp(col, new float3(1, 0.8f, 0.6f) * new float3(0.7f, 1.0f, 0.75f) * 0.95f, 1.0f - Hlsl.SmoothStep(0.0f, sf, d));
-
- if (d2 > 0.0f)
- {
- col *= ((Hlsl.Abs(Hlsl.Dot(n3, float3.One)) * 1.25f) + 1.25f) / 2.0f;
- }
- else
- {
- col *= Hlsl.Max(2.0f - ((Hlsl.Dot(n3, float3.One) + 1.45f) / 1.25f), 0.0f);
- }
-
- float pat = Hlsl.Abs(Hlsl.Frac((tri * 12.5f) + 0.4f) - 0.5f) * 2.0f;
-
- col *= (pat * 0.425f) + 0.75f;
- col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sf, d5)) * 0.95f);
- col = Hlsl.Lerp(col, float3.Zero, 1.0f - Hlsl.SmoothStep(0.0f, sf, d3));
- col = Hlsl.Lerp(col, float3.Zero, 1.0f - Hlsl.SmoothStep(0.0f, sf, d4));
- col = Hlsl.Lerp(col, float3.One, 1.0f - Hlsl.SmoothStep(0.0f, sf, d4 + 0.005f));
-
- float2 q = oP * 1.5f;
-
- col = Hlsl.Min(col, 1.0f);
-
- float gr = Hlsl.Sqrt(Hlsl.Dot(col, new float3(0.299f, 0.587f, 0.114f))) * 1.25f;
- float ns = (((N2D3G(q * 4.0f * new float2(1.0f / 3.0f, 3)) * 0.64f) + (N2D3G(q * 8.0f * new float2(1.0f / 3.0f, 3)) * 0.34f)) * 0.5f) + 0.5f;
-
- ns = gr - ns;
- q = Hlsl.Mul(q, Rotate2x2(3.14159f / 3.0f));
-
- float ns2 = (((N2D3G(q * 4.0f * new float2(1.0f / 3.0f, 3)) * 0.64f) + (N2D3G(q * 8.0f * new float2(1.0f / 3.0f, 3)) * 0.34f)) * 0.5f) + 0.5f;
-
- ns2 = gr - ns2;
- ns = Hlsl.SmoothStep(0.0f, 1.0f, Hlsl.Min(ns, ns2));
- col = Hlsl.Lerp(col, col * (ns + 0.35f), 0.4f);
-
- return col;
- }
-
- ///
- public float4 Execute()
- {
- int2 xy = (int2)D2D.GetScenePosition().XY;
- int2 coordinate = new(xy.X, dispatchSize.Y - xy.Y);
- float2 uv = (coordinate - ((float2)dispatchSize * 0.5f)) / Hlsl.Min(650.0f, dispatchSize.Y);
- float2 p = Hlsl.Mul(Rotate2x2(3.14159f / 12.0f), uv) + (new float2(0.8660254f, 0.5f) * time / 16.0f);
- float3 col = SimplexContour(p);
-
- uv = coordinate / (float2)dispatchSize;
- col *= Hlsl.Pow(Hlsl.Abs(16.0f * uv.X * uv.Y * (1.0f - uv.X) * (1.0f - uv.Y)), 0.0625f) + 0.1f;
-
- return new(Hlsl.Sqrt(Hlsl.Max(col, 0.0f)), 1);
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.Shaders.D2D1/TwoTiledTruchet.cs b/samples/ComputeSharp.SwapChain.Shaders.D2D1/TwoTiledTruchet.cs
deleted file mode 100644
index 441787b8..00000000
--- a/samples/ComputeSharp.SwapChain.Shaders.D2D1/TwoTiledTruchet.cs
+++ /dev/null
@@ -1,146 +0,0 @@
-using ComputeSharp.D2D1;
-
-namespace ComputeSharp.SwapChain.Shaders.D2D1;
-
-///
-/// A shader creating an animated two-tiles Truchet arrangement.
-/// Ported from .
-/// Created by Shane.
-///
-/// The current time since the start of the application.
-/// The dispatch size for the current output.
-[D2DInputCount(0)]
-[D2DRequiresScenePosition]
-[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)]
-[D2DGeneratedPixelShaderDescriptor]
-internal readonly partial struct TwoTiledTruchet(float time, int2 dispatchSize) : ID2D1PixelShader
-{
- ///
- /// Calculates the Truchet distance field.
- ///
- /// The input value to compute the distance field for.
- /// The resulting Truchet angle.
- /// The distance field for the input value.
- private float2 DistanceField(float2 p, out float2 ang)
- {
- // Fast hash for a pair of floats
- static float Hash21(float2 p)
- {
- return Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(p, new float2(27.619f, 57.583f))) * 43758.5453f);
- }
-
- // HLSL's port of the GLSL mod intrinsic
- static float Mod(float x, float y)
- {
- return x - (y * Hlsl.Floor(x / y));
- }
-
- float2 ip2 = Hlsl.Floor(p / 2.0f);
- float2 ip = Hlsl.Floor(p);
- float rnd = Hash21(ip);
- float rnd3 = Hash21(ip + 0.57f);
- float2 d = 1e5f;
-
- p -= ip + 0.5f;
-
- if (Mod(ip2.X + ip2.Y, 2.0f) < 0.5f)
- {
- d = Hlsl.Abs(p);
- ang = p.YX;
-
- if (Mod(ip.X + 1.0f, 2.0f) < 0.5f)
- {
- ang.X *= -1.0f;
-
- }
-
- if (Mod(ip.Y + 1.0f, 2.0f) > 0.5f)
- {
- ang.Y *= -1.0f;
- }
-
- if (rnd3 < 0.5f)
- {
- d = d.YX;
- ang = ang.YX;
- }
-
- ang += 0.5f;
- ang *= 3.0f;
-
- }
- else
- {
- if (rnd < 0.5f)
- {
- p = p.YX * new float2(1, -1);
- }
-
- d.X = Hlsl.Length(p - 0.5f) - 0.5f;
- d.Y = Hlsl.Length(p + 0.5f) - 0.5f;
-
- d = Hlsl.Abs(d);
-
- ang = 0;
- ang.X = -Hlsl.Atan((p.Y - 0.5f) / (p.X - 0.5f));
- ang.Y = -Hlsl.Atan((p.Y + 0.5f) / (p.X + 0.5f));
-
- if (Mod(ip.X + ip.Y, 2.0f) < 0.5f)
- {
- ang *= -1.0f;
- }
-
- if (rnd < 0.5f)
- {
- ang *= -1.0f;
- }
-
- if (rnd3 < 0.5f)
- {
- d = d.YX;
- ang = ang.YX;
- }
-
- ang *= 4.0f / 6.2831853f;
- ang *= 2.0f;
- }
-
- ang = Hlsl.Frac(ang + (time / 4.0f));
-
- return d;
- }
-
- ///
- public float4 Execute()
- {
- int2 xy = (int2)D2D.GetScenePosition().XY;
- float2 uv = (xy - ((float2)dispatchSize * 0.5f)) / dispatchSize.Y;
- float gSc = 7.0f;
- float2 p = (uv * gSc) - (new float2(-1, -0.5f) * time / 2.0f);
- float sf = 2.0f / dispatchSize.Y * gSc;
- float lSc = 6.0f;
- float lw = 1.0f / lSc / gSc;
- float2 d = DistanceField(p, out float2 ang) - (2.5f / lSc);
- float3 col = new(1.0f, 0.9f, 0.8f);
-
- for (int i = 0; i < 2; i++)
- {
- float di = d[i] - (lw / 4.0f);
- float tracks = Hlsl.Clamp(Hlsl.Sin((ang[i] * 6.2831f) + (time * 6.0f)) * 4.0f, 0.0f, 1.0f);
- float gap = 1.0f + lw;
-
- col = Hlsl.Lerp(col, 0, (1.0f - Hlsl.SmoothStep(0.0f, sf * 6.0f, di)) * 0.35f);
- col = Hlsl.Lerp(col, 0, 1.0f - Hlsl.SmoothStep(0.0f, sf, di));
- col = Hlsl.Lerp(col, new(1.0f, 0.9f, 0.8f), 1.0f - Hlsl.SmoothStep(0.0f, sf, di + (lw * 2.0f)));
- col = Hlsl.Lerp(col, 0, 1.0f - Hlsl.SmoothStep(0.0f, sf, di + (gap / lSc)));
- col = Hlsl.Lerp(col, 1, 1.0f - Hlsl.SmoothStep(0.0f, sf, di + (gap / lSc) + lw));
- col = Hlsl.Lerp(col, 0, 1.0f - Hlsl.SmoothStep(0.0f, sf, di + (2.0f * gap / lSc)));
- col = Hlsl.Lerp(col, 1 * tracks, 1.0f - Hlsl.SmoothStep(0.0f, sf, di + (2.0f * gap / lSc) + lw));
- }
-
- float3 rgb = Hlsl.Sqrt(Hlsl.Max(col, 0.0f));
- float4 color = new(rgb.X, rgb.Y, rgb.Z, 1.0f);
-
- return color;
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/LargeTile.scale-100.png b/samples/ComputeSharp.SwapChain.UI/Assets/LargeTile.scale-100.png
deleted file mode 100644
index d6c0045a..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/LargeTile.scale-100.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/LargeTile.scale-125.png b/samples/ComputeSharp.SwapChain.UI/Assets/LargeTile.scale-125.png
deleted file mode 100644
index 5122e651..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/LargeTile.scale-125.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/LargeTile.scale-150.png b/samples/ComputeSharp.SwapChain.UI/Assets/LargeTile.scale-150.png
deleted file mode 100644
index 53a9bc92..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/LargeTile.scale-150.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/LargeTile.scale-200.png b/samples/ComputeSharp.SwapChain.UI/Assets/LargeTile.scale-200.png
deleted file mode 100644
index cc8b55f3..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/LargeTile.scale-200.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/LargeTile.scale-400.png b/samples/ComputeSharp.SwapChain.UI/Assets/LargeTile.scale-400.png
deleted file mode 100644
index e774041e..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/LargeTile.scale-400.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/LockScreenLogo.scale-200.png b/samples/ComputeSharp.SwapChain.UI/Assets/LockScreenLogo.scale-200.png
deleted file mode 100644
index 7440f0d4..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/LockScreenLogo.scale-200.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Misc/noise_low.png b/samples/ComputeSharp.SwapChain.UI/Assets/Misc/noise_low.png
deleted file mode 100644
index 0784c124..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/Misc/noise_low.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/SmallTile.scale-100.png b/samples/ComputeSharp.SwapChain.UI/Assets/SmallTile.scale-100.png
deleted file mode 100644
index 605059d8..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/SmallTile.scale-100.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/SmallTile.scale-125.png b/samples/ComputeSharp.SwapChain.UI/Assets/SmallTile.scale-125.png
deleted file mode 100644
index cea40610..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/SmallTile.scale-125.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/SmallTile.scale-150.png b/samples/ComputeSharp.SwapChain.UI/Assets/SmallTile.scale-150.png
deleted file mode 100644
index 3a7361dd..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/SmallTile.scale-150.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/SmallTile.scale-200.png b/samples/ComputeSharp.SwapChain.UI/Assets/SmallTile.scale-200.png
deleted file mode 100644
index 75b9b2b3..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/SmallTile.scale-200.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/SmallTile.scale-400.png b/samples/ComputeSharp.SwapChain.UI/Assets/SmallTile.scale-400.png
deleted file mode 100644
index 418563fc..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/SmallTile.scale-400.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/SplashScreen.scale-100.png b/samples/ComputeSharp.SwapChain.UI/Assets/SplashScreen.scale-100.png
deleted file mode 100644
index d800c4a0..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/SplashScreen.scale-100.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/SplashScreen.scale-125.png b/samples/ComputeSharp.SwapChain.UI/Assets/SplashScreen.scale-125.png
deleted file mode 100644
index e2117c20..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/SplashScreen.scale-125.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/SplashScreen.scale-150.png b/samples/ComputeSharp.SwapChain.UI/Assets/SplashScreen.scale-150.png
deleted file mode 100644
index 08abf805..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/SplashScreen.scale-150.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/SplashScreen.scale-200.png b/samples/ComputeSharp.SwapChain.UI/Assets/SplashScreen.scale-200.png
deleted file mode 100644
index 1df2cb62..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/SplashScreen.scale-200.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/SplashScreen.scale-400.png b/samples/ComputeSharp.SwapChain.UI/Assets/SplashScreen.scale-400.png
deleted file mode 100644
index 5aebcf43..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/SplashScreen.scale-400.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square150x150Logo.scale-100.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square150x150Logo.scale-100.png
deleted file mode 100644
index 97045881..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/Square150x150Logo.scale-100.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square150x150Logo.scale-125.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square150x150Logo.scale-125.png
deleted file mode 100644
index b3f74401..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/Square150x150Logo.scale-125.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square150x150Logo.scale-150.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square150x150Logo.scale-150.png
deleted file mode 100644
index e4861d09..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/Square150x150Logo.scale-150.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square150x150Logo.scale-200.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square150x150Logo.scale-200.png
deleted file mode 100644
index 84faf5ff..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/Square150x150Logo.scale-200.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square150x150Logo.scale-400.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square150x150Logo.scale-400.png
deleted file mode 100644
index 3104ab19..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/Square150x150Logo.scale-400.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-lightunplated_targetsize-16.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-lightunplated_targetsize-16.png
deleted file mode 100644
index 6c39100e..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-lightunplated_targetsize-16.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-lightunplated_targetsize-24.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-lightunplated_targetsize-24.png
deleted file mode 100644
index 3e58e5b6..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-lightunplated_targetsize-24.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-lightunplated_targetsize-256.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-lightunplated_targetsize-256.png
deleted file mode 100644
index f50843bd..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-lightunplated_targetsize-256.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-lightunplated_targetsize-32.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-lightunplated_targetsize-32.png
deleted file mode 100644
index 90a762d9..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-lightunplated_targetsize-32.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-lightunplated_targetsize-48.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-lightunplated_targetsize-48.png
deleted file mode 100644
index 0d8c72f0..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-lightunplated_targetsize-48.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-unplated_targetsize-16.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-unplated_targetsize-16.png
deleted file mode 100644
index 6c39100e..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-unplated_targetsize-16.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-unplated_targetsize-256.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-unplated_targetsize-256.png
deleted file mode 100644
index f50843bd..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-unplated_targetsize-256.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-unplated_targetsize-32.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-unplated_targetsize-32.png
deleted file mode 100644
index 90a762d9..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-unplated_targetsize-32.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-unplated_targetsize-48.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-unplated_targetsize-48.png
deleted file mode 100644
index 0d8c72f0..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-unplated_targetsize-48.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.scale-100.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.scale-100.png
deleted file mode 100644
index 11dabfee..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.scale-100.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.scale-125.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.scale-125.png
deleted file mode 100644
index 1ff0964b..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.scale-125.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.scale-150.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.scale-150.png
deleted file mode 100644
index 4255eac3..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.scale-150.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.scale-200.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.scale-200.png
deleted file mode 100644
index f02661b2..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.scale-200.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.scale-400.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.scale-400.png
deleted file mode 100644
index 64e172ad..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.scale-400.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.targetsize-16.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.targetsize-16.png
deleted file mode 100644
index 6c39100e..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.targetsize-16.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.targetsize-24.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.targetsize-24.png
deleted file mode 100644
index 3e58e5b6..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.targetsize-24.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
deleted file mode 100644
index 3e58e5b6..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.targetsize-24_altform-unplated.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.targetsize-256.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.targetsize-256.png
deleted file mode 100644
index f50843bd..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.targetsize-256.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.targetsize-32.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.targetsize-32.png
deleted file mode 100644
index 90a762d9..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.targetsize-32.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.targetsize-48.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.targetsize-48.png
deleted file mode 100644
index 0d8c72f0..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.targetsize-48.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/StoreLogo.backup.png b/samples/ComputeSharp.SwapChain.UI/Assets/StoreLogo.backup.png
deleted file mode 100644
index a4586f26..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/StoreLogo.backup.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/StoreLogo.scale-100.png b/samples/ComputeSharp.SwapChain.UI/Assets/StoreLogo.scale-100.png
deleted file mode 100644
index 1ed8820e..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/StoreLogo.scale-100.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/StoreLogo.scale-125.png b/samples/ComputeSharp.SwapChain.UI/Assets/StoreLogo.scale-125.png
deleted file mode 100644
index cf1dbb07..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/StoreLogo.scale-125.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/StoreLogo.scale-150.png b/samples/ComputeSharp.SwapChain.UI/Assets/StoreLogo.scale-150.png
deleted file mode 100644
index 966a6067..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/StoreLogo.scale-150.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/StoreLogo.scale-200.png b/samples/ComputeSharp.SwapChain.UI/Assets/StoreLogo.scale-200.png
deleted file mode 100644
index 7bc22428..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/StoreLogo.scale-200.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/StoreLogo.scale-400.png b/samples/ComputeSharp.SwapChain.UI/Assets/StoreLogo.scale-400.png
deleted file mode 100644
index 87e3523c..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/StoreLogo.scale-400.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Wide310x150Logo.scale-100.png b/samples/ComputeSharp.SwapChain.UI/Assets/Wide310x150Logo.scale-100.png
deleted file mode 100644
index a5704b35..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/Wide310x150Logo.scale-100.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Wide310x150Logo.scale-125.png b/samples/ComputeSharp.SwapChain.UI/Assets/Wide310x150Logo.scale-125.png
deleted file mode 100644
index d92c4699..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/Wide310x150Logo.scale-125.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Wide310x150Logo.scale-150.png b/samples/ComputeSharp.SwapChain.UI/Assets/Wide310x150Logo.scale-150.png
deleted file mode 100644
index 73ac19b2..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/Wide310x150Logo.scale-150.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Wide310x150Logo.scale-200.png b/samples/ComputeSharp.SwapChain.UI/Assets/Wide310x150Logo.scale-200.png
deleted file mode 100644
index d800c4a0..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/Wide310x150Logo.scale-200.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Wide310x150Logo.scale-400.png b/samples/ComputeSharp.SwapChain.UI/Assets/Wide310x150Logo.scale-400.png
deleted file mode 100644
index 1df2cb62..00000000
Binary files a/samples/ComputeSharp.SwapChain.UI/Assets/Wide310x150Logo.scale-400.png and /dev/null differ
diff --git a/samples/ComputeSharp.SwapChain.UI/ComputeSharp.SwapChain.UI.projitems b/samples/ComputeSharp.SwapChain.UI/ComputeSharp.SwapChain.UI.projitems
deleted file mode 100644
index dbe45679..00000000
--- a/samples/ComputeSharp.SwapChain.UI/ComputeSharp.SwapChain.UI.projitems
+++ /dev/null
@@ -1,78 +0,0 @@
-
-
-
- $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
- true
- 6bc471c6-72f9-43cf-ae1e-f6d3e5ed3129
-
-
- ComputeSharp.SwapChain.UI
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.UI/ComputeSharp.SwapChain.UI.shproj b/samples/ComputeSharp.SwapChain.UI/ComputeSharp.SwapChain.UI.shproj
deleted file mode 100644
index 509c4d3f..00000000
--- a/samples/ComputeSharp.SwapChain.UI/ComputeSharp.SwapChain.UI.shproj
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
- 6bc471c6-72f9-43cf-ae1e-f6d3e5ed3129
- 14.0
-
-
-
-
-
-
-
-
diff --git a/samples/ComputeSharp.SwapChain.UI/Controls/D2D1AnimatedPixelShaderPanel.cs b/samples/ComputeSharp.SwapChain.UI/Controls/D2D1AnimatedPixelShaderPanel.cs
deleted file mode 100644
index bbde7698..00000000
--- a/samples/ComputeSharp.SwapChain.UI/Controls/D2D1AnimatedPixelShaderPanel.cs
+++ /dev/null
@@ -1,157 +0,0 @@
-using ComputeSharp.SwapChain.Core.Shaders;
-using Microsoft.Graphics.Canvas;
-using Microsoft.Graphics.Canvas.UI.Xaml;
-#if WINDOWS_UWP
-using Windows.UI.Xaml;
-using Windows.UI.Xaml.Controls;
-#else
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Controls;
-#endif
-
-#if WINDOWS_UWP
-namespace ComputeSharp.SwapChain.Uwp.Views;
-#else
-namespace ComputeSharp.SwapChain.WinUI.Views;
-#endif
-
-///
-/// A custom that can be used to render animated backgrounds via Win2D.
-///
-[TemplatePart(Name = "PART_CanvasAnimatedControl", Type = typeof(CanvasAnimatedControl))]
-public sealed partial class D2D1AnimatedPixelShaderPanel : Control
-{
- ///
- /// The backing .
- ///
- public static readonly DependencyProperty PixelShaderEffectProperty = DependencyProperty.Register(
- nameof(PixelShaderEffect),
- typeof(PixelShaderEffect),
- typeof(D2D1AnimatedPixelShaderPanel),
- new PropertyMetadata(null, OnPixelShaderEffectPropertyChanged));
-
- ///
- /// The backing .
- ///
- public static readonly DependencyProperty IsPausedProperty = DependencyProperty.Register(
- nameof(IsPaused),
- typeof(bool),
- typeof(D2D1AnimatedPixelShaderPanel),
- new PropertyMetadata(false, OnIsPausedPropertyChanged));
-
- ///
- /// The wrapped instance used to render frames.
- ///
- private CanvasAnimatedControl? canvasAnimatedControl;
-
- ///
- /// The instance currently in use, if any.
- ///
- private volatile PixelShaderEffect? pixelShaderEffect;
-
- ///
- /// Creates a new instance.
- ///
- public D2D1AnimatedPixelShaderPanel()
- {
- DefaultStyleKey = typeof(D2D1AnimatedPixelShaderPanel);
-
- Loaded += D2D1AnimatedPixelShaderPanel_Loaded;
- Unloaded += D2D1AnimatedPixelShaderPanel_Unloaded;
- }
-
- ///
- /// Gets or sets the instance to use to render content.
- ///
- public PixelShaderEffect? PixelShaderEffect
- {
- get => (PixelShaderEffect?)GetValue(PixelShaderEffectProperty);
- set => SetValue(PixelShaderEffectProperty, value);
- }
-
- ///
- /// Gets or sets whether or not the rendering is paused.
- ///
- public bool IsPaused
- {
- get => (bool)GetValue(IsPausedProperty);
- set => SetValue(IsPausedProperty, value);
- }
-
- ///
- protected override void OnApplyTemplate()
- {
- base.OnApplyTemplate();
-
- this.canvasAnimatedControl = (CanvasAnimatedControl)GetTemplateChild("PART_CanvasAnimatedControl")!;
- this.canvasAnimatedControl.Draw += CanvasAnimatedControl_Draw;
- }
-
- // Ensure the panel is not paused when the control is loaded
- private void D2D1AnimatedPixelShaderPanel_Loaded(object sender, RoutedEventArgs e)
- {
- if (this.canvasAnimatedControl is { } canvasAnimatedControl &&
- PixelShaderEffect is not null &&
- !IsPaused)
- {
- canvasAnimatedControl.Paused = false;
- }
- }
-
- // Always pause rendering when the control is unloaded
- private void D2D1AnimatedPixelShaderPanel_Unloaded(object sender, RoutedEventArgs e)
- {
- if (this.canvasAnimatedControl is { } canvasAnimatedControl)
- {
- canvasAnimatedControl.Paused = true;
- }
- }
-
- ///
- /// Draws a new frame on the wrapped instance.
- ///
- /// The source instance.
- /// The object to perform drawing with.
- private void CanvasAnimatedControl_Draw(ICanvasAnimatedControl sender, CanvasAnimatedDrawEventArgs args)
- {
- // Set the effect properties
- this.pixelShaderEffect!.ElapsedTime = args.Timing.TotalTime;
- this.pixelShaderEffect.ScreenWidth = sender.ConvertDipsToPixels((float)sender.Size.Width, CanvasDpiRounding.Round);
- this.pixelShaderEffect.ScreenHeight = sender.ConvertDipsToPixels((float)sender.Size.Height, CanvasDpiRounding.Round);
-
- // Draw the effect
- args.DrawingSession.DrawImage(this.pixelShaderEffect);
- }
-
- ///
- private static void OnPixelShaderEffectPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- D2D1AnimatedPixelShaderPanel @this = (D2D1AnimatedPixelShaderPanel)d;
- PixelShaderEffect? pixelShaderEffect = (PixelShaderEffect?)e.NewValue;
-
- // Save the new pixel shader effect for later (as the dependency property cannot be accessed by the render thread)
- @this.pixelShaderEffect = pixelShaderEffect;
-
- // Pause or start the render thread if an effect is available
- if (@this.canvasAnimatedControl is { } canvasAnimatedControl)
- {
- bool shouldRender = @this.IsLoaded && !@this.IsPaused && pixelShaderEffect is not null;
-
- canvasAnimatedControl.Paused = !shouldRender;
- }
- }
-
- ///
- private static void OnIsPausedPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
- {
- D2D1AnimatedPixelShaderPanel @this = (D2D1AnimatedPixelShaderPanel)d;
- bool isPaused = (bool)e.NewValue;
-
- if (@this.canvasAnimatedControl is { } canvasAnimatedControl)
- {
- bool shouldRender = @this.IsLoaded && !isPaused && @this.PixelShaderEffect is not null;
-
- canvasAnimatedControl.Paused = !shouldRender;
- }
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.UI/Converters/RenderingPauseConverter.cs b/samples/ComputeSharp.SwapChain.UI/Converters/RenderingPauseConverter.cs
deleted file mode 100644
index 0888d6e1..00000000
--- a/samples/ComputeSharp.SwapChain.UI/Converters/RenderingPauseConverter.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-#if WINDOWS_UWP
-using Windows.UI.Xaml.Controls;
-#else
-using Microsoft.UI.Xaml.Controls;
-#endif
-
-namespace ComputeSharp.SwapChain.Core.Converters;
-
-///
-/// A class with some static converters for rendering state.
-///
-public static class RenderingPauseConverter
-{
- ///
- /// Gets a symbol for an input rendering state.
- ///
- /// Whether or not the rendering is currently paused.
- /// A symbol representing the next action for the rendering.
- public static Symbol ConvertPausedToSymbol(bool value)
- {
- return value ? Symbol.Play : Symbol.Pause;
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.UI/Converters/ResolutionScaleConverter.cs b/samples/ComputeSharp.SwapChain.UI/Converters/ResolutionScaleConverter.cs
deleted file mode 100644
index a7be9a73..00000000
--- a/samples/ComputeSharp.SwapChain.UI/Converters/ResolutionScaleConverter.cs
+++ /dev/null
@@ -1,27 +0,0 @@
-namespace ComputeSharp.SwapChain.Core.Converters;
-
-///
-/// A class with some static converters for resolution scale settings.
-///
-public static class ResolutionScaleConverter
-{
- ///
- /// Converts a resolution scale to a formatted string.
- ///
- /// The input resolution scale (in percentage).
- /// A formatted percentage string for .
- public static string ConvertPercentageToFormattedString(int value)
- {
- return $"{value}%";
- }
-
- ///
- /// Converts a percentage value to a scaled value in the [0, 1] range.
- ///
- /// The input percentage value to scale.
- /// The input percentage scaled to the [0, 1] range.
- public static double ConvertPercentageToScale(int value)
- {
- return value / 100.0;
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.UI/Enums/RenderingMode.cs b/samples/ComputeSharp.SwapChain.UI/Enums/RenderingMode.cs
deleted file mode 100644
index 68f0ec13..00000000
--- a/samples/ComputeSharp.SwapChain.UI/Enums/RenderingMode.cs
+++ /dev/null
@@ -1,17 +0,0 @@
-namespace ComputeSharp.SwapChain.Core.Enums;
-
-///
-/// Indicates the rendering mode being used.
-///
-public enum RenderingMode
-{
- ///
- /// Render using DirectX 12 APIs.
- ///
- DirectX12,
-
- ///
- /// Render using Win2D (ie. Direct2D behind the scenes).
- ///
- Win2D
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.UI/Shaders/PixelShaderEffect.cs b/samples/ComputeSharp.SwapChain.UI/Shaders/PixelShaderEffect.cs
deleted file mode 100644
index a2ac4a69..00000000
--- a/samples/ComputeSharp.SwapChain.UI/Shaders/PixelShaderEffect.cs
+++ /dev/null
@@ -1,69 +0,0 @@
-using System;
-using ComputeSharp.D2D1;
-using ComputeSharp.D2D1.Descriptors;
-#if WINDOWS_UWP
-using ComputeSharp.D2D1.Uwp;
-#else
-using ComputeSharp.D2D1.WinUI;
-#endif
-
-namespace ComputeSharp.SwapChain.Core.Shaders;
-
-///
-/// An base effect for an animated pixel shader.
-///
-public abstract partial class PixelShaderEffect : CanvasEffect
-{
- ///
- /// Gets or sets the total elapsed time.
- ///
- [GeneratedCanvasEffectProperty]
- public partial TimeSpan ElapsedTime { get; set; }
-
- ///
- /// Gets or sets the screen width in raw pixels.
- ///
- [GeneratedCanvasEffectProperty]
- public partial int ScreenWidth { get; set; }
-
- ///
- /// Gets or sets the screen height in raw pixels.
- ///
- [GeneratedCanvasEffectProperty]
- public partial int ScreenHeight { get; set; }
-
- ///
- /// An effect for an animated pixel shader.
- ///
- /// The type of pixel shader to render.
- /// The input factory.
- public sealed partial class For(For.Factory factory) : PixelShaderEffect
- where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor
- {
- ///
- /// The node in use.
- ///
- private static readonly CanvasEffectNode> Effect = new();
-
- ///
- protected override void BuildEffectGraph(CanvasEffectGraph effectGraph)
- {
- effectGraph.RegisterOutputNode(Effect, new PixelShaderEffect());
- }
-
- ///
- protected override void ConfigureEffectGraph(CanvasEffectGraph effectGraph)
- {
- effectGraph.GetNode(Effect).ConstantBuffer = factory(ElapsedTime, ScreenWidth, ScreenHeight);
- }
-
- ///
- /// A factory of a given shader instance.
- ///
- /// The total elapsed time.
- /// The screen width in raw pixels.
- /// The screen height in raw pixels.
- /// A shader instance to render.
- public delegate T Factory(TimeSpan elapsedTime, int screenWidth, int screenHeight);
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.UI/Shaders/Runners/ContouredLayersRunner.cs b/samples/ComputeSharp.SwapChain.UI/Shaders/Runners/ContouredLayersRunner.cs
deleted file mode 100644
index 4c6fd817..00000000
--- a/samples/ComputeSharp.SwapChain.UI/Shaders/Runners/ContouredLayersRunner.cs
+++ /dev/null
@@ -1,40 +0,0 @@
-using System;
-using System.IO;
-using ComputeSharp.SwapChain.Shaders;
-#if WINDOWS_UWP
-using ComputeSharp.Uwp;
-#else
-using ComputeSharp.WinUI;
-#endif
-using Windows.ApplicationModel;
-
-namespace ComputeSharp.SwapChain.Core.Shaders.Runners;
-
-///
-/// A specialized for .
-///
-public sealed class ContouredLayersRunner : IShaderRunner
-{
- ///
- /// A texture for \Textures\RustyMetal.png.
- ///
- private ReadOnlyTexture2D? texture;
-
- ///
- public bool TryExecute(IReadWriteNormalizedTexture2D texture, TimeSpan timespan, object? parameter)
- {
- if (this.texture is null ||
- this.texture.GraphicsDevice != texture.GraphicsDevice)
- {
- string filename = Path.Combine(Package.Current.InstalledLocation.Path, "Assets", "Textures", "RustyMetal.png");
-
- this.texture?.Dispose();
-
- this.texture = texture.GraphicsDevice.LoadReadOnlyTexture2D(filename);
- }
-
- texture.GraphicsDevice.ForEach(texture, new ContouredLayers((float)timespan.TotalSeconds, this.texture));
-
- return true;
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.UI/Shaders/Runners/D2D1ContouredLayersRunner.cs b/samples/ComputeSharp.SwapChain.UI/Shaders/Runners/D2D1ContouredLayersRunner.cs
deleted file mode 100644
index 5a1d5db9..00000000
--- a/samples/ComputeSharp.SwapChain.UI/Shaders/Runners/D2D1ContouredLayersRunner.cs
+++ /dev/null
@@ -1,67 +0,0 @@
-using System;
-using System.IO;
-using ComputeSharp.D2D1;
-using ComputeSharp.D2D1.Interop;
-#if WINDOWS_UWP
-using ComputeSharp.D2D1.Uwp;
-#else
-using ComputeSharp.D2D1.WinUI;
-#endif
-using ComputeSharp.SwapChain.Shaders.D2D1;
-using Windows.ApplicationModel;
-
-namespace ComputeSharp.SwapChain.Core.Shaders.Runners;
-
-///
-/// A specialized for .
-///
-public sealed partial class D2D1ContouredLayersEffect : PixelShaderEffect
-{
- ///
- /// The reusable node to use to render frames.
- ///
- private static readonly CanvasEffectNode> PixelShaderEffect = new();
-
- ///
- protected override unsafe void BuildEffectGraph(CanvasEffectGraph effectGraph)
- {
- string filename = Path.Combine(Package.Current.InstalledLocation.Path, "Assets", "Textures", "RustyMetal.png");
-
- // As a temporary workaround for the lack of image decoding helpers for D2D1ResourceTextureManager, and in order to
- // keep the code here synchronous and simple, we can just leverage the DirectX 12 APIs to load textures. That is, we
- // first load a texture (which will use WIC behind the scenes) to get the decoded image data in GPU memory, and then
- // copy the data in a readback texture we can read from on the CPU. We can't just load an upload texture and read
- // from it, as that type of texture can only be written to from the CPU. From there, we create a D2D resource texture.
- using ReadOnlyTexture2D readOnlyTexture = GraphicsDevice.GetDefault().LoadReadOnlyTexture2D(filename);
- using ReadBackTexture2D readBackTexture = GraphicsDevice.GetDefault().AllocateReadBackTexture2D(readOnlyTexture.Width, readOnlyTexture.Height);
-
- readOnlyTexture.CopyTo(readBackTexture);
-
- // Get the buffer pointer, the stride, and calculate the buffer size without the trailing padding.
- // That is, the area between the end of the data in the last row and the stride is not included.
- Rgba32* dataBuffer = readBackTexture.View.DangerousGetAddressAndByteStride(out int strideInBytes);
- int bufferSize = ((readBackTexture.Height - 1) * strideInBytes) + (readBackTexture.View.Width * sizeof(Rgba32));
-
- // Create the resource texture manager to use in the shader
- D2D1ResourceTextureManager resourceTextureManager = new(
- extents: [(uint)readBackTexture.Height, (uint)readBackTexture.Width],
- bufferPrecision: D2D1BufferPrecision.UInt8Normalized,
- channelDepth: D2D1ChannelDepth.Four,
- filter: D2D1Filter.MinMagMipLinear,
- extendModes: [D2D1ExtendMode.Mirror, D2D1ExtendMode.Mirror],
- data: new ReadOnlySpan(dataBuffer, bufferSize),
- strides: [(uint)strideInBytes]);
-
- // Create the new pixel shader effect
- PixelShaderEffect pixelShaderEffect = new() { ResourceTextureManagers = { [0] = resourceTextureManager } };
-
- // Register the pixel shader effect as the output node in the effect graph
- effectGraph.RegisterOutputNode(PixelShaderEffect, pixelShaderEffect);
- }
-
- ///
- protected override void ConfigureEffectGraph(CanvasEffectGraph effectGraph)
- {
- effectGraph.GetNode(PixelShaderEffect).ConstantBuffer = new ContouredLayers((float)ElapsedTime.TotalSeconds, new int2(ScreenWidth, ScreenHeight));
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.UI/ViewModels/MainViewModel.cs b/samples/ComputeSharp.SwapChain.UI/ViewModels/MainViewModel.cs
deleted file mode 100644
index 93dd68cf..00000000
--- a/samples/ComputeSharp.SwapChain.UI/ViewModels/MainViewModel.cs
+++ /dev/null
@@ -1,163 +0,0 @@
-using System.Collections.ObjectModel;
-using CommunityToolkit.Mvvm.ComponentModel;
-using CommunityToolkit.Mvvm.Input;
-using ComputeSharp.SwapChain.Core.Enums;
-using ComputeSharp.SwapChain.Core.Shaders;
-using ComputeSharp.SwapChain.Core.Shaders.Runners;
-using ComputeSharp.SwapChain.Shaders;
-#if WINDOWS_UWP
-using ComputeSharp.Uwp;
-#else
-using ComputeSharp.WinUI;
-#endif
-
-#pragma warning disable IDE0300 // CsWinRT does not support marshalling collection expression (https://github.com/microsoft/CsWinRT/issues/1661)
-
-namespace ComputeSharp.SwapChain.Core.ViewModels;
-
-///
-/// The viewmodel for for a view that allows users to select shaders and customize settings.
-///
-public sealed partial class MainViewModel : ObservableObject
-{
- ///
- /// Creates a new instance.
- ///
- public MainViewModel()
- {
- SelectedComputeShader = ComputeShaderOptions[0];
- }
-
- ///
- /// Gets or sets the selected rendering mode.
- ///
- [ObservableProperty]
- [NotifyPropertyChangedFor(nameof(IsResolutionScaleOptionEnabled))]
- public partial RenderingMode SelectedRenderingMode { get; set; } = RenderingMode.DirectX12;
-
- ///
- /// Gets or sets whether the vertical sync is enabled.
- ///
- [ObservableProperty]
- public partial bool IsVerticalSyncEnabled { get; set; } = true;
-
- ///
- /// Gets or sets whether the dynamic resolution is enabled.
- ///
- [ObservableProperty]
- [NotifyPropertyChangedFor(nameof(IsResolutionScaleOptionEnabled))]
- public partial bool IsDynamicResolutionEnabled { get; set; } = true;
-
- ///
- /// Gets the currently selected resolution scale setting (as percentage value).
- ///
- [ObservableProperty]
- public partial int SelectedResolutionScale { get; set; } = 100;
-
- ///
- /// Gets or sets the currently selected compute shader.
- ///
- [ObservableProperty]
- public partial ShaderRunnerViewModel SelectedComputeShader { get; set; }
-
- ///
- /// Gets or sets whether the rendering is currently paused.
- ///
- [ObservableProperty]
- public partial bool IsRenderingPaused { get; set; }
-
- ///
- /// Gets the available resolution scaling options (as percentage values).
- ///
- public ReadOnlyCollection ResolutionScaleOptions { get; } = new((int[])[25, 50, 75, 100]);
-
- ///
- /// Gets the collection of available compute shader.
- ///
- public ReadOnlyCollection ComputeShaderOptions { get; } = new((ShaderRunnerViewModel[])
- [
- new(
- nameof(ColorfulInfinity),
- new ShaderRunner(static time => new((float)time.TotalSeconds)),
- new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))),
- new(
- nameof(FractalTiling),
- new ShaderRunner(static time => new((float)time.TotalSeconds)),
- new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))),
- new(
- nameof(MengerJourney),
- new ShaderRunner(static time => new((float)time.TotalSeconds)),
- new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))),
- new(
- nameof(Octagrams),
- new ShaderRunner(static time => new((float)time.TotalSeconds)),
- new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))),
- new(
- nameof(ProteanClouds),
- new ShaderRunner(static time => new((float)time.TotalSeconds)),
- new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))),
- new(
- nameof(TwoTiledTruchet),
- new ShaderRunner(static time => new((float)time.TotalSeconds)),
- new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))),
- new(
- nameof(PyramidPattern),
- new ShaderRunner(static time => new((float)time.TotalSeconds)),
- new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))),
- new(
- nameof(TriangleGridContouring),
- new ShaderRunner(static time => new((float)time.TotalSeconds)),
- new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))),
- new(nameof(ContouredLayers), new ContouredLayersRunner(), new D2D1ContouredLayersEffect()),
- new(
- nameof(TerracedHills),
- new ShaderRunner(static time => new((float)time.TotalSeconds)),
- new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))),
- ]);
-
- ///
- /// Checks whether the resolution scale can currently be expliclty set.
- ///
- public bool IsResolutionScaleOptionEnabled => SelectedRenderingMode == RenderingMode.DirectX12 && !IsDynamicResolutionEnabled;
-
- ///
- /// Sets .
- ///
- [RelayCommand]
- private void SetRenderingMode(RenderingMode renderingMode)
- {
- SelectedRenderingMode = renderingMode;
- }
-
- ///
- /// Sets .
- ///
- [RelayCommand]
- private void SetResolutionScale(int resolutionScale)
- {
- SelectedResolutionScale = resolutionScale;
- }
-
- ///
- /// Toggles .
- ///
- [RelayCommand]
- private void ToggleRenderingPaused()
- {
- IsRenderingPaused = !IsRenderingPaused;
- }
-
- ///
- partial void OnSelectedComputeShaderChanging(ShaderRunnerViewModel oldValue, ShaderRunnerViewModel newValue)
- {
- // Known issue with partial properties: while the property is marked as not nullable, assigning it in the
- // constructor will suppress the warning but cause the setter to be invoked, with 'field' being 'null'.
- // As such, as need to check for that scenario here to avoid an exception. Possibly fixed in C# 14.
- if (oldValue is not null)
- {
- oldValue.IsSelected = false;
- }
-
- newValue.IsSelected = true;
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.UI/ViewModels/ShaderRunnerViewModel.cs b/samples/ComputeSharp.SwapChain.UI/ViewModels/ShaderRunnerViewModel.cs
deleted file mode 100644
index e3db3a2d..00000000
--- a/samples/ComputeSharp.SwapChain.UI/ViewModels/ShaderRunnerViewModel.cs
+++ /dev/null
@@ -1,42 +0,0 @@
-using CommunityToolkit.Mvvm.ComponentModel;
-using ComputeSharp.SwapChain.Core.Shaders;
-#if WINDOWS_UWP
-using ComputeSharp.Uwp;
-#else
-using ComputeSharp.WinUI;
-#endif
-
-namespace ComputeSharp.SwapChain.Core.ViewModels;
-
-///
-/// A viewmodel for a compute shader.
-///
-/// The name of the shader type to execute.
-/// The instance to execute.
-/// The instance to execute.
-public sealed partial class ShaderRunnerViewModel(
- string shaderType,
- IShaderRunner shaderRunner,
- PixelShaderEffect pixelShaderEffect) : ObservableObject
-{
- ///
- /// Gets the name of the shader type to execute.
- ///
- public string ShaderType => shaderType;
-
- ///
- /// Gets the instance to execute.
- ///
- public IShaderRunner ShaderRunner => shaderRunner;
-
- ///
- /// Gets the instance to execute.
- ///
- public PixelShaderEffect PixelShaderEffect => pixelShaderEffect;
-
- ///
- /// Gets or sets whether the current shader is selected.
- ///
- [ObservableProperty]
- public partial bool IsSelected { get; set; }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.Uwp/App.xaml b/samples/ComputeSharp.SwapChain.Uwp/App.xaml
deleted file mode 100644
index 9ee3a3dc..00000000
--- a/samples/ComputeSharp.SwapChain.Uwp/App.xaml
+++ /dev/null
@@ -1,13 +0,0 @@
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.Uwp/App.xaml.cs b/samples/ComputeSharp.SwapChain.Uwp/App.xaml.cs
deleted file mode 100644
index d60363db..00000000
--- a/samples/ComputeSharp.SwapChain.Uwp/App.xaml.cs
+++ /dev/null
@@ -1,72 +0,0 @@
-using ComputeSharp.SwapChain.Uwp.Views;
-using Windows.ApplicationModel.Activation;
-using Windows.ApplicationModel.Core;
-using Windows.UI;
-using Windows.UI.ViewManagement;
-using Windows.UI.Xaml;
-
-namespace ComputeSharp.SwapChain.Uwp;
-
-///
-/// Provides application-specific behavior to supplement the default Application class.
-///
-sealed partial class App : Application
-{
- ///
- /// Initializes the singleton application object. This is the first line of authored code
- /// executed, and as such is the logical equivalent of main() or WinMain().
- ///
- public App()
- {
- InitializeComponent();
- }
-
- ///
- protected override void OnLaunched(LaunchActivatedEventArgs e)
- {
- if (Window.Current.Content is not MainView)
- {
- StyleTitleBar();
- ExpandViewIntoTitleBar();
-
- Window.Current.Content = new MainView();
- }
-
- if (!e.PrelaunchActivated)
- {
- Window.Current.Activate();
- }
- }
-
- ///
- /// Styles the title bar buttons according to the theme in use
- ///
- private static void StyleTitleBar()
- {
- ApplicationViewTitleBar titleBar = ApplicationView.GetForCurrentView().TitleBar;
-
- // Transparent colors
- titleBar.ForegroundColor = Colors.Transparent;
- titleBar.BackgroundColor = Colors.Transparent;
- titleBar.ButtonBackgroundColor = Colors.Transparent;
- titleBar.InactiveBackgroundColor = Colors.Transparent;
- titleBar.ButtonInactiveBackgroundColor = Colors.Transparent;
-
- // Theme aware colors
- titleBar.ButtonForegroundColor = titleBar.ButtonHoverForegroundColor = titleBar.ButtonPressedForegroundColor = Colors.White;
- titleBar.ButtonHoverBackgroundColor = Color.FromArgb(0x20, 0xFF, 0xFF, 0xFF);
- titleBar.ButtonPressedBackgroundColor = Color.FromArgb(0x40, 0xFF, 0xFF, 0xFF);
- titleBar.ButtonInactiveForegroundColor = Color.FromArgb(0xC0, 0xFF, 0xFF, 0xFF);
- titleBar.InactiveForegroundColor = Color.FromArgb(0xA0, 0xA0, 0xA0, 0xA0);
- }
-
- ///
- /// Sets up the app UI to be expanded into the title bar
- ///
- private static void ExpandViewIntoTitleBar()
- {
- CoreApplicationViewTitleBar coreTitleBar = CoreApplication.GetCurrentView().TitleBar;
-
- coreTitleBar.ExtendViewIntoTitleBar = true;
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.Uwp/ComputeSharp.SwapChain.Uwp.csproj b/samples/ComputeSharp.SwapChain.Uwp/ComputeSharp.SwapChain.Uwp.csproj
deleted file mode 100644
index 3ade76b3..00000000
--- a/samples/ComputeSharp.SwapChain.Uwp/ComputeSharp.SwapChain.Uwp.csproj
+++ /dev/null
@@ -1,68 +0,0 @@
-
-
- WinExe
- net8.0-windows10.0.26100.0
- 10.0.17763.0
- true
- x64;ARM64
- win-x64;win-arm64
- $(DefineConstants);WINDOWS_UWP
- en-US
- true
- win-$(Platform).pubxml
- true
-
-
- false
-
-
- 1.3.20250314.1
-
-
-
-
- false
- true
- 2
-
-
-
-
- false
- true
-
-
-
-
- true
- true
- true
- false
- Speed
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Controls/D2D1AnimatedPixelShaderPanel.xaml b/samples/ComputeSharp.SwapChain.Uwp/Controls/D2D1AnimatedPixelShaderPanel.xaml
deleted file mode 100644
index b7c172e8..00000000
--- a/samples/ComputeSharp.SwapChain.Uwp/Controls/D2D1AnimatedPixelShaderPanel.xaml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Package.appxmanifest b/samples/ComputeSharp.SwapChain.Uwp/Package.appxmanifest
deleted file mode 100644
index f12fcf8c..00000000
--- a/samples/ComputeSharp.SwapChain.Uwp/Package.appxmanifest
+++ /dev/null
@@ -1,46 +0,0 @@
-
-
-
-
-
-
-
-
-
- ComputeSharp Sample App
- Sergio Pedri
- Assets\StoreLogo.png
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Properties/PublishProfiles/win-arm64.pubxml b/samples/ComputeSharp.SwapChain.Uwp/Properties/PublishProfiles/win-arm64.pubxml
deleted file mode 100644
index 5de0b991..00000000
--- a/samples/ComputeSharp.SwapChain.Uwp/Properties/PublishProfiles/win-arm64.pubxml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
- FileSystem
- ARM64
- win-arm64
- bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\
- true
- true
-
-
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Properties/PublishProfiles/win-x64.pubxml b/samples/ComputeSharp.SwapChain.Uwp/Properties/PublishProfiles/win-x64.pubxml
deleted file mode 100644
index 89844a87..00000000
--- a/samples/ComputeSharp.SwapChain.Uwp/Properties/PublishProfiles/win-x64.pubxml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
- FileSystem
- x64
- win-x64
- bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\
- true
- true
-
-
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Properties/launchSettings.json b/samples/ComputeSharp.SwapChain.Uwp/Properties/launchSettings.json
deleted file mode 100644
index 46264d2b..00000000
--- a/samples/ComputeSharp.SwapChain.Uwp/Properties/launchSettings.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "profiles": {
- "ComputeSharp.SwapChain.Uwp": {
- "commandName": "MsixPackage"
- }
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Views/MainView.xaml b/samples/ComputeSharp.SwapChain.Uwp/Views/MainView.xaml
deleted file mode 100644
index ec299cb0..00000000
--- a/samples/ComputeSharp.SwapChain.Uwp/Views/MainView.xaml
+++ /dev/null
@@ -1,281 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Views/MainView.xaml.cs b/samples/ComputeSharp.SwapChain.Uwp/Views/MainView.xaml.cs
deleted file mode 100644
index 756d5329..00000000
--- a/samples/ComputeSharp.SwapChain.Uwp/Views/MainView.xaml.cs
+++ /dev/null
@@ -1,50 +0,0 @@
-using System;
-using ComputeSharp.Uwp;
-using Windows.UI.Xaml;
-using Windows.UI.Xaml.Controls;
-using Windows.UI.Xaml.Input;
-
-namespace ComputeSharp.SwapChain.Uwp.Views;
-
-///
-/// A view for .
-///
-public sealed partial class MainView : UserControl
-{
- public MainView()
- {
- InitializeComponent();
- }
-
- // Opens the shader selection panel
- private void OpenShaderSelectionPanelButton_Click(object sender, RoutedEventArgs e)
- {
- _ = this.Root.Resources.Remove(nameof(this.ShaderSelectionPanel));
-
- this.Root.Children.Add(this.ShaderSelectionPanel);
- }
-
- // Hides the shader selection panel
- private void ShaderSelectionPanel_Tapped(object sender, TappedRoutedEventArgs e)
- {
- _ = this.Root.Children.Remove(this.ShaderSelectionPanel);
- }
-
- // Updates the size of the shaders list panel
- private void UserControl_SizeChanged(object sender, SizeChangedEventArgs e)
- {
- this.ShadersListContainerPanel.Height = Math.Round(e.NewSize.Height * 0.35);
- }
-
- // Logs rendering failed in the main panel
- private void MainShaderPanel_RenderingFailed(AnimatedComputeShaderPanel sender, RenderingFailedEventArgs args)
- {
- this.RenderingErrorInfoBar.IsOpen = true;
- }
-
- // Logs rendering failed in a secondary panel
- private void SelectionShaderPanel_RenderingFailed(AnimatedComputeShaderPanel sender, RenderingFailedEventArgs args)
- {
- this.RenderingErrorInfoBar.IsOpen = true;
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.WinUI/App.xaml b/samples/ComputeSharp.SwapChain.WinUI/App.xaml
deleted file mode 100644
index 4e2888ba..00000000
--- a/samples/ComputeSharp.SwapChain.WinUI/App.xaml
+++ /dev/null
@@ -1,19 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/ComputeSharp.SwapChain.WinUI/App.xaml.cs b/samples/ComputeSharp.SwapChain.WinUI/App.xaml.cs
deleted file mode 100644
index c4a547d4..00000000
--- a/samples/ComputeSharp.SwapChain.WinUI/App.xaml.cs
+++ /dev/null
@@ -1,54 +0,0 @@
-using System;
-using System.Threading;
-using ComputeSharp.SwapChain.WinUI.Views;
-using Microsoft.UI.Xaml;
-
-#pragma warning disable CA1001, IDE0052
-
-namespace ComputeSharp.SwapChain.WinUI;
-
-///
-/// Provides application-specific behavior to supplement the default Application class.
-///
-public sealed partial class App : Application
-{
- ///
- /// The main application window
- ///
- private MainWindow? mainWindow;
-
- ///
- /// A timer to force shutdown after a given amount of time.
- ///
- /// This field is needed to keep the timer alive.
- private Timer? shutdownTimer;
-
- ///
- /// Initializes the singleton application object. This is the first line of authored code
- /// executed, and as such is the logical equivalent of main() or WinMain().
- ///
- public App()
- {
- InitializeComponent();
- }
-
- ///
- protected override void OnLaunched(LaunchActivatedEventArgs args)
- {
- this.mainWindow = new MainWindow();
- this.mainWindow.Closed += (_, _) =>
- {
- // Due to an issue (https://discord.com/channels/372137812037730304/663434534087426129/979543152853663744), the WinUI 3 app
- // will keep running after the window is closed if any render thread is still going. To work around this, each loaded shader
- // panel is tracked in a conditional weak table, and then when the window is closed they're all manually stopped by setting
- // their shader runners to null. After this, the app should just be able to close automatically when the panels are done.
- this.mainWindow.OnShutdown();
-
- // For good measure, also start a timer of one second. If the app is still alive by then (ie. if the timer callback is
- // executed at all), then just force the whole process to terminate, and exit with the E_APPLICATION_EXITING error code.
- this.shutdownTimer = new Timer(_ => Environment.Exit(unchecked((int)0x8000001A)), this, 1000, Timeout.Infinite);
- };
-
- this.mainWindow.Activate();
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.WinUI/ComputeSharp.SwapChain.WinUI.csproj b/samples/ComputeSharp.SwapChain.WinUI/ComputeSharp.SwapChain.WinUI.csproj
deleted file mode 100644
index cf222e6c..00000000
--- a/samples/ComputeSharp.SwapChain.WinUI/ComputeSharp.SwapChain.WinUI.csproj
+++ /dev/null
@@ -1,90 +0,0 @@
-
-
- WinExe
- net8.0-windows10.0.22621.0
- 10.0.17763.0
- app.manifest
- x64;ARM64
- win-x64;win-arm64
- win-$(Platform).pubxml
- true
- true
-
-
- false
-
-
-
-
-
-
- false
-
-
- true
-
-
- 2
-
-
-
-
- false
- true
-
-
-
-
- true
- true
- true
- false
- Speed
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- true
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Controls/D2D1AnimatedPixelShaderPanel.xaml b/samples/ComputeSharp.SwapChain.WinUI/Controls/D2D1AnimatedPixelShaderPanel.xaml
deleted file mode 100644
index 438d53d0..00000000
--- a/samples/ComputeSharp.SwapChain.WinUI/Controls/D2D1AnimatedPixelShaderPanel.xaml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Package.appxmanifest b/samples/ComputeSharp.SwapChain.WinUI/Package.appxmanifest
deleted file mode 100644
index a5b965f7..00000000
--- a/samples/ComputeSharp.SwapChain.WinUI/Package.appxmanifest
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-
-
-
- ComputeSharp Sample App (WinUI 3)
- Sergio Pedri
- Assets\StoreLogo.png
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Properties/PublishProfiles/win-arm64.pubxml b/samples/ComputeSharp.SwapChain.WinUI/Properties/PublishProfiles/win-arm64.pubxml
deleted file mode 100644
index 5de0b991..00000000
--- a/samples/ComputeSharp.SwapChain.WinUI/Properties/PublishProfiles/win-arm64.pubxml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
- FileSystem
- ARM64
- win-arm64
- bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\
- true
- true
-
-
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Properties/PublishProfiles/win-x64.pubxml b/samples/ComputeSharp.SwapChain.WinUI/Properties/PublishProfiles/win-x64.pubxml
deleted file mode 100644
index 89844a87..00000000
--- a/samples/ComputeSharp.SwapChain.WinUI/Properties/PublishProfiles/win-x64.pubxml
+++ /dev/null
@@ -1,11 +0,0 @@
-
-
-
- FileSystem
- x64
- win-x64
- bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\
- true
- true
-
-
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Properties/launchSettings.json b/samples/ComputeSharp.SwapChain.WinUI/Properties/launchSettings.json
deleted file mode 100644
index dd70ba94..00000000
--- a/samples/ComputeSharp.SwapChain.WinUI/Properties/launchSettings.json
+++ /dev/null
@@ -1,7 +0,0 @@
-{
- "profiles": {
- "ComputeSharp.SwapChain.WinUI": {
- "commandName": "MsixPackage"
- }
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Views/MainWindow.xaml b/samples/ComputeSharp.SwapChain.WinUI/Views/MainWindow.xaml
deleted file mode 100644
index 9f0df1a0..00000000
--- a/samples/ComputeSharp.SwapChain.WinUI/Views/MainWindow.xaml
+++ /dev/null
@@ -1,292 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Views/MainWindow.xaml.cs b/samples/ComputeSharp.SwapChain.WinUI/Views/MainWindow.xaml.cs
deleted file mode 100644
index 72e2b5c0..00000000
--- a/samples/ComputeSharp.SwapChain.WinUI/Views/MainWindow.xaml.cs
+++ /dev/null
@@ -1,79 +0,0 @@
-using System;
-using System.Runtime.CompilerServices;
-using ComputeSharp.SwapChain.Core.ViewModels;
-using ComputeSharp.WinUI;
-using Microsoft.UI.Xaml;
-using Microsoft.UI.Xaml.Input;
-
-namespace ComputeSharp.SwapChain.WinUI.Views;
-
-///
-/// A view for .
-///
-public sealed partial class MainWindow : Window
-{
- ///
- /// The mapping of currently alive shader panels.
- ///
- private readonly ConditionalWeakTable shaderPanels = [];
-
- public MainWindow()
- {
- InitializeComponent();
-
- ExtendsContentIntoTitleBar = true;
-
- SetTitleBar(this.TitleBarRectangle);
- }
-
- ///
- /// Stops all rendering when the application is closing.
- ///
- public void OnShutdown()
- {
- this.ShaderPanel.ShaderRunner = null;
-
- foreach ((AnimatedComputeShaderPanel panel, object? _) in this.shaderPanels)
- {
- panel.ShaderRunner = null;
- }
- }
-
- // Opens the shader selection panel
- private void OpenShaderSelectionPanelButton_Click(object sender, RoutedEventArgs e)
- {
- _ = this.Root.Resources.Remove("ShaderSelectionPanel");
-
- this.Root.Children.Add(this.ShaderSelectionPanel);
- }
-
- // Hides the shader selection panel
- private void ShaderSelectionPanel_Tapped(object sender, TappedRoutedEventArgs e)
- {
- _ = this.Root.Children.Remove(this.ShaderSelectionPanel);
- }
-
- // Updates the size of the shaders list panel
- private void Window_SizeChanged(object sender, WindowSizeChangedEventArgs e)
- {
- this.ShadersListContainerPanel.Height = Math.Round(e.Size.Height * 0.35);
- }
-
- // Tracks the current panel
- private void AnimatedComputeShaderPanel_Loaded(object sender, RoutedEventArgs e)
- {
- this.shaderPanels.AddOrUpdate((AnimatedComputeShaderPanel)sender, null);
- }
-
- // Logs rendering failed in the main panel
- private void MainShaderPanel_RenderingFailed(AnimatedComputeShaderPanel sender, RenderingFailedEventArgs args)
- {
- this.RenderingErrorInfoBar.IsOpen = true;
- }
-
- // Logs rendering failed in a secondary panel
- private void SelectionShaderPanel_RenderingFailed(AnimatedComputeShaderPanel sender, RenderingFailedEventArgs args)
- {
- this.RenderingErrorInfoBar.IsOpen = true;
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.WinUI/app.manifest b/samples/ComputeSharp.SwapChain.WinUI/app.manifest
deleted file mode 100644
index 2b945c52..00000000
--- a/samples/ComputeSharp.SwapChain.WinUI/app.manifest
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
-
-
-
-
-
- true/PM
- PerMonitorV2, PerMonitor
-
-
-
diff --git a/samples/ComputeSharp.SwapChain/Backend/Win32Application.cs b/samples/ComputeSharp.SwapChain/Backend/Win32Application.cs
deleted file mode 100644
index 080820a5..00000000
--- a/samples/ComputeSharp.SwapChain/Backend/Win32Application.cs
+++ /dev/null
@@ -1,300 +0,0 @@
-using System;
-using ComputeSharp.Interop;
-using TerraFX.Interop.DirectX;
-using TerraFX.Interop.Windows;
-
-namespace ComputeSharp.SwapChain.Backend;
-
-///
-/// A class representing a simple Win32 application.
-///
-/// The function pointer used to run a shader on a target texture.
-internal sealed unsafe class Win32Application(delegate*, TimeSpan, void> shaderCallback)
-{
- ///
- /// The pointer for the device currently in use.
- ///
- private ComPtr d3D12Device;
-
- ///
- /// The instance to use for graphics operations.
- ///
- private ComPtr d3D12CommandQueue;
-
- ///
- /// The instance used for graphics operations.
- ///
- private ComPtr d3D12Fence;
-
- ///
- /// The next fence value for graphics operations using .
- ///
- private ulong nextD3D12FenceValue = 1;
-
- ///
- /// The object to create command lists.
- ///
- private ComPtr d3D12CommandAllocator;
-
- ///
- /// The instance used to copy data to the back buffers.
- ///
- private ComPtr d3D12GraphicsCommandList;
-
- ///
- /// The instance used to display content onto the target window.
- ///
- private ComPtr dxgiSwapChain1;
-
- ///
- /// The first buffer within .
- ///
- private ComPtr d3D12Resource0;
-
- ///
- /// The second buffer within .
- ///
- private ComPtr d3D12Resource1;
-
- ///
- /// The index of the next buffer that can be used to present content.
- ///
- private uint currentBufferIndex;
-
- ///
- /// The instance used to prepare frames to display.
- ///
- private ReadWriteTexture2D? texture;
-
- ///
- /// Whether or not the window has been resized and requires the buffers to be updated.
- ///
- private volatile bool isResizePending;
-
- ///
- /// Initializes the current application.
- ///
- /// The handle for the window.
- public void OnInitialize(HWND hwnd)
- {
- // Get the underlying ID3D12Device in use
- fixed (ID3D12Device** d3D12Device = this.d3D12Device)
- {
- _ = InteropServices.TryGetID3D12Device(GraphicsDevice.GetDefault(), Windows.__uuidof(), (void**)d3D12Device);
- }
-
- // Create the direct command queue to use
- fixed (ID3D12CommandQueue** d3D12CommandQueue = this.d3D12CommandQueue)
- {
- D3D12_COMMAND_QUEUE_DESC d3D12CommandQueueDesc;
- d3D12CommandQueueDesc.Type = D3D12_COMMAND_LIST_TYPE.D3D12_COMMAND_LIST_TYPE_DIRECT;
- d3D12CommandQueueDesc.Priority = (int)D3D12_COMMAND_QUEUE_PRIORITY.D3D12_COMMAND_QUEUE_PRIORITY_NORMAL;
- d3D12CommandQueueDesc.Flags = D3D12_COMMAND_QUEUE_FLAGS.D3D12_COMMAND_QUEUE_FLAG_NONE;
- d3D12CommandQueueDesc.NodeMask = 0;
-
- _ = this.d3D12Device.Get()->CreateCommandQueue(
- &d3D12CommandQueueDesc,
- Windows.__uuidof(),
- (void**)d3D12CommandQueue);
- }
-
- // Create the direct fence
- fixed (ID3D12Fence** d3D12Fence = this.d3D12Fence)
- {
- _ = this.d3D12Device.Get()->CreateFence(
- 0,
- D3D12_FENCE_FLAGS.D3D12_FENCE_FLAG_NONE,
- Windows.__uuidof(),
- (void**)d3D12Fence);
- }
-
- // Create the swap chain to display frames
- fixed (IDXGISwapChain1** dxgiSwapChain1 = this.dxgiSwapChain1)
- {
- using ComPtr dxgiFactory2 = default;
-
- _ = DirectX.CreateDXGIFactory2(DXGI.DXGI_CREATE_FACTORY_DEBUG, Windows.__uuidof(), (void**)dxgiFactory2.GetAddressOf());
-
- DXGI_SWAP_CHAIN_DESC1 dxgiSwapChainDesc1 = default;
- dxgiSwapChainDesc1.AlphaMode = DXGI_ALPHA_MODE.DXGI_ALPHA_MODE_IGNORE;
- dxgiSwapChainDesc1.BufferCount = 2;
- dxgiSwapChainDesc1.Flags = 0;
- dxgiSwapChainDesc1.Format = DXGI_FORMAT.DXGI_FORMAT_R8G8B8A8_UNORM;
- dxgiSwapChainDesc1.Width = 0;
- dxgiSwapChainDesc1.Height = 0;
- dxgiSwapChainDesc1.SampleDesc = new DXGI_SAMPLE_DESC(count: 1, quality: 0);
- dxgiSwapChainDesc1.Scaling = DXGI_SCALING.DXGI_SCALING_STRETCH;
- dxgiSwapChainDesc1.Stereo = 0;
- dxgiSwapChainDesc1.SwapEffect = DXGI_SWAP_EFFECT.DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL;
-
- _ = dxgiFactory2.Get()->CreateSwapChainForHwnd(
- (IUnknown*)this.d3D12CommandQueue.Get(),
- hwnd,
- &dxgiSwapChainDesc1,
- null,
- null,
- dxgiSwapChain1);
- }
-
- // Create the command allocator to use
- fixed (ID3D12CommandAllocator** d3D12CommandAllocator = this.d3D12CommandAllocator)
- {
- _ = this.d3D12Device.Get()->CreateCommandAllocator(
- D3D12_COMMAND_LIST_TYPE.D3D12_COMMAND_LIST_TYPE_DIRECT,
- Windows.__uuidof(),
- (void**)d3D12CommandAllocator);
- }
-
- // Create the reusable command list to copy data to the back buffers
- fixed (ID3D12GraphicsCommandList** d3D12GraphicsCommandList = this.d3D12GraphicsCommandList)
- {
- _ = this.d3D12Device.Get()->CreateCommandList(
- 0,
- D3D12_COMMAND_LIST_TYPE.D3D12_COMMAND_LIST_TYPE_DIRECT,
- this.d3D12CommandAllocator,
- null,
- Windows.__uuidof(),
- (void**)d3D12GraphicsCommandList);
- }
-
- // Close the command list to prepare it for future use
- _ = this.d3D12GraphicsCommandList.Get()->Close();
- }
-
- ///
- /// Resizes the current application.
- ///
- public void OnResize()
- {
- this.isResizePending = true;
- }
-
- ///
- /// Applies the actual resize logic that was scheduled from .
- ///
- private void ApplyResize()
- {
- _ = this.d3D12CommandQueue.Get()->Signal(this.d3D12Fence.Get(), this.nextD3D12FenceValue);
-
- // Wait for the fence again to ensure there are no pending operations
- _ = this.d3D12Fence.Get()->SetEventOnCompletion(this.nextD3D12FenceValue, default);
-
- this.nextD3D12FenceValue++;
-
- // Dispose the old buffers before resizing the buffer
- this.d3D12Resource0.Dispose();
- this.d3D12Resource1.Dispose();
-
- // Resize the swap chain buffers
- _ = this.dxgiSwapChain1.Get()->ResizeBuffers(0, 0, 0, DXGI_FORMAT.DXGI_FORMAT_UNKNOWN, 0);
-
- // Get the index of the initial back buffer
- using (ComPtr dxgiSwapChain3 = default)
- {
- _ = this.dxgiSwapChain1.CopyTo(dxgiSwapChain3.GetAddressOf());
-
- this.currentBufferIndex = dxgiSwapChain3.Get()->GetCurrentBackBufferIndex();
- }
-
- // Retrieve the back buffers for the swap chain
- fixed (ID3D12Resource** d3D12Resource0 = this.d3D12Resource0)
- fixed (ID3D12Resource** d3D12Resource1 = this.d3D12Resource1)
- {
- _ = this.dxgiSwapChain1.Get()->GetBuffer(0, Windows.__uuidof(), (void**)d3D12Resource0);
- _ = this.dxgiSwapChain1.Get()->GetBuffer(1, Windows.__uuidof(), (void**)d3D12Resource1);
- }
-
- this.texture?.Dispose();
-
- D3D12_RESOURCE_DESC d3D12Resource0Description = this.d3D12Resource0.Get()->GetDesc();
-
- // Create the 2D texture to use to generate frames to display
- this.texture = GraphicsDevice.GetDefault().AllocateReadWriteTexture2D(
- (int)d3D12Resource0Description.Width,
- (int)d3D12Resource0Description.Height);
- }
-
- ///
- /// Updates the current application.
- ///
- /// The current time since the start of the application.
- public void OnUpdate(TimeSpan time)
- {
- if (this.isResizePending)
- {
- ApplyResize();
-
- this.isResizePending = false;
- }
-
- // Generate the new frame by invoking the callback
- shaderCallback(this.texture!, time);
-
- using ComPtr d3D12Resource = default;
-
- // Get the underlying ID3D12Resource pointer for the texture
- _ = InteropServices.TryGetID3D12Resource(this.texture!, Windows.__uuidof(), (void**)d3D12Resource.GetAddressOf());
-
- // Get the target back buffer to update
- ID3D12Resource* d3D12ResourceBackBuffer = this.currentBufferIndex switch
- {
- 0 => this.d3D12Resource0.Get(),
- 1 => this.d3D12Resource1.Get(),
- _ => null
- };
-
- this.currentBufferIndex ^= 1;
-
- // Reset the command list and command allocator
- _ = this.d3D12CommandAllocator.Get()->Reset();
- _ = this.d3D12GraphicsCommandList.Get()->Reset(this.d3D12CommandAllocator.Get(), null);
-
- D3D12_RESOURCE_BARRIER* d3D12ResourceBarriers = stackalloc D3D12_RESOURCE_BARRIER[]
- {
- D3D12_RESOURCE_BARRIER.InitTransition(
- d3D12Resource.Get(),
- D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_UNORDERED_ACCESS,
- D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COPY_SOURCE),
- D3D12_RESOURCE_BARRIER.InitTransition(
- d3D12ResourceBackBuffer,
- D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COMMON,
- D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COPY_DEST)
- };
-
- // Transition the resources to COPY_DEST and COPY_SOURCE respectively
- this.d3D12GraphicsCommandList.Get()->ResourceBarrier(2, d3D12ResourceBarriers);
-
- // Copy the generated frame to the target back buffer
- this.d3D12GraphicsCommandList.Get()->CopyResource(d3D12ResourceBackBuffer, d3D12Resource.Get());
-
- d3D12ResourceBarriers[0] = D3D12_RESOURCE_BARRIER.InitTransition(
- d3D12Resource.Get(),
- D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COPY_SOURCE,
- D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_UNORDERED_ACCESS);
-
- d3D12ResourceBarriers[1] = D3D12_RESOURCE_BARRIER.InitTransition(
- d3D12ResourceBackBuffer,
- D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COPY_DEST,
- D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COMMON);
-
- // Transition the resources back to COMMON and UNORDERED_ACCESS respectively
- this.d3D12GraphicsCommandList.Get()->ResourceBarrier(2, d3D12ResourceBarriers);
-
- _ = this.d3D12GraphicsCommandList.Get()->Close();
-
- // Execute the command list to perform the copy
- this.d3D12CommandQueue.Get()->ExecuteCommandLists(1, (ID3D12CommandList**)this.d3D12GraphicsCommandList.GetAddressOf());
-
- _ = this.d3D12CommandQueue.Get()->Signal(this.d3D12Fence.Get(), this.nextD3D12FenceValue);
-
- // Present the new frame
- _ = this.dxgiSwapChain1.Get()->Present(0, 0);
-
- if (this.nextD3D12FenceValue > this.d3D12Fence.Get()->GetCompletedValue())
- {
- _ = this.d3D12Fence.Get()->SetEventOnCompletion(this.nextD3D12FenceValue, default);
- }
-
- this.nextD3D12FenceValue++;
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationFactory{T}.cs b/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationFactory{T}.cs
deleted file mode 100644
index 91592432..00000000
--- a/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationFactory{T}.cs
+++ /dev/null
@@ -1,43 +0,0 @@
-using System;
-using ComputeSharp.Descriptors;
-using TerraFX.Interop.Windows;
-
-namespace ComputeSharp.SwapChain.Backend;
-
-///
-/// A factory type that renders an animated shader on a swapchain on a target .
-///
-/// The shader type to render.
-///
-/// The main point of this type is to hide the complexity of from the non-NativeAOT sample.
-///
-internal static class Win32ApplicationFactory
- where T : struct, IComputeShader, IComputeShaderDescriptor
-{
- ///
- /// The instance used to create shaders to run.
- ///
- private static Func? shaderFactory;
-
- ///
- /// Creates a new from the specified factory.
- ///
- /// The instance used to create shaders to run.
- /// A instance to use.
- public static unsafe Win32Application Create(Func shaderFactory)
- {
- Win32ApplicationFactory.shaderFactory = shaderFactory;
-
- return new(&ShaderCallback);
- }
-
- ///
- /// The callback function to draw a single frame.
- ///
- /// The input instance to draw on.
- /// The time for the current frame.
- private static void ShaderCallback(IReadWriteNormalizedTexture2D texture, TimeSpan time)
- {
- texture.GraphicsDevice.ForEach(texture, shaderFactory!(time));
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationRunner.cs b/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationRunner.cs
deleted file mode 100644
index fbcfea2e..00000000
--- a/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationRunner.cs
+++ /dev/null
@@ -1,350 +0,0 @@
-using System;
-using System.Diagnostics;
-using System.Drawing;
-using System.Runtime.InteropServices;
-using System.Threading;
-using TerraFX.Interop.Windows;
-
-namespace ComputeSharp.SwapChain.Backend;
-
-///
-/// A helper class to manage the creation and execution of Win32 applications.
-///
-internal static unsafe class Win32ApplicationRunner
-{
- ///
- /// Whether or not a resize operation is in progress.
- ///
- private static bool isResizing = false;
-
- ///
- /// Whether or not the application is currently paused.
- ///
- private static bool isPaused = false;
-
- ///
- /// The for the application window.
- ///
- private static HWND hwnd;
-
- ///
- /// The application being run.
- ///
- private static Win32Application application = null!;
-
- ///
- /// The thread running the render loop.
- ///
- private static Thread renderThread = null!;
-
- ///
- /// Runs a specified application and starts the main loop to update its state. This is the entry point for a given application,
- /// and it should be called as soon as the process is launched, excluding any other additional initialization needed.
- ///
- /// The input application instance to run.
- /// Name of the input application instance to run.
- /// The title to use for the window being opened.
- /// The exit code for the application.
- public static int Run(Win32Application application, string applicationName, string windowTitle)
- {
- Win32ApplicationRunner.application = application;
-
- HMODULE hInstance = Windows.GetModuleHandleW(null);
-
- fixed (char* name = applicationName)
- fixed (char* title = windowTitle)
- {
- // Initialize the window class
- WNDCLASSEXW windowClassEx = new()
- {
- cbSize = (uint)sizeof(WNDCLASSEXW),
- style = CS.CS_HREDRAW | CS.CS_VREDRAW,
- lpfnWndProc = &WindowProc,
- hInstance = hInstance,
- hCursor = Windows.LoadCursorW(HINSTANCE.NULL, IDC.IDC_ARROW),
- lpszClassName = name
- };
-
- // Register the window class
- _ = Windows.RegisterClassExW(&windowClassEx);
-
- Rectangle windowRect = new(0, 0, 1280, 720);
-
- // Set the target window size
- _ = Windows.AdjustWindowRect((RECT*)&windowRect, WS.WS_OVERLAPPEDWINDOW, Windows.FALSE);
-
- uint height = (uint)(windowRect.Bottom - windowRect.Top);
- uint width = (uint)(windowRect.Right - windowRect.Left);
-
- // Create the window and store a handle to it
- hwnd = Windows.CreateWindowExW(
- 0,
- windowClassEx.lpszClassName,
- title,
- WS.WS_OVERLAPPEDWINDOW,
- Windows.CW_USEDEFAULT,
- Windows.CW_USEDEFAULT,
- (int)width,
- (int)height,
- HWND.NULL,
- HMENU.NULL,
- hInstance,
- (void*)GCHandle.ToIntPtr(GCHandle.Alloc(application))
- );
-
- MARGINS margins = default;
- margins.cxLeftWidth = -1;
- margins.cxRightWidth = -1;
- margins.cyTopHeight = -1;
- margins.cyBottomHeight = -1;
-
- _ = Windows.DwmExtendFrameIntoClientArea(hwnd, &margins);
- }
-
- // Initialize the application
- application.OnInitialize(hwnd);
-
- // Display the window
- _ = Windows.ShowWindow(hwnd, SW.SW_SHOWDEFAULT);
-
- MSG msg = default;
-
- // Setup the render thread that enables smooth resizing of the window
- renderThread = new Thread(static args =>
- {
- (Win32Application application, CancellationToken token) = ((Win32Application, CancellationToken))args!;
-
- Stopwatch startStopwatch = Stopwatch.StartNew();
- Stopwatch frameStopwatch = Stopwatch.StartNew();
-
- const long targetFrameTimeInTicksFor60fps = 166666;
-
- while (!token.IsCancellationRequested)
- {
- if (frameStopwatch.ElapsedTicks >= targetFrameTimeInTicksFor60fps)
- {
- frameStopwatch.Restart();
-
- application.OnUpdate(startStopwatch.Elapsed);
- }
- }
- });
-
- CancellationTokenSource tokenSource = new();
-
- renderThread.Start((application, tokenSource.Token));
-
- // Process any messages in the queue
- while (msg.message != WM.WM_QUIT)
- {
- if (Windows.PeekMessageW(&msg, HWND.NULL, 0, 0, PM.PM_REMOVE) != 0)
- {
- _ = Windows.TranslateMessage(&msg);
- _ = Windows.DispatchMessageW(&msg);
- }
- else if (isPaused)
- {
- Thread.Sleep(100);
- }
-
- // Also listen to Escape and 'Q' to quit
- if (msg.message == WM.WM_KEYUP && (msg.wParam == (WPARAM)VK.VK_ESCAPE || msg.wParam == 'Q'))
- {
- _ = Windows.DestroyWindow(hwnd);
- }
- }
-
- tokenSource.Cancel();
-
- renderThread.Join();
-
- // Return this part of the WM_QUIT message to Windows
- return (int)msg.wParam;
- }
-
- ///
- /// Processes incoming messages for a window.
- ///
- /// A handle to the window.
- /// The message.
- /// Additional message information (the contents depend on the value of ).
- /// Additional message information (the contents depend on the value of ).
- /// The result of the message processing for the input message.
- [UnmanagedCallersOnly]
- private static LRESULT WindowProc(HWND hwnd, uint uMsg, WPARAM wParam, LPARAM lParam)
- {
- switch (uMsg)
- {
- // Change the paused state on window activation
- case WM.WM_ACTIVATE:
- {
- if (Windows.LOWORD(wParam) == Windows.WA_INACTIVE)
- {
- isPaused = true;
- }
- else
- {
- isPaused = false;
- }
-
- return 0;
- }
-
- // Change the paused state when ESC is pressed
- case WM.WM_KEYDOWN:
- {
- if (wParam == (byte)ConsoleKey.Escape)
- {
-
- if (isPaused)
- {
- _ = Windows.SetCapture(hwnd);
- }
- else
- {
- _ = Windows.ReleaseCapture();
- }
-
- isPaused = !isPaused;
- }
-
- return 0;
- }
-
- // Window resize started
- case WM.WM_ENTERSIZEMOVE:
- {
- isResizing = true;
-
- return 0;
- }
-
- // Window resize completed
- case WM.WM_EXITSIZEMOVE:
- {
- isResizing = false;
- application.OnResize();
-
- return 0;
- }
-
- // Size update
- case WM.WM_SIZE:
- {
- if (!isResizing && wParam != Windows.SIZE_MINIMIZED)
- {
- application.OnResize();
- }
-
- return 0;
- }
-
- // Size and position of the window (needed to enable the borderless mode)
- case WM.WM_NCCALCSIZE:
- {
- return 0;
- }
-
- // Enable dragging the window
- case WM.WM_NCHITTEST:
- {
- POINT point;
- RECT rect;
-
- _ = Windows.GetCursorPos(&point);
- _ = Windows.GetWindowRect(hwnd, &rect);
-
- bool isAtTop = Math.Abs(point.y - rect.top) < 12;
- bool isAtRight = Math.Abs(point.x - rect.right) < 12;
- bool isAtBottom = Math.Abs(point.y - rect.bottom) < 12;
- bool isAtLeft = Math.Abs(point.x - rect.left) < 12;
-
- if (isAtTop)
- {
- if (isAtRight)
- {
- return Windows.HTTOPRIGHT;
- }
-
- if (isAtLeft)
- {
- return Windows.HTTOPLEFT;
- }
-
- return Windows.HTTOP;
- }
-
- if (isAtRight)
- {
- if (isAtTop)
- {
- return Windows.HTTOPRIGHT;
- }
-
- if (isAtBottom)
- {
- return Windows.HTBOTTOMRIGHT;
- }
-
- return Windows.HTRIGHT;
- }
-
- if (isAtBottom)
- {
- if (isAtRight)
- {
- return Windows.HTBOTTOMRIGHT;
- }
-
- if (isAtLeft)
- {
- return Windows.HTBOTTOMLEFT;
- }
-
- return Windows.HTBOTTOM;
- }
-
- if (isAtLeft)
- {
- if (isAtTop)
- {
- return Windows.HTTOPLEFT;
- }
-
- if (isAtBottom)
- {
- return Windows.HTBOTTOMLEFT;
- }
-
- return Windows.HTLEFT;
- }
-
- return Windows.HTCAPTION;
- }
-
- // Restore the drop shadow
- case WM.WM_DWMCOMPOSITIONCHANGED:
- {
- MARGINS margins = default;
- margins.cxLeftWidth = -1;
- margins.cxRightWidth = -1;
- margins.cyTopHeight = -1;
- margins.cyBottomHeight = -1;
-
- _ = Windows.DwmExtendFrameIntoClientArea(hwnd, &margins);
-
- return 0;
- }
-
- // Shutdown
- case WM.WM_DESTROY:
- {
- Windows.PostQuitMessage(0);
-
- return 0;
- }
- }
-
- return Windows.DefWindowProcW(hwnd, uMsg, wParam, lParam);
- }
-}
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain/ComputeSharp.SwapChain.csproj b/samples/ComputeSharp.SwapChain/ComputeSharp.SwapChain.csproj
deleted file mode 100644
index ac8219e0..00000000
--- a/samples/ComputeSharp.SwapChain/ComputeSharp.SwapChain.csproj
+++ /dev/null
@@ -1,26 +0,0 @@
-
-
- Exe
- net8.0
- x64;ARM64
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- PreserveNewest
-
-
-
-
-
diff --git a/samples/ComputeSharp.SwapChain/Program.cs b/samples/ComputeSharp.SwapChain/Program.cs
deleted file mode 100644
index 6362852d..00000000
--- a/samples/ComputeSharp.SwapChain/Program.cs
+++ /dev/null
@@ -1,80 +0,0 @@
-using System;
-using System.IO;
-using System.Runtime.CompilerServices;
-using ComputeSharp.SwapChain.Backend;
-using ComputeSharp.SwapChain.Shaders;
-
-namespace ComputeSharp.SwapChain;
-
-class Program
-{
- ///
- /// A texture for \Textures\RustyMetal.png.
- ///
- private static readonly Lazy> RustyMetal = new(static () => LoadTexture());
-
- static void Main()
- {
- // Prepare the mapping of available samples to choose from
- (string ShaderName, Win32Application Application)[] samples =
- [
- (nameof(HelloWorld), Win32ApplicationFactory.Create(static time => new((float)time.TotalSeconds))),
- (nameof(FourColorGradient), Win32ApplicationFactory.Create(static time => new((float)time.TotalSeconds))),
- (nameof(ColorfulInfinity), Win32ApplicationFactory.Create(static time => new((float)time.TotalSeconds))),
- (nameof(FractalTiling), Win32ApplicationFactory.Create(static time => new((float)time.TotalSeconds))),
- (nameof(TwoTiledTruchet), Win32ApplicationFactory.Create(static time => new((float)time.TotalSeconds))),
- (nameof(MengerJourney), Win32ApplicationFactory.Create(static time => new((float)time.TotalSeconds))),
- (nameof(Octagrams), Win32ApplicationFactory.Create(static time => new((float)time.TotalSeconds))),
- (nameof(ProteanClouds), Win32ApplicationFactory.Create(static time => new((float)time.TotalSeconds))),
- (nameof(ExtrudedTruchetPattern), Win32ApplicationFactory.Create(static time => new((float)time.TotalSeconds))),
- (nameof(PyramidPattern), Win32ApplicationFactory.Create(static time => new((float)time.TotalSeconds))),
- (nameof(TriangleGridContouring), Win32ApplicationFactory.Create(static time => new((float)time.TotalSeconds))),
- (nameof(ContouredLayers), Win32ApplicationFactory.Create(static time => new((float)time.TotalSeconds, RustyMetal.Value))),
- (nameof(TerracedHills), Win32ApplicationFactory.Create(static time => new((float)time.TotalSeconds))),
- ];
-
- int index;
-
- do
- {
- Console.Clear();
- Console.WriteLine("Available samples:");
- Console.WriteLine();
-
- for (int i = 0; i < samples.Length; i++)
- {
- Console.WriteLine($"{i}: {samples[i].ShaderName}");
- }
-
- Console.WriteLine($"{samples.Length}+: Exit (Use Escape, 'Q', or Alt + F4 to exit a sample once chosen)");
- Console.WriteLine();
-
- do
- {
- Console.Write("Enter the index of the sample to run: ");
- }
- while (!int.TryParse(Console.ReadLine(), out index));
-
- if (index >= 0 && index < samples.Length)
- {
- Console.WriteLine();
- Console.WriteLine($"Starting {samples[index].ShaderName}...");
-
- _ = Win32ApplicationRunner.Run(samples[index].Application, "ComputeSharp.SwapChain", samples[index].ShaderName);
- }
- }
- while (index >= 0 && index < samples.Length);
- }
-
- ///
- /// Allocates a new instance with the specified texture data.
- ///
- /// The name of the texture to load.
- /// A texture with the data from the image at the specified name.
- private static ReadOnlyTexture2D LoadTexture([CallerMemberName] string name = null!)
- {
- string filename = Path.Combine(AppContext.BaseDirectory, "Textures", $"{name}.png");
-
- return GraphicsDevice.GetDefault().LoadReadOnlyTexture2D(filename);
- }
-}
\ No newline at end of file
diff --git a/src/ComputeSharp.Core/ComputeSharp.Core.csproj b/src/ComputeSharp.Core/ComputeSharp.Core.csproj
index 58c33e92..f410cbca 100644
--- a/src/ComputeSharp.Core/ComputeSharp.Core.csproj
+++ b/src/ComputeSharp.Core/ComputeSharp.Core.csproj
@@ -7,12 +7,6 @@
-
-
-
-
-
-
diff --git a/src/ComputeSharp.D2D1.CodeFixers/ComputeSharp.D2D1.CodeFixers.csproj b/src/ComputeSharp.D2D1.CodeFixers/ComputeSharp.D2D1.CodeFixers.csproj
deleted file mode 100644
index dbfc9741..00000000
--- a/src/ComputeSharp.D2D1.CodeFixers/ComputeSharp.D2D1.CodeFixers.csproj
+++ /dev/null
@@ -1,15 +0,0 @@
-
-
- netstandard2.0
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/ComputeSharp.D2D1.CodeFixers/MissingPixelShaderDescriptorOnPixelShaderCodeFixer.cs b/src/ComputeSharp.D2D1.CodeFixers/MissingPixelShaderDescriptorOnPixelShaderCodeFixer.cs
deleted file mode 100644
index 9cf759fd..00000000
--- a/src/ComputeSharp.D2D1.CodeFixers/MissingPixelShaderDescriptorOnPixelShaderCodeFixer.cs
+++ /dev/null
@@ -1,48 +0,0 @@
-using System.Composition;
-using ComputeSharp.CodeFixing;
-using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.CodeFixes;
-using static ComputeSharp.SourceGeneration.Diagnostics.DiagnosticDescriptors;
-
-namespace ComputeSharp.D2D1.CodeFixers;
-
-///
-/// A code fixer that adds the [D2DGeneratedPixelShaderDescriptor] to D2D1 shader types with no descriptor.
-///
-[ExportCodeFixProvider(LanguageNames.CSharp)]
-[Shared]
-public sealed class MissingPixelShaderDescriptorOnPixelShaderCodeFixer : MissingAttributeCodeFixer
-{
- ///
- /// The set of type names for all D2D attributes that can be over shader types.
- ///
- private static readonly string[] D2DAttributeTypeNames =
- [
- "ComputeSharp.D2D1.D2DCompileOptionsAttribute",
- "ComputeSharp.D2D1.D2DEffectAuthorAttribute",
- "ComputeSharp.D2D1.D2DEffectCategoryAttribute",
- "ComputeSharp.D2D1.D2DEffectDescriptionAttribute",
- "ComputeSharp.D2D1.D2DEffectDisplayNameAttribute",
- "ComputeSharp.D2D1.D2DEffectIdAttribute",
- "ComputeSharp.D2D1.D2DInputComplexAttribute",
- "ComputeSharp.D2D1.D2DInputCountAttribute",
- "ComputeSharp.D2D1.D2DInputDescriptionAttribute",
- "ComputeSharp.D2D1.D2DInputSimpleAttribute",
- "ComputeSharp.D2D1.D2DOutputBufferAttribute",
- "ComputeSharp.D2D1.D2DPixelOptionsAttribute",
- "ComputeSharp.D2D1.D2DRequiresScenePositionAttribute",
- "ComputeSharp.D2D1.D2DShaderProfileAttribute"
- ];
-
- ///
- /// Creates a new instance with the specified parameters.
- ///
- public MissingPixelShaderDescriptorOnPixelShaderCodeFixer()
- : base(
- diagnosticId: MissingPixelShaderDescriptorOnPixelShaderTypeId,
- codeActionTitle: "Add [D2DGeneratedPixelShaderDescriptor] attribute",
- attributeFullyQualifiedMetadataName: "ComputeSharp.D2D1.D2DGeneratedPixelShaderDescriptorAttribute",
- leadingAttributeFullyQualifiedMetadataNames: D2DAttributeTypeNames)
- {
- }
-}
\ No newline at end of file
diff --git a/src/ComputeSharp.D2D1.SourceGenerators/AnalyzerReleases.Shipped.md b/src/ComputeSharp.D2D1.SourceGenerators/AnalyzerReleases.Shipped.md
deleted file mode 100644
index e9637e0e..00000000
--- a/src/ComputeSharp.D2D1.SourceGenerators/AnalyzerReleases.Shipped.md
+++ /dev/null
@@ -1,95 +0,0 @@
-; Shipped analyzer releases
-; https://github.com/dotnet/roslyn-analyzers/blob/master/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md
-
-## Release 1.0
-
-### New Rules
-
-Rule ID | Category | Severity | Notes
---------|----------|----------|-------
-CMPSD2D0001 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0002 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0003 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0004 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0005 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0006 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0007 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0008 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0009 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0010 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0011 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0012 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0013 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0014 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0015 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0016 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0017 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0018 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0019 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0020 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0021 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0022 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0023 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0024 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0025 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0026 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0027 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0028 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0029 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0030 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0031 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0032 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0033 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0034 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0035 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0036 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0037 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0038 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0039 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0040 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0041 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0042 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0043 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0044 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0045 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0046 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0047 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0048 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0049 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0050 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0051 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0052 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0053 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0054 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0055 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0056 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0057 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0058 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0059 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0060 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0061 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0062 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0063 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0064 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0065 | ComputeSharp.D2D1.Shaders | Warning | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0066 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0067 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0068 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0069 | ComputeSharp.D2D1.Shaders | Warning | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0070 | ComputeSharp.D2D1.Shaders | Warning | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0071 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0072 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0073 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0074 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0075 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0076 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0077 | ComputeSharp.D2D1.Shaders | Info | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0078 | ComputeSharp.D2D1.Shaders | Warning | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0079 | ComputeSharp.D2D1.Shaders | Warning | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0080 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0081 | ComputeSharp.D2D1.Shaders | Warning | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0082 | ComputeSharp.D2D1.Shaders | Warning | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0083 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0084 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0085 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
-CMPSD2D0086 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp)
diff --git a/src/ComputeSharp.D2D1.SourceGenerators/AnalyzerReleases.Unshipped.md b/src/ComputeSharp.D2D1.SourceGenerators/AnalyzerReleases.Unshipped.md
deleted file mode 100644
index 6a6dd08d..00000000
--- a/src/ComputeSharp.D2D1.SourceGenerators/AnalyzerReleases.Unshipped.md
+++ /dev/null
@@ -1,2 +0,0 @@
-; Unshipped analyzer release
-; https://github.com/dotnet/roslyn-analyzers/blob/master/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md
diff --git a/src/ComputeSharp.D2D1.SourceGenerators/ComputeSharp.D2D1.SourceGenerators.csproj b/src/ComputeSharp.D2D1.SourceGenerators/ComputeSharp.D2D1.SourceGenerators.csproj
deleted file mode 100644
index 11887f91..00000000
--- a/src/ComputeSharp.D2D1.SourceGenerators/ComputeSharp.D2D1.SourceGenerators.csproj
+++ /dev/null
@@ -1,99 +0,0 @@
-
-
- netstandard2.0
- $(DefineConstants);D2D1_SOURCE_GENERATOR
-
-
-
-
-
- $(NoWarn);CS0419
-
-
- $(NoWarn);CS1574
-
-
- $(NoWarn);IDE0004
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.ConstantBuffer.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.ConstantBuffer.cs
deleted file mode 100644
index 8fad2ba0..00000000
--- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.ConstantBuffer.cs
+++ /dev/null
@@ -1,117 +0,0 @@
-using System.Collections.Immutable;
-using ComputeSharp.D2D1.SourceGenerators.Models;
-using ComputeSharp.SourceGeneration.Extensions;
-using ComputeSharp.SourceGeneration.Helpers;
-using ComputeSharp.SourceGeneration.Models;
-using ComputeSharp.SourceGeneration.SyntaxProcessors;
-using Microsoft.CodeAnalysis;
-
-namespace ComputeSharp.D2D1.SourceGenerators;
-
-///
-partial class D2DPixelShaderDescriptorGenerator
-{
- ///
- /// A helper with all logic to generate the constant buffer marshalling methods and additional types.
- ///
- private static class ConstantBuffer
- {
- ///
- ///
- ///
- ///
- ///
- public static void GetInfo(
- Compilation compilation,
- ITypeSymbol structDeclarationSymbol,
- out int constantBufferSizeInBytes,
- out ImmutableArray fields)
- {
- constantBufferSizeInBytes = 0;
-
- ConstantBufferSyntaxProcessor.GetInfo(
- compilation,
- structDeclarationSymbol,
- ref constantBufferSizeInBytes,
- out fields);
- }
-
- ///
- /// Writes the LoadConstantBuffer method.
- ///
- /// The input instance with gathered shader info.
- /// The instance to write into.
- public static void WriteLoadConstantBufferSyntax(D2D1ShaderInfo info, IndentedTextWriter writer)
- {
- string typeName = info.Hierarchy.Hierarchy[0].QualifiedName;
-
- writer.WriteLine("/// ");
- writer.WriteGeneratedAttributes(GeneratorName);
- writer.WriteLine("[global::System.Runtime.CompilerServices.SkipLocalsInit]");
-
- // Write the method declaration (we only need unsafe blocks if we have any values in the constant buffer)
- writer.Write("static ");
- writer.WriteIf(!info.Fields.IsEmpty, "unsafe ");
- writer.WriteLine($"void global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<{typeName}>.LoadConstantBuffer(in {typeName} shader, ref TLoader loader)");
-
- using (writer.WriteBlock())
- {
- // If there are no fields, just load an empty buffer
- if (info.Fields.IsEmpty)
- {
- writer.WriteLine("loader.LoadConstantBuffer(default);");
- }
- else
- {
- // Because D2D (and possibly other consumers) will do a bitwise check on the constant buffer to check for changes,
- // it is important that the padding space between aligned elements in the generated constant buffer type are also
- // cleared, and not filled with random data (which might be the case if no special care is taken). We cannot just
- // rely on the default zero-ing performed by the JIT, because there is no guarantee that the padding space in types
- // representing unions will also be zero-ed. So instead we create an uninitialized instance and manually clear it
- // with 'NativeMemory.Clear' (which can also be unrolled by the JIT). This still maintains good performance, and
- // makes it possible for downstream consumers to further improve performance by implementing better caching strategies.
- writer.WriteLine("global::System.Runtime.CompilerServices.Unsafe.SkipInit(out global::ComputeSharp.D2D1.Generated.ConstantBuffer buffer);");
- writer.WriteLine();
- writer.WriteLine("global::System.Runtime.InteropServices.NativeMemory.Clear(&buffer, (uint)sizeof(global::ComputeSharp.D2D1.Generated.ConstantBuffer));");
- writer.WriteLine();
-
- // Otherwise, pass a span into the marshalled native layout buffer
- writer.WriteLine("global::ComputeSharp.D2D1.Generated.ConstantBufferMarshaller.FromManaged(in shader, out buffer);");
- writer.WriteLine();
- writer.WriteLine("loader.LoadConstantBuffer(new global::System.ReadOnlySpan(&buffer, sizeof(global::ComputeSharp.D2D1.Generated.ConstantBuffer)));");
- }
- }
- }
-
- ///
- /// Writes the CreateFromConstantBuffer method.
- ///
- /// The input instance with gathered shader info.
- /// The instance to write into.
- public static void WriteCreateFromConstantBufferSyntax(D2D1ShaderInfo info, IndentedTextWriter writer)
- {
- string typeName = info.Hierarchy.Hierarchy[0].QualifiedName;
-
- writer.WriteLine("/// ");
- writer.WriteGeneratedAttributes(GeneratorName);
- writer.WriteLine("[global::System.Runtime.CompilerServices.SkipLocalsInit]");
- writer.WriteLine($"static {typeName} global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<{typeName}>.CreateFromConstantBuffer(global::System.ReadOnlySpan data)");
-
- using (writer.WriteBlock())
- {
- // If there are no fields, just return an empty shader
- if (info.Fields.IsEmpty)
- {
- writer.WriteLine("return default;");
-
- return;
- }
-
- // Get a reference to the data through the generated native layout type and define the shader
- writer.WriteLine("ref readonly global::ComputeSharp.D2D1.Generated.ConstantBuffer buffer = ref global::System.Runtime.InteropServices.MemoryMarshal.AsRef(data);");
- writer.WriteLine();
- writer.WriteLine("return global::ComputeSharp.D2D1.Generated.ConstantBufferMarshaller.ToManaged(in buffer);");
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectFactory.Syntax.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectFactory.Syntax.cs
deleted file mode 100644
index c69a6f24..00000000
--- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectFactory.Syntax.cs
+++ /dev/null
@@ -1,46 +0,0 @@
-using ComputeSharp.D2D1.SourceGenerators.Models;
-using ComputeSharp.SourceGeneration.Extensions;
-using ComputeSharp.SourceGeneration.Helpers;
-
-namespace ComputeSharp.D2D1.SourceGenerators;
-
-///
-partial class D2DPixelShaderDescriptorGenerator
-{
- ///
- /// A helper with all logic to generate the EffectFactory property.
- ///
- private static class EffectFactory
- {
- ///
- /// Writes the EffectFactory property.
- ///
- /// The input instance with gathered shader info.
- /// The instance to write into.
- public static void WriteSyntax(D2D1ShaderInfo info, IndentedTextWriter writer)
- {
- writer.WriteLine("/// ");
- writer.WriteGeneratedAttributes(GeneratorName);
- writer.WriteLine($"static unsafe nint global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<{info.Hierarchy.Hierarchy[0].QualifiedName}>.EffectFactory");
-
- using (writer.WriteBlock())
- {
- writer.WriteLine("[global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]");
- writer.WriteLine("get");
-
- using (writer.WriteBlock())
- {
- writer.WriteLine($$"""
- [global::System.Runtime.InteropServices.UnmanagedCallersOnly(CallConvs = [typeof(global::System.Runtime.CompilerServices.CallConvStdcall)])]
- static int EffectFactory(void** effectImpl)
- {
- return global::ComputeSharp.D2D1.Interop.D2D1PixelShaderEffect.CreateEffectUnsafe<{{info.Hierarchy.Hierarchy[0].QualifiedName}}>(effectImpl);
- }
-
- return (nint)(delegate* unmanaged[Stdcall])&EffectFactory;
- """, isMultiline: true);
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectId.Syntax.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectId.Syntax.cs
deleted file mode 100644
index 721c0ac6..00000000
--- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectId.Syntax.cs
+++ /dev/null
@@ -1,71 +0,0 @@
-using ComputeSharp.D2D1.SourceGenerators.Models;
-using ComputeSharp.SourceGeneration.Extensions;
-using ComputeSharp.SourceGeneration.Helpers;
-
-namespace ComputeSharp.D2D1.SourceGenerators;
-
-///
-partial class D2DPixelShaderDescriptorGenerator
-{
- ///
- partial class EffectId
- {
- ///
- /// Writes the EffectId property.
- ///
- /// The input instance with gathered shader info.
- /// The instance to write into.
- public static void WriteSyntax(D2D1ShaderInfo info, IndentedTextWriter writer)
- {
- writer.WriteLine("/// ");
- writer.WriteGeneratedAttributes(GeneratorName);
- writer.WriteLine($"static ref readonly global::System.Guid global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<{info.Hierarchy.Hierarchy[0].QualifiedName}>.EffectId");
-
- using (writer.WriteBlock())
- {
- writer.WriteLine("[global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]");
- writer.WriteLine("get");
-
- using (writer.WriteBlock())
- {
- writer.WriteLine("global::System.ReadOnlySpan bytes =");
- writer.WriteLine("[");
- writer.IncreaseIndent();
-
- // Write the bytes like so:
- //
- // b[0], b[1], b[2], b[3],
- // b[4], b[5],
- // b[6], b[7],
- // b[8],
- // b[9],
- // b[10],
- // b[11],
- // b[12],
- // b[13],
- // b[14],
- // b[15]
- SyntaxFormattingHelper.WriteByteArrayInitializationExpressions(info.EffectId.AsSpan()[..4], writer);
- writer.WriteLine(",");
- SyntaxFormattingHelper.WriteByteArrayInitializationExpressions(info.EffectId.AsSpan()[4..6], writer);
- writer.WriteLine(",");
- SyntaxFormattingHelper.WriteByteArrayInitializationExpressions(info.EffectId.AsSpan()[6..8], writer);
- writer.WriteLine(",");
- writer.WriteLine($"{SyntaxFormattingHelper.GetByteExpression(info.EffectId[8])},");
- writer.WriteLine($"{SyntaxFormattingHelper.GetByteExpression(info.EffectId[9])},");
- writer.WriteLine($"{SyntaxFormattingHelper.GetByteExpression(info.EffectId[10])},");
- writer.WriteLine($"{SyntaxFormattingHelper.GetByteExpression(info.EffectId[11])},");
- writer.WriteLine($"{SyntaxFormattingHelper.GetByteExpression(info.EffectId[12])},");
- writer.WriteLine($"{SyntaxFormattingHelper.GetByteExpression(info.EffectId[13])},");
- writer.WriteLine($"{SyntaxFormattingHelper.GetByteExpression(info.EffectId[14])},");
- writer.WriteLine(SyntaxFormattingHelper.GetByteExpression(info.EffectId[15]));
- writer.DecreaseIndent();
- writer.WriteLine("];");
-
- writer.WriteLine();
- writer.WriteLine("return ref global::System.Runtime.CompilerServices.Unsafe.As(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(bytes));");
- }
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectId.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectId.cs
deleted file mode 100644
index 7c270681..00000000
--- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectId.cs
+++ /dev/null
@@ -1,132 +0,0 @@
-using System;
-using System.Buffers;
-using System.Collections.Immutable;
-using System.Runtime.CompilerServices;
-using System.Security.Cryptography;
-using System.Text;
-using ComputeSharp.SourceGeneration.Extensions;
-using ComputeSharp.SourceGeneration.Helpers;
-using Microsoft.CodeAnalysis;
-
-namespace ComputeSharp.D2D1.SourceGenerators;
-
-///
-partial class D2DPixelShaderDescriptorGenerator
-{
- ///
- /// A helper with all logic to generate the EffectId property.
- ///
- private static partial class EffectId
- {
- ///
- /// The instance currently in use for the running thread, if any.
- ///
- [ThreadStatic]
- private static IncrementalHash? incrementalHash;
-
- ///
- /// Extracts the effect id info for the current shader.
- ///
- /// The input object currently in use.
- /// The for the shader type in use.
- /// The resulting effect id.
- public static ImmutableArray GetInfo(Compilation compilation, INamedTypeSymbol structDeclarationSymbol)
- {
- if (TryGetDefinedEffectId(compilation, structDeclarationSymbol, out ImmutableArray effectId))
- {
- return effectId;
- }
-
- return CreateDefaultEffectId(structDeclarationSymbol);
- }
-
- ///
- /// Tries to get the defined effect id for a given shader type.
- ///
- /// The input object currently in use.
- /// The input instance.
- /// The resulting defined effect id, if found.
- /// Whether or not a defined effect id could be found.
- private static bool TryGetDefinedEffectId(Compilation compilation, INamedTypeSymbol typeSymbol, out ImmutableArray effectId)
- {
- INamedTypeSymbol effectIdAttributeSymbol = compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2DEffectIdAttribute")!;
-
- foreach (AttributeData attributeData in typeSymbol.GetAttributes())
- {
- // Check that the attribute is [D2DEffectId] and with a valid parameter
- if (SymbolEqualityComparer.Default.Equals(attributeData.AttributeClass, effectIdAttributeSymbol) &&
- attributeData.ConstructorArguments is [{ Value: string value }] &&
- Guid.TryParse(value, out Guid guid))
- {
- byte[] bytes = guid.ToByteArray();
-
- effectId = Unsafe.As>(ref bytes);
-
- return true;
- }
- }
-
- effectId = default;
-
- return false;
- }
-
- ///
- /// Creates the default effect id for a given type symbol.
- ///
- /// The input instance.
- /// The resulting effect id.
- private static unsafe ImmutableArray CreateDefaultEffectId(INamedTypeSymbol typeSymbol)
- {
- try
- {
- // Initialize an instance using the MD5 algorithm. We use this for several reasons:
- // - We don't really need security, this is just to uniquely identify types
- // - The hash size is 128 bits, which is exactly the size of a GUID.
- IncrementalHash incrementalHash = EffectId.incrementalHash ??= IncrementalHash.CreateHash(HashAlgorithmName.MD5);
-
- string assemblyName = typeSymbol.ContainingAssembly?.Name ?? string.Empty;
-
- using ImmutableArrayBuilder charBuffer = new();
-
- // Format the fully qualified name into a pooled builder to avoid the string allocation
- typeSymbol.AppendFullyQualifiedMetadataName(in charBuffer);
-
- int maxTypeNameByteCount = Encoding.UTF8.GetMaxByteCount(charBuffer.Count);
- int maxAssemblyNameByteCount = Encoding.UTF8.GetMaxByteCount(assemblyName.Length);
- int maxEncodedByteCount = Math.Max(maxTypeNameByteCount, maxAssemblyNameByteCount);
-
- byte[] bufferUtf8 = ArrayPool.Shared.Rent(maxEncodedByteCount);
-
- // UTF8 encode the fully qualified name first
- int typeNameBytesWritten = Encoding.UTF8.GetBytes(charBuffer.WrittenSpan, bufferUtf8);
-
- // Append the UTF8 fully qualified name to the MD5 hash
- incrementalHash.AppendData(bufferUtf8, 0, typeNameBytesWritten);
-
- // UTF8 encode the assembly name as well
- int assemblyNameBytesWritten = Encoding.UTF8.GetBytes(assemblyName.AsSpan(), bufferUtf8);
-
- // Append the UTF8 assembly name to the MD5 hash
- incrementalHash.AppendData(bufferUtf8, 0, assemblyNameBytesWritten);
-
- // The state is now fully in the incremental hash, we can return the array
- ArrayPool.Shared.Return(bufferUtf8);
-
- // Get the resulting MD5 hash (128 bits)
- byte[] hash = incrementalHash.GetHashAndReset();
-
- // We own this buffer, so we can just reinterpret to an immutable array
- return Unsafe.As>(ref hash);
- }
- catch
- {
- // Something went wrong, throw away the current incremental hash.
- // Realistically speaking, this should just never happen.
- incrementalHash = null;
-
- throw;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectMetadata.Syntax.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectMetadata.Syntax.cs
deleted file mode 100644
index 83caf155..00000000
--- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectMetadata.Syntax.cs
+++ /dev/null
@@ -1,77 +0,0 @@
-using ComputeSharp.D2D1.SourceGenerators.Models;
-using ComputeSharp.SourceGeneration.Extensions;
-using ComputeSharp.SourceGeneration.Helpers;
-
-namespace ComputeSharp.D2D1.SourceGenerators;
-
-///
-partial class D2DPixelShaderDescriptorGenerator
-{
- ///
- partial class EffectMetadata
- {
- ///
- /// Writes the EffectDisplayName property.
- ///
- /// The input instance with gathered shader info.
- /// The instance to write into.
- public static void WriteEffectDisplayNameSyntax(D2D1ShaderInfo info, IndentedTextWriter writer)
- {
- WriteEffectMetadataSyntax(info.Hierarchy.Hierarchy[0].QualifiedName, "EffectDisplayName", info.EffectDisplayName, writer);
- }
-
- ///
- /// Writes the EffectDescription property.
- ///
- /// The input instance with gathered shader info.
- /// The instance to write into.
- public static void WriteEffectDescriptionSyntax(D2D1ShaderInfo info, IndentedTextWriter writer)
- {
- WriteEffectMetadataSyntax(info.Hierarchy.Hierarchy[0].QualifiedName, "EffectDescription", info.EffectDescription, writer);
- }
-
- ///
- /// Writes the EffectCategory property.
- ///
- /// The input instance with gathered shader info.
- /// The instance to write into.
- public static void WriteEffectCategorySyntax(D2D1ShaderInfo info, IndentedTextWriter writer)
- {
- WriteEffectMetadataSyntax(info.Hierarchy.Hierarchy[0].QualifiedName, "EffectCategory", info.EffectCategory, writer);
- }
-
- ///
- /// Writes the EffectAuthor property.
- ///
- /// The input instance with gathered shader info.
- /// The instance to write into.
- public static void WriteEffectAuthorSyntax(D2D1ShaderInfo info, IndentedTextWriter writer)
- {
- WriteEffectMetadataSyntax(info.Hierarchy.Hierarchy[0].QualifiedName, "EffectAuthor", info.EffectAuthor, writer);
- }
-
- ///
- /// Writes a specified metadata property.
- ///
- /// The qualified name of the shader type.
- /// The property name to generate.
- /// The input effect metadata value, if available.
- /// The instance to write into.
- private static void WriteEffectMetadataSyntax(string qualifiedName, string propertyName, string? metadataValue, IndentedTextWriter writer)
- {
- writer.WriteLine("/// ");
- writer.WriteGeneratedAttributes(GeneratorName);
- writer.Write($"static string? global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<{qualifiedName}>.{propertyName} => ");
-
- // Append null or the metadata value as a string literal
- if (metadataValue is null)
- {
- writer.WriteLine("null;");
- }
- else
- {
- writer.WriteLine($"\"{metadataValue}\";");
- }
- }
- }
-}
\ No newline at end of file
diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectMetadata.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectMetadata.cs
deleted file mode 100644
index 5ffcb502..00000000
--- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectMetadata.cs
+++ /dev/null
@@ -1,98 +0,0 @@
-using ComputeSharp.D2D1.SourceGenerators.Helpers;
-using Microsoft.CodeAnalysis;
-
-namespace ComputeSharp.D2D1.SourceGenerators;
-
-///
-partial class D2DPixelShaderDescriptorGenerator
-{
- ///
- /// A helper with all logic to generate the effect metadata properties.
- ///
- private static partial class EffectMetadata
- {
- ///
- /// Extracts the effect display name info for the current shader.
- ///
- /// The input object currently in use.
- /// The for the shader type in use.
- /// The resulting effect display name, if available.
- public static string? GetEffectDisplayNameInfo(Compilation compilation, INamedTypeSymbol structDeclarationSymbol)
- {
- if (D2D1EffectMetadataParser.TryGetEffectMetadataName(
- compilation,
- structDeclarationSymbol,
- "ComputeSharp.D2D1.D2DEffectDisplayNameAttribute",
- isAssemblyLevelAttributeSupported: false,
- out string? effectDisplayName))
- {
- return effectDisplayName;
- }
-
- return null;
- }
-
- ///
- /// Extracts the effect description info for the current shader.
- ///
- /// The input object currently in use.
- /// The for the shader type in use.
- /// The resulting effect description, if available.
- public static string? GetEffectDescriptionInfo(Compilation compilation, INamedTypeSymbol structDeclarationSymbol)
- {
- if (D2D1EffectMetadataParser.TryGetEffectMetadataName(
- compilation,
- structDeclarationSymbol,
- "ComputeSharp.D2D1.D2DEffectDescriptionAttribute",
- isAssemblyLevelAttributeSupported: false,
- out string? effectDescription))
- {
- return effectDescription;
- }
-
- return null;
- }
-
- ///
- /// Extracts the effect category info for the current shader.
- ///
- /// The input object currently in use.
- /// The for the shader type in use.
- /// The resulting effect category, if available.
- public static string? GetEffectCategoryInfo(Compilation compilation, INamedTypeSymbol structDeclarationSymbol)
- {
- if (D2D1EffectMetadataParser.TryGetEffectMetadataName(
- compilation,
- structDeclarationSymbol,
- "ComputeSharp.D2D1.D2DEffectCategoryAttribute",
- isAssemblyLevelAttributeSupported: true,
- out string? effectCategory))
- {
- return effectCategory;
- }
-
- return null;
- }
-
- ///
- /// Extracts the effect author info for the current shader.
- ///
- /// The input object currently in use.
- /// The for the shader type in use.
- /// The resulting effect author, if available.
- public static string? GetEffectAuthorInfo(Compilation compilation, INamedTypeSymbol structDeclarationSymbol)
- {
- if (D2D1EffectMetadataParser.TryGetEffectMetadataName(
- compilation,
- structDeclarationSymbol,
- "ComputeSharp.D2D1.D2DEffectAuthorAttribute",
- isAssemblyLevelAttributeSupported: true,
- out string? effectAuthor))
- {
- return effectAuthor;
- }
-
- return null;
- }
- }
-}
\ No newline at end of file
diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslBytecode.Syntax.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslBytecode.Syntax.cs
deleted file mode 100644
index 5df2a00f..00000000
--- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslBytecode.Syntax.cs
+++ /dev/null
@@ -1,158 +0,0 @@
-using System.Linq;
-using ComputeSharp.D2D1.SourceGenerators.Models;
-using ComputeSharp.SourceGeneration.Extensions;
-using ComputeSharp.SourceGeneration.Helpers;
-using ComputeSharp.SourceGeneration.Models;
-using Microsoft.CodeAnalysis;
-
-namespace ComputeSharp.D2D1.SourceGenerators;
-
-///
-partial class D2DPixelShaderDescriptorGenerator
-{
- ///
- partial class HlslBytecode
- {
- ///
- /// Writes the ShaderProfile property.
- ///
- /// The input instance with gathered shader info.
- /// The instance to write into.
- public static void WriteShaderProfileSyntax(D2D1ShaderInfo info, IndentedTextWriter writer)
- {
- writer.WriteLine("/// ");
- writer.WriteGeneratedAttributes(GeneratorName);
- writer.WriteLine($"static ComputeSharp.D2D1.D2D1ShaderProfile global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<{info.Hierarchy.Hierarchy[0].QualifiedName}>.ShaderProfile => global::ComputeSharp.D2D1.D2D1ShaderProfile.{info.HlslInfoKey.ShaderProfile};");
- }
-
- ///
- /// Writes the CompileOptions property.
- ///
- /// The input instance with gathered shader info.
- /// The instance to write into.
- public static void WriteCompileOptionsSyntax(D2D1ShaderInfo info, IndentedTextWriter writer)
- {
- // Get a formatted representation of the compile options being used
- string compileOptionsExpression =
- info.HlslInfoKey.CompileOptions
- .ToString()
- .Split(',')
- .Select(static name => $"global::ComputeSharp.D2D1.D2D1CompileOptions.{name.Trim()}")
- .Aggregate("", static (left, right) => left.Length > 0 ? $"{left} | {right}" : right);
-
- writer.WriteLine("/// ");
- writer.WriteGeneratedAttributes(GeneratorName);
- writer.WriteLine($"static ComputeSharp.D2D1.D2D1CompileOptions global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<{info.Hierarchy.Hierarchy[0].QualifiedName}>.CompileOptions => {compileOptionsExpression};");
- }
-
- ///
- /// Writes the HlslBytecode property.
- ///
- /// The input instance with gathered shader info.
- /// The instance to write into.
- public static void WriteHlslBytecodeSyntax(D2D1ShaderInfo info, IndentedTextWriter writer)
- {
- writer.WriteLine("/// ");
- writer.WriteGeneratedAttributes(GeneratorName);
- writer.Write($"static global::System.ReadOnlyMemory global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<{info.Hierarchy.Hierarchy[0].QualifiedName}>.HlslBytecode => ");
-
- // If there is no bytecode, just return a default expression.
- // Otherwise, return the memory manager backed memory instance.
- if (info.HlslInfo is not HlslBytecodeInfo.Success)
- {
- writer.WriteLine("default;");
- }
- else
- {
- writer.WriteLine("global::ComputeSharp.D2D1.Generated.HlslBytecodeMemoryManager.Instance.Memory;");
- }
- }
-
- ///
- /// Registers a callback to generate additional types, if needed.
- ///
- /// The input instance with gathered shader info.
- /// The registered callbacks to generate additional types.
- /// The using directives needed by the generated code.
- public static void RegisterAdditionalTypesSyntax(
- D2D1ShaderInfo info,
- ImmutableArrayBuilder> callbacks,
- ImmutableHashSetBuilder usingDirectives)
- {
- // If there is no bytecode, no memory manager is needed
- if (info.HlslInfo is not HlslBytecodeInfo.Success)
- {
- return;
- }
-
- _ = usingDirectives.Add("global::System");
- _ = usingDirectives.Add("global::System.Buffers");
- _ = usingDirectives.Add("global::System.CodeDom.Compiler");
- _ = usingDirectives.Add("global::System.Diagnostics");
- _ = usingDirectives.Add("global::System.Diagnostics.CodeAnalysis");
- _ = usingDirectives.Add("global::System.Runtime.CompilerServices");
- _ = usingDirectives.Add("global::System.Runtime.InteropServices");
-
- // Declare the HlslBytecodeMemoryManager custom memory manager type
- static void Callback(D2D1ShaderInfo info, IndentedTextWriter writer)
- {
- writer.WriteLine($$"""/// """);
- writer.WriteLine($$"""/// implementation to get the HLSL bytecode.""");
- writer.WriteLine($$"""/// """);
- writer.WriteGeneratedAttributes(GeneratorName, useFullyQualifiedTypeNames: false);
- writer.WriteLine($$"""file sealed class HlslBytecodeMemoryManager : MemoryManager""");
-
- using (writer.WriteBlock())
- {
- // Static singleton instance (to avoid the static constructor, just like with the input types)
- writer.WriteLine($$"""/// The singleton instance to use.""");
- writer.WriteLine($$"""public static readonly HlslBytecodeMemoryManager Instance = new();""");
-
- // RVA field (with the compiled HLSL bytecode, on a single line)
- writer.WriteLine();
- writer.WriteLine("/// The RVA data with the HLSL bytecode.");
- writer.Write("private static ReadOnlySpan Data => [");
-
- SyntaxFormattingHelper.WriteByteArrayInitializationExpressions(((HlslBytecodeInfo.Success)info.HlslInfo).Bytecode.AsSpan(), writer);
-
- writer.WriteLine("];");
- writer.WriteLine();
-
- // Add the remaining members for the memory manager
- writer.WriteLine("""
- ///
- public override unsafe Span GetSpan()
- {
- return new(Unsafe.AsPointer(ref MemoryMarshal.GetReference(Data)), Data.Length);
- }
-
- ///
- public override Memory Memory
- {
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- get => CreateMemory(Data.Length);
- }
-
- ///
- public override unsafe MemoryHandle Pin(int elementIndex)
- {
- return new(Unsafe.AsPointer(ref Unsafe.AsRef(in Data[elementIndex])), pinnable: this);
- }
-
- ///
- public override void Unpin()
- {
- }
-
- ///
- protected override void Dispose(bool disposing)
- {
- }
- """, isMultiline: true);
- }
- }
-
- callbacks.Add(Callback);
- }
- }
-}
\ No newline at end of file
diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslBytecode.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslBytecode.cs
deleted file mode 100644
index f0ea920a..00000000
--- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslBytecode.cs
+++ /dev/null
@@ -1,86 +0,0 @@
-using ComputeSharp.SourceGeneration.Extensions;
-using Microsoft.CodeAnalysis;
-
-namespace ComputeSharp.D2D1.SourceGenerators;
-
-///
-partial class D2DPixelShaderDescriptorGenerator
-{
- ///
- /// A helper with all logic to generate the HLSL bytecode properties.
- ///
- internal static partial class HlslBytecode
- {
- ///
- /// Extracts the requested shader profile for the current shader.
- ///
- /// The input instance to process.
- /// The requested shader profile to use to compile the shader, if present.
- public static D2D1ShaderProfile? GetRequestedShaderProfile(INamedTypeSymbol structDeclarationSymbol)
- {
- if (structDeclarationSymbol.TryGetAttributeWithFullyQualifiedMetadataName("ComputeSharp.D2D1.D2DShaderProfileAttribute", out AttributeData? attributeData))
- {
- return (D2D1ShaderProfile)attributeData.ConstructorArguments[0].Value!;
- }
-
- if (structDeclarationSymbol.ContainingAssembly.TryGetAttributeWithFullyQualifiedMetadataName("ComputeSharp.D2D1.D2DShaderProfileAttribute", out attributeData))
- {
- return (D2D1ShaderProfile)attributeData.ConstructorArguments[0].Value!;
- }
-
- return null;
- }
-
- ///
- /// Extracts the requested compile options for the current shader.
- ///
- /// The input instance to process.
- /// The requested compile options to use to compile the shader, if present.
- public static D2D1CompileOptions? GetRequestedCompileOptions(INamedTypeSymbol structDeclarationSymbol)
- {
- if (structDeclarationSymbol.TryGetAttributeWithFullyQualifiedMetadataName("ComputeSharp.D2D1.D2DCompileOptionsAttribute", out AttributeData? attributeData))
- {
- D2D1CompileOptions options = (D2D1CompileOptions)attributeData.ConstructorArguments[0].Value!;
-
- // PackMatrixRowMajor is always automatically enabled. If by any chance the attribute is requesting
- // column major packing, the analyzer will emit a diagnostic (same as for the assembly-level case).
- return options | D2D1CompileOptions.PackMatrixRowMajor;
- }
-
- if (structDeclarationSymbol.ContainingAssembly.TryGetAttributeWithFullyQualifiedMetadataName("ComputeSharp.D2D1.D2DCompileOptionsAttribute", out attributeData))
- {
- // No need to validate against PackMatrixColumnMajor as that's checked separately
- return (D2D1CompileOptions)attributeData.ConstructorArguments[0].Value! | D2D1CompileOptions.PackMatrixRowMajor;
- }
-
- return null;
- }
-
- ///
- /// Gets the effective shader profile to use.
- ///
- /// The requested shader profile.
- /// Whether compilation should be performed with the input profile.
- /// The effective shader profile.
- public static D2D1ShaderProfile GetEffectiveShaderProfile(D2D1ShaderProfile? shaderProfile, out bool isCompilationEnabled)
- {
- // Compilation is only enabled if the user explicitly selected a shader profile
- isCompilationEnabled = shaderProfile is not null;
-
- // The effective shader profile is either be the requested one, or the default value (which maps to PS5.0)
- return shaderProfile ?? D2D1ShaderProfile.PixelShader50;
- }
-
- ///
- /// Gets the effective compile options to use.
- ///
- /// The requested compile options.
- /// The effective compile options.
- public static D2D1CompileOptions GetEffectiveCompileOptions(D2D1CompileOptions? compileOptions)
- {
- // If an explicit set of compile options is provided, use that directly. Otherwise, use the default
- // options plus the option to enable linking only if the shader can potentially support it.
- return compileOptions ?? D2D1CompileOptions.Default;
- }
- }
-}
\ No newline at end of file
diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslSource.Syntax.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslSource.Syntax.cs
deleted file mode 100644
index 4016dd5e..00000000
--- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslSource.Syntax.cs
+++ /dev/null
@@ -1,31 +0,0 @@
-using ComputeSharp.D2D1.SourceGenerators.Models;
-using ComputeSharp.SourceGeneration.Extensions;
-using ComputeSharp.SourceGeneration.Helpers;
-
-namespace ComputeSharp.D2D1.SourceGenerators;
-
-///
-partial class D2DPixelShaderDescriptorGenerator
-{
- ///
- partial class HlslSource
- {
- ///
- /// Writes the HlslSource property.
- ///
- /// The input instance with gathered shader info.
- /// The instance to write into.
- public static void WriteSyntax(D2D1ShaderInfo info, IndentedTextWriter writer)
- {
- writer.WriteLine("/// ");
- writer.WriteGeneratedAttributes(GeneratorName);
- writer.WriteLine($"static string global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<{info.Hierarchy.Hierarchy[0].QualifiedName}>.HlslSource =>");
- writer.IncreaseIndent();
- writer.WriteLine("\"\"\"");
- writer.Write(info.HlslInfoKey.HlslSource, isMultiline: true);
- writer.WriteLine(skipIfPresent: true);
- writer.WriteLine("\"\"\";");
- writer.DecreaseIndent();
- }
- }
-}
\ No newline at end of file
diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslSource.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslSource.cs
deleted file mode 100644
index 91ea3a83..00000000
--- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslSource.cs
+++ /dev/null
@@ -1,539 +0,0 @@
-using System;
-using System.Collections.Generic;
-using System.Collections.Immutable;
-using System.Threading;
-using ComputeSharp.SourceGeneration.Extensions;
-using ComputeSharp.SourceGeneration.Helpers;
-using ComputeSharp.SourceGeneration.Mappings;
-using ComputeSharp.SourceGeneration.Models;
-using ComputeSharp.SourceGeneration.SyntaxProcessors;
-using ComputeSharp.SourceGeneration.SyntaxRewriters;
-using Microsoft.CodeAnalysis;
-using Microsoft.CodeAnalysis.CSharp;
-using Microsoft.CodeAnalysis.CSharp.Syntax;
-using static ComputeSharp.SourceGeneration.Diagnostics.DiagnosticDescriptors;
-
-namespace ComputeSharp.D2D1.SourceGenerators;
-
-///
-partial class D2DPixelShaderDescriptorGenerator
-{
- ///
- /// A helper with all logic to generate the HlslSource property.
- ///
- private static partial class HlslSource
- {
- ///
- /// Gathers all necessary information on a transpiled HLSL source for a given shader type.
- ///
- /// The collection of produced instances.
- /// The input object currently in use.
- /// The for the shader type.
- /// The shader interface type implemented by the shader type.
- /// The number of inputs for the shader.
- /// The indices of the simple shader inputs.
- /// The indices of the complex shader inputs.
- /// The used to cancel the operation, if needed.
- /// The HLSL source for the shader.
- public static string GetHlslSource(
- ImmutableArrayBuilder diagnostics,
- Compilation compilation,
- INamedTypeSymbol structDeclarationSymbol,
- INamedTypeSymbol shaderInterfaceType,
- int inputCount,
- ImmutableArray inputSimpleIndices,
- ImmutableArray inputComplexIndices,
- CancellationToken token)
- {
- // Detect any invalid properties
- HlslDefinitionsSyntaxProcessor.DetectAndReportInvalidPropertyDeclarations(diagnostics, structDeclarationSymbol);
-
- token.ThrowIfCancellationRequested();
-
- // We need to sets to track all discovered custom types and static methods
- HashSet discoveredTypes = new(SymbolEqualityComparer.Default);
- Dictionary staticMethods = new(SymbolEqualityComparer.Default);
- Dictionary instanceMethods = new(SymbolEqualityComparer.Default);
- Dictionary constructors = new(SymbolEqualityComparer.Default);
- Dictionary constantDefinitions = new(SymbolEqualityComparer.Default);
- Dictionary staticFieldDefinitions = new(SymbolEqualityComparer.Default);
-
- token.ThrowIfCancellationRequested();
-
- // Extract information on all captured fields
- GetInstanceFields(
- diagnostics,
- structDeclarationSymbol,
- discoveredTypes,
- out ImmutableArray valueFields,
- out ImmutableArray resourceTextureFields);
-
- token.ThrowIfCancellationRequested();
-
- SemanticModelProvider semanticModelProvider = new(compilation);
-
- // Explore the syntax tree and extract the processed info
- (string entryPoint, ImmutableArray processedMethods) = GetProcessedMethods(
- diagnostics,
- structDeclarationSymbol,
- shaderInterfaceType,
- semanticModelProvider,
- discoveredTypes,
- staticMethods,
- instanceMethods,
- constructors,
- constantDefinitions,
- staticFieldDefinitions,
- token,
- out bool methodsNeedD2D1RequiresScenePosition);
-
- token.ThrowIfCancellationRequested();
-
- ImmutableArray staticFields = GetStaticFields(
- diagnostics,
- semanticModelProvider,
- structDeclarationSymbol,
- discoveredTypes,
- constantDefinitions,
- staticFieldDefinitions,
- token,
- out bool fieldsNeedD2D1RequiresScenePosition);
-
- token.ThrowIfCancellationRequested();
-
- // Process the discovered types and constants
- HlslDefinitionsSyntaxProcessor.GetDeclaredTypes(
- diagnostics,
- structDeclarationSymbol,
- discoveredTypes,
- instanceMethods,
- constructors,
- out ImmutableArray typeDeclarations,
- out ImmutableArray typeMethodDeclarations);
-
- token.ThrowIfCancellationRequested();
-
- ImmutableArray definedConstants = HlslDefinitionsSyntaxProcessor.GetDefinedConstants(constantDefinitions);
-
- token.ThrowIfCancellationRequested();
-
- // Check whether the scene position is required
- bool requiresScenePosition = GetD2DRequiresScenePositionInfo(structDeclarationSymbol);
-
- // Emit diagnostics for incorrect scene position uses
- ReportInvalidD2DRequiresScenePositionUse(
- diagnostics,
- structDeclarationSymbol,
- requiresScenePosition,
- methodsNeedD2D1RequiresScenePosition || fieldsNeedD2D1RequiresScenePosition);
-
- token.ThrowIfCancellationRequested();
-
- // Get the HLSL source
- return GetHlslSource(
- definedConstants,
- valueFields,
- resourceTextureFields,
- staticFields,
- processedMethods,
- typeDeclarations,
- typeMethodDeclarations,
- entryPoint,
- inputCount,
- inputSimpleIndices,
- inputComplexIndices,
- requiresScenePosition);
- }
-
- ///
- /// Gets a sequence of captured fields and their mapped names.
- ///
- /// The collection of produced instances.
- /// The input instance to process.
- /// The collection of currently discovered types.
- /// The sequence of captured fields in .
- /// The sequence of captured resource textures in .
- private static void GetInstanceFields(
- ImmutableArrayBuilder diagnostics,
- INamedTypeSymbol structDeclarationSymbol,
- ICollection types,
- out ImmutableArray valueFields,
- out ImmutableArray resourceTextureFields)
- {
- using ImmutableArrayBuilder values = new();
- using ImmutableArrayBuilder resourceTextures = new();
-
- foreach (ISymbol memberSymbol in structDeclarationSymbol.GetMembers())
- {
- // Skip constants and static fields, we only care about instance ones here
- if (memberSymbol is not IFieldSymbol { IsConst: false, IsStatic: false } fieldSymbol)
- {
- continue;
- }
-
- // Try to get the actual field name
- if (!ConstantBufferSyntaxProcessor.TryGetFieldAccessorName(fieldSymbol, out string? fieldName, out _))
- {
- continue;
- }
-
- // Captured fields must be named type symbols
- if (fieldSymbol.Type is not INamedTypeSymbol typeSymbol)
- {
- diagnostics.Add(InvalidShaderField, fieldSymbol, structDeclarationSymbol, fieldName, fieldSymbol.Type);
-
- continue;
- }
-
- string metadataName = typeSymbol.GetFullyQualifiedMetadataName();
- string typeName = HlslKnownTypes.GetMappedName(typeSymbol);
-
- _ = HlslKnownKeywords.TryGetMappedName(fieldName, out string? mapping);
-
- // Handle resource textures as a special case
- if (HlslKnownTypes.IsResourceTextureType(metadataName))
- {
- ITypeSymbol resourceTextureTypeArgumentSymbol = typeSymbol.TypeArguments[0];
-
- // Validate that the type argument is only either float or float4
- if (!resourceTextureTypeArgumentSymbol.HasFullyQualifiedMetadataName("System.Single") &&
- !resourceTextureTypeArgumentSymbol.HasFullyQualifiedMetadataName("ComputeSharp.Float4"))
- {
- diagnostics.Add(
- InvalidResourceTextureElementType,
- fieldSymbol,
- fieldName,
- structDeclarationSymbol,
- fieldSymbol.Type);
- }
-
- int index = 0;
-
- // If [D2DResourceTextureIndex] is present, get the resource texture index.
- // This generator doesn't need to emit diagnostics, as that's handled separately
- // by the logic handling the info gathering for LoadResourceTextureDescriptions.
- if (fieldSymbol.TryGetAttributeWithFullyQualifiedMetadataName("ComputeSharp.D2D1.D2DResourceTextureIndexAttribute", out AttributeData? attributeData))
- {
- _ = attributeData.TryGetConstructorArgument(0, out index);
- }
-
- resourceTextures.Add((mapping ?? fieldName, typeName, index));
- }
- else if (typeSymbol.IsUnmanagedType)
- {
- // Allowed fields must be unmanaged values.
- // Also, track the type if it's a custom struct.
- if (!HlslKnownTypes.IsKnownHlslType(metadataName))
- {
- types.Add(typeSymbol);
- }
-
- values.Add((mapping ?? fieldName, typeName));
- }
- else
- {
- diagnostics.Add(InvalidShaderField, fieldSymbol, structDeclarationSymbol, fieldName, typeSymbol);
- }
- }
-
- valueFields = values.ToImmutable();
- resourceTextureFields = resourceTextures.ToImmutable();
- }
-
- ///
- /// Gets a sequence of shader static fields and their mapped names.
- ///
- /// The collection of produced instances.
- /// The instance for the type to process.
- /// The type symbol for the shader type.
- /// The collection of currently discovered types.
- /// The collection of discovered constant definitions.
- /// The collection of discovered static field definitions.
- /// The used to cancel the operation, if needed.
- /// Whether or not the shader needs the [D2DRequiresScenePosition] annotation.
- /// A sequence of static constant fields in .
- private static ImmutableArray GetStaticFields(
- ImmutableArrayBuilder diagnostics,
- SemanticModelProvider semanticModel,
- INamedTypeSymbol structDeclarationSymbol,
- ICollection discoveredTypes,
- IDictionary constantDefinitions,
- IDictionary staticFieldDefinitions,
- CancellationToken token,
- out bool needsD2D1RequiresScenePosition)
- {
- using ImmutableArrayBuilder builder = new();
-
- needsD2D1RequiresScenePosition = false;
-
- foreach (ISymbol memberSymbol in structDeclarationSymbol.GetMembers())
- {
- if (memberSymbol is not IFieldSymbol fieldSymbol)
- {
- continue;
- }
-
- if (HlslDefinitionsSyntaxProcessor.TryGetStaticField(
- structDeclarationSymbol,
- fieldSymbol,
- semanticModel,
- discoveredTypes,
- constantDefinitions,
- staticFieldDefinitions,
- diagnostics,
- token,
- out string? name,
- out string? typeDeclaration,
- out string? assignmentExpression,
- out StaticFieldRewriter? staticFieldRewriter))
- {
- needsD2D1RequiresScenePosition |= staticFieldRewriter.NeedsD2DRequiresScenePositionAttribute;
-
- builder.Add((name, typeDeclaration, assignmentExpression));
- }
- }
-
- // Also gather the external static fields (same as in the DX12 generator)
- foreach (HlslStaticField externalField in staticFieldDefinitions.Values)
- {
- builder.Add(externalField);
- }
-
- return builder.ToImmutable();
- }
-
- ///
- /// Gets a sequence of processed methods declared within a given type.
- ///
- /// The collection of produced instances.
- /// The type symbol for the shader type.
- /// The shader interface type implemented by the shader type.
- /// The instance for the type to process.
- /// The collection of currently discovered types.
- /// The set of discovered and processed static methods.
- /// The collection of discovered instance methods for custom struct types.
- /// The collection of discovered constructors for custom struct types.
- /// The collection of discovered constant definitions.
- /// The collection of discovered static field definitions.
- /// Whether or not the shader needs the [D2DRequiresScenePosition] annotation.
- /// The used to cancel the operation, if needed.
- /// A sequence of processed methods in , and the entry point.
- private static (string EntryPoint, ImmutableArray Methods) GetProcessedMethods(
- ImmutableArrayBuilder diagnostics,
- INamedTypeSymbol structDeclarationSymbol,
- INamedTypeSymbol shaderInterfaceType,
- SemanticModelProvider semanticModel,
- ICollection discoveredTypes,
- IDictionary staticMethods,
- IDictionary instanceMethods,
- IDictionary constructors,
- IDictionary constantDefinitions,
- IDictionary staticFieldDefinitions,
- CancellationToken token,
- out bool needsD2D1RequiresScenePosition)
- {
- using ImmutableArrayBuilder methods = new();
-
- IMethodSymbol entryPointInterfaceMethod = shaderInterfaceType.GetMethod("Execute")!;
- string? entryPoint = null;
-
- // By default, the scene position is not required. We will set this while
- // rewriting HLSL, if any method we traverse ends up requiring the position.
- needsD2D1RequiresScenePosition = false;
-
- foreach (ISymbol memberSymbol in structDeclarationSymbol.GetMembers())
- {
- // Find all declared methods in the type
- if (memberSymbol is not IMethodSymbol { IsImplicitlyDeclared: false, } methodSymbol)
- {
- continue;
- }
-
- // Ensure that we have accessible source information
- if (!methodSymbol.TryGetSyntaxNode(token, out MethodDeclarationSyntax? methodDeclaration))
- {
- continue;
- }
-
- // Check whether the current method is the entry point (ie. it's implementing 'Execute').
- // This is the same logic as in the DX12 generator for compute shaders and pixel shaders.
- bool isShaderEntryPoint = SymbolEqualityComparer.Default.Equals(
- structDeclarationSymbol.FindImplementationForInterfaceMember(entryPointInterfaceMethod),
- methodSymbol);
-
- // Except for the entry point, ignore explicit interface implementations
- if (!isShaderEntryPoint && !methodSymbol.ExplicitInterfaceImplementations.IsDefaultOrEmpty)
- {
- continue;
- }
-
- token.ThrowIfCancellationRequested();
-
- // Create the source rewriter for the current method
- ShaderSourceRewriter shaderSourceRewriter = new(
- structDeclarationSymbol,
- semanticModel,
- discoveredTypes,
- staticMethods,
- instanceMethods,
- constructors,
- constantDefinitions,
- staticFieldDefinitions,
- diagnostics,
- token,
- isShaderEntryPoint);
-
- // Rewrite the method syntax tree
- MethodDeclarationSyntax? processedMethod = shaderSourceRewriter.Visit(methodDeclaration)!.WithoutTrivia();
-
- token.ThrowIfCancellationRequested();
-
- // Update the position requirement
- needsD2D1RequiresScenePosition |= shaderSourceRewriter.NeedsD2DRequiresScenePositionAttribute;
-
- // Emit the extracted local functions first
- foreach (KeyValuePair localFunction in shaderSourceRewriter.LocalFunctions)
- {
- methods.Add((
- localFunction.Value.AsDefinition().NormalizeWhitespace(eol: "\n").ToFullString(),
- localFunction.Value.NormalizeWhitespace(eol: "\n").ToFullString()));
- }
-
- // If the method is the shader entry point, do additional processing
- if (isShaderEntryPoint)
- {
- string entryPointDeclaration = processedMethod.NormalizeWhitespace(eol: "\n").ToFullString();
- string adjustedEntryPointDeclaration = entryPointDeclaration.Replace("float4 Execute()", "D2D_PS_ENTRY(Execute)");
-
- entryPoint = adjustedEntryPointDeclaration;
- }
- else
- {
- methods.Add((
- processedMethod.AsDefinition().NormalizeWhitespace(eol: "\n").ToFullString(),
- processedMethod.NormalizeWhitespace(eol: "\n").ToFullString()));
- }
- }
-
- token.ThrowIfCancellationRequested();
-
- // Process static methods as well
- foreach (MethodDeclarationSyntax staticMethod in staticMethods.Values)
- {
- methods.Add((
- staticMethod.AsDefinition().NormalizeWhitespace(eol: "\n").ToFullString(),
- staticMethod.NormalizeWhitespace(eol: "\n").ToFullString()));
- }
-
- return (entryPoint!, methods.ToImmutable());
- }
-
- ///
- /// Reports diagnostics for invalid uses of [D2DRequiresScenePosition] in a shader.
- ///
- /// The collection of produced instances.
- /// The input instance to process.
- /// Whether the shader type is declaring the need for scene position.
- /// Whether the shader is using APIs that rely on scene position.
- private static void ReportInvalidD2DRequiresScenePositionUse(
- ImmutableArrayBuilder diagnostics,
- INamedTypeSymbol structDeclarationSymbol,
- bool requiresScenePosition,
- bool usesPositionDependentMethods)
- {
- if (!requiresScenePosition && usesPositionDependentMethods)
- {
- diagnostics.Add(MissingD2DRequiresScenePositionAttribute, structDeclarationSymbol, structDeclarationSymbol);
- }
- }
-
- ///
- /// Gets whether or not a given shader requires the scene position.
- ///
- /// The input instance to process.
- /// Whether requires the scene position.
- private static bool GetD2DRequiresScenePositionInfo(INamedTypeSymbol structDeclarationSymbol)
- {
- return structDeclarationSymbol.TryGetAttributeWithFullyQualifiedMetadataName("ComputeSharp.D2D1.D2DRequiresScenePositionAttribute", out _);
- }
-
- ///
- /// Produces the series of statements to build the current HLSL source.
- ///
- ///
- ///
- /// The sequence of captured resource textures for the current shader.
- ///
- ///
- ///
- ///
- /// The body of the entry point of the shader.
- /// The number of shader inputs to declare.
- /// The indices of the simple shader inputs.
- /// The indices of the complex shader inputs.
- /// Whether the shader requires the scene position.
- /// The series of statements to build the HLSL source to compile to execute the current shader.
- private static string GetHlslSource(
- ImmutableArray definedConstants,
- ImmutableArray valueFields,
- ImmutableArray resourceTextureFields,
- ImmutableArray staticFields,
- ImmutableArray processedMethods,
- ImmutableArray typeDeclarations,
- ImmutableArray typeMethodDeclarations,
- string executeMethod,
- int inputCount,
- ImmutableArray inputSimpleIndices,
- ImmutableArray inputComplexIndices,
- bool requiresScenePosition)
- {
- using IndentedTextWriter writer = new();
-
- // Shader metadata
- writer.WriteLine($"#define D2D_INPUT_COUNT {inputCount}");
-
- foreach (int simpleInput in inputSimpleIndices)
- {
- writer.WriteLine($"#define D2D_INPUT{simpleInput}_SIMPLE");
- }
-
- foreach (int complexInput in inputComplexIndices)
- {
- writer.WriteLine($"#define D2D_INPUT{complexInput}_COMPLEX");
- }
-
- writer.WriteLineIf(requiresScenePosition, "#define D2D_REQUIRES_SCENE_POSITION");
-
- // Add the "d2d1effecthelpers.hlsli" header
- writer.WriteLine();
- writer.WriteLine("#include \"d2d1effecthelpers.hlsli\"");
- writer.WriteLine();
-
- // The FXC compiler does not support type forward declarations
- HlslSourceSyntaxProcessor.WriteTopDeclarations(
- writer,
- definedConstants,
- staticFields,
- processedMethods,
- typeDeclarations,
- includeTypeForwardDeclarations: false);
-
- HlslSourceSyntaxProcessor.WriteCapturedFields(writer, valueFields);
-
- // Resource textures
- foreach (HlslResourceTextureField field in resourceTextureFields)
- {
- writer.WriteLine(skipIfPresent: true);
- writer.WriteLine($"{field.Type} {field.Name} : register(t{field.Index});");
- writer.WriteLine($"SamplerState __sampler__{field.Name} : register(s{field.Index});");
- }
-
- HlslSourceSyntaxProcessor.WriteMethodDeclarations(writer, processedMethods, typeMethodDeclarations);
-
- // Entry point
- writer.WriteLine(executeMethod);
-
- return writer.ToString();
- }
- }
-}
\ No newline at end of file
diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.InputDescriptions.Syntax.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.InputDescriptions.Syntax.cs
deleted file mode 100644
index 4023760e..00000000
--- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.InputDescriptions.Syntax.cs
+++ /dev/null
@@ -1,145 +0,0 @@
-using ComputeSharp.D2D1.SourceGenerators.Models;
-using ComputeSharp.SourceGeneration.Extensions;
-using ComputeSharp.SourceGeneration.Helpers;
-
-#pragma warning disable IDE0053
-
-namespace ComputeSharp.D2D1.SourceGenerators;
-
-///
-partial class D2DPixelShaderDescriptorGenerator
-{
- ///
- private static partial class InputDescriptions
- {
- ///
- /// Writes the InputDescriptions property.
- ///
- /// The input instance with gathered shader info.
- /// The instance to write into.
- public static void WriteSyntax(D2D1ShaderInfo info, IndentedTextWriter writer)
- {
- writer.WriteLine("/// ");
- writer.WriteGeneratedAttributes(GeneratorName);
- writer.Write($"static global::System.ReadOnlyMemory global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<{info.Hierarchy.Hierarchy[0].QualifiedName}>.InputDescriptions => ");
-
- // If there are no input descriptions, just return a default expression.
- // Otherwise, return the shared array with cached input descriptions.
- if (info.InputDescriptions.IsEmpty)
- {
- writer.WriteLine("default;");
- }
- else
- {
- writer.WriteLine("global::ComputeSharp.D2D1.Generated.Data.InputDescriptions;");
- }
- }
-
- ///
- /// Registers a callback to generate additional types, if needed.
- ///
- /// The input instance with gathered shader info.
- /// The registered callbacks to generate additional types.
- /// The using directives needed by the generated code.
- public static void RegisterAdditionalTypesSyntax(
- D2D1ShaderInfo info,
- ImmutableArrayBuilder> callbacks,
- ImmutableHashSetBuilder usingDirectives)
- {
- // If there are no necessary data members, stop here
- if (info.InputDescriptions.IsEmpty &&
- info.ResourceTextureDescriptions.IsEmpty)
- {
- return;
- }
-
- _ = usingDirectives.Add("global::System.CodeDom.Compiler");
- _ = usingDirectives.Add("global::System.Diagnostics");
- _ = usingDirectives.Add("global::System.Diagnostics.CodeAnalysis");
-
- AddAdditionalDataMemberUsingDirectives(info, usingDirectives);
- ResourceTextureDescriptions.AddAdditionalDataMemberUsingDirectives(info, usingDirectives);
-
- // Declare the additional data type
- static void Callback(D2D1ShaderInfo info, IndentedTextWriter writer)
- {
- writer.WriteLine($$"""/// """);
- writer.WriteLine($$"""/// A container type for additional data needed by the shader.""");
- writer.WriteLine($$"""/// """);
- writer.WriteGeneratedAttributes(GeneratorName, useFullyQualifiedTypeNames: false);
- writer.WriteLine($$"""file static class Data""");
-
- using (writer.WriteBlock())
- {
- using ImmutableArrayBuilder> dataMembers = new();
-
- RegisterAdditionalDataMemberSyntax(info, dataMembers);
- ResourceTextureDescriptions.RegisterAdditionalDataMemberSyntax(info, dataMembers);
-
- for (int i = 0; i < dataMembers.WrittenSpan.Length; i++)
- {
- dataMembers.WrittenSpan[i](info, writer);
-
- if (i < dataMembers.WrittenSpan.Length - 1)
- {
- writer.WriteLine();
- }
- }
- }
- }
-
- callbacks.Add(Callback);
- }
-
- ///
- /// Adds any using directives for the additional data member, if needed.
- ///
- /// The input instance with gathered shader info.
- /// The using directives needed by the generated code.
- private static void AddAdditionalDataMemberUsingDirectives(D2D1ShaderInfo info, ImmutableHashSetBuilder usingDirectives)
- {
- if (info.InputDescriptions.IsEmpty)
- {
- return;
- }
-
- _ = usingDirectives.Add("global::ComputeSharp.D2D1");
- _ = usingDirectives.Add("global::ComputeSharp.D2D1.Interop");
- }
-
- ///
- /// Registers a callback to generate an additional data member, if needed.
- ///
- /// The input instance with gathered shader info.
- /// The registered callbacks to generate additional data members.
- private static void RegisterAdditionalDataMemberSyntax(D2D1ShaderInfo info, ImmutableArrayBuilder> callbacks)
- {
- // If there are no input descriptions, there is nothing to di
- if (info.InputDescriptions.IsEmpty)
- {
- return;
- }
-
- // Declare the shared array with input descriptions
- static void Callback(D2D1ShaderInfo info, IndentedTextWriter writer)
- {
- writer.WriteLine("""/// The singleton array instance.""");
- writer.WriteLine("""public static readonly D2D1InputDescription[] InputDescriptions =""");
- writer.WriteLine("""[""");
- writer.IncreaseIndent();
-
- // Initialize all input descriptions
- writer.WriteInitializationExpressions(info.InputDescriptions.AsSpan(), static (description, writer) =>
- {
- writer.Write($$"""new D2D1InputDescription({{description.Index}}, D2D1Filter.{{description.Filter}}) { LevelOfDetailCount = {{description.LevelOfDetailCount}} }""");
- });
-
- writer.DecreaseIndent();
- writer.WriteLine();
- writer.WriteLine("];");
- }
-
- callbacks.Add(Callback);
- }
- }
-}
\ No newline at end of file
diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.InputDescriptions.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.InputDescriptions.cs
deleted file mode 100644
index 462591b2..00000000
--- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.InputDescriptions.cs
+++ /dev/null
@@ -1,44 +0,0 @@
-using System.Collections.Immutable;
-using ComputeSharp.D2D1.SourceGenerators.Models;
-using ComputeSharp.SourceGeneration.Extensions;
-using ComputeSharp.SourceGeneration.Helpers;
-using Microsoft.CodeAnalysis;
-
-namespace ComputeSharp.D2D1.SourceGenerators;
-
-///
-partial class D2DPixelShaderDescriptorGenerator
-{
- ///
- /// A helper with all logic to generate the InputDescriptions property.
- ///
- private static partial class InputDescriptions
- {
- ///
- /// Extracts the input descriptions for the current shader.
- ///
- /// The input instance to process.
- /// The produced input descriptions for the shader.
- public static void GetInfo(
- INamedTypeSymbol structDeclarationSymbol,
- out ImmutableArray inputDescriptions)
- {
- using ImmutableArrayBuilder builder = new();
-
- foreach (AttributeData attributeData in structDeclarationSymbol.GetAttributes())
- {
- if (attributeData.AttributeClass?.HasFullyQualifiedMetadataName("ComputeSharp.D2D1.D2DInputDescriptionAttribute") == true)
- {
- int index = (int)attributeData.ConstructorArguments[0].Value!;
- D2D1Filter filter = (D2D1Filter)attributeData.ConstructorArguments[1].Value!;
-
- _ = attributeData.TryGetNamedArgument("LevelOfDetailCount", out int levelOfDetailCount);
-
- builder.Add(new InputDescription(index, filter, levelOfDetailCount));
- }
- }
-
- inputDescriptions = builder.ToImmutable();
- }
- }
-}
\ No newline at end of file
diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.InputTypes.Syntax.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.InputTypes.Syntax.cs
deleted file mode 100644
index 8476cbea..00000000
--- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.InputTypes.Syntax.cs
+++ /dev/null
@@ -1,133 +0,0 @@
-using ComputeSharp.D2D1.SourceGenerators.Models;
-using ComputeSharp.SourceGeneration.Extensions;
-using ComputeSharp.SourceGeneration.Helpers;
-
-namespace ComputeSharp.D2D1.SourceGenerators;
-
-///
-partial class D2DPixelShaderDescriptorGenerator
-{
- ///
- partial class InputTypes
- {
- ///
- /// Writes the InputTypes property.
- ///
- /// The input instance with gathered shader info.
- /// The instance to write into.
- public static void WriteSyntax(D2D1ShaderInfo info, IndentedTextWriter writer)
- {
- writer.WriteLine("/// ");
- writer.WriteGeneratedAttributes(GeneratorName);
- writer.Write($"static global::System.ReadOnlyMemory global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<{info.Hierarchy.Hierarchy[0].QualifiedName}>.InputTypes => ");
-
- // If there are no inputs, simply return a default expression. Otherwise, create
- // a ReadOnlyMemory instance from the memory manager.
- if (info.InputTypes.IsEmpty)
- {
- writer.WriteLine("default;");
- }
- else
- {
- writer.WriteLine("global::ComputeSharp.D2D1.Generated.InputTypesMemoryManager.Instance.Memory;");
- }
- }
-
- ///
- /// Registers a callback to generate additional types, if needed.
- ///
- /// The input instance with gathered shader info.
- /// The registered callbacks to generate additional types.
- /// The using directives needed by the generated code.
- public static void RegisterAdditionalTypesSyntax(
- D2D1ShaderInfo info,
- ImmutableArrayBuilder> callbacks,
- ImmutableHashSetBuilder usingDirectives)
- {
- // If there are no inputs, no memory manager is needed
- if (info.InputTypes.IsEmpty)
- {
- return;
- }
-
- _ = usingDirectives.Add("global::System");
- _ = usingDirectives.Add("global::System.Buffers");
- _ = usingDirectives.Add("global::System.CodeDom.Compiler");
- _ = usingDirectives.Add("global::System.Diagnostics");
- _ = usingDirectives.Add("global::System.Diagnostics.CodeAnalysis");
- _ = usingDirectives.Add("global::System.Runtime.CompilerServices");
- _ = usingDirectives.Add("global::System.Runtime.InteropServices");
- _ = usingDirectives.Add("global::ComputeSharp.D2D1.Interop");
-
- // Declare the InputTypesMemoryManager custom memory manager type
- static void Callback(D2D1ShaderInfo info, IndentedTextWriter writer)
- {
- writer.WriteLine($$"""/// """);
- writer.WriteLine($$"""/// A implementation to get the input types.""");
- writer.WriteLine($$"""/// """);
- writer.WriteGeneratedAttributes(GeneratorName, useFullyQualifiedTypeNames: false);
- writer.WriteLine($$"""file sealed class InputTypesMemoryManager : MemoryManager""");
-
- using (writer.WriteBlock())
- {
- // Static singleton instance (the object goes in the frozen heap, so there's no static constructor)
- writer.WriteLine($$"""/// The singleton instance to use.""");
- writer.WriteLine($$"""public static readonly InputTypesMemoryManager Instance = new();""");
-
- // RVA field
- writer.WriteLine();
- writer.WriteLine("/// The RVA data with the input type info.");
- writer.WriteLine("private static ReadOnlySpan Data =>");
- writer.WriteLine("[");
- writer.IncreaseIndent();
-
- // Input types, one per line in the RVA field initializer
- writer.WriteInitializationExpressions(info.InputTypes.AsSpan(), static (type, writer) =>
- {
- writer.Write("D2D1PixelShaderInputType.");
- writer.Write(type == 0 ? "Simple" : "Complex");
- });
-
- writer.DecreaseIndent();
- writer.WriteLine();
- writer.WriteLine("];");
- writer.WriteLine();
-
- // Add the remaining members for the memory manager
- writer.WriteLine("""
- ///
- public override unsafe Span GetSpan()
- {
- return new(Unsafe.AsPointer(ref MemoryMarshal.GetReference(Data)), Data.Length);
- }
-
- ///
- public override Memory Memory
- {
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- get => CreateMemory(Data.Length);
- }
-
- ///
- public override unsafe MemoryHandle Pin(int elementIndex)
- {
- return new(Unsafe.AsPointer(ref Unsafe.AsRef(in Data[elementIndex])), pinnable: this);
- }
-
- ///
- public override void Unpin()
- {
- }
-
- ///
- protected override void Dispose(bool disposing)
- {
- }
- """, isMultiline: true);
- }
- }
-
- callbacks.Add(Callback);
- }
- }
-}
\ No newline at end of file
diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.InputTypes.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.InputTypes.cs
deleted file mode 100644
index 4d134694..00000000
--- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.InputTypes.cs
+++ /dev/null
@@ -1,93 +0,0 @@
-using System;
-using System.Collections.Immutable;
-using System.Runtime.CompilerServices;
-using ComputeSharp.SourceGeneration.Extensions;
-using ComputeSharp.SourceGeneration.Helpers;
-using Microsoft.CodeAnalysis;
-
-namespace ComputeSharp.D2D1.SourceGenerators;
-
-///
-partial class D2DPixelShaderDescriptorGenerator
-{
- ///
- /// A helper with all logic to generate the