diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs
index d0311584..27397b78 100644
--- a/.git-blame-ignore-revs
+++ b/.git-blame-ignore-revs
@@ -6,3 +6,9 @@ d5e3114f7c57c815fe72ae8e2c4c1225352bfc03
# Removed multiline variable declarations
ee0d3a7b68e95a9c3e569d582b4efc8aa7fd4d4a
+
+# Remove leftover nested namespace blocks
+c6252ee1c9041e6f4a407816e551455c9d545a53
+
+# Apply XAML styler refactor pass to UWP/WinUI 3 samples
+e608db8a7f727abda72bde9c538d12b3b4319f55
diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml
index 53ecd86c..7bc4b50e 100644
--- a/.github/workflows/dotnet.yml
+++ b/.github/workflows/dotnet.yml
@@ -4,25 +4,50 @@ on: [push, pull_request]
jobs:
- # Build the ComputeSharp project directly. This is the project that
- # would be built when running any of the local samples or unit tests.
- build-project:
+ # Build the whole ComputeSharp solution, in Debug
+ build-solution-debug:
runs-on: windows-2022
steps:
- name: Git checkout
uses: actions/checkout@v2
+ - name: Add msbuild to PATH
+ uses: microsoft/setup-msbuild@v1.0.3
+ - name: Setup .NET Core 3.1 SDK
+ uses: actions/setup-dotnet@v1
+ with:
+ dotnet-version: 3.1.x
- name: Setup .NET 6 SDK
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- name: Build
- run: dotnet build src\ComputeSharp\ComputeSharp.csproj -c Release
+ run: msbuild -t:restore,build /p:Configuration=Debug /p:Platform=x64
+ shell: cmd
+
+ # Build the whole ComputeSharp solution, in Release
+ build-solution-release:
+ runs-on: windows-2022
+ steps:
+ - name: Git checkout
+ uses: actions/checkout@v2
+ - name: Add msbuild to PATH
+ uses: microsoft/setup-msbuild@v1.0.3
+ - name: Setup .NET Core 3.1 SDK
+ uses: actions/setup-dotnet@v1
+ with:
+ dotnet-version: 3.1.x
+ - name: Setup .NET 6 SDK
+ uses: actions/setup-dotnet@v1
+ with:
+ dotnet-version: 6.0.x
+ - name: Build
+ run: msbuild -t:restore,build /p:Configuration=Release /p:Platform=x64
shell: cmd
# Run all the unit tests referencing the ComputeSharp project directly
run-tests:
if: success()
- needs: [build-project]
+ needs: [build-solution-debug, build-solution-release]
runs-on: windows-2022
steps:
- name: Git checkout
@@ -125,6 +150,8 @@ jobs:
# Buils the .msbuildproj project to generate the NuGet package.
# This workflow also uploads the resulting package as an artifact.
build-package:
+ if: success()
+ needs: [build-solution-debug, build-solution-release]
runs-on: windows-2022
steps:
- name: Git checkout
@@ -186,7 +213,7 @@ jobs:
# 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.
- verify-libs:
+ verify-package-native-libs:
if: success()
needs: [verify-package]
runs-on: windows-2022
@@ -201,29 +228,11 @@ jobs:
run: dotnet test tests\ComputeSharp.Tests.NativeLibrariesResolver\ComputeSharp.Tests.NativeLibrariesResolver.csproj -v n -l "console;verbosity=detailed"
shell: cmd
- # Build the WinUI panel project
- build-project-winui:
- runs-on: windows-2022
- steps:
- - name: Git checkout
- uses: actions/checkout@v2
- - name: Add msbuild to PATH
- uses: microsoft/setup-msbuild@v1.0.3
- with:
- vs-prerelease: true
- - name: Setup .NET SDK
- uses: actions/setup-dotnet@v1
- with:
- dotnet-version: 6.0.x
- - name: Build
- run: msbuild src\ComputeSharp.WinUI\ComputeSharp.WinUI.csproj -t:restore,build /p:Configuration=Release
- shell: cmd
-
# Build the WinUI project again to generate a NuGet package from it.
# This workflow also uploads the resulting package as an artifact.
build-package-winui:
if: success()
- needs: [build-project-winui]
+ needs: [verify-package]
runs-on: windows-2022
steps:
- name: Git checkout
@@ -235,21 +244,22 @@ jobs:
with:
dotnet-version: 6.0.x
- name: Build
- run: msbuild src\ComputeSharp.WinUI\ComputeSharp.WinUI.csproj -t:restore,build /p:Configuration=Release
+ run: msbuild src\ComputeSharp.WinUI\ComputeSharp.WinUI.csproj -t:restore /p:Configuration=Release /p:ContinuousIntegrationBuild=True
shell: cmd
- - name: Pack
+ - name: Build
run: msbuild src\ComputeSharp.WinUI\ComputeSharp.WinUI.csproj -t:pack /p:Configuration=Release /p:ContinuousIntegrationBuild=True
- shell: cmd
+ shell: cmd # Packing needs to be done separately and with no previous build target for it to work correctly
- name: Upload package artifact
uses: actions/upload-artifact@v2
with:
name: ComputeSharp.WinUI.nupkg
path: src\ComputeSharp.WinUI\bin\Release\*.nupkg
- # Build the local WinUI sample to ensure it builds with no errors
- build-samples-winui:
+ # Build the UWP project again to generate a NuGet package from it.
+ # This workflow also uploads the resulting package as an artifact, like the WinUI one.
+ build-package-uwp:
if: success()
- needs: [build-project-winui]
+ needs: [verify-package]
runs-on: windows-2022
steps:
- name: Git checkout
@@ -260,9 +270,11 @@ jobs:
uses: actions/setup-dotnet@v1
with:
dotnet-version: 6.0.x
- - name: Restore ComputeSharp.SwapChain.WinUI sample
- run: msbuild samples\ComputeSharp.SwapChain.WinUI\ComputeSharp.SwapChain.WinUI.csproj -t:restore /p:Configuration=Release /p:Platform=x64
+ - name: Build
+ run: msbuild src\ComputeSharp.Uwp\ComputeSharp.Uwp.csproj -t:restore,build,pack /p:Configuration=Release /p:ContinuousIntegrationBuild=True
shell: cmd
- - name: Build ComputeSharp.SwapChain.WinUI sample
- run: msbuild samples\ComputeSharp.SwapChain.WinUI\ComputeSharp.SwapChain.WinUI.csproj -t:build /p:Configuration=Release /p:Platform=x64
- shell: cmd # the build of the sample has to be a separate step, as '-t:restore,build' causes the build to fail
\ No newline at end of file
+ - name: Upload package artifact
+ uses: actions/upload-artifact@v2
+ with:
+ name: ComputeSharp.Uwp.nupkg
+ path: src\ComputeSharp.Uwp\bin\Release\*.nupkg
\ No newline at end of file
diff --git a/ComputeSharp.sln b/ComputeSharp.sln
index f1ed2725..d4c0b7a6 100644
--- a/ComputeSharp.sln
+++ b/ComputeSharp.sln
@@ -58,14 +58,35 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.WinUI", "src\C
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("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Uwp", "src\ComputeSharp.Uwp\ComputeSharp.Uwp.csproj", "{AFAAFDC9-BE42-45D4-8C79-0EE8C8EDBF52}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComputeSharp.SwapChain.Uwp", "samples\ComputeSharp.SwapChain.Uwp\ComputeSharp.SwapChain.Uwp.csproj", "{FBD388A5-7855-4408-98FF-E689F509DB5A}"
+EndProject
+Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.UI", "src\ComputeSharp.UI\ComputeSharp.UI.shproj", "{0C82EDE1-5B8A-4DF3-87DA-700B29D5E265}"
+EndProject
+Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.SwapChain.Shaders.Shared", "samples\ComputeSharp.SwapChain.Shaders.Shared\ComputeSharp.SwapChain.Shaders.Shared.shproj", "{0800BD51-499D-44C2-9417-FD1F7FDFE9C4}"
+EndProject
+Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.SwapChain.Core.Shared", "samples\ComputeSharp.SwapChain.Core.Shared\ComputeSharp.SwapChain.Core.Shared.shproj", "{751BB05B-563D-4B3A-94C6-15E2D79D35EA}"
+EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
+ samples\ComputeSharp.SwapChain.Core.Shared\ComputeSharp.SwapChain.Core.Shared.projitems*{0071701e-b9c5-4098-be5f-ef556c4553c6}*SharedItemsImports = 5
+ samples\ComputeSharp.SwapChain.Shaders.Shared\ComputeSharp.SwapChain.Shaders.Shared.projitems*{0071701e-b9c5-4098-be5f-ef556c4553c6}*SharedItemsImports = 5
+ samples\ComputeSharp.SwapChain.Shaders.Shared\ComputeSharp.SwapChain.Shaders.Shared.projitems*{0800bd51-499d-44c2-9417-fd1f7fdfe9c4}*SharedItemsImports = 13
+ src\ComputeSharp.UI\ComputeSharp.UI.projitems*{0c82ede1-5b8a-4df3-87da-700b29d5e265}*SharedItemsImports = 13
src\ComputeSharp.NetStandard\ComputeSharp.NetStandard.projitems*{314eb353-e7e3-4146-8111-685cc83ec1de}*SharedItemsImports = 5
src\TerraFX.Interop.Windows\TerraFX.Interop.Windows.projitems*{314eb353-e7e3-4146-8111-685cc83ec1de}*SharedItemsImports = 5
src\TerraFX.Interop.Windows\TerraFX.Interop.Windows.projitems*{514ff00e-bbf0-4d55-a47c-eeeb6208adce}*SharedItemsImports = 13
samples\ComputeSharp.Sample.Shared\ComputeSharp.Sample.Shared.projitems*{7048deea-0a6f-46a0-b951-b682a8f1cb75}*SharedItemsImports = 5
+ samples\ComputeSharp.SwapChain.Core.Shared\ComputeSharp.SwapChain.Core.Shared.projitems*{751bb05b-563d-4b3a-94c6-15e2d79d35ea}*SharedItemsImports = 13
samples\ComputeSharp.Sample.Shared\ComputeSharp.Sample.Shared.projitems*{8cefc324-ca6c-4845-9ad9-70b92bd87057}*SharedItemsImports = 13
src\ComputeSharp.NetStandard\ComputeSharp.NetStandard.projitems*{a5997814-d8d2-4541-87ac-c3e53caa67c0}*SharedItemsImports = 13
+ src\ComputeSharp.UI\ComputeSharp.UI.projitems*{afaafdc9-be42-45d4-8c79-0ee8c8edbf52}*SharedItemsImports = 5
+ samples\ComputeSharp.SwapChain.Shaders.Shared\ComputeSharp.SwapChain.Shaders.Shared.projitems*{e7c9247d-016b-4819-af9f-0e9b3591e04b}*SharedItemsImports = 5
+ samples\ComputeSharp.SwapChain.Shaders.Shared\ComputeSharp.SwapChain.Shaders.Shared.projitems*{e91f4d24-922a-4921-a8d7-9c45a143c45d}*SharedItemsImports = 5
+ src\ComputeSharp.UI\ComputeSharp.UI.projitems*{fa18ba9f-76bf-4de0-8d24-02fc7657e6cb}*SharedItemsImports = 5
+ samples\ComputeSharp.SwapChain.Core.Shared\ComputeSharp.SwapChain.Core.Shared.projitems*{fbd388a5-7855-4408-98ff-e689f509db5a}*SharedItemsImports = 4
+ samples\ComputeSharp.SwapChain.Shaders.Shared\ComputeSharp.SwapChain.Shaders.Shared.projitems*{fbd388a5-7855-4408-98ff-e689f509db5a}*SharedItemsImports = 4
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@@ -250,6 +271,36 @@ Global
{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
+ {AFAAFDC9-BE42-45D4-8C79-0EE8C8EDBF52}.Debug|Any CPU.ActiveCfg = Debug|x64
+ {AFAAFDC9-BE42-45D4-8C79-0EE8C8EDBF52}.Debug|Any CPU.Build.0 = Debug|x64
+ {AFAAFDC9-BE42-45D4-8C79-0EE8C8EDBF52}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {AFAAFDC9-BE42-45D4-8C79-0EE8C8EDBF52}.Debug|ARM64.Build.0 = Debug|ARM64
+ {AFAAFDC9-BE42-45D4-8C79-0EE8C8EDBF52}.Debug|x64.ActiveCfg = Debug|x64
+ {AFAAFDC9-BE42-45D4-8C79-0EE8C8EDBF52}.Debug|x64.Build.0 = Debug|x64
+ {AFAAFDC9-BE42-45D4-8C79-0EE8C8EDBF52}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {AFAAFDC9-BE42-45D4-8C79-0EE8C8EDBF52}.Release|Any CPU.Build.0 = Release|Any CPU
+ {AFAAFDC9-BE42-45D4-8C79-0EE8C8EDBF52}.Release|ARM64.ActiveCfg = Release|ARM64
+ {AFAAFDC9-BE42-45D4-8C79-0EE8C8EDBF52}.Release|ARM64.Build.0 = Release|ARM64
+ {AFAAFDC9-BE42-45D4-8C79-0EE8C8EDBF52}.Release|x64.ActiveCfg = Release|x64
+ {AFAAFDC9-BE42-45D4-8C79-0EE8C8EDBF52}.Release|x64.Build.0 = Release|x64
+ {FBD388A5-7855-4408-98FF-E689F509DB5A}.Debug|Any CPU.ActiveCfg = Debug|x64
+ {FBD388A5-7855-4408-98FF-E689F509DB5A}.Debug|Any CPU.Build.0 = Debug|x64
+ {FBD388A5-7855-4408-98FF-E689F509DB5A}.Debug|Any CPU.Deploy.0 = Debug|x64
+ {FBD388A5-7855-4408-98FF-E689F509DB5A}.Debug|ARM64.ActiveCfg = Debug|ARM64
+ {FBD388A5-7855-4408-98FF-E689F509DB5A}.Debug|ARM64.Build.0 = Debug|ARM64
+ {FBD388A5-7855-4408-98FF-E689F509DB5A}.Debug|ARM64.Deploy.0 = Debug|ARM64
+ {FBD388A5-7855-4408-98FF-E689F509DB5A}.Debug|x64.ActiveCfg = Debug|x64
+ {FBD388A5-7855-4408-98FF-E689F509DB5A}.Debug|x64.Build.0 = Debug|x64
+ {FBD388A5-7855-4408-98FF-E689F509DB5A}.Debug|x64.Deploy.0 = Debug|x64
+ {FBD388A5-7855-4408-98FF-E689F509DB5A}.Release|Any CPU.ActiveCfg = Release|x64
+ {FBD388A5-7855-4408-98FF-E689F509DB5A}.Release|Any CPU.Build.0 = Release|x64
+ {FBD388A5-7855-4408-98FF-E689F509DB5A}.Release|Any CPU.Deploy.0 = Release|x64
+ {FBD388A5-7855-4408-98FF-E689F509DB5A}.Release|ARM64.ActiveCfg = Release|ARM64
+ {FBD388A5-7855-4408-98FF-E689F509DB5A}.Release|ARM64.Build.0 = Release|ARM64
+ {FBD388A5-7855-4408-98FF-E689F509DB5A}.Release|ARM64.Deploy.0 = Release|ARM64
+ {FBD388A5-7855-4408-98FF-E689F509DB5A}.Release|x64.ActiveCfg = Release|x64
+ {FBD388A5-7855-4408-98FF-E689F509DB5A}.Release|x64.Build.0 = Release|x64
+ {FBD388A5-7855-4408-98FF-E689F509DB5A}.Release|x64.Deploy.0 = Release|x64
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
@@ -269,6 +320,9 @@ Global
{A5997814-D8D2-4541-87AC-C3E53CAA67C0} = {8DCE343F-BA78-4FE1-B562-B57C603A8BAA}
{514FF00E-BBF0-4D55-A47C-EEEB6208ADCE} = {8DCE343F-BA78-4FE1-B562-B57C603A8BAA}
{0071701E-B9C5-4098-BE5F-EF556C4553C6} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1}
+ {FBD388A5-7855-4408-98FF-E689F509DB5A} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1}
+ {0800BD51-499D-44C2-9417-FD1F7FDFE9C4} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1}
+ {751BB05B-563D-4B3A-94C6-15E2D79D35EA} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {4664C5E3-0340-4E22-BCFD-98AAEDF5F2DC}
diff --git a/Directory.Build.props b/Directory.Build.props
index 7b324180..b15ad129 100644
--- a/Directory.Build.props
+++ b/Directory.Build.props
@@ -3,6 +3,7 @@
true
10.0
enable
+ true
Sergio Pedri
Copyright (c) 2021 Sergio Pedri
$(NoWarn);MSB3270
@@ -23,9 +24,15 @@
icon.png
https://user-images.githubusercontent.com/10199417/110238403-b8811080-7f41-11eb-8cfe-e47e7e58f05b.png
dotnet net netcore netstandard csharp library graphics directx shader hlsl compute gpu performance parallel windows
+ true
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/global.json b/global.json
new file mode 100644
index 00000000..8a794e68
--- /dev/null
+++ b/global.json
@@ -0,0 +1,6 @@
+{
+ "msbuild-sdks":
+ {
+ "MSBuild.Sdk.Extras": "3.0.38"
+ }
+ }
\ No newline at end of file
diff --git a/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor{TPixel}.cs b/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor{TPixel}.cs
index e41bb4f6..79eb4b45 100644
--- a/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor{TPixel}.cs
+++ b/samples/ComputeSharp.ImageProcessing/Processors/HlslBokehBlurProcessor{TPixel}.cs
@@ -56,7 +56,7 @@ public sealed partial class HlslBokehBlurProcessor
private readonly float KernelsScale;
///
- /// The mapping of initialized complex kernels and parameters, to speed up the initialization of new instances.
+ /// The mapping of initialized complex kernels and parameters, to speed up the initialization of new instances.
///
private static readonly ConcurrentDictionary<(int Radius, int ComponentsCount), (Vector4[] Parameters, float Scale, Complex64[][] Kernels)> Cache = new();
diff --git a/samples/ComputeSharp.SwapChain.Core.Shared/ComputeSharp.SwapChain.Core.Shared.projitems b/samples/ComputeSharp.SwapChain.Core.Shared/ComputeSharp.SwapChain.Core.Shared.projitems
new file mode 100644
index 00000000..2a5e911c
--- /dev/null
+++ b/samples/ComputeSharp.SwapChain.Core.Shared/ComputeSharp.SwapChain.Core.Shared.projitems
@@ -0,0 +1,18 @@
+
+
+
+ $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
+ true
+ 751bb05b-563d-4b3a-94c6-15e2d79d35ea
+
+
+ ComputeSharp.SwapChain.Core.Shared
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.Core.Shared/ComputeSharp.SwapChain.Core.Shared.shproj b/samples/ComputeSharp.SwapChain.Core.Shared/ComputeSharp.SwapChain.Core.Shared.shproj
new file mode 100644
index 00000000..db365a5b
--- /dev/null
+++ b/samples/ComputeSharp.SwapChain.Core.Shared/ComputeSharp.SwapChain.Core.Shared.shproj
@@ -0,0 +1,13 @@
+
+
+
+ 751bb05b-563d-4b3a-94c6-15e2d79d35ea
+ 14.0
+
+
+
+
+
+
+
+
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Converters/RenderingPauseConverter.cs b/samples/ComputeSharp.SwapChain.Core.Shared/Converters/RenderingPauseConverter.cs
similarity index 77%
rename from samples/ComputeSharp.SwapChain.WinUI/Converters/RenderingPauseConverter.cs
rename to samples/ComputeSharp.SwapChain.Core.Shared/Converters/RenderingPauseConverter.cs
index 5c8ae0bf..18c8479b 100644
--- a/samples/ComputeSharp.SwapChain.WinUI/Converters/RenderingPauseConverter.cs
+++ b/samples/ComputeSharp.SwapChain.Core.Shared/Converters/RenderingPauseConverter.cs
@@ -1,6 +1,10 @@
-using Microsoft.UI.Xaml.Controls;
+#if WINDOWS_UWP
+using Windows.UI.Xaml.Controls;
+#else
+using Microsoft.UI.Xaml.Controls;
+#endif
-namespace ComputeSharp.SwapChain.WinUI.Converters;
+namespace ComputeSharp.SwapChain.Core.Converters;
///
/// A class with some static converters for rendering state.
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Converters/ResolutionScaleConverter.cs b/samples/ComputeSharp.SwapChain.Core.Shared/Converters/ResolutionScaleConverter.cs
similarity index 94%
rename from samples/ComputeSharp.SwapChain.WinUI/Converters/ResolutionScaleConverter.cs
rename to samples/ComputeSharp.SwapChain.Core.Shared/Converters/ResolutionScaleConverter.cs
index 1d242fc7..b13c844a 100644
--- a/samples/ComputeSharp.SwapChain.WinUI/Converters/ResolutionScaleConverter.cs
+++ b/samples/ComputeSharp.SwapChain.Core.Shared/Converters/ResolutionScaleConverter.cs
@@ -1,4 +1,4 @@
-namespace ComputeSharp.SwapChain.WinUI.Converters;
+namespace ComputeSharp.SwapChain.Core.Converters;
///
/// A class with some static converters for resolution scale settings.
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Models/ComputeShader.cs b/samples/ComputeSharp.SwapChain.Core.Shared/Models/ComputeShader.cs
similarity index 91%
rename from samples/ComputeSharp.SwapChain.WinUI/Models/ComputeShader.cs
rename to samples/ComputeSharp.SwapChain.Core.Shared/Models/ComputeShader.cs
index 9816232b..77ff496f 100644
--- a/samples/ComputeSharp.SwapChain.WinUI/Models/ComputeShader.cs
+++ b/samples/ComputeSharp.SwapChain.Core.Shared/Models/ComputeShader.cs
@@ -1,7 +1,13 @@
using CommunityToolkit.Mvvm.ComponentModel;
+#if WINDOWS_UWP
+using ComputeSharp.Uwp;
+#else
using ComputeSharp.WinUI;
+#endif
-namespace ComputeSharp.SwapChain.WinUI.Models;
+#nullable enable
+
+namespace ComputeSharp.SwapChain.Core.Models;
///
/// A model for a compute shader.
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Shaders/Runners/ContouredLayersRunner.cs b/samples/ComputeSharp.SwapChain.Core.Shared/Shaders/Runners/ContouredLayersRunner.cs
similarity index 88%
rename from samples/ComputeSharp.SwapChain.WinUI/Shaders/Runners/ContouredLayersRunner.cs
rename to samples/ComputeSharp.SwapChain.Core.Shared/Shaders/Runners/ContouredLayersRunner.cs
index 1a09c53a..6e91c5e5 100644
--- a/samples/ComputeSharp.SwapChain.WinUI/Shaders/Runners/ContouredLayersRunner.cs
+++ b/samples/ComputeSharp.SwapChain.Core.Shared/Shaders/Runners/ContouredLayersRunner.cs
@@ -1,10 +1,16 @@
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.WinUI.Shaders.Runners;
+#nullable enable
+
+namespace ComputeSharp.SwapChain.Core.Shaders.Runners;
///
/// A specialized for .
diff --git a/samples/ComputeSharp.SwapChain.WinUI/ViewModels/MainViewModel.cs b/samples/ComputeSharp.SwapChain.Core.Shared/ViewModels/MainViewModel.cs
similarity index 95%
rename from samples/ComputeSharp.SwapChain.WinUI/ViewModels/MainViewModel.cs
rename to samples/ComputeSharp.SwapChain.Core.Shared/ViewModels/MainViewModel.cs
index 0340006a..db1a5868 100644
--- a/samples/ComputeSharp.SwapChain.WinUI/ViewModels/MainViewModel.cs
+++ b/samples/ComputeSharp.SwapChain.Core.Shared/ViewModels/MainViewModel.cs
@@ -1,12 +1,18 @@
using System.Collections.Generic;
-using ComputeSharp.SwapChain.Shaders;
-using ComputeSharp.SwapChain.WinUI.Models;
-using ComputeSharp.WinUI;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
-using ComputeSharp.SwapChain.WinUI.Shaders.Runners;
+using ComputeSharp.SwapChain.Core.Models;
+using ComputeSharp.SwapChain.Core.Shaders.Runners;
+using ComputeSharp.SwapChain.Shaders;
+#if WINDOWS_UWP
+using ComputeSharp.Uwp;
+#else
+using ComputeSharp.WinUI;
+#endif
-namespace ComputeSharp.SwapChain.WinUI.ViewModels;
+#nullable enable
+
+namespace ComputeSharp.SwapChain.Core.ViewModels;
///
/// The viewmodel for for a view that allows users to select shaders and customize settings.
diff --git a/samples/ComputeSharp.SwapChain/Shaders/ColorfulInfinity.cs b/samples/ComputeSharp.SwapChain.Shaders.Shared/ColorfulInfinity.cs
similarity index 100%
rename from samples/ComputeSharp.SwapChain/Shaders/ColorfulInfinity.cs
rename to samples/ComputeSharp.SwapChain.Shaders.Shared/ColorfulInfinity.cs
diff --git a/samples/ComputeSharp.SwapChain.Shaders.Shared/ComputeSharp.SwapChain.Shaders.Shared.projitems b/samples/ComputeSharp.SwapChain.Shaders.Shared/ComputeSharp.SwapChain.Shaders.Shared.projitems
new file mode 100644
index 00000000..6c0c0b40
--- /dev/null
+++ b/samples/ComputeSharp.SwapChain.Shaders.Shared/ComputeSharp.SwapChain.Shaders.Shared.projitems
@@ -0,0 +1,25 @@
+
+
+
+ $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
+ true
+ 0800bd51-499d-44c2-9417-fd1f7fdfe9c4
+
+
+ ComputeSharp.SwapChain.Shaders.Shared
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.Shaders.Shared/ComputeSharp.SwapChain.Shaders.Shared.shproj b/samples/ComputeSharp.SwapChain.Shaders.Shared/ComputeSharp.SwapChain.Shaders.Shared.shproj
new file mode 100644
index 00000000..293130fe
--- /dev/null
+++ b/samples/ComputeSharp.SwapChain.Shaders.Shared/ComputeSharp.SwapChain.Shaders.Shared.shproj
@@ -0,0 +1,13 @@
+
+
+
+ 0800bd51-499d-44c2-9417-fd1f7fdfe9c4
+ 14.0
+
+
+
+
+
+
+
+
diff --git a/samples/ComputeSharp.SwapChain/Shaders/ContouredLayers.cs b/samples/ComputeSharp.SwapChain.Shaders.Shared/ContouredLayers.cs
similarity index 100%
rename from samples/ComputeSharp.SwapChain/Shaders/ContouredLayers.cs
rename to samples/ComputeSharp.SwapChain.Shaders.Shared/ContouredLayers.cs
diff --git a/samples/ComputeSharp.SwapChain/Shaders/ExtrudedTruchetPattern.cs b/samples/ComputeSharp.SwapChain.Shaders.Shared/ExtrudedTruchetPattern.cs
similarity index 100%
rename from samples/ComputeSharp.SwapChain/Shaders/ExtrudedTruchetPattern.cs
rename to samples/ComputeSharp.SwapChain.Shaders.Shared/ExtrudedTruchetPattern.cs
diff --git a/samples/ComputeSharp.SwapChain/Shaders/FourColorGradient.cs b/samples/ComputeSharp.SwapChain.Shaders.Shared/FourColorGradient.cs
similarity index 100%
rename from samples/ComputeSharp.SwapChain/Shaders/FourColorGradient.cs
rename to samples/ComputeSharp.SwapChain.Shaders.Shared/FourColorGradient.cs
diff --git a/samples/ComputeSharp.SwapChain/Shaders/FractalTiling.cs b/samples/ComputeSharp.SwapChain.Shaders.Shared/FractalTiling.cs
similarity index 100%
rename from samples/ComputeSharp.SwapChain/Shaders/FractalTiling.cs
rename to samples/ComputeSharp.SwapChain.Shaders.Shared/FractalTiling.cs
diff --git a/samples/ComputeSharp.SwapChain.Shaders.Shared/HelloWorld.cs b/samples/ComputeSharp.SwapChain.Shaders.Shared/HelloWorld.cs
new file mode 100644
index 00000000..b3ab8088
--- /dev/null
+++ b/samples/ComputeSharp.SwapChain.Shaders.Shared/HelloWorld.cs
@@ -0,0 +1,27 @@
+namespace ComputeSharp.SwapChain.Shaders;
+
+///
+/// A simple shader to get started with based on shadertoy new shader template.
+/// Ported from .
+///
+[AutoConstructor]
+internal readonly partial struct HelloWorld : IPixelShader
+{
+ ///
+ /// The current time since the start of the application.
+ ///
+ public readonly float time;
+
+ ///
+ public float4 Execute()
+ {
+ // Normalized screen space UV coordinates from 0.0 to 1.0
+ float2 uv = ThreadIds.Normalized.XY;
+
+ // 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);
+ }
+}
diff --git a/samples/ComputeSharp.SwapChain/Shaders/MengerJourney.cs b/samples/ComputeSharp.SwapChain.Shaders.Shared/MengerJourney.cs
similarity index 100%
rename from samples/ComputeSharp.SwapChain/Shaders/MengerJourney.cs
rename to samples/ComputeSharp.SwapChain.Shaders.Shared/MengerJourney.cs
diff --git a/samples/ComputeSharp.SwapChain/Shaders/Octagrams.cs b/samples/ComputeSharp.SwapChain.Shaders.Shared/Octagrams.cs
similarity index 100%
rename from samples/ComputeSharp.SwapChain/Shaders/Octagrams.cs
rename to samples/ComputeSharp.SwapChain.Shaders.Shared/Octagrams.cs
diff --git a/samples/ComputeSharp.SwapChain/Shaders/ProteanClouds.cs b/samples/ComputeSharp.SwapChain.Shaders.Shared/ProteanClouds.cs
similarity index 100%
rename from samples/ComputeSharp.SwapChain/Shaders/ProteanClouds.cs
rename to samples/ComputeSharp.SwapChain.Shaders.Shared/ProteanClouds.cs
diff --git a/samples/ComputeSharp.SwapChain/Shaders/PyramidPattern.cs b/samples/ComputeSharp.SwapChain.Shaders.Shared/PyramidPattern.cs
similarity index 100%
rename from samples/ComputeSharp.SwapChain/Shaders/PyramidPattern.cs
rename to samples/ComputeSharp.SwapChain.Shaders.Shared/PyramidPattern.cs
diff --git a/samples/ComputeSharp.SwapChain/Shaders/TriangleGridContouring.cs b/samples/ComputeSharp.SwapChain.Shaders.Shared/TriangleGridContouring.cs
similarity index 100%
rename from samples/ComputeSharp.SwapChain/Shaders/TriangleGridContouring.cs
rename to samples/ComputeSharp.SwapChain.Shaders.Shared/TriangleGridContouring.cs
diff --git a/samples/ComputeSharp.SwapChain/Shaders/TwoTiledTruchet.cs b/samples/ComputeSharp.SwapChain.Shaders.Shared/TwoTiledTruchet.cs
similarity index 100%
rename from samples/ComputeSharp.SwapChain/Shaders/TwoTiledTruchet.cs
rename to samples/ComputeSharp.SwapChain.Shaders.Shared/TwoTiledTruchet.cs
diff --git a/samples/ComputeSharp.SwapChain.Uwp/App.xaml b/samples/ComputeSharp.SwapChain.Uwp/App.xaml
new file mode 100644
index 00000000..c01ce6cb
--- /dev/null
+++ b/samples/ComputeSharp.SwapChain.Uwp/App.xaml
@@ -0,0 +1,4 @@
+
diff --git a/samples/ComputeSharp.SwapChain.Uwp/App.xaml.cs b/samples/ComputeSharp.SwapChain.Uwp/App.xaml.cs
new file mode 100644
index 00000000..720413f7
--- /dev/null
+++ b/samples/ComputeSharp.SwapChain.Uwp/App.xaml.cs
@@ -0,0 +1,72 @@
+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()
+ {
+ this.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;
+ }
+}
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/LargeTile.scale-100.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/LargeTile.scale-100.png
new file mode 100644
index 00000000..a15aa789
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/LargeTile.scale-100.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/LargeTile.scale-125.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/LargeTile.scale-125.png
new file mode 100644
index 00000000..cdd395eb
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/LargeTile.scale-125.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/LargeTile.scale-150.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/LargeTile.scale-150.png
new file mode 100644
index 00000000..a11860e1
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/LargeTile.scale-150.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/LargeTile.scale-200.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/LargeTile.scale-200.png
new file mode 100644
index 00000000..27b8d951
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/LargeTile.scale-200.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/LargeTile.scale-400.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/LargeTile.scale-400.png
new file mode 100644
index 00000000..451db4e9
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/LargeTile.scale-400.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/LockScreenLogo.scale-200.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/LockScreenLogo.scale-200.png
new file mode 100644
index 00000000..735f57ad
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/LockScreenLogo.scale-200.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/Misc/noise_low.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/Misc/noise_low.png
new file mode 100644
index 00000000..0784c124
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/Misc/noise_low.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/SmallTile.scale-100.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/SmallTile.scale-100.png
new file mode 100644
index 00000000..4186c153
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/SmallTile.scale-100.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/SmallTile.scale-125.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/SmallTile.scale-125.png
new file mode 100644
index 00000000..b89a3b30
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/SmallTile.scale-125.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/SmallTile.scale-150.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/SmallTile.scale-150.png
new file mode 100644
index 00000000..bd2cc348
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/SmallTile.scale-150.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/SmallTile.scale-200.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/SmallTile.scale-200.png
new file mode 100644
index 00000000..b3791a08
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/SmallTile.scale-200.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/SmallTile.scale-400.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/SmallTile.scale-400.png
new file mode 100644
index 00000000..ccf5830b
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/SmallTile.scale-400.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/SplashScreen.scale-100.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/SplashScreen.scale-100.png
new file mode 100644
index 00000000..06b1422b
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/SplashScreen.scale-100.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/SplashScreen.scale-125.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/SplashScreen.scale-125.png
new file mode 100644
index 00000000..74b67d70
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/SplashScreen.scale-125.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/SplashScreen.scale-150.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/SplashScreen.scale-150.png
new file mode 100644
index 00000000..81754d90
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/SplashScreen.scale-150.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/SplashScreen.scale-200.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/SplashScreen.scale-200.png
new file mode 100644
index 00000000..dd6c312b
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/SplashScreen.scale-200.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/SplashScreen.scale-400.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/SplashScreen.scale-400.png
new file mode 100644
index 00000000..b28b180c
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/SplashScreen.scale-400.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/Square150x150Logo.scale-100.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square150x150Logo.scale-100.png
new file mode 100644
index 00000000..32bd822d
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square150x150Logo.scale-100.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/Square150x150Logo.scale-125.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square150x150Logo.scale-125.png
new file mode 100644
index 00000000..f4342abc
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square150x150Logo.scale-125.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/Square150x150Logo.scale-150.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square150x150Logo.scale-150.png
new file mode 100644
index 00000000..c1107980
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square150x150Logo.scale-150.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/Square150x150Logo.scale-200.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square150x150Logo.scale-200.png
new file mode 100644
index 00000000..79e9c5e4
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square150x150Logo.scale-200.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/Square150x150Logo.scale-400.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square150x150Logo.scale-400.png
new file mode 100644
index 00000000..73ceb76b
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square150x150Logo.scale-400.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.altform-lightunplated_targetsize-16.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.altform-lightunplated_targetsize-16.png
new file mode 100644
index 00000000..18275c6f
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.altform-lightunplated_targetsize-16.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.altform-lightunplated_targetsize-24.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.altform-lightunplated_targetsize-24.png
new file mode 100644
index 00000000..7561de6f
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.altform-lightunplated_targetsize-24.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.altform-lightunplated_targetsize-256.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.altform-lightunplated_targetsize-256.png
new file mode 100644
index 00000000..f50843bd
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.altform-lightunplated_targetsize-256.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.altform-lightunplated_targetsize-32.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.altform-lightunplated_targetsize-32.png
new file mode 100644
index 00000000..3d4ee641
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.altform-lightunplated_targetsize-32.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.altform-lightunplated_targetsize-48.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.altform-lightunplated_targetsize-48.png
new file mode 100644
index 00000000..e003e7e6
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.altform-lightunplated_targetsize-48.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.altform-unplated_targetsize-16.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.altform-unplated_targetsize-16.png
new file mode 100644
index 00000000..18275c6f
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.altform-unplated_targetsize-16.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.altform-unplated_targetsize-256.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.altform-unplated_targetsize-256.png
new file mode 100644
index 00000000..f50843bd
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.altform-unplated_targetsize-256.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.altform-unplated_targetsize-32.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.altform-unplated_targetsize-32.png
new file mode 100644
index 00000000..3d4ee641
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.altform-unplated_targetsize-32.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.altform-unplated_targetsize-48.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.altform-unplated_targetsize-48.png
new file mode 100644
index 00000000..e003e7e6
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.altform-unplated_targetsize-48.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.scale-100.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.scale-100.png
new file mode 100644
index 00000000..e6b266e0
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.scale-100.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.scale-125.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.scale-125.png
new file mode 100644
index 00000000..ba883192
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.scale-125.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.scale-150.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.scale-150.png
new file mode 100644
index 00000000..6a0ee022
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.scale-150.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.scale-200.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.scale-200.png
new file mode 100644
index 00000000..3ce9873d
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.scale-200.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.scale-400.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.scale-400.png
new file mode 100644
index 00000000..74d1bded
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.scale-400.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.targetsize-16.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.targetsize-16.png
new file mode 100644
index 00000000..18275c6f
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.targetsize-16.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.targetsize-24.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.targetsize-24.png
new file mode 100644
index 00000000..7561de6f
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.targetsize-24.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
new file mode 100644
index 00000000..e3ab7e4c
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.targetsize-256.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.targetsize-256.png
new file mode 100644
index 00000000..f50843bd
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.targetsize-256.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.targetsize-32.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.targetsize-32.png
new file mode 100644
index 00000000..b44a854c
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.targetsize-32.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.targetsize-48.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.targetsize-48.png
new file mode 100644
index 00000000..1bf9d6f6
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/Square44x44Logo.targetsize-48.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/StoreLogo.backup.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/StoreLogo.backup.png
new file mode 100644
index 00000000..7385b56c
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/StoreLogo.backup.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/StoreLogo.scale-100.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/StoreLogo.scale-100.png
new file mode 100644
index 00000000..1ed8820e
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/StoreLogo.scale-100.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/StoreLogo.scale-125.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/StoreLogo.scale-125.png
new file mode 100644
index 00000000..cf1dbb07
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/StoreLogo.scale-125.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/StoreLogo.scale-150.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/StoreLogo.scale-150.png
new file mode 100644
index 00000000..fa496dca
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/StoreLogo.scale-150.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/StoreLogo.scale-200.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/StoreLogo.scale-200.png
new file mode 100644
index 00000000..829aa3b5
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/StoreLogo.scale-200.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/StoreLogo.scale-400.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/StoreLogo.scale-400.png
new file mode 100644
index 00000000..6e28acc7
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/StoreLogo.scale-400.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/Wide310x150Logo.scale-100.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/Wide310x150Logo.scale-100.png
new file mode 100644
index 00000000..96ad84bc
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/Wide310x150Logo.scale-100.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/Wide310x150Logo.scale-125.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/Wide310x150Logo.scale-125.png
new file mode 100644
index 00000000..6bb12caa
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/Wide310x150Logo.scale-125.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/Wide310x150Logo.scale-150.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/Wide310x150Logo.scale-150.png
new file mode 100644
index 00000000..47b73b95
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/Wide310x150Logo.scale-150.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/Wide310x150Logo.scale-200.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/Wide310x150Logo.scale-200.png
new file mode 100644
index 00000000..06b1422b
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/Wide310x150Logo.scale-200.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Assets/Wide310x150Logo.scale-400.png b/samples/ComputeSharp.SwapChain.Uwp/Assets/Wide310x150Logo.scale-400.png
new file mode 100644
index 00000000..dd6c312b
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.Uwp/Assets/Wide310x150Logo.scale-400.png differ
diff --git a/samples/ComputeSharp.SwapChain.Uwp/ComputeSharp.SwapChain.Uwp.csproj b/samples/ComputeSharp.SwapChain.Uwp/ComputeSharp.SwapChain.Uwp.csproj
new file mode 100644
index 00000000..62ed2535
--- /dev/null
+++ b/samples/ComputeSharp.SwapChain.Uwp/ComputeSharp.SwapChain.Uwp.csproj
@@ -0,0 +1,239 @@
+
+
+
+
+ Debug
+ x86
+ {FBD388A5-7855-4408-98FF-E689F509DB5A}
+ AppContainerExe
+ Properties
+ ComputeSharp.SwapChain.Uwp
+ ComputeSharp.SwapChain.Uwp
+ en-US
+ UAP
+ 10.0.19041.0
+ 10.0.17763.0
+ 14
+ 512
+ {A5A43C5B-DE2A-4C0C-9213-0A381AF9435A};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
+ true
+ false
+
+
+ true
+ bin\x86\Debug\
+ DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
+ ;2008
+ full
+ x86
+ false
+ prompt
+ true
+
+
+ bin\x86\Release\
+ TRACE;NETFX_CORE;WINDOWS_UWP
+ true
+ ;2008
+ pdbonly
+ x86
+ false
+ prompt
+ true
+ true
+
+
+ true
+ bin\ARM\Debug\
+ DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
+ ;2008
+ full
+ ARM
+ false
+ prompt
+ true
+
+
+ bin\ARM\Release\
+ TRACE;NETFX_CORE;WINDOWS_UWP
+ true
+ ;2008
+ pdbonly
+ ARM
+ false
+ prompt
+ true
+ true
+
+
+ true
+ bin\ARM64\Debug\
+ DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
+ ;2008
+ full
+ ARM64
+ false
+ prompt
+ true
+ true
+
+
+ bin\ARM64\Release\
+ TRACE;NETFX_CORE;WINDOWS_UWP
+ true
+ ;2008
+ pdbonly
+ ARM64
+ false
+ prompt
+ true
+ true
+
+
+ true
+ bin\x64\Debug\
+ DEBUG;TRACE;NETFX_CORE;WINDOWS_UWP
+ ;2008
+ full
+ x64
+ false
+ prompt
+ true
+
+
+ bin\x64\Release\
+ TRACE;NETFX_CORE;WINDOWS_UWP
+ true
+ ;2008
+ pdbonly
+ x64
+ false
+ prompt
+ true
+ true
+
+
+ PackageReference
+
+
+
+ App.xaml
+
+
+
+ MainView.xaml
+
+
+
+
+ Designer
+
+
+
+
+
+
+
+
+
+ PreserveNewest
+
+
+ Assets\Textures\RustyMetal.png
+ PreserveNewest
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ MSBuild:Compile
+ Designer
+
+
+
+
+ 7.1.2
+
+
+ 6.2.13
+
+
+ 7.1.2
+
+
+ 7.1.2
+
+
+
+
+
+
+
+
+
+
+ Designer
+ MSBuild:Compile
+
+
+
+
+
+ 14.0
+
+
+
+
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Package.appxmanifest b/samples/ComputeSharp.SwapChain.Uwp/Package.appxmanifest
new file mode 100644
index 00000000..eb50ef1e
--- /dev/null
+++ b/samples/ComputeSharp.SwapChain.Uwp/Package.appxmanifest
@@ -0,0 +1,51 @@
+
+
+
+
+
+
+
+
+
+ ComputeSharp Sample App
+ Sergio Pedri
+ Assets\StoreLogo.png
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Properties/AssemblyInfo.cs b/samples/ComputeSharp.SwapChain.Uwp/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000..84399f6d
--- /dev/null
+++ b/samples/ComputeSharp.SwapChain.Uwp/Properties/AssemblyInfo.cs
@@ -0,0 +1,29 @@
+using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("ComputeSharp.SwapChain.Uwp")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("")]
+[assembly: AssemblyProduct("ComputeSharp.SwapChain.Uwp")]
+[assembly: AssemblyCopyright("Copyright © 2021")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Version information for an assembly consists of the following four values:
+//
+// Major Version
+// Minor Version
+// Build Number
+// Revision
+//
+// You can specify all the values or you can default the Build and Revision Numbers
+// by using the '*' as shown below:
+// [assembly: AssemblyVersion("1.0.*")]
+[assembly: AssemblyVersion("1.0.0.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
+[assembly: ComVisible(false)]
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Properties/Default.rd.xml b/samples/ComputeSharp.SwapChain.Uwp/Properties/Default.rd.xml
new file mode 100644
index 00000000..819be7a4
--- /dev/null
+++ b/samples/ComputeSharp.SwapChain.Uwp/Properties/Default.rd.xml
@@ -0,0 +1,21 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Views/MainView.xaml b/samples/ComputeSharp.SwapChain.Uwp/Views/MainView.xaml
new file mode 100644
index 00000000..fe94efd1
--- /dev/null
+++ b/samples/ComputeSharp.SwapChain.Uwp/Views/MainView.xaml
@@ -0,0 +1,233 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/samples/ComputeSharp.SwapChain.Uwp/Views/MainView.xaml.cs b/samples/ComputeSharp.SwapChain.Uwp/Views/MainView.xaml.cs
new file mode 100644
index 00000000..92b663c5
--- /dev/null
+++ b/samples/ComputeSharp.SwapChain.Uwp/Views/MainView.xaml.cs
@@ -0,0 +1,36 @@
+using System;
+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()
+ {
+ this.InitializeComponent();
+ }
+
+ // Opens the shader selection panel
+ private void OpenShaderSelectionPanelButton_Click(object sender, RoutedEventArgs e)
+ {
+ Root.Resources.Remove("ShaderSelectionPanel");
+ Root.Children.Add(ShaderSelectionPanel);
+ }
+
+ // Hides the shader selection panel
+ private void ShaderSelectionPanel_Tapped(object sender, TappedRoutedEventArgs e)
+ {
+ Root.Children.Remove(ShaderSelectionPanel);
+ }
+
+ // Updates the size of the shaders list panel
+ private void UserControl_SizeChanged(object sender, SizeChangedEventArgs e)
+ {
+ ShadersListContainerPanel.Height = Math.Round(e.NewSize.Height * 0.35);
+ }
+}
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/LargeTile.scale-100.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/LargeTile.scale-100.png
new file mode 100644
index 00000000..d6c0045a
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/LargeTile.scale-100.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/LargeTile.scale-125.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/LargeTile.scale-125.png
new file mode 100644
index 00000000..5122e651
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/LargeTile.scale-125.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/LargeTile.scale-150.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/LargeTile.scale-150.png
new file mode 100644
index 00000000..53a9bc92
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/LargeTile.scale-150.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/LargeTile.scale-200.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/LargeTile.scale-200.png
new file mode 100644
index 00000000..cc8b55f3
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/LargeTile.scale-200.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/LargeTile.scale-400.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/LargeTile.scale-400.png
new file mode 100644
index 00000000..e774041e
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/LargeTile.scale-400.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/SmallTile.scale-100.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/SmallTile.scale-100.png
new file mode 100644
index 00000000..605059d8
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/SmallTile.scale-100.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/SmallTile.scale-125.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/SmallTile.scale-125.png
new file mode 100644
index 00000000..cea40610
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/SmallTile.scale-125.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/SmallTile.scale-150.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/SmallTile.scale-150.png
new file mode 100644
index 00000000..3a7361dd
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/SmallTile.scale-150.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/SmallTile.scale-200.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/SmallTile.scale-200.png
new file mode 100644
index 00000000..75b9b2b3
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/SmallTile.scale-200.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/SmallTile.scale-400.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/SmallTile.scale-400.png
new file mode 100644
index 00000000..418563fc
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/SmallTile.scale-400.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/SplashScreen.scale-100.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/SplashScreen.scale-100.png
new file mode 100644
index 00000000..d800c4a0
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/SplashScreen.scale-100.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/SplashScreen.scale-125.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/SplashScreen.scale-125.png
new file mode 100644
index 00000000..e2117c20
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/SplashScreen.scale-125.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/SplashScreen.scale-150.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/SplashScreen.scale-150.png
new file mode 100644
index 00000000..08abf805
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/SplashScreen.scale-150.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/SplashScreen.scale-200.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/SplashScreen.scale-200.png
index 32f486a8..1df2cb62 100644
Binary files a/samples/ComputeSharp.SwapChain.WinUI/Assets/SplashScreen.scale-200.png and b/samples/ComputeSharp.SwapChain.WinUI/Assets/SplashScreen.scale-200.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/SplashScreen.scale-400.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/SplashScreen.scale-400.png
new file mode 100644
index 00000000..5aebcf43
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/SplashScreen.scale-400.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/Square150x150Logo.scale-100.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square150x150Logo.scale-100.png
new file mode 100644
index 00000000..97045881
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square150x150Logo.scale-100.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/Square150x150Logo.scale-125.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square150x150Logo.scale-125.png
new file mode 100644
index 00000000..b3f74401
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square150x150Logo.scale-125.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/Square150x150Logo.scale-150.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square150x150Logo.scale-150.png
new file mode 100644
index 00000000..e4861d09
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square150x150Logo.scale-150.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/Square150x150Logo.scale-200.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square150x150Logo.scale-200.png
index 53ee3777..84faf5ff 100644
Binary files a/samples/ComputeSharp.SwapChain.WinUI/Assets/Square150x150Logo.scale-200.png and b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square150x150Logo.scale-200.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/Square150x150Logo.scale-400.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square150x150Logo.scale-400.png
new file mode 100644
index 00000000..3104ab19
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square150x150Logo.scale-400.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.altform-lightunplated_targetsize-16.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.altform-lightunplated_targetsize-16.png
new file mode 100644
index 00000000..6c39100e
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.altform-lightunplated_targetsize-16.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.altform-lightunplated_targetsize-24.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.altform-lightunplated_targetsize-24.png
new file mode 100644
index 00000000..3e58e5b6
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.altform-lightunplated_targetsize-24.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.altform-lightunplated_targetsize-256.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.altform-lightunplated_targetsize-256.png
new file mode 100644
index 00000000..f50843bd
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.altform-lightunplated_targetsize-256.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.altform-lightunplated_targetsize-32.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.altform-lightunplated_targetsize-32.png
new file mode 100644
index 00000000..90a762d9
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.altform-lightunplated_targetsize-32.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.altform-lightunplated_targetsize-48.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.altform-lightunplated_targetsize-48.png
new file mode 100644
index 00000000..0d8c72f0
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.altform-lightunplated_targetsize-48.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.altform-unplated_targetsize-16.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.altform-unplated_targetsize-16.png
new file mode 100644
index 00000000..6c39100e
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.altform-unplated_targetsize-16.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.altform-unplated_targetsize-256.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.altform-unplated_targetsize-256.png
new file mode 100644
index 00000000..f50843bd
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.altform-unplated_targetsize-256.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.altform-unplated_targetsize-32.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.altform-unplated_targetsize-32.png
new file mode 100644
index 00000000..90a762d9
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.altform-unplated_targetsize-32.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.altform-unplated_targetsize-48.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.altform-unplated_targetsize-48.png
new file mode 100644
index 00000000..0d8c72f0
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.altform-unplated_targetsize-48.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.scale-100.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.scale-100.png
new file mode 100644
index 00000000..11dabfee
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.scale-100.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.scale-125.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.scale-125.png
new file mode 100644
index 00000000..1ff0964b
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.scale-125.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.scale-150.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.scale-150.png
new file mode 100644
index 00000000..4255eac3
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.scale-150.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.scale-200.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.scale-200.png
index f713bba6..f02661b2 100644
Binary files a/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.scale-200.png and b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.scale-200.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.scale-400.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.scale-400.png
new file mode 100644
index 00000000..64e172ad
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.scale-400.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.targetsize-16.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.targetsize-16.png
new file mode 100644
index 00000000..6c39100e
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.targetsize-16.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.targetsize-24.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.targetsize-24.png
new file mode 100644
index 00000000..3e58e5b6
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.targetsize-24.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.targetsize-24_altform-unplated.png
index dc9f5bea..3e58e5b6 100644
Binary files a/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.targetsize-24_altform-unplated.png and b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.targetsize-24_altform-unplated.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.targetsize-256.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.targetsize-256.png
new file mode 100644
index 00000000..f50843bd
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.targetsize-256.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.targetsize-32.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.targetsize-32.png
new file mode 100644
index 00000000..90a762d9
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.targetsize-32.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.targetsize-48.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.targetsize-48.png
new file mode 100644
index 00000000..0d8c72f0
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/Square44x44Logo.targetsize-48.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/StoreLogo.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/StoreLogo.backup.png
similarity index 100%
rename from samples/ComputeSharp.SwapChain.WinUI/Assets/StoreLogo.png
rename to samples/ComputeSharp.SwapChain.WinUI/Assets/StoreLogo.backup.png
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/StoreLogo.scale-100.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/StoreLogo.scale-100.png
new file mode 100644
index 00000000..1ed8820e
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/StoreLogo.scale-100.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/StoreLogo.scale-125.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/StoreLogo.scale-125.png
new file mode 100644
index 00000000..cf1dbb07
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/StoreLogo.scale-125.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/StoreLogo.scale-150.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/StoreLogo.scale-150.png
new file mode 100644
index 00000000..966a6067
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/StoreLogo.scale-150.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/StoreLogo.scale-200.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/StoreLogo.scale-200.png
new file mode 100644
index 00000000..7bc22428
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/StoreLogo.scale-200.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/StoreLogo.scale-400.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/StoreLogo.scale-400.png
new file mode 100644
index 00000000..87e3523c
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/StoreLogo.scale-400.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/Wide310x150Logo.scale-100.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/Wide310x150Logo.scale-100.png
new file mode 100644
index 00000000..a5704b35
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/Wide310x150Logo.scale-100.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/Wide310x150Logo.scale-125.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/Wide310x150Logo.scale-125.png
new file mode 100644
index 00000000..d92c4699
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/Wide310x150Logo.scale-125.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/Wide310x150Logo.scale-150.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/Wide310x150Logo.scale-150.png
new file mode 100644
index 00000000..73ac19b2
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/Wide310x150Logo.scale-150.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/Wide310x150Logo.scale-200.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/Wide310x150Logo.scale-200.png
index 8b4a5d0d..d800c4a0 100644
Binary files a/samples/ComputeSharp.SwapChain.WinUI/Assets/Wide310x150Logo.scale-200.png and b/samples/ComputeSharp.SwapChain.WinUI/Assets/Wide310x150Logo.scale-200.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Assets/Wide310x150Logo.scale-400.png b/samples/ComputeSharp.SwapChain.WinUI/Assets/Wide310x150Logo.scale-400.png
new file mode 100644
index 00000000..1df2cb62
Binary files /dev/null and b/samples/ComputeSharp.SwapChain.WinUI/Assets/Wide310x150Logo.scale-400.png differ
diff --git a/samples/ComputeSharp.SwapChain.WinUI/ComputeSharp.SwapChain.WinUI.csproj b/samples/ComputeSharp.SwapChain.WinUI/ComputeSharp.SwapChain.WinUI.csproj
index 881b6747..4d829db6 100644
--- a/samples/ComputeSharp.SwapChain.WinUI/ComputeSharp.SwapChain.WinUI.csproj
+++ b/samples/ComputeSharp.SwapChain.WinUI/ComputeSharp.SwapChain.WinUI.csproj
@@ -23,7 +23,6 @@
-
@@ -31,19 +30,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -60,4 +46,8 @@
ReferenceOutputAssembly="false"
PrivateAssets="contentfiles;build" />
+
+
+
+
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Package.appxmanifest b/samples/ComputeSharp.SwapChain.WinUI/Package.appxmanifest
index aa2f427c..4ca96b07 100644
--- a/samples/ComputeSharp.SwapChain.WinUI/Package.appxmanifest
+++ b/samples/ComputeSharp.SwapChain.WinUI/Package.appxmanifest
@@ -12,8 +12,8 @@
Version="1.0.0.0" />
- ComputeSharp.SwapChain.WinUI
- Sergio
+ ComputeSharp Sample App (WinUI 3)
+ Sergio Pedri
Assets\StoreLogo.png
@@ -31,13 +31,13 @@
Executable="$targetnametoken$.exe"
EntryPoint="$targetentrypoint$">
-
-
+
+
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Properties/PublishProfiles/win10-arm64.pubxml b/samples/ComputeSharp.SwapChain.WinUI/Properties/PublishProfiles/win10-arm64.pubxml
new file mode 100644
index 00000000..318e1b94
--- /dev/null
+++ b/samples/ComputeSharp.SwapChain.WinUI/Properties/PublishProfiles/win10-arm64.pubxml
@@ -0,0 +1,19 @@
+
+
+
+
+ FileSystem
+ ARM64
+ win10-arm64
+ bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\
+ true
+ False
+ True
+
+
+
\ No newline at end of file
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Views/MainWindow.xaml b/samples/ComputeSharp.SwapChain.WinUI/Views/MainWindow.xaml
index 985d0dce..3a80242f 100644
--- a/samples/ComputeSharp.SwapChain.WinUI/Views/MainWindow.xaml
+++ b/samples/ComputeSharp.SwapChain.WinUI/Views/MainWindow.xaml
@@ -2,211 +2,242 @@
x:Class="ComputeSharp.SwapChain.WinUI.Views.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:animations="using:CommunityToolkit.WinUI.UI.Animations"
+ xmlns:computesharp="using:ComputeSharp.WinUI"
+ xmlns:controls="using:CommunityToolkit.WinUI.UI.Controls"
+ xmlns:converters="using:ComputeSharp.SwapChain.Core.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:controls="using:CommunityToolkit.WinUI.UI.Controls"
- xmlns:ui="using:CommunityToolkit.WinUI.UI"
- xmlns:animations="using:CommunityToolkit.WinUI.UI.Animations"
xmlns:media="using:CommunityToolkit.WinUI.UI.Media"
- xmlns:computesharp="using:ComputeSharp.WinUI"
- xmlns:converters="using:ComputeSharp.SwapChain.WinUI.Converters"
- xmlns:viewmodels="using:ComputeSharp.SwapChain.WinUI.ViewModels"
- xmlns:models="using:ComputeSharp.SwapChain.WinUI.Models"
+ xmlns:models="using:ComputeSharp.SwapChain.Core.Models"
+ xmlns:ui="using:CommunityToolkit.WinUI.UI"
+ xmlns:viewmodels="using:ComputeSharp.SwapChain.Core.ViewModels"
+ SizeChanged="UserControl_SizeChanged"
mc:Ignorable="d">
-
+
-
+ change and stop their render loops. This avoids wasting GPU resources when the panel isn't visible.
+ -->
-
+
-
+
+ TextureUri="ms-appx:///Assets/Misc/noise_low.png"
+ TintColor="#FF222222"
+ TintOpacity="0.2" />
-
-
+
+ VerticalAlignment="Bottom"
+ Background="#FF222222">
-
+
-
+
-
+
+
+
-
-
-
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+
+
+
+
-
-
+
+
-
+ When that is working, the ComputeShader.IsSelected property can also be removed, as it will no longer be needed.
+ -->
+ VerticalAlignment="Top"
+ Fill="White"
+ Points="0,0 32,0 32,32" />
-
-
-
-
-
+
+
+
+
+
-
+
+ ShaderRunner="{x:Bind ViewModel.SelectedComputeShader.ShaderRunner, Mode=OneWay}" />
-
+
+ VerticalAlignment="Bottom"
+ Orientation="Horizontal"
+ Spacing="20">
-
+
-
+
-
+
-
+
+
+
+
+ HorizontalAlignment="Stretch"
+ VerticalAlignment="Top"
+ Fill="Transparent" />
diff --git a/samples/ComputeSharp.SwapChain.WinUI/Views/MainWindow.xaml.cs b/samples/ComputeSharp.SwapChain.WinUI/Views/MainWindow.xaml.cs
index c9ce9c54..c65c33d0 100644
--- a/samples/ComputeSharp.SwapChain.WinUI/Views/MainWindow.xaml.cs
+++ b/samples/ComputeSharp.SwapChain.WinUI/Views/MainWindow.xaml.cs
@@ -1,10 +1,11 @@
-using Microsoft.UI.Xaml;
+using System;
+using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Input;
namespace ComputeSharp.SwapChain.WinUI.Views;
///
-/// A view for .
+/// A view for .
///
public sealed partial class MainWindow : Window
{
@@ -28,4 +29,16 @@ public sealed partial class MainWindow : Window
{
Root.Children.Remove(ShaderSelectionPanel);
}
+
+ // Updates the size of the shaders list panel
+ private void UserControl_SizeChanged(object sender, WindowSizeChangedEventArgs e)
+ {
+ ShadersListContainerPanel.Height = Math.Round(e.Size.Height * 0.35);
+ }
+
+ // Closes the app
+ private void CloseButton_Click(object sender, RoutedEventArgs e)
+ {
+ Application.Current.Exit();
+ }
}
diff --git a/samples/ComputeSharp.SwapChain/Backend/SwapChainApplication{T}.cs b/samples/ComputeSharp.SwapChain/Backend/SwapChainApplication{T}.cs
index db765d50..df208d46 100644
--- a/samples/ComputeSharp.SwapChain/Backend/SwapChainApplication{T}.cs
+++ b/samples/ComputeSharp.SwapChain/Backend/SwapChainApplication{T}.cs
@@ -76,7 +76,7 @@ internal sealed class SwapChainApplication : Win32Application
private bool isResizePending;
///
- /// Creates a new instance with the specified parameters.
+ /// Creates a new instance with the specified parameters.
///
/// The instance used to create shaders to run.
public SwapChainApplication(Func shaderFactory)
diff --git a/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationRunner.cs b/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationRunner.cs
index 281a26cf..475a2210 100644
--- a/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationRunner.cs
+++ b/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationRunner.cs
@@ -39,13 +39,10 @@ internal unsafe static class Win32ApplicationRunner
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 of type , and it should be
- /// called as soon as the process is launched, excluding any other additional initialization needed.
- /// To launch an application, simply add this line to the project being used:
- /// Win32ApplicationRunner.Run<MyApplication>();
+ /// 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 type of application being launched.
+ /// The input application instance to run.
/// The exit code for the application.
public static int Run(Win32Application application)
{
diff --git a/samples/ComputeSharp.SwapChain/ComputeSharp.SwapChain.csproj b/samples/ComputeSharp.SwapChain/ComputeSharp.SwapChain.csproj
index d1a42239..0fa5b528 100644
--- a/samples/ComputeSharp.SwapChain/ComputeSharp.SwapChain.csproj
+++ b/samples/ComputeSharp.SwapChain/ComputeSharp.SwapChain.csproj
@@ -20,4 +20,6 @@
+
+
diff --git a/samples/ComputeSharp.SwapChain/Shaders/HelloWorld.cs b/samples/ComputeSharp.SwapChain/Shaders/HelloWorld.cs
deleted file mode 100644
index 8e60a9ff..00000000
--- a/samples/ComputeSharp.SwapChain/Shaders/HelloWorld.cs
+++ /dev/null
@@ -1,28 +0,0 @@
-namespace ComputeSharp.SwapChain.Shaders
-{
- ///
- /// A simple shader to get started with based on shadertoy new shader template.
- /// Ported from .
- ///
- [AutoConstructor]
- internal readonly partial struct HelloWorld : IPixelShader
- {
- ///
- /// The current time since the start of the application.
- ///
- public readonly float time;
-
- ///
- public float4 Execute()
- {
- // Normalized screen space UV coordinates from 0.0 to 1.0
- float2 uv = ThreadIds.Normalized.XY;
-
- // 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);
- }
- }
-}
diff --git a/samples/Directory.Build.props b/samples/Directory.Build.props
new file mode 100644
index 00000000..e190c8b2
--- /dev/null
+++ b/samples/Directory.Build.props
@@ -0,0 +1,7 @@
+
+
+
+
+ $(NoWarn);CS1591
+
+
\ No newline at end of file
diff --git a/src/ComputeSharp.Package/icon_highres.png b/src/ComputeSharp.Package/icon_highres.png
new file mode 100644
index 00000000..2653e7a7
Binary files /dev/null and b/src/ComputeSharp.Package/icon_highres.png differ
diff --git a/src/ComputeSharp.SourceGenerators/ComputeSharp.SourceGenerators.csproj b/src/ComputeSharp.SourceGenerators/ComputeSharp.SourceGenerators.csproj
index 59ea54ce..c6b670e3 100644
--- a/src/ComputeSharp.SourceGenerators/ComputeSharp.SourceGenerators.csproj
+++ b/src/ComputeSharp.SourceGenerators/ComputeSharp.SourceGenerators.csproj
@@ -74,7 +74,7 @@
-
+
diff --git a/src/ComputeSharp.SourceGenerators/Diagnostics/DiagnosticsExtensions.cs b/src/ComputeSharp.SourceGenerators/Diagnostics/DiagnosticsExtensions.cs
index 9739f8ab..a5894cd6 100644
--- a/src/ComputeSharp.SourceGenerators/Diagnostics/DiagnosticsExtensions.cs
+++ b/src/ComputeSharp.SourceGenerators/Diagnostics/DiagnosticsExtensions.cs
@@ -11,7 +11,7 @@ internal static class DiagnosticsExtensions
///
/// Adds a new diagnostics to the current compilation.
///
- /// The instance currently in use.
+ /// The instance currently in use.
/// The input for the diagnostics to create.
/// The source to attach the diagnostics to.
/// The optional arguments for the formatted message to include.
@@ -27,7 +27,7 @@ internal static class DiagnosticsExtensions
///
/// Adds a new diagnostics to the current compilation.
///
- /// The instance currently in use.
+ /// The instance currently in use.
/// The input for the diagnostics to create.
/// The source to attach the diagnostics to.
/// The optional arguments for the formatted message to include.
diff --git a/src/ComputeSharp.SourceGenerators/Helpers/SyntaxFactoryHelper.cs b/src/ComputeSharp.SourceGenerators/Helpers/SyntaxFactoryHelper.cs
index 8b08572f..f1d215c8 100644
--- a/src/ComputeSharp.SourceGenerators/Helpers/SyntaxFactoryHelper.cs
+++ b/src/ComputeSharp.SourceGenerators/Helpers/SyntaxFactoryHelper.cs
@@ -21,7 +21,7 @@ internal static class SyntaxFactoryHelper
///
///
///
- /// The input sequence of groups.
+ /// The input sequence of groups.
/// An instance with the described contents.
[Pure]
public static ArrayCreationExpressionSyntax NestedArrayExpression(IEnumerable<(string A, string B)> groups)
diff --git a/src/ComputeSharp.SourceGenerators/IShaderGenerator.cs b/src/ComputeSharp.SourceGenerators/IShaderGenerator.cs
index 986e19ca..c89752f1 100644
--- a/src/ComputeSharp.SourceGenerators/IShaderGenerator.cs
+++ b/src/ComputeSharp.SourceGenerators/IShaderGenerator.cs
@@ -147,7 +147,7 @@ public sealed partial class IShaderGenerator : ISourceGenerator
///
/// Creates a instance for the GetDispatchId method.
///
- /// The for .
+ /// The for the input struct declaration.
/// The resulting instance for the GetDispatchId method.
private static partial MethodDeclarationSyntax CreateGetDispatchIdMethod(INamedTypeSymbol structDeclarationSymbol);
@@ -155,7 +155,7 @@ public sealed partial class IShaderGenerator : ISourceGenerator
/// Creates a instance for the LoadDispatchDataMethod method.
///
/// The input instance to use.
- /// The for .
+ /// The for the input struct declaration.
/// The collection of discovered resources in the current shader type.
/// The total number of 32 bit root constants being loaded for the current shader type.
/// The resulting instance for the LoadDispatchDataMethod method.
diff --git a/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownMembers.cs b/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownMembers.cs
index 904ef8e1..adecb8dd 100644
--- a/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownMembers.cs
+++ b/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownMembers.cs
@@ -414,11 +414,12 @@ internal static class HlslKnownMembers
}
///
- /// Tries to get the mapped HLSL-compatible indexer vector type name for the input indexer name.
+ /// Tries to get the mapped rank and axis for a given indexer name.
///
/// The input fully qualified indexer name.
- /// The mapped type name, if one is found.
- /// The HLSL-compatible type name that can be used in an HLSL shader for the given indexer.
+ /// The resulting indexer rank, if found.
+ /// The resulting indexer axis, if found.
+ /// Whether or not a rank and axis could be resolved by the input indexer name.
[Pure]
public static bool TryGetAccessorRankAndAxis(string name, out int rank, out int axis)
{
diff --git a/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownTypes.cs b/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownTypes.cs
index 9ebd68ed..25b7ae9d 100644
--- a/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownTypes.cs
+++ b/src/ComputeSharp.SourceGenerators/Mappings/HlslKnownTypes.cs
@@ -336,7 +336,8 @@ internal static class HlslKnownTypes
///
/// Gets the mapped HLSL-compatible type name for the input type name.
///
- /// The input type name to map.
+ /// The input type name to map.
+ /// The resulting mapped type name, if found.
/// The HLSL-compatible type name that can be used in an HLSL shader.
public static bool TryGetMappedName(string originalName, out string? mappedName)
{
diff --git a/src/ComputeSharp.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs b/src/ComputeSharp.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs
index 89cd50a3..0b45396c 100644
--- a/src/ComputeSharp.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs
+++ b/src/ComputeSharp.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs
@@ -114,7 +114,7 @@ internal sealed class ShaderSourceRewriter : HlslSourceRewriter
public bool IsGroupIdsUsed { get; private set; }
///
- /// Gets whether or not the shader uses at least once.
///
public bool IsGroupIdsIndexUsed { get; private set; }
diff --git a/src/ComputeSharp.UI/ComputeSharp.UI.projitems b/src/ComputeSharp.UI/ComputeSharp.UI.projitems
new file mode 100644
index 00000000..e081e8cc
--- /dev/null
+++ b/src/ComputeSharp.UI/ComputeSharp.UI.projitems
@@ -0,0 +1,19 @@
+
+
+
+ $(MSBuildAllProjects);$(MSBuildThisFileFullPath)
+ true
+ 0c82ede1-5b8a-4df3-87da-700b29d5e265
+
+
+ ComputeSharp.UI
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/ComputeSharp.UI/ComputeSharp.UI.shproj b/src/ComputeSharp.UI/ComputeSharp.UI.shproj
new file mode 100644
index 00000000..dfd65f65
--- /dev/null
+++ b/src/ComputeSharp.UI/ComputeSharp.UI.shproj
@@ -0,0 +1,13 @@
+
+
+
+ 0c82ede1-5b8a-4df3-87da-700b29d5e265
+ 14.0
+
+
+
+
+
+
+
+
diff --git a/src/ComputeSharp.WinUI/Controls/ComputeShaderPanel.Properties.cs b/src/ComputeSharp.UI/Controls/ComputeShaderPanel.Properties.cs
similarity index 98%
rename from src/ComputeSharp.WinUI/Controls/ComputeShaderPanel.Properties.cs
rename to src/ComputeSharp.UI/Controls/ComputeShaderPanel.Properties.cs
index 2714afd8..73e49028 100644
--- a/src/ComputeSharp.WinUI/Controls/ComputeShaderPanel.Properties.cs
+++ b/src/ComputeSharp.UI/Controls/ComputeShaderPanel.Properties.cs
@@ -1,7 +1,13 @@
using System;
-using Microsoft.UI.Xaml;
+#if WINDOWS_UWP
+using Windows.UI.Xaml;
+namespace ComputeSharp.Uwp;
+#else
+
+using Microsoft.UI.Xaml;
namespace ComputeSharp.WinUI;
+#endif
///
public sealed unsafe partial class ComputeShaderPanel
diff --git a/src/ComputeSharp.WinUI/Controls/ComputeShaderPanel.Rendering.cs b/src/ComputeSharp.UI/Controls/ComputeShaderPanel.Rendering.cs
similarity index 95%
rename from src/ComputeSharp.WinUI/Controls/ComputeShaderPanel.Rendering.cs
rename to src/ComputeSharp.UI/Controls/ComputeShaderPanel.Rendering.cs
index f946f799..0e4903ee 100644
--- a/src/ComputeSharp.WinUI/Controls/ComputeShaderPanel.Rendering.cs
+++ b/src/ComputeSharp.UI/Controls/ComputeShaderPanel.Rendering.cs
@@ -1,19 +1,32 @@
using System;
using System.Diagnostics;
+#if WINDOWS_UWP
+using System.Runtime.InteropServices;
+#endif
using System.Threading;
using ComputeSharp.Core.Extensions;
using ComputeSharp.Graphics.Helpers;
using ComputeSharp.Interop;
+#if WINDOWS_UWP
+using ComputeSharp.Uwp.Helpers;
+#else
using ComputeSharp.WinUI.Helpers;
+#endif
using TerraFX.Interop.DirectX;
using TerraFX.Interop.Windows;
using TerraFX.Interop.WinRT;
+#if !WINDOWS_UWP
using WinRT;
+#endif
using Win32 = TerraFX.Interop.Windows.Windows;
#pragma warning disable CS0420
+#if WINDOWS_UWP
+namespace ComputeSharp.Uwp;
+#else
namespace ComputeSharp.WinUI;
+#endif
///
public sealed partial class ComputeShaderPanel
@@ -64,7 +77,7 @@ public sealed partial class ComputeShaderPanel
private ComPtr dxgiSwapChain3;
///
- /// The awaitable object for calls.
+ /// The awaitable object for calls.
///
private HANDLE frameLatencyWaitableObject;
@@ -94,22 +107,22 @@ public sealed partial class ComputeShaderPanel
private volatile bool isResizePending;
///
- /// The backing store for for the render thread.
+ /// The backing store for the actual width for the render thread.
///
private volatile float width;
///
- /// The backing store for for the render thread.
+ /// The backing store for the actual height for the render thread.
///
private volatile float height;
///
- /// The backing store for for the render thread.
+ /// The backing store for the current composition scale on the X axis for the render thread.
///
private volatile float compositionScaleX;
///
- /// The backing store for for the render thread.
+ /// The backing store for the current composition scale on the Y axis for the render thread.
///
private volatile float compositionScaleY;
@@ -249,12 +262,20 @@ public sealed partial class ComputeShaderPanel
// IDXGISwapChain reference just created and set that as the swap chain panel to use.
using ComPtr swapChainPanelNative = default;
+#if WINDOWS_UWP
+ IUnknown* swapChainPanel = (IUnknown*)Marshal.GetIUnknownForObject(this);
+
+ swapChainPanel->QueryInterface(
+ Win32.__uuidof(),
+ (void**)&swapChainPanelNative).Assert();
+#else
IUnknown* swapChainPanel = (IUnknown*)((IWinRTObject)this).NativeObject.ThisPtr;
Guid iSwapChainPanelNativeUuid = new(0x63AAD0B8, 0x7C24, 0x40FF, 0x85, 0xA8, 0x64, 0x0D, 0x94, 0x4C, 0xC3, 0x25);
swapChainPanel->QueryInterface(
&iSwapChainPanelNativeUuid,
(void**)&swapChainPanelNative).Assert();
+#endif
using (ComPtr idxgiSwapChain = default)
{
diff --git a/src/ComputeSharp.WinUI/Controls/ComputeShaderPanel.cs b/src/ComputeSharp.UI/Controls/ComputeShaderPanel.cs
similarity index 94%
rename from src/ComputeSharp.WinUI/Controls/ComputeShaderPanel.cs
rename to src/ComputeSharp.UI/Controls/ComputeShaderPanel.cs
index 7ca0e51c..70d86b9d 100644
--- a/src/ComputeSharp.WinUI/Controls/ComputeShaderPanel.cs
+++ b/src/ComputeSharp.UI/Controls/ComputeShaderPanel.cs
@@ -1,7 +1,14 @@
-using Microsoft.UI.Xaml;
+#if WINDOWS_UWP
+using Windows.UI.Xaml;
+using Windows.UI.Xaml.Controls;
+
+namespace ComputeSharp.Uwp;
+#else
+using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
namespace ComputeSharp.WinUI;
+#endif
///
/// A custom that can be used to render animated backgrounds.
diff --git a/src/ComputeSharp.WinUI/Helpers/DynamicResolutionManager.cs b/src/ComputeSharp.UI/Helpers/DynamicResolutionManager.cs
similarity index 94%
rename from src/ComputeSharp.WinUI/Helpers/DynamicResolutionManager.cs
rename to src/ComputeSharp.UI/Helpers/DynamicResolutionManager.cs
index 802650db..26b9004e 100644
--- a/src/ComputeSharp.WinUI/Helpers/DynamicResolutionManager.cs
+++ b/src/ComputeSharp.UI/Helpers/DynamicResolutionManager.cs
@@ -1,8 +1,14 @@
using System;
+#if !WINDOWS_UWP
using System.Runtime.InteropServices;
+#endif
using System.Threading;
+#if WINDOWS_UWP
+namespace ComputeSharp.Uwp.Helpers;
+#else
namespace ComputeSharp.WinUI.Helpers;
+#endif
///
/// A helper type that is responsible for applying dynamic resolution changes.
@@ -68,7 +74,14 @@ internal unsafe ref struct DynamicResolutionManager
manager.frameTimeOffset = 0;
manager.slidingFrameTimeWindowSum = TargetFrameTimeInTicksFor60fps * SlidingFrameTimeWindowLength;
+#if WINDOWS_UWP
+ fixed (long* p = &manager.frameTimesInTicks[0])
+ {
+ new Span(p, SlidingFrameTimeWindowLength).Fill(TargetFrameTimeInTicksFor60fps);
+ }
+#else
MemoryMarshal.CreateSpan(ref manager.frameTimesInTicks[0], SlidingFrameTimeWindowLength).Fill(TargetFrameTimeInTicksFor60fps);
+#endif
}
///
diff --git a/src/ComputeSharp.WinUI/IShaderRunner.cs b/src/ComputeSharp.UI/IShaderRunner.cs
similarity index 90%
rename from src/ComputeSharp.WinUI/IShaderRunner.cs
rename to src/ComputeSharp.UI/IShaderRunner.cs
index 8a1deb5e..c681b68b 100644
--- a/src/ComputeSharp.WinUI/IShaderRunner.cs
+++ b/src/ComputeSharp.UI/IShaderRunner.cs
@@ -1,6 +1,10 @@
using System;
+#if WINDOWS_UWP
+namespace ComputeSharp.Uwp;
+#else
namespace ComputeSharp.WinUI;
+#endif
///
/// An interface for a shader runner to be used with .
diff --git a/src/ComputeSharp.WinUI/ShaderRunner{T}.cs b/src/ComputeSharp.UI/ShaderRunner{T}.cs
similarity index 96%
rename from src/ComputeSharp.WinUI/ShaderRunner{T}.cs
rename to src/ComputeSharp.UI/ShaderRunner{T}.cs
index af32f397..be100516 100644
--- a/src/ComputeSharp.WinUI/ShaderRunner{T}.cs
+++ b/src/ComputeSharp.UI/ShaderRunner{T}.cs
@@ -1,6 +1,10 @@
using System;
+#if WINDOWS_UWP
+namespace ComputeSharp.Uwp;
+#else
namespace ComputeSharp.WinUI;
+#endif
///
/// An implementation powered by a supplied shader type.
diff --git a/src/ComputeSharp.Uwp/ComputeSharp.Uwp.csproj b/src/ComputeSharp.Uwp/ComputeSharp.Uwp.csproj
new file mode 100644
index 00000000..06046c44
--- /dev/null
+++ b/src/ComputeSharp.Uwp/ComputeSharp.Uwp.csproj
@@ -0,0 +1,42 @@
+
+
+ uap10.0.17763
+ 10.0
+ 19041
+ 17763
+ $(TargetPlatformBaseVersion).$(TargetPlatformRevision).0
+ $(TargetPlatformBaseVersion).$(TargetPlatformMinRevision).0
+ Portable
+ true
+ true
+ true
+ true
+ true
+ $(AllowedOutputExtensionsInPackageBuildOutputFolder);.pdb
+ ComputeSharp.Uwp
+ x64;ARM64
+ win10-x64;win-arm64
+ $(NoWarn);NETSDK1023
+
+
+
+ ComputeSharp.Uwp
+ ComputeSharp.Uwp
+ A UWP library with controls to render DX12 shaders powered by ComputeSharp
+ $(PackageTags) uwp winui
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/ComputeSharp.Uwp/Directory.Build.props b/src/ComputeSharp.Uwp/Directory.Build.props
new file mode 100644
index 00000000..7fbbecef
--- /dev/null
+++ b/src/ComputeSharp.Uwp/Directory.Build.props
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/src/ComputeSharp.Uwp/Properties/AssemblyInfo.cs b/src/ComputeSharp.Uwp/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000..eecfefd0
--- /dev/null
+++ b/src/ComputeSharp.Uwp/Properties/AssemblyInfo.cs
@@ -0,0 +1,6 @@
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+[module: SkipLocalsInit]
+
+[assembly: ComVisible(false)]
\ No newline at end of file
diff --git a/src/ComputeSharp.WinUI/ComputeSharp.WinUI.csproj b/src/ComputeSharp.WinUI/ComputeSharp.WinUI.csproj
index d2821e60..4f65001f 100644
--- a/src/ComputeSharp.WinUI/ComputeSharp.WinUI.csproj
+++ b/src/ComputeSharp.WinUI/ComputeSharp.WinUI.csproj
@@ -6,6 +6,9 @@
x64;ARM64
win10-x64;win10-arm64
true
+
+
+ $(NoWarn);NU5104
@@ -27,4 +30,6 @@
+
+
diff --git a/src/ComputeSharp.WinUI/Properties/AssemblyInfo.cs b/src/ComputeSharp.WinUI/Properties/AssemblyInfo.cs
new file mode 100644
index 00000000..196f23c5
--- /dev/null
+++ b/src/ComputeSharp.WinUI/Properties/AssemblyInfo.cs
@@ -0,0 +1,3 @@
+using System.Runtime.CompilerServices;
+
+[module: SkipLocalsInit]
\ No newline at end of file
diff --git a/src/ComputeSharp/ComputeSharp.csproj b/src/ComputeSharp/ComputeSharp.csproj
index 3b456dec..4c8128dc 100644
--- a/src/ComputeSharp/ComputeSharp.csproj
+++ b/src/ComputeSharp/ComputeSharp.csproj
@@ -8,7 +8,7 @@
-
+
diff --git a/src/ComputeSharp/Graphics/Extensions/Interop/ComPtrExtensions.cs b/src/ComputeSharp/Graphics/Extensions/Interop/ComPtrExtensions.cs
index e589b564..8ff5c5df 100644
--- a/src/ComputeSharp/Graphics/Extensions/Interop/ComPtrExtensions.cs
+++ b/src/ComputeSharp/Graphics/Extensions/Interop/ComPtrExtensions.cs
@@ -17,11 +17,20 @@ internal static class ComPtrExtensions
/// A instance of type .
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe uint AddRef(this ComPtr ptr)
+#if NET6_0_OR_GREATER
where T : unmanaged, IUnknown.Interface
+#else
+ where T : unmanaged
+#endif
{
if (ptr.Get() is not null)
{
+#if NET6_0_OR_GREATER
return ptr.Get()->AddRef();
+#else
+ return ((IUnknown*)ptr.Get())->AddRef();
+#endif
+
}
return 0;
@@ -36,11 +45,19 @@ internal static class ComPtrExtensions
/// A instance of type .
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe uint Release(this ref ComPtr ptr)
+#if NET6_0_OR_GREATER
where T : unmanaged, IUnknown.Interface
+#else
+ where T : unmanaged
+#endif
{
if (ptr.Get() is not null)
{
+#if NET6_0_OR_GREATER
uint count = ptr.Get()->Release();
+#else
+ uint count = ((IUnknown*)ptr.Get())->Release();
+#endif
if (count == 0)
{
@@ -66,7 +83,11 @@ internal static class ComPtrExtensions
[Pure]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe ref readonly ComPtr AsIUnknown(this in ComPtr ptr)
+#if NET6_0_OR_GREATER
where T : unmanaged, IUnknown.Interface
+#else
+ where T : unmanaged
+#endif
{
return ref Unsafe.As, ComPtr>(ref Unsafe.AsRef(in ptr));
}
@@ -81,7 +102,11 @@ internal static class ComPtrExtensions
[Pure]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe void** GetVoidAddressOf(this in ComPtr ptr)
+#if NET6_0_OR_GREATER
where T : unmanaged, IUnknown.Interface
+#else
+ where T : unmanaged
+#endif
{
return (void**)Unsafe.AsPointer(ref Unsafe.AsRef(in ptr));
}
@@ -94,7 +119,11 @@ internal static class ComPtrExtensions
/// The moved instance.
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static unsafe ComPtr Move(this in ComPtr ptr)
+#if NET6_0_OR_GREATER
where T : unmanaged, IUnknown.Interface
+#else
+ where T : unmanaged
+#endif
{
ComPtr copy = default;
diff --git a/src/ComputeSharp/Properties/AssemblyInfo.cs b/src/ComputeSharp/Properties/AssemblyInfo.cs
index a671df7e..bbec36ea 100644
--- a/src/ComputeSharp/Properties/AssemblyInfo.cs
+++ b/src/ComputeSharp/Properties/AssemblyInfo.cs
@@ -3,4 +3,5 @@
[module: SkipLocalsInit]
[assembly: InternalsVisibleTo("ComputeSharp.Tests.Internals")]
+[assembly: InternalsVisibleTo("ComputeSharp.Uwp")]
[assembly: InternalsVisibleTo("ComputeSharp.WinUI")]
diff --git a/src/Directory.Build.props b/src/Directory.Build.props
index 3b884e46..96486587 100644
--- a/src/Directory.Build.props
+++ b/src/Directory.Build.props
@@ -1,7 +1,7 @@
+
+
-
-
\ No newline at end of file
diff --git a/src/TerraFX.Interop.Windows/ComPtr`1.cs b/src/TerraFX.Interop.Windows/ComPtr`1.cs
index db953e85..dd8c38ab 100644
--- a/src/TerraFX.Interop.Windows/ComPtr`1.cs
+++ b/src/TerraFX.Interop.Windows/ComPtr`1.cs
@@ -7,8 +7,8 @@ using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Runtime.CompilerServices;
-using static TerraFX.Interop.Windows.S;
using static TerraFX.Interop.Windows.Windows;
+using static TerraFX.Interop.Windows.S;
namespace TerraFX.Interop.Windows
{
@@ -16,7 +16,7 @@ namespace TerraFX.Interop.Windows
/// The type to wrap in the current instance.
/// While this type is not marked as so that it can also be used in fields, make sure to keep the reference counts properly tracked if you do store instances on the heap.
internal unsafe struct ComPtr : IDisposable
- where T : unmanaged, IUnknown.Interface
+ where T : unmanaged
{
/// The raw pointer to a COM object, if existing.
private T* ptr_;
@@ -55,9 +55,9 @@ namespace TerraFX.Interop.Windows
/// The result of for the target type .
/// This method will automatically release the target COM object pointed to by , if any.
public readonly HRESULT As(ComPtr* p)
- where U : unmanaged, IUnknown.Interface
+ where U : unmanaged
{
- return ptr_->QueryInterface(__uuidof(), (void**)p->ReleaseAndGetAddressOf());
+ return ((IUnknown*)ptr_)->QueryInterface(__uuidof(), (void**)p->ReleaseAndGetAddressOf());
}
/// Converts the current object reference to type and assigns that to a target value.
@@ -66,10 +66,10 @@ namespace TerraFX.Interop.Windows
/// The result of for the target type .
/// This method will automatically release the target COM object pointed to by , if any.
public readonly HRESULT As(ref ComPtr other)
- where U : unmanaged, IUnknown.Interface
+ where U : unmanaged
{
U* ptr;
- HRESULT result = ptr_->QueryInterface(__uuidof(), (void**)&ptr);
+ HRESULT result = ((IUnknown*)ptr_)->QueryInterface(__uuidof(), (void**)&ptr);
other.Attach(ptr);
return result;
@@ -82,7 +82,7 @@ namespace TerraFX.Interop.Windows
/// This method will automatically release the target COM object pointed to by , if any.
public readonly HRESULT AsIID(Guid* riid, ComPtr* other)
{
- return ptr_->QueryInterface(riid, (void**)other->ReleaseAndGetAddressOf());
+ return ((IUnknown*)ptr_)->QueryInterface(riid, (void**)other->ReleaseAndGetAddressOf());
}
/// Converts the current object reference to a type indicated by the given IID and assigns that to a target value.
@@ -93,7 +93,7 @@ namespace TerraFX.Interop.Windows
public readonly HRESULT AsIID(Guid* riid, ref ComPtr other)
{
IUnknown* ptr;
- HRESULT result = ptr_->QueryInterface(riid, (void**)&ptr);
+ HRESULT result = ((IUnknown*)ptr_)->QueryInterface(riid, (void**)&ptr);
other.Attach(ptr);
return result;
@@ -106,7 +106,7 @@ namespace TerraFX.Interop.Windows
{
if (ptr_ != null)
{
- var @ref = ptr_->Release();
+ var @ref = ((IUnknown*)ptr_)->Release();
Debug.Assert((@ref != 0) || (ptr_ != other));
}
ptr_ = other;
@@ -156,28 +156,28 @@ namespace TerraFX.Interop.Windows
/// The target raw pointer to copy the address of the current COM object to.
/// The result of for the target type .
public readonly HRESULT CopyTo(U** ptr)
- where U : unmanaged, IUnknown.Interface
+ where U : unmanaged
{
- return ptr_->QueryInterface(__uuidof(), (void**)ptr);
+ return ((IUnknown*)ptr_)->QueryInterface(__uuidof(), (void**)ptr);
}
/// Converts the current COM object reference to a given interface type and assigns that to a target .
/// The target raw pointer to copy the address of the current COM object to.
/// The result of for the target type .
public readonly HRESULT CopyTo(ComPtr* p)
- where U : unmanaged, IUnknown.Interface
+ where U : unmanaged
{
- return ptr_->QueryInterface(__uuidof(), (void**)p->ReleaseAndGetAddressOf());
+ return ((IUnknown*)ptr_)->QueryInterface(__uuidof(), (void**)p->ReleaseAndGetAddressOf());
}
/// Converts the current COM object reference to a given interface type and assigns that to a target .
/// The target reference to copy the address of the current COM object to.
/// The result of for the target type .
public readonly HRESULT CopyTo(ref ComPtr other)
- where U : unmanaged, IUnknown.Interface
+ where U : unmanaged
{
U* ptr;
- HRESULT result = ptr_->QueryInterface(__uuidof(), (void**)&ptr);
+ HRESULT result = ((IUnknown*)ptr_)->QueryInterface(__uuidof(), (void**)&ptr);
other.Attach(ptr);
return result;
@@ -189,7 +189,7 @@ namespace TerraFX.Interop.Windows
/// The result of for the target IID.
public readonly HRESULT CopyTo(Guid* riid, void** ptr)
{
- return ptr_->QueryInterface(riid, ptr);
+ return ((IUnknown*)ptr_)->QueryInterface(riid, ptr);
}
/// Converts the current object reference to a type indicated by the given IID and assigns that to a target value.
@@ -198,7 +198,7 @@ namespace TerraFX.Interop.Windows
/// The result of for the target IID.
public readonly HRESULT CopyTo(Guid* riid, ComPtr* p)
{
- return ptr_->QueryInterface(riid, (void**)p->ReleaseAndGetAddressOf());
+ return ((IUnknown*)ptr_)->QueryInterface(riid, (void**)p->ReleaseAndGetAddressOf());
}
/// Converts the current object reference to a type indicated by the given IID and assigns that to a target value.
@@ -208,7 +208,7 @@ namespace TerraFX.Interop.Windows
public readonly HRESULT CopyTo(Guid* riid, ref ComPtr other)
{
IUnknown* ptr;
- HRESULT result = ptr_->QueryInterface(riid, (void**)&ptr);
+ HRESULT result = ((IUnknown*)ptr_)->QueryInterface(riid, (void**)&ptr);
other.Attach(ptr);
return result;
@@ -219,11 +219,11 @@ namespace TerraFX.Interop.Windows
public void Dispose()
{
T* pointer = ptr_;
-
if (pointer != null)
{
ptr_ = null;
- _ = pointer->Release();
+
+ _ = ((IUnknown*)pointer)->Release();
}
}
@@ -300,7 +300,7 @@ namespace TerraFX.Interop.Windows
if (temp != null)
{
- _ = temp->AddRef();
+ _ = ((IUnknown*)temp)->AddRef();
}
}
@@ -313,10 +313,10 @@ namespace TerraFX.Interop.Windows
if (temp != null)
{
ptr_ = null;
- @ref = temp->Release();
+ @ref = ((IUnknown*)temp)->Release();
}
return @ref;
}
}
-}
+}
\ No newline at end of file
diff --git a/src/TerraFX.Interop.Windows/DirectX/other/d3dx12/D3D12_RESOURCE_DESC.Manual.cs b/src/TerraFX.Interop.Windows/DirectX/other/d3dx12/D3D12_RESOURCE_DESC.Manual.cs
index e87dae05..8150cc56 100644
--- a/src/TerraFX.Interop.Windows/DirectX/other/d3dx12/D3D12_RESOURCE_DESC.Manual.cs
+++ b/src/TerraFX.Interop.Windows/DirectX/other/d3dx12/D3D12_RESOURCE_DESC.Manual.cs
@@ -58,21 +58,6 @@ namespace TerraFX.Interop.DirectX
public ushort ArraySize => ((Dimension != D3D12_RESOURCE_DIMENSION_TEXTURE3D) ? DepthOrArraySize : (ushort)(1));
- public byte GetPlaneCount(ID3D12Device* pDevice)
- {
- return D3D12GetFormatPlaneCount(pDevice, Format);
- }
-
- public uint GetSubresources(ID3D12Device* pDevice)
- {
- return MipLevels * (uint)ArraySize * GetPlaneCount(pDevice);
- }
-
- public uint CalcSubresource(uint MipSlice, uint ArraySlice, uint PlaneSlice)
- {
- return D3D12CalcSubresource(MipSlice, ArraySlice, PlaneSlice, MipLevels, ArraySize);
- }
-
public static bool operator ==([NativeTypeName("const D3D12_RESOURCE_DESC &")] in D3D12_RESOURCE_DESC l, [NativeTypeName("const D3D12_RESOURCE_DESC &")] in D3D12_RESOURCE_DESC r)
{
return (l.Dimension == r.Dimension)
diff --git a/src/TerraFX.Interop.Windows/DirectX/other/d3dx12/DirectX.cs b/src/TerraFX.Interop.Windows/DirectX/other/d3dx12/DirectX.cs
deleted file mode 100644
index ec19f141..00000000
--- a/src/TerraFX.Interop.Windows/DirectX/other/d3dx12/DirectX.cs
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-
-// Ported from d3dx12.h in the microsoft/DirectX-Graphics-Samples tag v10.0.19041.0
-// Original source is Copyright © Microsoft. All rights reserved. Licensed under the MIT License (MIT).
-
-using TerraFX.Interop.Windows;
-using static TerraFX.Interop.DirectX.D3D12_FEATURE;
-
-namespace TerraFX.Interop.DirectX
-{
- internal static unsafe partial class DirectX
- {
- public static uint D3D12CalcSubresource(uint MipSlice, uint ArraySlice, uint PlaneSlice, uint MipLevels, uint ArraySize)
- {
- return MipSlice + ArraySlice * MipLevels + PlaneSlice * MipLevels * ArraySize;
- }
-
- [return: NativeTypeName("UINT8")]
- public static byte D3D12GetFormatPlaneCount(ID3D12Device* pDevice, DXGI_FORMAT Format)
- {
- D3D12_FEATURE_DATA_FORMAT_INFO formatInfo = new D3D12_FEATURE_DATA_FORMAT_INFO
- {
- Format = Format,
- PlaneCount = 0,
- };
-
- if ((((HRESULT)(pDevice->CheckFeatureSupport(D3D12_FEATURE_FORMAT_INFO, &formatInfo, (uint)(sizeof(D3D12_FEATURE_DATA_FORMAT_INFO))))) < 0))
- {
- return 0;
- }
-
- return formatInfo.PlaneCount;
- }
- }
-}
diff --git a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/DXGI.cs b/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/DXGI.cs
new file mode 100644
index 00000000..7f74e299
--- /dev/null
+++ b/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/DXGI.cs
@@ -0,0 +1,103 @@
+// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
+
+// Ported from shared/dxgi.h in the Windows SDK for Windows 10.0.20348.0
+// Original source is Copyright © Microsoft. All rights reserved.
+
+namespace TerraFX.Interop.DirectX
+{
+ internal static partial class DXGI
+ {
+ [NativeTypeName("#define DXGI_USAGE_SHADER_INPUT 0x00000010UL")]
+ public const uint DXGI_USAGE_SHADER_INPUT = 0x00000010U;
+
+ [NativeTypeName("#define DXGI_USAGE_RENDER_TARGET_OUTPUT 0x00000020UL")]
+ public const uint DXGI_USAGE_RENDER_TARGET_OUTPUT = 0x00000020U;
+
+ [NativeTypeName("#define DXGI_USAGE_BACK_BUFFER 0x00000040UL")]
+ public const uint DXGI_USAGE_BACK_BUFFER = 0x00000040U;
+
+ [NativeTypeName("#define DXGI_USAGE_SHARED 0x00000080UL")]
+ public const uint DXGI_USAGE_SHARED = 0x00000080U;
+
+ [NativeTypeName("#define DXGI_USAGE_READ_ONLY 0x00000100UL")]
+ public const uint DXGI_USAGE_READ_ONLY = 0x00000100U;
+
+ [NativeTypeName("#define DXGI_USAGE_DISCARD_ON_PRESENT 0x00000200UL")]
+ public const uint DXGI_USAGE_DISCARD_ON_PRESENT = 0x00000200U;
+
+ [NativeTypeName("#define DXGI_USAGE_UNORDERED_ACCESS 0x00000400UL")]
+ public const uint DXGI_USAGE_UNORDERED_ACCESS = 0x00000400U;
+
+ [NativeTypeName("#define DXGI_RESOURCE_PRIORITY_MINIMUM ( 0x28000000 )")]
+ public const int DXGI_RESOURCE_PRIORITY_MINIMUM = (0x28000000);
+
+ [NativeTypeName("#define DXGI_RESOURCE_PRIORITY_LOW ( 0x50000000 )")]
+ public const int DXGI_RESOURCE_PRIORITY_LOW = (0x50000000);
+
+ [NativeTypeName("#define DXGI_RESOURCE_PRIORITY_NORMAL ( 0x78000000 )")]
+ public const int DXGI_RESOURCE_PRIORITY_NORMAL = (0x78000000);
+
+ [NativeTypeName("#define DXGI_RESOURCE_PRIORITY_HIGH ( 0xa0000000 )")]
+ public const uint DXGI_RESOURCE_PRIORITY_HIGH = (0xa0000000);
+
+ [NativeTypeName("#define DXGI_RESOURCE_PRIORITY_MAXIMUM ( 0xc8000000 )")]
+ public const uint DXGI_RESOURCE_PRIORITY_MAXIMUM = (0xc8000000);
+
+ [NativeTypeName("#define DXGI_MAP_READ ( 1UL )")]
+ public const uint DXGI_MAP_READ = (1U);
+
+ [NativeTypeName("#define DXGI_MAP_WRITE ( 2UL )")]
+ public const uint DXGI_MAP_WRITE = (2U);
+
+ [NativeTypeName("#define DXGI_MAP_DISCARD ( 4UL )")]
+ public const uint DXGI_MAP_DISCARD = (4U);
+
+ [NativeTypeName("#define DXGI_ENUM_MODES_INTERLACED ( 1UL )")]
+ public const uint DXGI_ENUM_MODES_INTERLACED = (1U);
+
+ [NativeTypeName("#define DXGI_ENUM_MODES_SCALING ( 2UL )")]
+ public const uint DXGI_ENUM_MODES_SCALING = (2U);
+
+ [NativeTypeName("#define DXGI_MAX_SWAP_CHAIN_BUFFERS ( 16 )")]
+ public const int DXGI_MAX_SWAP_CHAIN_BUFFERS = (16);
+
+ [NativeTypeName("#define DXGI_PRESENT_TEST 0x00000001UL")]
+ public const uint DXGI_PRESENT_TEST = 0x00000001U;
+
+ [NativeTypeName("#define DXGI_PRESENT_DO_NOT_SEQUENCE 0x00000002UL")]
+ public const uint DXGI_PRESENT_DO_NOT_SEQUENCE = 0x00000002U;
+
+ [NativeTypeName("#define DXGI_PRESENT_RESTART 0x00000004UL")]
+ public const uint DXGI_PRESENT_RESTART = 0x00000004U;
+
+ [NativeTypeName("#define DXGI_PRESENT_DO_NOT_WAIT 0x00000008UL")]
+ public const uint DXGI_PRESENT_DO_NOT_WAIT = 0x00000008U;
+
+ [NativeTypeName("#define DXGI_PRESENT_STEREO_PREFER_RIGHT 0x00000010UL")]
+ public const uint DXGI_PRESENT_STEREO_PREFER_RIGHT = 0x00000010U;
+
+ [NativeTypeName("#define DXGI_PRESENT_STEREO_TEMPORARY_MONO 0x00000020UL")]
+ public const uint DXGI_PRESENT_STEREO_TEMPORARY_MONO = 0x00000020U;
+
+ [NativeTypeName("#define DXGI_PRESENT_RESTRICT_TO_OUTPUT 0x00000040UL")]
+ public const uint DXGI_PRESENT_RESTRICT_TO_OUTPUT = 0x00000040U;
+
+ [NativeTypeName("#define DXGI_PRESENT_USE_DURATION 0x00000100UL")]
+ public const uint DXGI_PRESENT_USE_DURATION = 0x00000100U;
+
+ [NativeTypeName("#define DXGI_PRESENT_ALLOW_TEARING 0x00000200UL")]
+ public const uint DXGI_PRESENT_ALLOW_TEARING = 0x00000200U;
+
+ [NativeTypeName("#define DXGI_MWA_NO_WINDOW_CHANGES ( 1 << 0 )")]
+ public const int DXGI_MWA_NO_WINDOW_CHANGES = (1 << 0);
+
+ [NativeTypeName("#define DXGI_MWA_NO_ALT_ENTER ( 1 << 1 )")]
+ public const int DXGI_MWA_NO_ALT_ENTER = (1 << 1);
+
+ [NativeTypeName("#define DXGI_MWA_NO_PRINT_SCREEN ( 1 << 2 )")]
+ public const int DXGI_MWA_NO_PRINT_SCREEN = (1 << 2);
+
+ [NativeTypeName("#define DXGI_MWA_VALID ( 0x7 )")]
+ public const int DXGI_MWA_VALID = (0x7);
+ }
+}
diff --git a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/DXGI_FRAME_STATISTICS.cs b/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/DXGI_FRAME_STATISTICS.cs
deleted file mode 100644
index 02d072e3..00000000
--- a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/DXGI_FRAME_STATISTICS.cs
+++ /dev/null
@@ -1,22 +0,0 @@
-// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-
-// Ported from shared/dxgi.h in the Windows SDK for Windows 10.0.20348.0
-// Original source is Copyright © Microsoft. All rights reserved.
-
-using TerraFX.Interop.Windows;
-
-namespace TerraFX.Interop.DirectX
-{
- internal partial struct DXGI_FRAME_STATISTICS
- {
- public uint PresentCount;
-
- public uint PresentRefreshCount;
-
- public uint SyncRefreshCount;
-
- public LARGE_INTEGER SyncQPCTime;
-
- public LARGE_INTEGER SyncGPUTime;
- }
-}
diff --git a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/DXGI_MAPPED_RECT.cs b/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/DXGI_MAPPED_RECT.cs
deleted file mode 100644
index 3e442232..00000000
--- a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/DXGI_MAPPED_RECT.cs
+++ /dev/null
@@ -1,14 +0,0 @@
-// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-
-// Ported from shared/dxgi.h in the Windows SDK for Windows 10.0.20348.0
-// Original source is Copyright © Microsoft. All rights reserved.
-
-namespace TerraFX.Interop.DirectX
-{
- internal unsafe partial struct DXGI_MAPPED_RECT
- {
- public int Pitch;
-
- public byte* pBits;
- }
-}
diff --git a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/DXGI_OUTPUT_DESC.cs b/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/DXGI_OUTPUT_DESC.cs
deleted file mode 100644
index 668a3b00..00000000
--- a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/DXGI_OUTPUT_DESC.cs
+++ /dev/null
@@ -1,23 +0,0 @@
-// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-
-// Ported from shared/dxgi.h in the Windows SDK for Windows 10.0.20348.0
-// Original source is Copyright © Microsoft. All rights reserved.
-
-using TerraFX.Interop.Windows;
-
-namespace TerraFX.Interop.DirectX
-{
- internal unsafe partial struct DXGI_OUTPUT_DESC
- {
- [NativeTypeName("WCHAR [32]")]
- public fixed ushort DeviceName[32];
-
- public RECT DesktopCoordinates;
-
- public BOOL AttachedToDesktop;
-
- public DXGI_MODE_ROTATION Rotation;
-
- public HMONITOR Monitor;
- }
-}
diff --git a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/DXGI_SURFACE_DESC.cs b/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/DXGI_SURFACE_DESC.cs
deleted file mode 100644
index 19cb2efc..00000000
--- a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/DXGI_SURFACE_DESC.cs
+++ /dev/null
@@ -1,18 +0,0 @@
-// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-
-// Ported from shared/dxgi.h in the Windows SDK for Windows 10.0.20348.0
-// Original source is Copyright © Microsoft. All rights reserved.
-
-namespace TerraFX.Interop.DirectX
-{
- internal partial struct DXGI_SURFACE_DESC
- {
- public uint Width;
-
- public uint Height;
-
- public DXGI_FORMAT Format;
-
- public DXGI_SAMPLE_DESC SampleDesc;
- }
-}
diff --git a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/DXGI_SWAP_CHAIN_DESC.cs b/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/DXGI_SWAP_CHAIN_DESC.cs
deleted file mode 100644
index dba3b686..00000000
--- a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/DXGI_SWAP_CHAIN_DESC.cs
+++ /dev/null
@@ -1,29 +0,0 @@
-// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-
-// Ported from shared/dxgi.h in the Windows SDK for Windows 10.0.20348.0
-// Original source is Copyright © Microsoft. All rights reserved.
-
-using TerraFX.Interop.Windows;
-
-namespace TerraFX.Interop.DirectX
-{
- internal partial struct DXGI_SWAP_CHAIN_DESC
- {
- public DXGI_MODE_DESC BufferDesc;
-
- public DXGI_SAMPLE_DESC SampleDesc;
-
- [NativeTypeName("DXGI_USAGE")]
- public uint BufferUsage;
-
- public uint BufferCount;
-
- public HWND OutputWindow;
-
- public BOOL Windowed;
-
- public DXGI_SWAP_EFFECT SwapEffect;
-
- public uint Flags;
- }
-}
diff --git a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/DXGI_SWAP_CHAIN_FLAG.cs b/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/DXGI_SWAP_CHAIN_FLAG.cs
new file mode 100644
index 00000000..16968bd2
--- /dev/null
+++ b/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/DXGI_SWAP_CHAIN_FLAG.cs
@@ -0,0 +1,27 @@
+// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
+
+// Ported from shared/dxgi.h in the Windows SDK for Windows 10.0.20348.0
+// Original source is Copyright © Microsoft. All rights reserved.
+
+using System;
+
+namespace TerraFX.Interop.DirectX
+{
+ [Flags]
+ internal enum DXGI_SWAP_CHAIN_FLAG
+ {
+ DXGI_SWAP_CHAIN_FLAG_NONPREROTATED = 1,
+ DXGI_SWAP_CHAIN_FLAG_ALLOW_MODE_SWITCH = 2,
+ DXGI_SWAP_CHAIN_FLAG_GDI_COMPATIBLE = 4,
+ DXGI_SWAP_CHAIN_FLAG_RESTRICTED_CONTENT = 8,
+ DXGI_SWAP_CHAIN_FLAG_RESTRICT_SHARED_RESOURCE_DRIVER = 16,
+ DXGI_SWAP_CHAIN_FLAG_DISPLAY_ONLY = 32,
+ DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT = 64,
+ DXGI_SWAP_CHAIN_FLAG_FOREGROUND_LAYER = 128,
+ DXGI_SWAP_CHAIN_FLAG_FULLSCREEN_VIDEO = 256,
+ DXGI_SWAP_CHAIN_FLAG_YUV_VIDEO = 512,
+ DXGI_SWAP_CHAIN_FLAG_HW_PROTECTED = 1024,
+ DXGI_SWAP_CHAIN_FLAG_ALLOW_TEARING = 2048,
+ DXGI_SWAP_CHAIN_FLAG_RESTRICTED_TO_ALL_HOLOGRAPHIC_DISPLAYS = 4096,
+ }
+}
diff --git a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/IDXGIAdapter.cs b/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/IDXGIAdapter.cs
index c9776b48..c33669e3 100644
--- a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/IDXGIAdapter.cs
+++ b/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/IDXGIAdapter.cs
@@ -13,7 +13,7 @@ namespace TerraFX.Interop.DirectX
[Guid("2411E7E1-12AC-4CCF-BD14-9798E8534DC0")]
[NativeTypeName("struct IDXGIAdapter : IDXGIObject")]
[NativeInheritance("IDXGIObject")]
- internal unsafe partial struct IDXGIAdapter : IDXGIAdapter.Interface
+ internal unsafe partial struct IDXGIAdapter
{
public void** lpVtbl;
@@ -88,50 +88,5 @@ namespace TerraFX.Interop.DirectX
{
return ((delegate* unmanaged[Stdcall])(lpVtbl[9]))((IDXGIAdapter*)Unsafe.AsPointer(ref this), InterfaceName, pUMDVersion);
}
-
- public interface Interface : IDXGIObject.Interface
- {
- [VtblIndex(7)]
- HRESULT EnumOutputs(uint Output, IDXGIOutput** ppOutput);
-
- [VtblIndex(8)]
- HRESULT GetDesc(DXGI_ADAPTER_DESC* pDesc);
-
- [VtblIndex(9)]
- HRESULT CheckInterfaceSupport([NativeTypeName("const GUID &")] Guid* InterfaceName, LARGE_INTEGER* pUMDVersion);
- }
-
- internal partial struct Vtbl
- {
- [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] QueryInterface;
-
- [NativeTypeName("ULONG () __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] AddRef;
-
- [NativeTypeName("ULONG () __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] Release;
-
- [NativeTypeName("HRESULT (const GUID &, UINT, const void *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] SetPrivateData;
-
- [NativeTypeName("HRESULT (const GUID &, const IUnknown *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] SetPrivateDataInterface;
-
- [NativeTypeName("HRESULT (const GUID &, UINT *, void *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetPrivateData;
-
- [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetParent;
-
- [NativeTypeName("HRESULT (UINT, IDXGIOutput **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] EnumOutputs;
-
- [NativeTypeName("HRESULT (DXGI_ADAPTER_DESC *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetDesc;
-
- [NativeTypeName("HRESULT (const GUID &, LARGE_INTEGER *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] CheckInterfaceSupport;
- }
}
}
diff --git a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/IDXGIAdapter1.cs b/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/IDXGIAdapter1.cs
index 56a7c0b2..505a0501 100644
--- a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/IDXGIAdapter1.cs
+++ b/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/IDXGIAdapter1.cs
@@ -13,7 +13,7 @@ namespace TerraFX.Interop.DirectX
[Guid("29038F61-3839-4626-91FD-086879011A05")]
[NativeTypeName("struct IDXGIAdapter1 : IDXGIAdapter")]
[NativeInheritance("IDXGIAdapter")]
- internal unsafe partial struct IDXGIAdapter1 : IDXGIAdapter1.Interface
+ internal unsafe partial struct IDXGIAdapter1
{
public void** lpVtbl;
@@ -95,47 +95,5 @@ namespace TerraFX.Interop.DirectX
{
return ((delegate* unmanaged[Stdcall])(lpVtbl[10]))((IDXGIAdapter1*)Unsafe.AsPointer(ref this), pDesc);
}
-
- public interface Interface : IDXGIAdapter.Interface
- {
- [VtblIndex(10)]
- HRESULT GetDesc1(DXGI_ADAPTER_DESC1* pDesc);
- }
-
- internal partial struct Vtbl
- {
- [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] QueryInterface;
-
- [NativeTypeName("ULONG () __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] AddRef;
-
- [NativeTypeName("ULONG () __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] Release;
-
- [NativeTypeName("HRESULT (const GUID &, UINT, const void *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] SetPrivateData;
-
- [NativeTypeName("HRESULT (const GUID &, const IUnknown *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] SetPrivateDataInterface;
-
- [NativeTypeName("HRESULT (const GUID &, UINT *, void *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetPrivateData;
-
- [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetParent;
-
- [NativeTypeName("HRESULT (UINT, IDXGIOutput **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] EnumOutputs;
-
- [NativeTypeName("HRESULT (DXGI_ADAPTER_DESC *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetDesc;
-
- [NativeTypeName("HRESULT (const GUID &, LARGE_INTEGER *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] CheckInterfaceSupport;
-
- [NativeTypeName("HRESULT (DXGI_ADAPTER_DESC1 *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetDesc1;
- }
}
}
diff --git a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/IDXGIDeviceSubObject.cs b/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/IDXGIDeviceSubObject.cs
deleted file mode 100644
index 6559b7a8..00000000
--- a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/IDXGIDeviceSubObject.cs
+++ /dev/null
@@ -1,111 +0,0 @@
-// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-
-// Ported from shared/dxgi.h in the Windows SDK for Windows 10.0.20348.0
-// Original source is Copyright © Microsoft. All rights reserved.
-
-using System;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using TerraFX.Interop.Windows;
-
-namespace TerraFX.Interop.DirectX
-{
- [Guid("3D3E0379-F9DE-4D58-BB6C-18D62992F1A6")]
- [NativeTypeName("struct IDXGIDeviceSubObject : IDXGIObject")]
- [NativeInheritance("IDXGIObject")]
- internal unsafe partial struct IDXGIDeviceSubObject : IDXGIDeviceSubObject.Interface
- {
- public void** lpVtbl;
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(0)]
- public HRESULT QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[0]))((IDXGIDeviceSubObject*)Unsafe.AsPointer(ref this), riid, ppvObject);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(1)]
- [return: NativeTypeName("ULONG")]
- public uint AddRef()
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[1]))((IDXGIDeviceSubObject*)Unsafe.AsPointer(ref this));
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(2)]
- [return: NativeTypeName("ULONG")]
- public uint Release()
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[2]))((IDXGIDeviceSubObject*)Unsafe.AsPointer(ref this));
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(3)]
- public HRESULT SetPrivateData([NativeTypeName("const GUID &")] Guid* Name, uint DataSize, [NativeTypeName("const void *")] void* pData)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[3]))((IDXGIDeviceSubObject*)Unsafe.AsPointer(ref this), Name, DataSize, pData);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(4)]
- public HRESULT SetPrivateDataInterface([NativeTypeName("const GUID &")] Guid* Name, [NativeTypeName("const IUnknown *")] IUnknown* pUnknown)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[4]))((IDXGIDeviceSubObject*)Unsafe.AsPointer(ref this), Name, pUnknown);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(5)]
- public HRESULT GetPrivateData([NativeTypeName("const GUID &")] Guid* Name, uint* pDataSize, void* pData)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[5]))((IDXGIDeviceSubObject*)Unsafe.AsPointer(ref this), Name, pDataSize, pData);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(6)]
- public HRESULT GetParent([NativeTypeName("const IID &")] Guid* riid, void** ppParent)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[6]))((IDXGIDeviceSubObject*)Unsafe.AsPointer(ref this), riid, ppParent);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(7)]
- public HRESULT GetDevice([NativeTypeName("const IID &")] Guid* riid, void** ppDevice)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[7]))((IDXGIDeviceSubObject*)Unsafe.AsPointer(ref this), riid, ppDevice);
- }
-
- public interface Interface : IDXGIObject.Interface
- {
- [VtblIndex(7)]
- HRESULT GetDevice([NativeTypeName("const IID &")] Guid* riid, void** ppDevice);
- }
-
- internal partial struct Vtbl
- {
- [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] QueryInterface;
-
- [NativeTypeName("ULONG () __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] AddRef;
-
- [NativeTypeName("ULONG () __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] Release;
-
- [NativeTypeName("HRESULT (const GUID &, UINT, const void *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] SetPrivateData;
-
- [NativeTypeName("HRESULT (const GUID &, const IUnknown *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] SetPrivateDataInterface;
-
- [NativeTypeName("HRESULT (const GUID &, UINT *, void *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetPrivateData;
-
- [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetParent;
-
- [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetDevice;
- }
- }
-}
diff --git a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/IDXGIFactory.cs b/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/IDXGIFactory.cs
index 20398d23..aa9bda1f 100644
--- a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/IDXGIFactory.cs
+++ b/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/IDXGIFactory.cs
@@ -13,7 +13,7 @@ namespace TerraFX.Interop.DirectX
[Guid("7B7166EC-21C7-44AE-B21A-C9AE321AE369")]
[NativeTypeName("struct IDXGIFactory : IDXGIObject")]
[NativeInheritance("IDXGIObject")]
- internal unsafe partial struct IDXGIFactory : IDXGIFactory.Interface
+ internal unsafe partial struct IDXGIFactory
{
public void** lpVtbl;
@@ -39,125 +39,5 @@ namespace TerraFX.Interop.DirectX
{
return ((delegate* unmanaged[Stdcall])(lpVtbl[2]))((IDXGIFactory*)Unsafe.AsPointer(ref this));
}
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(3)]
- public HRESULT SetPrivateData([NativeTypeName("const GUID &")] Guid* Name, uint DataSize, [NativeTypeName("const void *")] void* pData)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[3]))((IDXGIFactory*)Unsafe.AsPointer(ref this), Name, DataSize, pData);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(4)]
- public HRESULT SetPrivateDataInterface([NativeTypeName("const GUID &")] Guid* Name, [NativeTypeName("const IUnknown *")] IUnknown* pUnknown)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[4]))((IDXGIFactory*)Unsafe.AsPointer(ref this), Name, pUnknown);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(5)]
- public HRESULT GetPrivateData([NativeTypeName("const GUID &")] Guid* Name, uint* pDataSize, void* pData)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[5]))((IDXGIFactory*)Unsafe.AsPointer(ref this), Name, pDataSize, pData);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(6)]
- public HRESULT GetParent([NativeTypeName("const IID &")] Guid* riid, void** ppParent)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[6]))((IDXGIFactory*)Unsafe.AsPointer(ref this), riid, ppParent);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(7)]
- public HRESULT EnumAdapters(uint Adapter, IDXGIAdapter** ppAdapter)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[7]))((IDXGIFactory*)Unsafe.AsPointer(ref this), Adapter, ppAdapter);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(8)]
- public HRESULT MakeWindowAssociation(HWND WindowHandle, uint Flags)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[8]))((IDXGIFactory*)Unsafe.AsPointer(ref this), WindowHandle, Flags);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(9)]
- public HRESULT GetWindowAssociation(HWND* pWindowHandle)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[9]))((IDXGIFactory*)Unsafe.AsPointer(ref this), pWindowHandle);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(10)]
- public HRESULT CreateSwapChain(IUnknown* pDevice, DXGI_SWAP_CHAIN_DESC* pDesc, IDXGISwapChain** ppSwapChain)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[10]))((IDXGIFactory*)Unsafe.AsPointer(ref this), pDevice, pDesc, ppSwapChain);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(11)]
- public HRESULT CreateSoftwareAdapter(HMODULE Module, IDXGIAdapter** ppAdapter)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[11]))((IDXGIFactory*)Unsafe.AsPointer(ref this), Module, ppAdapter);
- }
-
- public interface Interface : IDXGIObject.Interface
- {
- [VtblIndex(7)]
- HRESULT EnumAdapters(uint Adapter, IDXGIAdapter** ppAdapter);
-
- [VtblIndex(8)]
- HRESULT MakeWindowAssociation(HWND WindowHandle, uint Flags);
-
- [VtblIndex(9)]
- HRESULT GetWindowAssociation(HWND* pWindowHandle);
-
- [VtblIndex(10)]
- HRESULT CreateSwapChain(IUnknown* pDevice, DXGI_SWAP_CHAIN_DESC* pDesc, IDXGISwapChain** ppSwapChain);
-
- [VtblIndex(11)]
- HRESULT CreateSoftwareAdapter(HMODULE Module, IDXGIAdapter** ppAdapter);
- }
-
- internal partial struct Vtbl
- {
- [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] QueryInterface;
-
- [NativeTypeName("ULONG () __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] AddRef;
-
- [NativeTypeName("ULONG () __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] Release;
-
- [NativeTypeName("HRESULT (const GUID &, UINT, const void *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] SetPrivateData;
-
- [NativeTypeName("HRESULT (const GUID &, const IUnknown *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] SetPrivateDataInterface;
-
- [NativeTypeName("HRESULT (const GUID &, UINT *, void *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetPrivateData;
-
- [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetParent;
-
- [NativeTypeName("HRESULT (UINT, IDXGIAdapter **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] EnumAdapters;
-
- [NativeTypeName("HRESULT (HWND, UINT) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] MakeWindowAssociation;
-
- [NativeTypeName("HRESULT (HWND *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetWindowAssociation;
-
- [NativeTypeName("HRESULT (IUnknown *, DXGI_SWAP_CHAIN_DESC *, IDXGISwapChain **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] CreateSwapChain;
-
- [NativeTypeName("HRESULT (HMODULE, IDXGIAdapter **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] CreateSoftwareAdapter;
- }
}
}
diff --git a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/IDXGIFactory1.cs b/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/IDXGIFactory1.cs
deleted file mode 100644
index e72ddbef..00000000
--- a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/IDXGIFactory1.cs
+++ /dev/null
@@ -1,174 +0,0 @@
-// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-
-// Ported from shared/dxgi.h in the Windows SDK for Windows 10.0.20348.0
-// Original source is Copyright © Microsoft. All rights reserved.
-
-using System;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using TerraFX.Interop.Windows;
-
-namespace TerraFX.Interop.DirectX
-{
- [Guid("770AAE78-F26F-4DBA-A829-253C83D1B387")]
- [NativeTypeName("struct IDXGIFactory1 : IDXGIFactory")]
- [NativeInheritance("IDXGIFactory")]
- internal unsafe partial struct IDXGIFactory1 : IDXGIFactory1.Interface
- {
- public void** lpVtbl;
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(0)]
- public HRESULT QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[0]))((IDXGIFactory1*)Unsafe.AsPointer(ref this), riid, ppvObject);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(1)]
- [return: NativeTypeName("ULONG")]
- public uint AddRef()
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[1]))((IDXGIFactory1*)Unsafe.AsPointer(ref this));
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(2)]
- [return: NativeTypeName("ULONG")]
- public uint Release()
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[2]))((IDXGIFactory1*)Unsafe.AsPointer(ref this));
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(3)]
- public HRESULT SetPrivateData([NativeTypeName("const GUID &")] Guid* Name, uint DataSize, [NativeTypeName("const void *")] void* pData)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[3]))((IDXGIFactory1*)Unsafe.AsPointer(ref this), Name, DataSize, pData);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(4)]
- public HRESULT SetPrivateDataInterface([NativeTypeName("const GUID &")] Guid* Name, [NativeTypeName("const IUnknown *")] IUnknown* pUnknown)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[4]))((IDXGIFactory1*)Unsafe.AsPointer(ref this), Name, pUnknown);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(5)]
- public HRESULT GetPrivateData([NativeTypeName("const GUID &")] Guid* Name, uint* pDataSize, void* pData)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[5]))((IDXGIFactory1*)Unsafe.AsPointer(ref this), Name, pDataSize, pData);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(6)]
- public HRESULT GetParent([NativeTypeName("const IID &")] Guid* riid, void** ppParent)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[6]))((IDXGIFactory1*)Unsafe.AsPointer(ref this), riid, ppParent);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(7)]
- public HRESULT EnumAdapters(uint Adapter, IDXGIAdapter** ppAdapter)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[7]))((IDXGIFactory1*)Unsafe.AsPointer(ref this), Adapter, ppAdapter);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(8)]
- public HRESULT MakeWindowAssociation(HWND WindowHandle, uint Flags)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[8]))((IDXGIFactory1*)Unsafe.AsPointer(ref this), WindowHandle, Flags);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(9)]
- public HRESULT GetWindowAssociation(HWND* pWindowHandle)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[9]))((IDXGIFactory1*)Unsafe.AsPointer(ref this), pWindowHandle);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(10)]
- public HRESULT CreateSwapChain(IUnknown* pDevice, DXGI_SWAP_CHAIN_DESC* pDesc, IDXGISwapChain** ppSwapChain)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[10]))((IDXGIFactory1*)Unsafe.AsPointer(ref this), pDevice, pDesc, ppSwapChain);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(11)]
- public HRESULT CreateSoftwareAdapter(HMODULE Module, IDXGIAdapter** ppAdapter)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[11]))((IDXGIFactory1*)Unsafe.AsPointer(ref this), Module, ppAdapter);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(12)]
- public HRESULT EnumAdapters1(uint Adapter, IDXGIAdapter1** ppAdapter)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[12]))((IDXGIFactory1*)Unsafe.AsPointer(ref this), Adapter, ppAdapter);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(13)]
- public BOOL IsCurrent()
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[13]))((IDXGIFactory1*)Unsafe.AsPointer(ref this));
- }
-
- public interface Interface : IDXGIFactory.Interface
- {
- [VtblIndex(12)]
- HRESULT EnumAdapters1(uint Adapter, IDXGIAdapter1** ppAdapter);
-
- [VtblIndex(13)]
- BOOL IsCurrent();
- }
-
- internal partial struct Vtbl
- {
- [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] QueryInterface;
-
- [NativeTypeName("ULONG () __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] AddRef;
-
- [NativeTypeName("ULONG () __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] Release;
-
- [NativeTypeName("HRESULT (const GUID &, UINT, const void *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] SetPrivateData;
-
- [NativeTypeName("HRESULT (const GUID &, const IUnknown *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] SetPrivateDataInterface;
-
- [NativeTypeName("HRESULT (const GUID &, UINT *, void *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetPrivateData;
-
- [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetParent;
-
- [NativeTypeName("HRESULT (UINT, IDXGIAdapter **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] EnumAdapters;
-
- [NativeTypeName("HRESULT (HWND, UINT) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] MakeWindowAssociation;
-
- [NativeTypeName("HRESULT (HWND *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetWindowAssociation;
-
- [NativeTypeName("HRESULT (IUnknown *, DXGI_SWAP_CHAIN_DESC *, IDXGISwapChain **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] CreateSwapChain;
-
- [NativeTypeName("HRESULT (HMODULE, IDXGIAdapter **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] CreateSoftwareAdapter;
-
- [NativeTypeName("HRESULT (UINT, IDXGIAdapter1 **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] EnumAdapters1;
-
- [NativeTypeName("BOOL () __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] IsCurrent;
- }
- }
-}
diff --git a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/IDXGIObject.cs b/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/IDXGIObject.cs
deleted file mode 100644
index 8d459c92..00000000
--- a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/IDXGIObject.cs
+++ /dev/null
@@ -1,110 +0,0 @@
-// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-
-// Ported from shared/dxgi.h in the Windows SDK for Windows 10.0.20348.0
-// Original source is Copyright © Microsoft. All rights reserved.
-
-using System;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using TerraFX.Interop.Windows;
-
-namespace TerraFX.Interop.DirectX
-{
- [Guid("AEC22FB8-76F3-4639-9BE0-28EB43A67A2E")]
- [NativeTypeName("struct IDXGIObject : IUnknown")]
- [NativeInheritance("IUnknown")]
- internal unsafe partial struct IDXGIObject : IDXGIObject.Interface
- {
- public void** lpVtbl;
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(0)]
- public HRESULT QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[0]))((IDXGIObject*)Unsafe.AsPointer(ref this), riid, ppvObject);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(1)]
- [return: NativeTypeName("ULONG")]
- public uint AddRef()
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[1]))((IDXGIObject*)Unsafe.AsPointer(ref this));
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(2)]
- [return: NativeTypeName("ULONG")]
- public uint Release()
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[2]))((IDXGIObject*)Unsafe.AsPointer(ref this));
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(3)]
- public HRESULT SetPrivateData([NativeTypeName("const GUID &")] Guid* Name, uint DataSize, [NativeTypeName("const void *")] void* pData)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[3]))((IDXGIObject*)Unsafe.AsPointer(ref this), Name, DataSize, pData);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(4)]
- public HRESULT SetPrivateDataInterface([NativeTypeName("const GUID &")] Guid* Name, [NativeTypeName("const IUnknown *")] IUnknown* pUnknown)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[4]))((IDXGIObject*)Unsafe.AsPointer(ref this), Name, pUnknown);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(5)]
- public HRESULT GetPrivateData([NativeTypeName("const GUID &")] Guid* Name, uint* pDataSize, void* pData)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[5]))((IDXGIObject*)Unsafe.AsPointer(ref this), Name, pDataSize, pData);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(6)]
- public HRESULT GetParent([NativeTypeName("const IID &")] Guid* riid, void** ppParent)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[6]))((IDXGIObject*)Unsafe.AsPointer(ref this), riid, ppParent);
- }
-
- public interface Interface : IUnknown.Interface
- {
- [VtblIndex(3)]
- HRESULT SetPrivateData([NativeTypeName("const GUID &")] Guid* Name, uint DataSize, [NativeTypeName("const void *")] void* pData);
-
- [VtblIndex(4)]
- HRESULT SetPrivateDataInterface([NativeTypeName("const GUID &")] Guid* Name, [NativeTypeName("const IUnknown *")] IUnknown* pUnknown);
-
- [VtblIndex(5)]
- HRESULT GetPrivateData([NativeTypeName("const GUID &")] Guid* Name, uint* pDataSize, void* pData);
-
- [VtblIndex(6)]
- HRESULT GetParent([NativeTypeName("const IID &")] Guid* riid, void** ppParent);
- }
-
- internal partial struct Vtbl
- {
- [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] QueryInterface;
-
- [NativeTypeName("ULONG () __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] AddRef;
-
- [NativeTypeName("ULONG () __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] Release;
-
- [NativeTypeName("HRESULT (const GUID &, UINT, const void *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] SetPrivateData;
-
- [NativeTypeName("HRESULT (const GUID &, const IUnknown *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] SetPrivateDataInterface;
-
- [NativeTypeName("HRESULT (const GUID &, UINT *, void *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetPrivateData;
-
- [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetParent;
- }
- }
-}
diff --git a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/IDXGIOutput.cs b/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/IDXGIOutput.cs
index be59812a..d2593375 100644
--- a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/IDXGIOutput.cs
+++ b/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/IDXGIOutput.cs
@@ -13,7 +13,7 @@ namespace TerraFX.Interop.DirectX
[Guid("AE02EEDB-C735-4690-8D52-5A8DC20213AA")]
[NativeTypeName("struct IDXGIOutput : IDXGIObject")]
[NativeInheritance("IDXGIObject")]
- internal unsafe partial struct IDXGIOutput : IDXGIOutput.Interface
+ internal unsafe partial struct IDXGIOutput
{
public void** lpVtbl;
@@ -39,216 +39,5 @@ namespace TerraFX.Interop.DirectX
{
return ((delegate* unmanaged[Stdcall])(lpVtbl[2]))((IDXGIOutput*)Unsafe.AsPointer(ref this));
}
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(3)]
- public HRESULT SetPrivateData([NativeTypeName("const GUID &")] Guid* Name, uint DataSize, [NativeTypeName("const void *")] void* pData)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[3]))((IDXGIOutput*)Unsafe.AsPointer(ref this), Name, DataSize, pData);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(4)]
- public HRESULT SetPrivateDataInterface([NativeTypeName("const GUID &")] Guid* Name, [NativeTypeName("const IUnknown *")] IUnknown* pUnknown)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[4]))((IDXGIOutput*)Unsafe.AsPointer(ref this), Name, pUnknown);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(5)]
- public HRESULT GetPrivateData([NativeTypeName("const GUID &")] Guid* Name, uint* pDataSize, void* pData)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[5]))((IDXGIOutput*)Unsafe.AsPointer(ref this), Name, pDataSize, pData);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(6)]
- public HRESULT GetParent([NativeTypeName("const IID &")] Guid* riid, void** ppParent)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[6]))((IDXGIOutput*)Unsafe.AsPointer(ref this), riid, ppParent);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(7)]
- public HRESULT GetDesc(DXGI_OUTPUT_DESC* pDesc)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[7]))((IDXGIOutput*)Unsafe.AsPointer(ref this), pDesc);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(8)]
- public HRESULT GetDisplayModeList(DXGI_FORMAT EnumFormat, uint Flags, uint* pNumModes, DXGI_MODE_DESC* pDesc)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[8]))((IDXGIOutput*)Unsafe.AsPointer(ref this), EnumFormat, Flags, pNumModes, pDesc);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(9)]
- public HRESULT FindClosestMatchingMode([NativeTypeName("const DXGI_MODE_DESC *")] DXGI_MODE_DESC* pModeToMatch, DXGI_MODE_DESC* pClosestMatch, IUnknown* pConcernedDevice)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[9]))((IDXGIOutput*)Unsafe.AsPointer(ref this), pModeToMatch, pClosestMatch, pConcernedDevice);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(10)]
- public HRESULT WaitForVBlank()
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[10]))((IDXGIOutput*)Unsafe.AsPointer(ref this));
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(11)]
- public HRESULT TakeOwnership(IUnknown* pDevice, BOOL Exclusive)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[11]))((IDXGIOutput*)Unsafe.AsPointer(ref this), pDevice, Exclusive);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(12)]
- public void ReleaseOwnership()
- {
- ((delegate* unmanaged[Stdcall])(lpVtbl[12]))((IDXGIOutput*)Unsafe.AsPointer(ref this));
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(13)]
- public HRESULT GetGammaControlCapabilities(DXGI_GAMMA_CONTROL_CAPABILITIES* pGammaCaps)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[13]))((IDXGIOutput*)Unsafe.AsPointer(ref this), pGammaCaps);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(14)]
- public HRESULT SetGammaControl([NativeTypeName("const DXGI_GAMMA_CONTROL *")] DXGI_GAMMA_CONTROL* pArray)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[14]))((IDXGIOutput*)Unsafe.AsPointer(ref this), pArray);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(15)]
- public HRESULT GetGammaControl(DXGI_GAMMA_CONTROL* pArray)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[15]))((IDXGIOutput*)Unsafe.AsPointer(ref this), pArray);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(16)]
- public HRESULT SetDisplaySurface(IDXGISurface* pScanoutSurface)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[16]))((IDXGIOutput*)Unsafe.AsPointer(ref this), pScanoutSurface);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(17)]
- public HRESULT GetDisplaySurfaceData(IDXGISurface* pDestination)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[17]))((IDXGIOutput*)Unsafe.AsPointer(ref this), pDestination);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(18)]
- public HRESULT GetFrameStatistics(DXGI_FRAME_STATISTICS* pStats)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[18]))((IDXGIOutput*)Unsafe.AsPointer(ref this), pStats);
- }
-
- public interface Interface : IDXGIObject.Interface
- {
- [VtblIndex(7)]
- HRESULT GetDesc(DXGI_OUTPUT_DESC* pDesc);
-
- [VtblIndex(8)]
- HRESULT GetDisplayModeList(DXGI_FORMAT EnumFormat, uint Flags, uint* pNumModes, DXGI_MODE_DESC* pDesc);
-
- [VtblIndex(9)]
- HRESULT FindClosestMatchingMode([NativeTypeName("const DXGI_MODE_DESC *")] DXGI_MODE_DESC* pModeToMatch, DXGI_MODE_DESC* pClosestMatch, IUnknown* pConcernedDevice);
-
- [VtblIndex(10)]
- HRESULT WaitForVBlank();
-
- [VtblIndex(11)]
- HRESULT TakeOwnership(IUnknown* pDevice, BOOL Exclusive);
-
- [VtblIndex(12)]
- void ReleaseOwnership();
-
- [VtblIndex(13)]
- HRESULT GetGammaControlCapabilities(DXGI_GAMMA_CONTROL_CAPABILITIES* pGammaCaps);
-
- [VtblIndex(14)]
- HRESULT SetGammaControl([NativeTypeName("const DXGI_GAMMA_CONTROL *")] DXGI_GAMMA_CONTROL* pArray);
-
- [VtblIndex(15)]
- HRESULT GetGammaControl(DXGI_GAMMA_CONTROL* pArray);
-
- [VtblIndex(16)]
- HRESULT SetDisplaySurface(IDXGISurface* pScanoutSurface);
-
- [VtblIndex(17)]
- HRESULT GetDisplaySurfaceData(IDXGISurface* pDestination);
-
- [VtblIndex(18)]
- HRESULT GetFrameStatistics(DXGI_FRAME_STATISTICS* pStats);
- }
-
- internal partial struct Vtbl
- {
- [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] QueryInterface;
-
- [NativeTypeName("ULONG () __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] AddRef;
-
- [NativeTypeName("ULONG () __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] Release;
-
- [NativeTypeName("HRESULT (const GUID &, UINT, const void *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] SetPrivateData;
-
- [NativeTypeName("HRESULT (const GUID &, const IUnknown *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] SetPrivateDataInterface;
-
- [NativeTypeName("HRESULT (const GUID &, UINT *, void *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetPrivateData;
-
- [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetParent;
-
- [NativeTypeName("HRESULT (DXGI_OUTPUT_DESC *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetDesc;
-
- [NativeTypeName("HRESULT (DXGI_FORMAT, UINT, UINT *, DXGI_MODE_DESC *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetDisplayModeList;
-
- [NativeTypeName("HRESULT (const DXGI_MODE_DESC *, DXGI_MODE_DESC *, IUnknown *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] FindClosestMatchingMode;
-
- [NativeTypeName("HRESULT () __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] WaitForVBlank;
-
- [NativeTypeName("HRESULT (IUnknown *, BOOL) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] TakeOwnership;
-
- [NativeTypeName("void () __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] ReleaseOwnership;
-
- [NativeTypeName("HRESULT (DXGI_GAMMA_CONTROL_CAPABILITIES *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetGammaControlCapabilities;
-
- [NativeTypeName("HRESULT (const DXGI_GAMMA_CONTROL *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] SetGammaControl;
-
- [NativeTypeName("HRESULT (DXGI_GAMMA_CONTROL *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetGammaControl;
-
- [NativeTypeName("HRESULT (IDXGISurface *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] SetDisplaySurface;
-
- [NativeTypeName("HRESULT (IDXGISurface *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetDisplaySurfaceData;
-
- [NativeTypeName("HRESULT (DXGI_FRAME_STATISTICS *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetFrameStatistics;
- }
}
}
diff --git a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/IDXGISurface.cs b/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/IDXGISurface.cs
deleted file mode 100644
index f31bda8e..00000000
--- a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/IDXGISurface.cs
+++ /dev/null
@@ -1,147 +0,0 @@
-// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-
-// Ported from shared/dxgi.h in the Windows SDK for Windows 10.0.20348.0
-// Original source is Copyright © Microsoft. All rights reserved.
-
-using System;
-using System.Runtime.CompilerServices;
-using System.Runtime.InteropServices;
-using TerraFX.Interop.Windows;
-
-namespace TerraFX.Interop.DirectX
-{
- [Guid("CAFCB56C-6AC3-4889-BF47-9E23BBD260EC")]
- [NativeTypeName("struct IDXGISurface : IDXGIDeviceSubObject")]
- [NativeInheritance("IDXGIDeviceSubObject")]
- internal unsafe partial struct IDXGISurface : IDXGISurface.Interface
- {
- public void** lpVtbl;
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(0)]
- public HRESULT QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[0]))((IDXGISurface*)Unsafe.AsPointer(ref this), riid, ppvObject);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(1)]
- [return: NativeTypeName("ULONG")]
- public uint AddRef()
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[1]))((IDXGISurface*)Unsafe.AsPointer(ref this));
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(2)]
- [return: NativeTypeName("ULONG")]
- public uint Release()
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[2]))((IDXGISurface*)Unsafe.AsPointer(ref this));
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(3)]
- public HRESULT SetPrivateData([NativeTypeName("const GUID &")] Guid* Name, uint DataSize, [NativeTypeName("const void *")] void* pData)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[3]))((IDXGISurface*)Unsafe.AsPointer(ref this), Name, DataSize, pData);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(4)]
- public HRESULT SetPrivateDataInterface([NativeTypeName("const GUID &")] Guid* Name, [NativeTypeName("const IUnknown *")] IUnknown* pUnknown)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[4]))((IDXGISurface*)Unsafe.AsPointer(ref this), Name, pUnknown);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(5)]
- public HRESULT GetPrivateData([NativeTypeName("const GUID &")] Guid* Name, uint* pDataSize, void* pData)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[5]))((IDXGISurface*)Unsafe.AsPointer(ref this), Name, pDataSize, pData);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(6)]
- public HRESULT GetParent([NativeTypeName("const IID &")] Guid* riid, void** ppParent)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[6]))((IDXGISurface*)Unsafe.AsPointer(ref this), riid, ppParent);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(7)]
- public HRESULT GetDevice([NativeTypeName("const IID &")] Guid* riid, void** ppDevice)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[7]))((IDXGISurface*)Unsafe.AsPointer(ref this), riid, ppDevice);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(8)]
- public HRESULT GetDesc(DXGI_SURFACE_DESC* pDesc)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[8]))((IDXGISurface*)Unsafe.AsPointer(ref this), pDesc);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(9)]
- public HRESULT Map(DXGI_MAPPED_RECT* pLockedRect, uint MapFlags)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[9]))((IDXGISurface*)Unsafe.AsPointer(ref this), pLockedRect, MapFlags);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(10)]
- public HRESULT Unmap()
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[10]))((IDXGISurface*)Unsafe.AsPointer(ref this));
- }
-
- public interface Interface : IDXGIDeviceSubObject.Interface
- {
- [VtblIndex(8)]
- HRESULT GetDesc(DXGI_SURFACE_DESC* pDesc);
-
- [VtblIndex(9)]
- HRESULT Map(DXGI_MAPPED_RECT* pLockedRect, uint MapFlags);
-
- [VtblIndex(10)]
- HRESULT Unmap();
- }
-
- internal partial struct Vtbl
- {
- [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] QueryInterface;
-
- [NativeTypeName("ULONG () __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] AddRef;
-
- [NativeTypeName("ULONG () __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] Release;
-
- [NativeTypeName("HRESULT (const GUID &, UINT, const void *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] SetPrivateData;
-
- [NativeTypeName("HRESULT (const GUID &, const IUnknown *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] SetPrivateDataInterface;
-
- [NativeTypeName("HRESULT (const GUID &, UINT *, void *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetPrivateData;
-
- [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetParent;
-
- [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetDevice;
-
- [NativeTypeName("HRESULT (DXGI_SURFACE_DESC *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetDesc;
-
- [NativeTypeName("HRESULT (DXGI_MAPPED_RECT *, UINT) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] Map;
-
- [NativeTypeName("HRESULT () __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] Unmap;
- }
- }
-}
diff --git a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/IDXGISwapChain.cs b/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/IDXGISwapChain.cs
index 3a428798..5e8cf0a8 100644
--- a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/IDXGISwapChain.cs
+++ b/src/TerraFX.Interop.Windows/DirectX/shared/dxgi/IDXGISwapChain.cs
@@ -13,7 +13,7 @@ namespace TerraFX.Interop.DirectX
[Guid("310D36A0-D2E7-4C0A-AA04-6A9D23B8886A")]
[NativeTypeName("struct IDXGISwapChain : IDXGIDeviceSubObject")]
[NativeInheritance("IDXGIDeviceSubObject")]
- internal unsafe partial struct IDXGISwapChain : IDXGISwapChain.Interface
+ internal unsafe partial struct IDXGISwapChain
{
public void** lpVtbl;
@@ -39,200 +39,5 @@ namespace TerraFX.Interop.DirectX
{
return ((delegate* unmanaged[Stdcall])(lpVtbl[2]))((IDXGISwapChain*)Unsafe.AsPointer(ref this));
}
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(3)]
- public HRESULT SetPrivateData([NativeTypeName("const GUID &")] Guid* Name, uint DataSize, [NativeTypeName("const void *")] void* pData)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[3]))((IDXGISwapChain*)Unsafe.AsPointer(ref this), Name, DataSize, pData);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(4)]
- public HRESULT SetPrivateDataInterface([NativeTypeName("const GUID &")] Guid* Name, [NativeTypeName("const IUnknown *")] IUnknown* pUnknown)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[4]))((IDXGISwapChain*)Unsafe.AsPointer(ref this), Name, pUnknown);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(5)]
- public HRESULT GetPrivateData([NativeTypeName("const GUID &")] Guid* Name, uint* pDataSize, void* pData)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[5]))((IDXGISwapChain*)Unsafe.AsPointer(ref this), Name, pDataSize, pData);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(6)]
- public HRESULT GetParent([NativeTypeName("const IID &")] Guid* riid, void** ppParent)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[6]))((IDXGISwapChain*)Unsafe.AsPointer(ref this), riid, ppParent);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(7)]
- public HRESULT GetDevice([NativeTypeName("const IID &")] Guid* riid, void** ppDevice)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[7]))((IDXGISwapChain*)Unsafe.AsPointer(ref this), riid, ppDevice);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(8)]
- public HRESULT Present(uint SyncInterval, uint Flags)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[8]))((IDXGISwapChain*)Unsafe.AsPointer(ref this), SyncInterval, Flags);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(9)]
- public HRESULT GetBuffer(uint Buffer, [NativeTypeName("const IID &")] Guid* riid, void** ppSurface)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[9]))((IDXGISwapChain*)Unsafe.AsPointer(ref this), Buffer, riid, ppSurface);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(10)]
- public HRESULT SetFullscreenState(BOOL Fullscreen, IDXGIOutput* pTarget)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[10]))((IDXGISwapChain*)Unsafe.AsPointer(ref this), Fullscreen, pTarget);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(11)]
- public HRESULT GetFullscreenState(BOOL* pFullscreen, IDXGIOutput** ppTarget)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[11]))((IDXGISwapChain*)Unsafe.AsPointer(ref this), pFullscreen, ppTarget);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(12)]
- public HRESULT GetDesc(DXGI_SWAP_CHAIN_DESC* pDesc)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[12]))((IDXGISwapChain*)Unsafe.AsPointer(ref this), pDesc);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(13)]
- public HRESULT ResizeBuffers(uint BufferCount, uint Width, uint Height, DXGI_FORMAT NewFormat, uint SwapChainFlags)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[13]))((IDXGISwapChain*)Unsafe.AsPointer(ref this), BufferCount, Width, Height, NewFormat, SwapChainFlags);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(14)]
- public HRESULT ResizeTarget([NativeTypeName("const DXGI_MODE_DESC *")] DXGI_MODE_DESC* pNewTargetParameters)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[14]))((IDXGISwapChain*)Unsafe.AsPointer(ref this), pNewTargetParameters);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(15)]
- public HRESULT GetContainingOutput(IDXGIOutput** ppOutput)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[15]))((IDXGISwapChain*)Unsafe.AsPointer(ref this), ppOutput);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(16)]
- public HRESULT GetFrameStatistics(DXGI_FRAME_STATISTICS* pStats)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[16]))((IDXGISwapChain*)Unsafe.AsPointer(ref this), pStats);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(17)]
- public HRESULT GetLastPresentCount(uint* pLastPresentCount)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[17]))((IDXGISwapChain*)Unsafe.AsPointer(ref this), pLastPresentCount);
- }
-
- public interface Interface : IDXGIDeviceSubObject.Interface
- {
- [VtblIndex(8)]
- HRESULT Present(uint SyncInterval, uint Flags);
-
- [VtblIndex(9)]
- HRESULT GetBuffer(uint Buffer, [NativeTypeName("const IID &")] Guid* riid, void** ppSurface);
-
- [VtblIndex(10)]
- HRESULT SetFullscreenState(BOOL Fullscreen, IDXGIOutput* pTarget);
-
- [VtblIndex(11)]
- HRESULT GetFullscreenState(BOOL* pFullscreen, IDXGIOutput** ppTarget);
-
- [VtblIndex(12)]
- HRESULT GetDesc(DXGI_SWAP_CHAIN_DESC* pDesc);
-
- [VtblIndex(13)]
- HRESULT ResizeBuffers(uint BufferCount, uint Width, uint Height, DXGI_FORMAT NewFormat, uint SwapChainFlags);
-
- [VtblIndex(14)]
- HRESULT ResizeTarget([NativeTypeName("const DXGI_MODE_DESC *")] DXGI_MODE_DESC* pNewTargetParameters);
-
- [VtblIndex(15)]
- HRESULT GetContainingOutput(IDXGIOutput** ppOutput);
-
- [VtblIndex(16)]
- HRESULT GetFrameStatistics(DXGI_FRAME_STATISTICS* pStats);
-
- [VtblIndex(17)]
- HRESULT GetLastPresentCount(uint* pLastPresentCount);
- }
-
- internal partial struct Vtbl
- {
- [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] QueryInterface;
-
- [NativeTypeName("ULONG () __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] AddRef;
-
- [NativeTypeName("ULONG () __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] Release;
-
- [NativeTypeName("HRESULT (const GUID &, UINT, const void *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] SetPrivateData;
-
- [NativeTypeName("HRESULT (const GUID &, const IUnknown *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] SetPrivateDataInterface;
-
- [NativeTypeName("HRESULT (const GUID &, UINT *, void *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetPrivateData;
-
- [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetParent;
-
- [NativeTypeName("HRESULT (const IID &, void **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetDevice;
-
- [NativeTypeName("HRESULT (UINT, UINT) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] Present;
-
- [NativeTypeName("HRESULT (UINT, const IID &, void **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetBuffer;
-
- [NativeTypeName("HRESULT (BOOL, IDXGIOutput *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] SetFullscreenState;
-
- [NativeTypeName("HRESULT (BOOL *, IDXGIOutput **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetFullscreenState;
-
- [NativeTypeName("HRESULT (DXGI_SWAP_CHAIN_DESC *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetDesc;
-
- [NativeTypeName("HRESULT (UINT, UINT, UINT, DXGI_FORMAT, UINT) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] ResizeBuffers;
-
- [NativeTypeName("HRESULT (const DXGI_MODE_DESC *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] ResizeTarget;
-
- [NativeTypeName("HRESULT (IDXGIOutput **) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetContainingOutput;
-
- [NativeTypeName("HRESULT (DXGI_FRAME_STATISTICS *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetFrameStatistics;
-
- [NativeTypeName("HRESULT (UINT *) __attribute__((stdcall))")]
- public delegate* unmanaged[Stdcall] GetLastPresentCount;
- }
}
}
diff --git a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi1_2/DXGI_PRESENT_PARAMETERS.cs b/src/TerraFX.Interop.Windows/DirectX/shared/dxgi1_2/DXGI_PRESENT_PARAMETERS.cs
deleted file mode 100644
index fd07a791..00000000
--- a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi1_2/DXGI_PRESENT_PARAMETERS.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-
-// Ported from shared/dxgi1_2.h in the Windows SDK for Windows 10.0.20348.0
-// Original source is Copyright © Microsoft. All rights reserved.
-
-using TerraFX.Interop.Windows;
-
-namespace TerraFX.Interop.DirectX
-{
- internal unsafe partial struct DXGI_PRESENT_PARAMETERS
- {
- public uint DirtyRectsCount;
-
- public RECT* pDirtyRects;
-
- public RECT* pScrollRect;
-
- public POINT* pScrollOffset;
- }
-}
diff --git a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi1_2/DXGI_SWAP_CHAIN_FULLSCREEN_DESC.cs b/src/TerraFX.Interop.Windows/DirectX/shared/dxgi1_2/DXGI_SWAP_CHAIN_FULLSCREEN_DESC.cs
deleted file mode 100644
index 12142f5a..00000000
--- a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi1_2/DXGI_SWAP_CHAIN_FULLSCREEN_DESC.cs
+++ /dev/null
@@ -1,20 +0,0 @@
-// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.
-
-// Ported from shared/dxgi1_2.h in the Windows SDK for Windows 10.0.20348.0
-// Original source is Copyright © Microsoft. All rights reserved.
-
-using TerraFX.Interop.Windows;
-
-namespace TerraFX.Interop.DirectX
-{
- internal partial struct DXGI_SWAP_CHAIN_FULLSCREEN_DESC
- {
- public DXGI_RATIONAL RefreshRate;
-
- public DXGI_MODE_SCANLINE_ORDER ScanlineOrdering;
-
- public DXGI_MODE_SCALING Scaling;
-
- public BOOL Windowed;
- }
-}
diff --git a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi1_2/IDXGIFactory2.cs b/src/TerraFX.Interop.Windows/DirectX/shared/dxgi1_2/IDXGIFactory2.cs
index 7cc967af..92a574e0 100644
--- a/src/TerraFX.Interop.Windows/DirectX/shared/dxgi1_2/IDXGIFactory2.cs
+++ b/src/TerraFX.Interop.Windows/DirectX/shared/dxgi1_2/IDXGIFactory2.cs
@@ -13,7 +13,7 @@ namespace TerraFX.Interop.DirectX
[Guid("50C83A1C-E072-4C48-87B0-3630FA36A6D0")]
[NativeTypeName("struct IDXGIFactory2 : IDXGIFactory1")]
[NativeInheritance("IDXGIFactory1")]
- internal unsafe partial struct IDXGIFactory2 : IDXGIFactory2.Interface
+ internal unsafe partial struct IDXGIFactory2
{
public void** lpVtbl;
@@ -40,272 +40,11 @@ namespace TerraFX.Interop.DirectX
return ((delegate* unmanaged[Stdcall])(lpVtbl[2]))((IDXGIFactory2*)Unsafe.AsPointer(ref this));
}
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(3)]
- public HRESULT SetPrivateData([NativeTypeName("const GUID &")] Guid* Name, uint DataSize, [NativeTypeName("const void *")] void* pData)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[3]))((IDXGIFactory2*)Unsafe.AsPointer(ref this), Name, DataSize, pData);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(4)]
- public HRESULT SetPrivateDataInterface([NativeTypeName("const GUID &")] Guid* Name, [NativeTypeName("const IUnknown *")] IUnknown* pUnknown)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[4]))((IDXGIFactory2*)Unsafe.AsPointer(ref this), Name, pUnknown);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(5)]
- public HRESULT GetPrivateData([NativeTypeName("const GUID &")] Guid* Name, uint* pDataSize, void* pData)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[5]))((IDXGIFactory2*)Unsafe.AsPointer(ref this), Name, pDataSize, pData);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(6)]
- public HRESULT GetParent([NativeTypeName("const IID &")] Guid* riid, void** ppParent)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[6]))((IDXGIFactory2*)Unsafe.AsPointer(ref this), riid, ppParent);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(7)]
- public HRESULT EnumAdapters(uint Adapter, IDXGIAdapter** ppAdapter)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[7]))((IDXGIFactory2*)Unsafe.AsPointer(ref this), Adapter, ppAdapter);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(8)]
- public HRESULT MakeWindowAssociation(HWND WindowHandle, uint Flags)
- {
- return ((delegate* unmanaged[Stdcall])(lpVtbl[8]))((IDXGIFactory2*)Unsafe.AsPointer(ref this), WindowHandle, Flags);
- }
-
- [MethodImpl(MethodImplOptions.AggressiveInlining)]
- [VtblIndex(9)]
- public HRESULT GetWindowAssociation(HWND* pWindowHandle)
- {
- return ((delegate* unmanaged[Stdcall]