From 67af7b667bad54846a1bc7195164d7679172cf00 Mon Sep 17 00:00:00 2001 From: routersys Date: Fri, 17 Jul 2026 08:38:20 +0900 Subject: [PATCH] =?UTF-8?q?=E5=8F=82=E7=85=A7=E3=81=95=E3=82=8C=E3=81=AA?= =?UTF-8?q?=E3=81=84=E3=83=97=E3=83=AD=E3=82=B8=E3=82=A7=E3=82=AF=E3=83=88?= =?UTF-8?q?=E3=82=92=E5=89=8A=E9=99=A4=E3=81=97=E3=83=93=E3=83=AB=E3=83=89?= =?UTF-8?q?=E6=A7=8B=E6=88=90=E3=82=92=E6=95=B4=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/dotnet.yml | 308 +-- ComputeSharp.sln | 427 ---- .../Blas/BlasBenchmark.cs | 163 -- .../Blas/BlasHelpers.cs | 108 - .../ComputeSharp.Benchmark.csproj | 31 - .../Dispatching/DispatchingBenchmark.cs | 122 -- .../Imaging/ImagingBenchmark.cs | 94 - samples/ComputeSharp.Benchmark/Program.cs | 11 - .../ComputeSharp.ImageProcessing.csproj | 21 - .../ComputeSharp.ImageProcessing/Program.cs | 40 - .../ComputeSharp.NativeLibrary.WinRT.csproj | 56 - .../HelloWorldEffect.cs | 70 - .../ComputeSharp.NativeLibrary.csproj | 29 - .../NativeLibrary.cs | 84 - .../ComputeSharp.Sample.FSharp.Shaders.csproj | 12 - .../MultiplyByTwo.cs | 15 - .../ComputeSharp.Sample.FSharp.fsproj | 25 - samples/ComputeSharp.Sample.FSharp/Program.fs | 51 - .../ComputeSharp.Sample.csproj | 13 - .../ComputeSharp.Sample/Helpers/Formatting.cs | 38 - samples/ComputeSharp.Sample/Program.cs | 35 - .../ComputeSharp.SwapChain.Cli.csproj | 70 - samples/ComputeSharp.SwapChain.Cli/Program.cs | 64 - .../Backend/PixelShaderEffect.cs | 65 - .../Backend/Win32Application.cs | 149 -- .../Backend/Win32ApplicationRunner.cs | 96 - .../ComputeSharp.SwapChain.D2D1.Cli.csproj | 82 - .../Program.cs | 76 - .../app.manifest | 9 - .../ComputeSharp.SwapChain.D2D1.Uwp/App.cs | 120 -- .../Assets/LockScreenLogo.scale-200.png | Bin 432 -> 0 bytes .../Assets/SplashScreen.scale-200.png | Bin 8537 -> 0 bytes .../Assets/Square150x150Logo.scale-200.png | Bin 3760 -> 0 bytes .../Assets/Square44x44Logo.scale-200.png | Bin 1723 -> 0 bytes ...x44Logo.targetsize-24_altform-unplated.png | Bin 796 -> 0 bytes .../Assets/StoreLogo.scale-200.png | Bin 2077 -> 0 bytes .../Assets/Wide310x150Logo.scale-200.png | Bin 4291 -> 0 bytes .../Backend/CoreWindowApplication.cs | 142 -- .../Backend/CoreWindowApplicationRunner.cs | 56 - .../Backend/PixelShaderEffect.cs | 65 - .../ComputeSharp.SwapChain.D2D1.Uwp.csproj | 54 - .../ApplicationViewTitleBarExtensions.cs | 33 - .../Package.appxmanifest | 46 - .../PublishProfiles/win-arm64.pubxml | 11 - .../Properties/PublishProfiles/win-x64.pubxml | 11 - .../Properties/launchSettings.json | 7 - .../ColorfulInfinity.cs | 71 - ...puteSharp.SwapChain.Shaders.D2D1.projitems | 24 - ...ComputeSharp.SwapChain.Shaders.D2D1.shproj | 12 - .../ContouredLayers.cs | 203 -- .../FractalTiling.cs | 48 - .../HelloWorld.cs | 31 - .../MengerJourney.cs | 177 -- .../Octagrams.cs | 126 -- .../ProteanClouds.cs | 174 -- .../PyramidPattern.cs | 191 -- .../TerracedHills.cs | 124 -- .../TriangleGridContouring.cs | 302 --- .../TwoTiledTruchet.cs | 146 -- .../Assets/LargeTile.scale-100.png | Bin 3731 -> 0 bytes .../Assets/LargeTile.scale-125.png | Bin 4448 -> 0 bytes .../Assets/LargeTile.scale-150.png | Bin 5036 -> 0 bytes .../Assets/LargeTile.scale-200.png | Bin 6906 -> 0 bytes .../Assets/LargeTile.scale-400.png | Bin 15857 -> 0 bytes .../Assets/LockScreenLogo.scale-200.png | Bin 432 -> 0 bytes .../Assets/Misc/noise_low.png | Bin 213131 -> 0 bytes .../Assets/SmallTile.scale-100.png | Bin 1799 -> 0 bytes .../Assets/SmallTile.scale-125.png | Bin 1882 -> 0 bytes .../Assets/SmallTile.scale-150.png | Bin 2010 -> 0 bytes .../Assets/SmallTile.scale-200.png | Bin 2325 -> 0 bytes .../Assets/SmallTile.scale-400.png | Bin 3613 -> 0 bytes .../Assets/SplashScreen.scale-100.png | Bin 4291 -> 0 bytes .../Assets/SplashScreen.scale-125.png | Bin 5157 -> 0 bytes .../Assets/SplashScreen.scale-150.png | Bin 5922 -> 0 bytes .../Assets/SplashScreen.scale-200.png | Bin 8537 -> 0 bytes .../Assets/SplashScreen.scale-400.png | Bin 20956 -> 0 bytes .../Assets/Square150x150Logo.scale-100.png | Bin 2368 -> 0 bytes .../Assets/Square150x150Logo.scale-125.png | Bin 2759 -> 0 bytes .../Assets/Square150x150Logo.scale-150.png | Bin 2919 -> 0 bytes .../Assets/Square150x150Logo.scale-200.png | Bin 3760 -> 0 bytes .../Assets/Square150x150Logo.scale-400.png | Bin 6741 -> 0 bytes ...go.altform-lightunplated_targetsize-16.png | Bin 508 -> 0 bytes ...go.altform-lightunplated_targetsize-24.png | Bin 796 -> 0 bytes ...o.altform-lightunplated_targetsize-256.png | Bin 2940 -> 0 bytes ...go.altform-lightunplated_targetsize-32.png | Bin 711 -> 0 bytes ...go.altform-lightunplated_targetsize-48.png | Bin 826 -> 0 bytes ...x44Logo.altform-unplated_targetsize-16.png | Bin 508 -> 0 bytes ...44Logo.altform-unplated_targetsize-256.png | Bin 2940 -> 0 bytes ...x44Logo.altform-unplated_targetsize-32.png | Bin 711 -> 0 bytes ...x44Logo.altform-unplated_targetsize-48.png | Bin 826 -> 0 bytes .../Assets/Square44x44Logo.scale-100.png | Bin 1443 -> 0 bytes .../Assets/Square44x44Logo.scale-125.png | Bin 1607 -> 0 bytes .../Assets/Square44x44Logo.scale-150.png | Bin 1523 -> 0 bytes .../Assets/Square44x44Logo.scale-200.png | Bin 1723 -> 0 bytes .../Assets/Square44x44Logo.scale-400.png | Bin 1912 -> 0 bytes .../Assets/Square44x44Logo.targetsize-16.png | Bin 508 -> 0 bytes .../Assets/Square44x44Logo.targetsize-24.png | Bin 796 -> 0 bytes ...x44Logo.targetsize-24_altform-unplated.png | Bin 796 -> 0 bytes .../Assets/Square44x44Logo.targetsize-256.png | Bin 2940 -> 0 bytes .../Assets/Square44x44Logo.targetsize-32.png | Bin 711 -> 0 bytes .../Assets/Square44x44Logo.targetsize-48.png | Bin 826 -> 0 bytes .../Assets/StoreLogo.backup.png | Bin 456 -> 0 bytes .../Assets/StoreLogo.scale-100.png | Bin 1420 -> 0 bytes .../Assets/StoreLogo.scale-125.png | Bin 1596 -> 0 bytes .../Assets/StoreLogo.scale-150.png | Bin 1750 -> 0 bytes .../Assets/StoreLogo.scale-200.png | Bin 2077 -> 0 bytes .../Assets/StoreLogo.scale-400.png | Bin 2808 -> 0 bytes .../Assets/Wide310x150Logo.scale-100.png | Bin 2626 -> 0 bytes .../Assets/Wide310x150Logo.scale-125.png | Bin 3043 -> 0 bytes .../Assets/Wide310x150Logo.scale-150.png | Bin 3267 -> 0 bytes .../Assets/Wide310x150Logo.scale-200.png | Bin 4291 -> 0 bytes .../Assets/Wide310x150Logo.scale-400.png | Bin 8537 -> 0 bytes .../ComputeSharp.SwapChain.UI.projitems | 78 - .../ComputeSharp.SwapChain.UI.shproj | 13 - .../Controls/D2D1AnimatedPixelShaderPanel.cs | 157 -- .../Converters/RenderingPauseConverter.cs | 23 - .../Converters/ResolutionScaleConverter.cs | 27 - .../Enums/RenderingMode.cs | 17 - .../Shaders/PixelShaderEffect.cs | 69 - .../Shaders/Runners/ContouredLayersRunner.cs | 40 - .../Runners/D2D1ContouredLayersRunner.cs | 67 - .../ViewModels/MainViewModel.cs | 163 -- .../ViewModels/ShaderRunnerViewModel.cs | 42 - samples/ComputeSharp.SwapChain.Uwp/App.xaml | 13 - .../ComputeSharp.SwapChain.Uwp/App.xaml.cs | 72 - .../ComputeSharp.SwapChain.Uwp.csproj | 68 - .../D2D1AnimatedPixelShaderPanel.xaml | 16 - .../Package.appxmanifest | 46 - .../PublishProfiles/win-arm64.pubxml | 11 - .../Properties/PublishProfiles/win-x64.pubxml | 11 - .../Properties/launchSettings.json | 7 - .../Views/MainView.xaml | 281 --- .../Views/MainView.xaml.cs | 50 - samples/ComputeSharp.SwapChain.WinUI/App.xaml | 19 - .../ComputeSharp.SwapChain.WinUI/App.xaml.cs | 54 - .../ComputeSharp.SwapChain.WinUI.csproj | 90 - .../D2D1AnimatedPixelShaderPanel.xaml | 16 - .../Package.appxmanifest | 42 - .../PublishProfiles/win-arm64.pubxml | 11 - .../Properties/PublishProfiles/win-x64.pubxml | 11 - .../Properties/launchSettings.json | 7 - .../Views/MainWindow.xaml | 292 --- .../Views/MainWindow.xaml.cs | 79 - .../ComputeSharp.SwapChain.WinUI/app.manifest | 15 - .../Backend/Win32Application.cs | 300 --- .../Backend/Win32ApplicationFactory{T}.cs | 43 - .../Backend/Win32ApplicationRunner.cs | 350 --- .../ComputeSharp.SwapChain.csproj | 26 - samples/ComputeSharp.SwapChain/Program.cs | 80 - .../ComputeSharp.Core.csproj | 6 - .../ComputeSharp.D2D1.CodeFixers.csproj | 15 - ...lShaderDescriptorOnPixelShaderCodeFixer.cs | 48 - .../AnalyzerReleases.Shipped.md | 95 - .../AnalyzerReleases.Unshipped.md | 2 - .../ComputeSharp.D2D1.SourceGenerators.csproj | 99 - ...haderDescriptorGenerator.ConstantBuffer.cs | 117 - ...escriptorGenerator.EffectFactory.Syntax.cs | 46 - ...aderDescriptorGenerator.EffectId.Syntax.cs | 71 - ...PixelShaderDescriptorGenerator.EffectId.cs | 132 -- ...scriptorGenerator.EffectMetadata.Syntax.cs | 77 - ...haderDescriptorGenerator.EffectMetadata.cs | 98 - ...DescriptorGenerator.HlslBytecode.Syntax.cs | 158 -- ...lShaderDescriptorGenerator.HlslBytecode.cs | 86 - ...erDescriptorGenerator.HlslSource.Syntax.cs | 31 - ...xelShaderDescriptorGenerator.HlslSource.cs | 539 ----- ...iptorGenerator.InputDescriptions.Syntax.cs | 145 -- ...erDescriptorGenerator.InputDescriptions.cs | 44 - ...erDescriptorGenerator.InputTypes.Syntax.cs | 133 -- ...xelShaderDescriptorGenerator.InputTypes.cs | 93 - ...iptorGenerator.NumericProperties.Syntax.cs | 51 - ...DescriptorGenerator.OutputBuffer.Syntax.cs | 53 - ...lShaderDescriptorGenerator.OutputBuffer.cs | 62 - ...lShaderDescriptorGenerator.PixelOptions.cs | 52 - ...ator.ResourceTextureDescriptions.Syntax.cs | 88 - ...orGenerator.ResourceTextureDescriptions.cs | 67 - .../D2DPixelShaderDescriptorGenerator.cs | 278 --- .../D2DPixelShaderSourceGenerator.Execute.cs | 180 -- .../D2DPixelShaderSourceGenerator.cs | 117 - ...bleRuntimeCompilationOnAssemblyAnalyzer.cs | 39 - ...DEnableRuntimeCompilationOnTypeAnalyzer.cs | 94 - ...deedPixelShaderDispatchDataSizeAnalyzer.cs | 73 - ...alidAssemblyLevelCompileOptionsAnalyzer.cs | 48 - ...ionsTrivialSamplingOnShaderTypeAnalyzer.cs | 120 -- ...ShaderDescriptorAttributeTargetAnalyzer.cs | 58 - .../InvalidD2DInputArgumentAnalyzer.cs | 202 -- ...D2DInputDescriptionAttributeUseAnalyzer.cs | 122 -- ...2DPixelShaderSourceAttributeUseAnalyzer.cs | 59 - ...xelShaderSourceMethodReturnTypeAnalyzer.cs | 65 - ...DRequiresDoublePrecisionSupportAnalyzer.cs | 66 - ...ceTextureIndexAttributeLocationAnalyzer.cs | 64 - ...esourceTextureIndexAttributeUseAnalyzer.cs | 193 -- .../Analyzers/InvalidEffectIdValueAnalyzer.cs | 63 - .../InvalidEffectMetadataValueAnalyzer.cs | 92 - ...InvalidShaderTypeCompileOptionsAnalyzer.cs | 59 - .../InvalidShaderTypeInputsAnalyzer.cs | 212 -- ...owUnsafeBlocksCompilationOptionAnalyzer.cs | 19 - ...onsOnD2DPixelShaderSourceMethodAnalyzer.cs | 61 - ...ileOnD2DPixelShaderSourceMethodAnalyzer.cs | 61 - ...elShaderDescriptorOnPixelShaderAnalyzer.cs | 80 - .../NonConstantD2DInputArgumentAnalyzer.cs | 133 -- ...ShaderDescriptorAttributeTargetAnalyzer.cs | 19 - ...ShaderDescriptorAttributeTargetAnalyzer.cs | 19 - ...adOnlyPixelShaderTypeWithFieldsAnalyzer.cs | 19 - .../Diagnostics/DiagnosticDescriptors.cs | 1304 ----------- .../Diagnostics/SuppressionDescriptors.cs | 17 - ...eUninitializedFieldDiagnosticSuppressor.cs | 69 - .../Fxc/D3DCompiler.cs | 33 - .../Helpers/D2D1EffectMetadataParser.cs | 105 - .../Mappings/HlslKnownKeywords.cs | 22 - .../Mappings/HlslKnownMethods.cs | 53 - .../Mappings/HlslKnownProperties.cs | 31 - .../Mappings/HlslKnownTypes.cs | 57 - .../Models/D2D1PixelShaderSourceInfo.cs | 23 - .../Models/D2D1ShaderInfo.cs | 43 - .../Models/HlslBytecodeInfoKey.cs | 14 - .../Models/InputDescription.cs | 9 - .../Models/ResourceTextureDescription.cs | 8 - .../NativeMethods.txt | 30 - .../Polyfills/EncodingExtensions.cs | 23 - ...tBufferSyntaxProcessor.ArtificialFields.cs | 11 - .../HlslBytecodeSyntaxProcessor.D2D1.cs | 40 - .../SyntaxRewriters/ShaderSourceRewriter.cs | 42 - .../SyntaxRewriters/StaticFieldRewriter.cs | 28 - .../ComputeSharp.D2D1.UI.CodeFixers.projitems | 14 - .../ComputeSharp.D2D1.UI.CodeFixers.shproj | 13 - ...fectPropertyOnSemiAutoPropertyCodeFixer.cs | 350 --- .../CanvasEffectPropertyGenerator.Execute.cs | 258 --- .../CanvasEffectPropertyGenerator.cs | 145 -- ...teSharp.D2D1.UI.SourceGenerators.projitems | 24 - ...mputeSharp.D2D1.UI.SourceGenerators.shproj | 13 - .../Constants/WellKnownTypeNames.cs | 41 - ...edCanvasEffectPropertyAccessorsAnalyzer.cs | 70 - ...vasEffectPropertyContainingTypeAnalyzer.cs | 71 - ...CanvasEffectPropertyDeclarationAnalyzer.cs | 115 - ...ireCSharpLanguageVersionPreviewAnalyzer.cs | 70 - ...ffectPropertyOnSemiAutoPropertyAnalyzer.cs | 356 --- .../Diagnostics/DiagnosticDescriptors.cs | 166 -- .../Models/CanvasEffectPropertyInfo.cs | 31 - .../ICanvasDevice.cs | 43 - .../ICanvasEffect.cs | 69 - .../ICanvasEffectFactoryNative.cs | 178 -- .../ICanvasFactoryNative.cs | 168 -- .../ICanvasImageInterop.cs | 233 -- .../ICanvasResourceCreator.cs | 69 - .../ICanvasResourceCreatorWithDpi.cs | 69 - .../ICanvasResourceWrapperNative.cs | 79 - .../ID2D1DeviceContextLease.cs | 56 - .../ID2D1DeviceContextPool.cs | 81 - .../Inspectable/IInspectable.cs | 47 - .../WIN2D_GET_D2D_IMAGE_FLAGS.cs | 50 - .../WIN2D_GET_DEVICE_ASSOCIATION_TYPE.cs | 30 - .../ABI.Microsoft.Graphics.Canvas/Win2D.cs | 92 - .../GeneratedCanvasEffectPropertyAttribute.cs | 69 - .../Buffers/GraphicsEffectSourceBuffer.cs | 22 - .../Buffers/ResourceTextureManagerBuffer.cs | 22 - .../Buffers/SourceReference.cs | 194 -- .../CanvasEffect.Interop.cs | 123 -- src/ComputeSharp.D2D1.UI/CanvasEffect.cs | 222 -- src/ComputeSharp.D2D1.UI/CanvasEffectGraph.cs | 218 -- .../CanvasEffectInvalidationType.cs | 40 - .../CanvasEffectNode{T}.cs | 14 - .../Collections/FixedCountList{T}.cs | 93 - .../Collections/IFixedCountList{T}.cs | 23 - .../ComputeSharp.D2D1.UI.projitems | 59 - .../ComputeSharp.D2D1.UI.shproj | 13 - .../Extensions/ICanvasDeviceExtensions.cs | 81 - .../ID2D1DeviceContextExtensions.cs | 83 - .../Extensions/ID2D1EffectExtensions.cs | 237 -- .../Extensions/IUnknownExtensions.cs | 84 - .../Helpers/RcwMarshaller.cs | 64 - .../Helpers/ResourceManager.cs | 123 -- src/ComputeSharp.D2D1.UI/ICanvasEffectNode.cs | 19 - .../ICanvasEffectNode{T}.cs | 23 - .../PixelShaderEffect{T}.ICanvasEffect.cs | 218 -- ...derEffect{T}.ICanvasEffectFactoryNative.cs | 152 -- .../PixelShaderEffect{T}.ICanvasImage.cs | 61 - ...ixelShaderEffect{T}.ICanvasImageInterop.cs | 417 ---- ...derEffect{T}.Properties.Interop.Sources.cs | 365 ---- ...PixelShaderEffect{T}.Properties.Interop.cs | 243 --- ...erties.ResourceTextureManagerCollection.cs | 270 --- ...erEffect{T}.Properties.SourceCollection.cs | 240 --- .../PixelShaderEffect{T}.Properties.cs | 61 - .../PixelShaderEffect{T}.ReferenceTracking.cs | 76 - .../PixelShaderEffect{T}.cs | 83 - .../ComputeSharp.D2D1.Uwp.CodeFixers.csproj | 16 - .../AnalyzerReleases.Shipped.md | 17 - .../AnalyzerReleases.Unshipped.md | 2 - ...puteSharp.D2D1.Uwp.SourceGenerators.csproj | 26 - .../ComputeSharp.D2D1.Uwp.csproj | 32 - .../ComputeSharp.D2D1.Uwp.targets | 56 - src/ComputeSharp.D2D1.Uwp/README.md | 9 - .../ComputeSharp.D2D1.WinUI.CodeFixers.csproj | 16 - .../AnalyzerReleases.Shipped.md | 17 - .../AnalyzerReleases.Unshipped.md | 2 - ...teSharp.D2D1.WinUI.SourceGenerators.csproj | 26 - .../ComputeSharp.D2D1.WinUI.csproj | 34 - .../ComputeSharp.D2D1.WinUI.targets | 56 - src/ComputeSharp.D2D1.WinUI/README.md | 9 - .../Attributes/D2DCompileOptionsAttribute.cs | 35 - .../Attributes/D2DEffectAuthorAttribute.cs | 19 - .../Attributes/D2DEffectCategoryAttribute.cs | 19 - .../D2DEffectDescriptionAttribute.cs | 19 - .../D2DEffectDisplayNameAttribute.cs | 19 - .../Attributes/D2DEffectIdAttribute.cs | 19 - .../Attributes/D2DEnableRuntimeCompilation.cs | 27 - ...GeneratedPixelShaderDescriptorAttribute.cs | 22 - .../Attributes/D2DInputComplexAttribute.cs | 21 - .../Attributes/D2DInputCountAttribute.cs | 21 - .../D2DInputDescriptionAttribute.cs | 32 - .../Attributes/D2DInputSimpleAttribute.cs | 21 - .../Attributes/D2DOutputBufferAttribute.cs | 53 - .../Attributes/D2DPixelOptionsAttribute.cs | 20 - .../D2DPixelShaderSourceAttribute.cs | 43 - ...RequiresDoublePrecisionSupportAttribute.cs | 23 - .../D2DRequiresScenePositionAttribute.cs | 15 - .../D2DResourceTextureIndexAttribute.cs | 20 - .../Attributes/D2DShaderProfileAttribute.cs | 35 - .../Attributes/Enums/D2D1BufferPrecision.cs | 47 - .../Attributes/Enums/D2D1ChannelDepth.cs | 32 - .../Attributes/Enums/D2D1CompileOptions.cs | 203 -- .../Attributes/Enums/D2D1Filter.cs | 69 - .../Attributes/Enums/D2D1PixelOptions.cs | 29 - .../Attributes/Enums/D2D1ShaderProfile.cs | 69 - .../ComputeSharp.D2D1.csproj | 23 - .../ComputeSharp.D2D1.targets | 60 - .../Extensions/ComPtrExtensions.cs | 28 - .../Extensions/HRESULTExtensions.cs | 36 - .../Extensions/RECTExtensions.cs | 97 - .../Extensions/RectangleExtensions.cs | 39 - .../Descriptors/ID2D1ConstantBufferLoader.cs | 15 - .../ID2D1PixelShaderDescriptor{T}.cs | 160 -- .../Interfaces/ID2D1PixelShader.cs | 13 - .../HlslD2DIntrinsicInputTypeAttribute.cs | 23 - src/ComputeSharp.D2D1/Intrinsics/D2D.cs | 73 - src/ComputeSharp.D2D1/README.md | 39 - .../Resources/D2D1ResourceTexture1D{T}.cs | 32 - .../Resources/D2D1ResourceTexture2D{T}.cs | 54 - .../Resources/D2D1ResourceTexture3D{T}.cs | 62 - .../Exceptions/FxcCompilationException.cs | 37 - .../Interop/Buffers/ArrayPoolBinaryWriter.cs | 169 -- .../Interop/D2D1DrawInfoUpdateContext{T}.cs | 72 - .../D2D1DrawTransformMapper{T}.Factories.cs | 88 - .../Interop/D2D1DrawTransformMapper{T}.cs | 277 --- .../Interop/D2D1EffectRegistrationData.cs | 297 --- .../Shaders/Interop/D2D1ExtendMode.cs | 28 - .../Shaders/Interop/D2D1InputDescription.cs | 42 - .../Shaders/Interop/D2D1PixelShader.cs | 472 ---- .../Shaders/Interop/D2D1PixelShaderEffect.cs | 553 ----- .../Interop/D2D1PixelShaderEffectProperty.cs | 140 -- .../Interop/D2D1PixelShaderInputType.cs | 31 - .../Shaders/Interop/D2D1PropertyBinding.cs | 35 - .../Shaders/Interop/D2D1ReflectionServices.cs | 79 - .../Interop/D2D1ResourceTextureDescription.cs | 33 - .../Interop/D2D1ResourceTextureManager.cs | 534 ----- .../Shaders/Interop/D2D1ShaderCompiler.cs | 112 - .../Shaders/Interop/D2D1ShaderInfo.cs | 62 - .../Shaders/Interop/D3DFeatureLevel.cs | 69 - .../Effects/PixelShaderEffect.Globals{T}.cs | 121 -- ...lShaderEffect.ID2D1DrawTransformMethods.cs | 290 --- ...ixelShaderEffect.ID2D1EffectImplMethods.cs | 157 -- .../Effects/PixelShaderEffect.Properties.cs | 241 --- .../Effects/PixelShaderEffect.Properties.g.cs | 232 -- .../Effects/PixelShaderEffect.Properties.tt | 38 - ...aderEffect.ResourceTextureManagerBuffer.cs | 23 - .../Interop/Effects/PixelShaderEffect.cs | 227 -- ...ManagerImpl.ID2D1ResourceTextureManager.cs | 643 ------ ...mpl.ID2D1ResourceTextureManagerInternal.cs | 179 -- .../D2D1ResourceTextureManagerImpl.cs | 246 --- .../ID2D1ResourceTextureManager.cs | 99 - .../ID2D1ResourceTextureManagerInternal.cs | 71 - ...teContextImpl.ID2D1DrawInfoUpdateContex.cs | 120 -- ...tImpl.ID2D1DrawInfoUpdateContexInternal.cs | 61 - .../D2D1DrawInfoUpdateContextImpl.cs | 177 -- ...formMapperImpl.ID2D1DrawTransformMapper.cs | 143 -- ...erImpl.ID2D1DrawTransformMapperInternal.cs | 59 - .../D2D1DrawTransformMapperImpl.cs | 240 --- .../ID2D1DrawInfoUpdateContext.cs | 86 - .../ID2D1DrawInfoUpdateContextInternal.cs | 53 - .../ID2D1DrawTransformMapper.cs | 112 - .../ID2D1DrawTransformMapperInternal.cs | 56 - .../ID2D1DrawTransformMapperInterop.cs | 30 - .../ID2D1EffectContextExtensions.cs | 150 -- .../D2D1TransformMapper{T,TParameters}.cs | 97 - .../Factories/D2D1AffineTransformMapper{T}.cs | 143 -- .../D2D1InflateTransformMapper{T}.cs | 111 - .../Helpers/D2D1AssemblyAssociatedMemory.cs | 35 - .../Interop/Helpers/D2D1EffectXmlFactory.cs | 144 -- .../Shaders/Interop/Helpers/Point64.cs | 64 - .../Shaders/Interop/Helpers/Rectangle64.cs | 144 -- .../D2D1ByteArrayConstantBufferLoader.cs | 33 - .../D2D1ByteBufferConstantBufferLoader.cs | 73 - .../D2D1DrawInfoConstantBufferLoader.cs | 37 - ...awInfoUpdateContextConstantBufferLoader.cs | 37 - .../Loaders/D2D1EffectConstantBufferLoader.cs | 44 - .../Shaders/Translation/ASCII.cs | 68 - .../Translation/D3DCompiler.ID3DInclude.cs | 122 -- .../Shaders/Translation/D3DCompiler.cs | 316 --- .../Translation/Headers/D2D1EffectHelpers.cs | 339 --- .../ComputeContextExtensions.cs | 281 --- src/ComputeSharp.Pix/ComputeSharp.Pix.csproj | 77 - src/ComputeSharp.Pix/ComputeSharp.Pix.targets | 53 - .../ID3D12GraphicsCommandListExtensions.cs | 105 - src/ComputeSharp.Pix/Interop/Pix.cs | 44 - src/ComputeSharp.Pix/Interop/Pix.h.cs | 43 - src/ComputeSharp.Pix/LICENSE.txt | 106 - src/ComputeSharp.Pix/README.md | 9 - src/ComputeSharp.UI/ComputeSharp.UI.projitems | 27 - src/ComputeSharp.UI/ComputeSharp.UI.shproj | 13 - .../AnimatedComputeShaderPanel.Properties.cs | 210 -- .../Controls/AnimatedComputeShaderPanel.cs | 101 - .../Controls/ComputeShaderPanel.Properties.cs | 210 -- .../Controls/ComputeShaderPanel.cs | 95 - .../Controls/RenderingFailedEventArgs.cs | 27 - .../Extensions/IDXGIAdapterExtensions.cs | 77 - .../Extensions/SemaphoreSlimExtensions.cs | 56 - .../Helpers/DynamicResolutionManager.cs | 139 -- .../Helpers/SwapChainManager.Rendering.cs | 444 ---- .../Helpers/SwapChainManager.cs | 582 ----- .../Helpers/SwapChainPanelNativeMarshaller.cs | 68 - src/ComputeSharp.UI/IFrameRequestQueue.cs | 39 - src/ComputeSharp.UI/IShaderRunner.cs | 26 - src/ComputeSharp.UI/ShaderRunner{T}.cs | 73 - src/ComputeSharp.Uwp/ComputeSharp.Uwp.csproj | 18 - src/ComputeSharp.Uwp/README.md | 9 - src/ComputeSharp.Win32.D2D1/.editorconfig | 46 - .../ComputeSharp.Win32.D2D1.projitems | 79 - .../ComputeSharp.Win32.D2D1.shproj | 12 - .../headers/d3dcommon/D3D_FEATURE_LEVEL.cs | 21 - .../DirectX/um/d2d1/D2D1_EXTEND_MODE.cs | 14 - .../DirectX/um/d2d1/ID2D1Factory.cs | 13 - .../DirectX/um/d2d1/ID2D1Image.cs | 75 - .../um/d2d1_1/D2D1_BUFFER_PRECISION.cs | 17 - .../DirectX/um/d2d1_1/D2D1_CHANNEL_DEPTH.cs | 14 - .../DirectX/um/d2d1_1/D2D1_PROPERTY.cs | 21 - .../DirectX/um/d2d1_1/D2D1_PROPERTY_TYPE.cs | 14 - .../DirectX/um/d2d1_1/ID2D1CommandList.cs | 42 - .../DirectX/um/d2d1_1/ID2D1DeviceContext.cs | 44 - .../DirectX/um/d2d1_1/ID2D1Effect.cs | 43 - .../DirectX/um/d2d1_1/ID2D1Factory1.cs | 49 - .../DirectX/um/d2d1_1/ID2D1Multithread.cs | 89 - .../DirectX/um/d2d1_2/ID2D1Device1.cs | 75 - .../um/d2d1effectauthor/D2D1_CHANGE_TYPE.cs | 18 - .../um/d2d1effectauthor/D2D1_FEATURE.cs | 13 - .../D2D1_FEATURE_DATA_DOUBLES.cs | 11 - .../um/d2d1effectauthor/D2D1_FILTER.cs | 20 - .../D2D1_INPUT_DESCRIPTION.cs | 14 - .../um/d2d1effectauthor/D2D1_PIXEL_OPTIONS.cs | 16 - .../d2d1effectauthor/D2D1_PROPERTY_BINDING.cs | 18 - .../D2D1_RESOURCE_TEXTURE_PROPERTIES.cs | 24 - .../um/d2d1effectauthor/ID2D1DrawInfo.cs | 68 - .../um/d2d1effectauthor/ID2D1DrawTransform.cs | 101 - .../um/d2d1effectauthor/ID2D1EffectContext.cs | 81 - .../um/d2d1effectauthor/ID2D1EffectImpl.cs | 86 - .../d2d1effectauthor/ID2D1ResourceTexture.cs | 49 - .../um/d2d1effectauthor/ID2D1Transform.cs | 42 - .../d2d1effectauthor/ID2D1TransformGraph.cs | 22 - .../um/d2d1effectauthor/ID2D1TransformNode.cs | 42 - .../DirectX/um/d2d1effects/CLSID.cs | 63 - .../um/d2d1effects/D2D1_BORDER_MODE.cs | 13 - ...D2D1_DPICOMPENSATION_INTERPOLATION_MODE.cs | 17 - .../d2d1effects/D2D1_DPICOMPENSATION_PROP.cs | 14 - .../um/d3d11shader/D3D11_SHADER_DESC.cs | 86 - .../um/d3d11shader/ID3D11ShaderReflection.cs | 139 -- .../DirectX/um/d3dcommon/D3D_INCLUDE_TYPE.cs | 15 - .../DirectX/um/d3dcommon/D3D_SHADER_MACRO.cs | 15 - .../DirectX/um/d3dcommon/ID3DInclude.cs | 27 - .../DirectX/um/d3dcompiler/D3DCOMPILE.cs | 111 - .../um/d3dcompiler/D3DCOMPILER_STRIP_FLAGS.cs | 19 - .../DirectX/um/d3dcompiler/D3D_BLOB_PART.cs | 27 - .../DirectX/um/d3dcompiler/DirectX.cs | 24 - .../DirectX/um/dcommon/D2D_VECTOR_2F.cs | 12 - .../Windows/other/helper-types/HSTRING.cs | 13 - .../Windows/shared/windef/RECT.cs | 21 - .../Windows/shared/winerror/D2DERR.cs | 21 - .../Windows/shared/winerror/RO.cs | 12 - .../ComputeSharp.WinUI.csproj | 26 - src/ComputeSharp.WinUI/README.md | 9 - src/ComputeSharp/ComputeSharp.csproj | 3 - src/Directory.Build.props | 23 - ....D2D1.Tests.AssemblyLevelAttributes.csproj | 16 - .../D2D1PixelShaderTests.cs | 193 -- .../Properties/AssemblyInfo.cs | 4 - ...teSharp.D2D1.Tests.SourceGenerators.csproj | 37 - .../Test_D2DPixelShaderDescriptorGenerator.cs | 1919 ----------------- ...ixelShaderDescriptorGenerator_Analyzers.cs | 1566 -------------- ...elShaderDescriptorGenerator_Diagnostics.cs | 64 - ...haderDescriptorGenerator_Incrementality.cs | 202 -- ...D2DPixelShaderSourceGenerator_Analyzers.cs | 267 --- ...xelShaderSourceGenerator_Incrementality.cs | 275 --- ...lShaderDescriptorOnPixelShaderCodeFixer.cs | 361 ---- .../Assets/ContouredLayers.png | Bin 2600714 -> 0 bytes .../Assets/Green32x32.png | Bin 123 -> 0 bytes .../Assets/Landscape.png | Bin 1819066 -> 0 bytes .../Assets/Landscape_CheckerboardClip.png | Bin 1183096 -> 0 bytes .../Assets/Landscape_Inverted.png | Bin 2065391 -> 0 bytes .../Assets/Landscape_Pixelate.png | Bin 90122 -> 0 bytes .../Assets/PyramidPattern.png | Bin 1707380 -> 0 bytes .../Assets/RadialFadeOut.png | Bin 2098677 -> 0 bytes .../Assets/TerracedHills.png | Bin 941015 -> 0 bytes .../Assets/TriangleGridContouring.png | Bin 1813132 -> 0 bytes .../Assets/TwoTiledTruchet.png | Bin 419672 -> 0 bytes .../Assets/Wallpaper0.png | Bin 454673 -> 0 bytes .../Assets/Wallpaper1.png | Bin 335469 -> 0 bytes .../Assets/WallpapersStack.png | Bin 1521538 -> 0 bytes .../Assets/ZonePlate.png | Bin 423711 -> 0 bytes .../ComputeSharp.D2D1.Tests.csproj | 104 - .../D2D1EffectRegistrationDataTests.cs | 241 --- .../D2D1PixelShaderEffectTests.cs | 296 --- .../D2D1PixelShaderTests.cs | 1335 ------------ .../D2D1ReflectionServicesTests.cs | 131 -- .../D2D1ResourceTextureManagerTests.cs | 945 -------- ...itializedFieldDiagnosticSuppressorTests.cs | 23 - .../D2D1ShaderCompilerTests.cs | 318 --- .../D2D1TransformMapperTests.cs | 324 --- .../D2DPixelShaderSourceTests.cs | 33 - .../Effects/BokehBlurEffect.cs | 625 ------ .../Effects/CheckerboardClipEffect.cs | 28 - .../Effects/InvertEffect.cs | 17 - .../Effects/InvertWithThresholdEffect.cs | 17 - ...tWithUserTypeAndMutuallyInvokingMethods.cs | 50 - ...InvertWithUserTypeWithConstructorEffect.cs | 33 - .../Effects/PixelateEffect.cs | 45 - .../Effects/ZonePlateEffect.cs | 33 - tests/ComputeSharp.D2D1.Tests/EffectsTests.cs | 93 - .../Extensions/ComPtrExtensions.cs | 28 - .../Extensions/HRESULTExtensions.cs | 53 - .../Helpers/D2D1Helper.cs | 242 --- .../Helpers/D2D1TestRunner.cs | 194 -- .../Helpers/ImageHelper.cs | 63 - .../ShaderRewriterTests.cs | 240 --- tests/ComputeSharp.D2D1.Tests/ShadersTests.cs | 123 -- ...p.D2D1.WinUI.Tests.SourceGenerators.csproj | 37 - ...harpCodeFixerTest{TAnalyzer,TCodeFixer}.cs | 42 - .../Test_CanvasEffectPropertyGenerator.cs | 584 ----- ...CanvasEffectPropertyGenerator_Analyzers.cs | 457 ---- ...sEffectPropertyGenerator_Incrementality.cs | 120 -- ...fectPropertyOnSemiAutoPropertyCodeFixer.cs | 767 ------- tests/ComputeSharp.D2D1.WinUI.Tests/App.xaml | 4 - .../ComputeSharp.D2D1.WinUI.Tests/App.xaml.cs | 25 - .../Assets/LockScreenLogo.scale-200.png | Bin 432 -> 0 bytes .../Assets/SplashScreen.scale-200.png | Bin 5372 -> 0 bytes .../Assets/Square150x150Logo.scale-200.png | Bin 1755 -> 0 bytes .../Assets/Square44x44Logo.scale-200.png | Bin 637 -> 0 bytes ...x44Logo.targetsize-24_altform-unplated.png | Bin 283 -> 0 bytes .../Assets/StoreLogo.png | Bin 456 -> 0 bytes .../Assets/Wide310x150Logo.scale-200.png | Bin 2097 -> 0 bytes .../ComputeSharp.D2D1.WinUI.Tests.csproj | 97 - .../Helpers/TolerantImageComparer.cs | 103 - .../Helpers/Win2DHelper.cs | 116 - .../Package.appxmanifest | 49 - .../PublishProfiles/win-arm64.pubxml | 14 - .../Properties/PublishProfiles/win-x64.pubxml | 14 - .../Properties/launchSettings.json | 10 - .../Tests/CanvasEffectTests.cs | 712 ------ .../Tests/PixelShaderEffectTests.cs | 521 ----- .../Tests/ShadersTests.cs | 142 -- .../app.manifest | 17 - .../ComputeSharp.Dxc.NuGet.csproj | 19 - tests/ComputeSharp.Dxc.NuGet/Program.cs | 45 - .../ComputeSharp.NuGet.csproj | 18 - tests/ComputeSharp.NuGet/Program.cs | 37 - .../ComputeSharp.Pix.NuGet.csproj | 19 - tests/ComputeSharp.Pix.NuGet/Program.cs | 43 - .../ComputeSharp.Tests.DeviceLost.csproj | 35 - .../DeviceDisposalTests.cs | 191 -- .../DeviceLostTests.cs | 167 -- .../Extensions/DeviceExtensions.cs | 56 - .../GetDefaultDeviceTests.cs | 121 -- .../Helpers/GraphicsDeviceHelper.cs | 97 - .../Properties/AssemblyInfo.cs | 3 - ...arp.Tests.DisableDynamicCompilation.csproj | 29 - .../DispatchTests.cs | 91 - ...ComputeSharp.Tests.GlobalStatements.csproj | 14 - .../Program.cs | 37 - ...Sharp.Tests.NativeLibrariesResolver.csproj | 14 - .../DxcNativeLibrariesResolverTests.cs | 36 - .../NativeLibrariesResolverTestsBase.cs | 299 --- .../NativeLibrariesResolverTests.cs | 34 - .../PixNativeLibrariesResolverTests.cs | 37 - .../Properties/AssemblyInfo.cs | 3 - ...ComputeSharp.Tests.SourceGenerators.csproj | 25 - .../Helpers/CSharpAnalyzerTest{TAnalyzer}.cs | 85 - .../CSharpGeneratorTest{TGenerator}.cs | 230 -- .../Test_ComputeShaderDescriptorGenerator.cs | 882 -------- ...puteShaderDescriptorGenerator_Analyzers.cs | 725 ------- ...teShaderDescriptorGenerator_Diagnostics.cs | 1554 ------------- ...haderDescriptorGenerator_Incrementality.cs | 98 - .../InteropServicesTests.Sharing.cs | 21 - 588 files changed, 3 insertions(+), 56403 deletions(-) delete mode 100644 samples/ComputeSharp.Benchmark/Blas/BlasBenchmark.cs delete mode 100644 samples/ComputeSharp.Benchmark/Blas/BlasHelpers.cs delete mode 100644 samples/ComputeSharp.Benchmark/ComputeSharp.Benchmark.csproj delete mode 100644 samples/ComputeSharp.Benchmark/Dispatching/DispatchingBenchmark.cs delete mode 100644 samples/ComputeSharp.Benchmark/Imaging/ImagingBenchmark.cs delete mode 100644 samples/ComputeSharp.Benchmark/Program.cs delete mode 100644 samples/ComputeSharp.ImageProcessing/ComputeSharp.ImageProcessing.csproj delete mode 100644 samples/ComputeSharp.ImageProcessing/Program.cs delete mode 100644 samples/ComputeSharp.NativeLibrary.WinRT/ComputeSharp.NativeLibrary.WinRT.csproj delete mode 100644 samples/ComputeSharp.NativeLibrary.WinRT/HelloWorldEffect.cs delete mode 100644 samples/ComputeSharp.NativeLibrary/ComputeSharp.NativeLibrary.csproj delete mode 100644 samples/ComputeSharp.NativeLibrary/NativeLibrary.cs delete mode 100644 samples/ComputeSharp.Sample.FSharp.Shaders/ComputeSharp.Sample.FSharp.Shaders.csproj delete mode 100644 samples/ComputeSharp.Sample.FSharp.Shaders/MultiplyByTwo.cs delete mode 100644 samples/ComputeSharp.Sample.FSharp/ComputeSharp.Sample.FSharp.fsproj delete mode 100644 samples/ComputeSharp.Sample.FSharp/Program.fs delete mode 100644 samples/ComputeSharp.Sample/ComputeSharp.Sample.csproj delete mode 100644 samples/ComputeSharp.Sample/Helpers/Formatting.cs delete mode 100644 samples/ComputeSharp.Sample/Program.cs delete mode 100644 samples/ComputeSharp.SwapChain.Cli/ComputeSharp.SwapChain.Cli.csproj delete mode 100644 samples/ComputeSharp.SwapChain.Cli/Program.cs delete mode 100644 samples/ComputeSharp.SwapChain.D2D1.Cli/Backend/PixelShaderEffect.cs delete mode 100644 samples/ComputeSharp.SwapChain.D2D1.Cli/Backend/Win32Application.cs delete mode 100644 samples/ComputeSharp.SwapChain.D2D1.Cli/Backend/Win32ApplicationRunner.cs delete mode 100644 samples/ComputeSharp.SwapChain.D2D1.Cli/ComputeSharp.SwapChain.D2D1.Cli.csproj delete mode 100644 samples/ComputeSharp.SwapChain.D2D1.Cli/Program.cs delete mode 100644 samples/ComputeSharp.SwapChain.D2D1.Cli/app.manifest delete mode 100644 samples/ComputeSharp.SwapChain.D2D1.Uwp/App.cs delete mode 100644 samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/LockScreenLogo.scale-200.png delete mode 100644 samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/SplashScreen.scale-200.png delete mode 100644 samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/Square150x150Logo.scale-200.png delete mode 100644 samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/Square44x44Logo.scale-200.png delete mode 100644 samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png delete mode 100644 samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/StoreLogo.scale-200.png delete mode 100644 samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/Wide310x150Logo.scale-200.png delete mode 100644 samples/ComputeSharp.SwapChain.D2D1.Uwp/Backend/CoreWindowApplication.cs delete mode 100644 samples/ComputeSharp.SwapChain.D2D1.Uwp/Backend/CoreWindowApplicationRunner.cs delete mode 100644 samples/ComputeSharp.SwapChain.D2D1.Uwp/Backend/PixelShaderEffect.cs delete mode 100644 samples/ComputeSharp.SwapChain.D2D1.Uwp/ComputeSharp.SwapChain.D2D1.Uwp.csproj delete mode 100644 samples/ComputeSharp.SwapChain.D2D1.Uwp/Extensions/ApplicationViewTitleBarExtensions.cs delete mode 100644 samples/ComputeSharp.SwapChain.D2D1.Uwp/Package.appxmanifest delete mode 100644 samples/ComputeSharp.SwapChain.D2D1.Uwp/Properties/PublishProfiles/win-arm64.pubxml delete mode 100644 samples/ComputeSharp.SwapChain.D2D1.Uwp/Properties/PublishProfiles/win-x64.pubxml delete mode 100644 samples/ComputeSharp.SwapChain.D2D1.Uwp/Properties/launchSettings.json delete mode 100644 samples/ComputeSharp.SwapChain.Shaders.D2D1/ColorfulInfinity.cs delete mode 100644 samples/ComputeSharp.SwapChain.Shaders.D2D1/ComputeSharp.SwapChain.Shaders.D2D1.projitems delete mode 100644 samples/ComputeSharp.SwapChain.Shaders.D2D1/ComputeSharp.SwapChain.Shaders.D2D1.shproj delete mode 100644 samples/ComputeSharp.SwapChain.Shaders.D2D1/ContouredLayers.cs delete mode 100644 samples/ComputeSharp.SwapChain.Shaders.D2D1/FractalTiling.cs delete mode 100644 samples/ComputeSharp.SwapChain.Shaders.D2D1/HelloWorld.cs delete mode 100644 samples/ComputeSharp.SwapChain.Shaders.D2D1/MengerJourney.cs delete mode 100644 samples/ComputeSharp.SwapChain.Shaders.D2D1/Octagrams.cs delete mode 100644 samples/ComputeSharp.SwapChain.Shaders.D2D1/ProteanClouds.cs delete mode 100644 samples/ComputeSharp.SwapChain.Shaders.D2D1/PyramidPattern.cs delete mode 100644 samples/ComputeSharp.SwapChain.Shaders.D2D1/TerracedHills.cs delete mode 100644 samples/ComputeSharp.SwapChain.Shaders.D2D1/TriangleGridContouring.cs delete mode 100644 samples/ComputeSharp.SwapChain.Shaders.D2D1/TwoTiledTruchet.cs delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/LargeTile.scale-100.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/LargeTile.scale-125.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/LargeTile.scale-150.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/LargeTile.scale-200.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/LargeTile.scale-400.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/LockScreenLogo.scale-200.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/Misc/noise_low.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/SmallTile.scale-100.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/SmallTile.scale-125.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/SmallTile.scale-150.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/SmallTile.scale-200.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/SmallTile.scale-400.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/SplashScreen.scale-100.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/SplashScreen.scale-125.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/SplashScreen.scale-150.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/SplashScreen.scale-200.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/SplashScreen.scale-400.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/Square150x150Logo.scale-100.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/Square150x150Logo.scale-125.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/Square150x150Logo.scale-150.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/Square150x150Logo.scale-200.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/Square150x150Logo.scale-400.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-lightunplated_targetsize-16.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-lightunplated_targetsize-24.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-lightunplated_targetsize-256.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-lightunplated_targetsize-32.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-lightunplated_targetsize-48.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-unplated_targetsize-16.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-unplated_targetsize-256.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-unplated_targetsize-32.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-unplated_targetsize-48.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.scale-100.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.scale-125.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.scale-150.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.scale-200.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.scale-400.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.targetsize-16.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.targetsize-24.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.targetsize-24_altform-unplated.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.targetsize-256.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.targetsize-32.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.targetsize-48.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/StoreLogo.backup.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/StoreLogo.scale-100.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/StoreLogo.scale-125.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/StoreLogo.scale-150.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/StoreLogo.scale-200.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/StoreLogo.scale-400.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/Wide310x150Logo.scale-100.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/Wide310x150Logo.scale-125.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/Wide310x150Logo.scale-150.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/Wide310x150Logo.scale-200.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/Assets/Wide310x150Logo.scale-400.png delete mode 100644 samples/ComputeSharp.SwapChain.UI/ComputeSharp.SwapChain.UI.projitems delete mode 100644 samples/ComputeSharp.SwapChain.UI/ComputeSharp.SwapChain.UI.shproj delete mode 100644 samples/ComputeSharp.SwapChain.UI/Controls/D2D1AnimatedPixelShaderPanel.cs delete mode 100644 samples/ComputeSharp.SwapChain.UI/Converters/RenderingPauseConverter.cs delete mode 100644 samples/ComputeSharp.SwapChain.UI/Converters/ResolutionScaleConverter.cs delete mode 100644 samples/ComputeSharp.SwapChain.UI/Enums/RenderingMode.cs delete mode 100644 samples/ComputeSharp.SwapChain.UI/Shaders/PixelShaderEffect.cs delete mode 100644 samples/ComputeSharp.SwapChain.UI/Shaders/Runners/ContouredLayersRunner.cs delete mode 100644 samples/ComputeSharp.SwapChain.UI/Shaders/Runners/D2D1ContouredLayersRunner.cs delete mode 100644 samples/ComputeSharp.SwapChain.UI/ViewModels/MainViewModel.cs delete mode 100644 samples/ComputeSharp.SwapChain.UI/ViewModels/ShaderRunnerViewModel.cs delete mode 100644 samples/ComputeSharp.SwapChain.Uwp/App.xaml delete mode 100644 samples/ComputeSharp.SwapChain.Uwp/App.xaml.cs delete mode 100644 samples/ComputeSharp.SwapChain.Uwp/ComputeSharp.SwapChain.Uwp.csproj delete mode 100644 samples/ComputeSharp.SwapChain.Uwp/Controls/D2D1AnimatedPixelShaderPanel.xaml delete mode 100644 samples/ComputeSharp.SwapChain.Uwp/Package.appxmanifest delete mode 100644 samples/ComputeSharp.SwapChain.Uwp/Properties/PublishProfiles/win-arm64.pubxml delete mode 100644 samples/ComputeSharp.SwapChain.Uwp/Properties/PublishProfiles/win-x64.pubxml delete mode 100644 samples/ComputeSharp.SwapChain.Uwp/Properties/launchSettings.json delete mode 100644 samples/ComputeSharp.SwapChain.Uwp/Views/MainView.xaml delete mode 100644 samples/ComputeSharp.SwapChain.Uwp/Views/MainView.xaml.cs delete mode 100644 samples/ComputeSharp.SwapChain.WinUI/App.xaml delete mode 100644 samples/ComputeSharp.SwapChain.WinUI/App.xaml.cs delete mode 100644 samples/ComputeSharp.SwapChain.WinUI/ComputeSharp.SwapChain.WinUI.csproj delete mode 100644 samples/ComputeSharp.SwapChain.WinUI/Controls/D2D1AnimatedPixelShaderPanel.xaml delete mode 100644 samples/ComputeSharp.SwapChain.WinUI/Package.appxmanifest delete mode 100644 samples/ComputeSharp.SwapChain.WinUI/Properties/PublishProfiles/win-arm64.pubxml delete mode 100644 samples/ComputeSharp.SwapChain.WinUI/Properties/PublishProfiles/win-x64.pubxml delete mode 100644 samples/ComputeSharp.SwapChain.WinUI/Properties/launchSettings.json delete mode 100644 samples/ComputeSharp.SwapChain.WinUI/Views/MainWindow.xaml delete mode 100644 samples/ComputeSharp.SwapChain.WinUI/Views/MainWindow.xaml.cs delete mode 100644 samples/ComputeSharp.SwapChain.WinUI/app.manifest delete mode 100644 samples/ComputeSharp.SwapChain/Backend/Win32Application.cs delete mode 100644 samples/ComputeSharp.SwapChain/Backend/Win32ApplicationFactory{T}.cs delete mode 100644 samples/ComputeSharp.SwapChain/Backend/Win32ApplicationRunner.cs delete mode 100644 samples/ComputeSharp.SwapChain/ComputeSharp.SwapChain.csproj delete mode 100644 samples/ComputeSharp.SwapChain/Program.cs delete mode 100644 src/ComputeSharp.D2D1.CodeFixers/ComputeSharp.D2D1.CodeFixers.csproj delete mode 100644 src/ComputeSharp.D2D1.CodeFixers/MissingPixelShaderDescriptorOnPixelShaderCodeFixer.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/AnalyzerReleases.Shipped.md delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/AnalyzerReleases.Unshipped.md delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/ComputeSharp.D2D1.SourceGenerators.csproj delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.ConstantBuffer.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectFactory.Syntax.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectId.Syntax.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectId.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectMetadata.Syntax.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectMetadata.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslBytecode.Syntax.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslBytecode.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslSource.Syntax.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslSource.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.InputDescriptions.Syntax.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.InputDescriptions.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.InputTypes.Syntax.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.InputTypes.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.NumericProperties.Syntax.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.OutputBuffer.Syntax.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.OutputBuffer.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.PixelOptions.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.ResourceTextureDescriptions.Syntax.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.ResourceTextureDescriptions.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderSourceGenerator.Execute.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderSourceGenerator.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/D2DEnableRuntimeCompilationOnAssemblyAnalyzer.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/D2DEnableRuntimeCompilationOnTypeAnalyzer.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/ExcedeedPixelShaderDispatchDataSizeAnalyzer.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidAssemblyLevelCompileOptionsAnalyzer.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2D1PixelOptionsTrivialSamplingOnShaderTypeAnalyzer.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DGeneratedPixelShaderDescriptorAttributeTargetAnalyzer.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DInputArgumentAnalyzer.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DInputDescriptionAttributeUseAnalyzer.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DPixelShaderSourceAttributeUseAnalyzer.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DPixelShaderSourceMethodReturnTypeAnalyzer.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DRequiresDoublePrecisionSupportAnalyzer.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DResourceTextureIndexAttributeLocationAnalyzer.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DResourceTextureIndexAttributeUseAnalyzer.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidEffectIdValueAnalyzer.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidEffectMetadataValueAnalyzer.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidShaderTypeCompileOptionsAnalyzer.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidShaderTypeInputsAnalyzer.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/MissingAllowUnsafeBlocksCompilationOptionAnalyzer.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/MissingD2DCompileOptionsOnD2DPixelShaderSourceMethodAnalyzer.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/MissingD2DShaderProfileOnD2DPixelShaderSourceMethodAnalyzer.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/MissingPixelShaderDescriptorOnPixelShaderAnalyzer.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/NonConstantD2DInputArgumentAnalyzer.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/NotAccessibleD2DGeneratedPixelShaderDescriptorAttributeTargetAnalyzer.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/NotAccessibleFieldTypeInD2DGeneratedShaderDescriptorAttributeTargetAnalyzer.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/NotReadOnlyPixelShaderTypeWithFieldsAnalyzer.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/SuppressionDescriptors.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Suppressors/D2D1ResourceTextureUninitializedFieldDiagnosticSuppressor.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Fxc/D3DCompiler.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Helpers/D2D1EffectMetadataParser.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Mappings/HlslKnownKeywords.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Mappings/HlslKnownMethods.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Mappings/HlslKnownProperties.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Mappings/HlslKnownTypes.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Models/D2D1PixelShaderSourceInfo.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Models/D2D1ShaderInfo.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Models/HlslBytecodeInfoKey.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Models/InputDescription.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Models/ResourceTextureDescription.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/NativeMethods.txt delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/Polyfills/EncodingExtensions.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/SyntaxProcessors/ConstantBufferSyntaxProcessor.ArtificialFields.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/SyntaxProcessors/HlslBytecodeSyntaxProcessor.D2D1.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs delete mode 100644 src/ComputeSharp.D2D1.SourceGenerators/SyntaxRewriters/StaticFieldRewriter.cs delete mode 100644 src/ComputeSharp.D2D1.UI.CodeFixers/ComputeSharp.D2D1.UI.CodeFixers.projitems delete mode 100644 src/ComputeSharp.D2D1.UI.CodeFixers/ComputeSharp.D2D1.UI.CodeFixers.shproj delete mode 100644 src/ComputeSharp.D2D1.UI.CodeFixers/UseGeneratedCanvasEffectPropertyOnSemiAutoPropertyCodeFixer.cs delete mode 100644 src/ComputeSharp.D2D1.UI.SourceGenerators/CanvasEffectPropertyGenerator.Execute.cs delete mode 100644 src/ComputeSharp.D2D1.UI.SourceGenerators/CanvasEffectPropertyGenerator.cs delete mode 100644 src/ComputeSharp.D2D1.UI.SourceGenerators/ComputeSharp.D2D1.UI.SourceGenerators.projitems delete mode 100644 src/ComputeSharp.D2D1.UI.SourceGenerators/ComputeSharp.D2D1.UI.SourceGenerators.shproj delete mode 100644 src/ComputeSharp.D2D1.UI.SourceGenerators/Constants/WellKnownTypeNames.cs delete mode 100644 src/ComputeSharp.D2D1.UI.SourceGenerators/Diagnostics/Analyzers/InvalidGeneratedCanvasEffectPropertyAccessorsAnalyzer.cs delete mode 100644 src/ComputeSharp.D2D1.UI.SourceGenerators/Diagnostics/Analyzers/InvalidGeneratedCanvasEffectPropertyContainingTypeAnalyzer.cs delete mode 100644 src/ComputeSharp.D2D1.UI.SourceGenerators/Diagnostics/Analyzers/InvalidGeneratedCanvasEffectPropertyDeclarationAnalyzer.cs delete mode 100644 src/ComputeSharp.D2D1.UI.SourceGenerators/Diagnostics/Analyzers/RequireCSharpLanguageVersionPreviewAnalyzer.cs delete mode 100644 src/ComputeSharp.D2D1.UI.SourceGenerators/Diagnostics/Analyzers/UseGeneratedCanvasEffectPropertyOnSemiAutoPropertyAnalyzer.cs delete mode 100644 src/ComputeSharp.D2D1.UI.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs delete mode 100644 src/ComputeSharp.D2D1.UI.SourceGenerators/Models/CanvasEffectPropertyInfo.cs delete mode 100644 src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ICanvasDevice.cs delete mode 100644 src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ICanvasEffect.cs delete mode 100644 src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ICanvasEffectFactoryNative.cs delete mode 100644 src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ICanvasFactoryNative.cs delete mode 100644 src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ICanvasImageInterop.cs delete mode 100644 src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ICanvasResourceCreator.cs delete mode 100644 src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ICanvasResourceCreatorWithDpi.cs delete mode 100644 src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ICanvasResourceWrapperNative.cs delete mode 100644 src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ID2D1DeviceContextLease.cs delete mode 100644 src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ID2D1DeviceContextPool.cs delete mode 100644 src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/Inspectable/IInspectable.cs delete mode 100644 src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/WIN2D_GET_D2D_IMAGE_FLAGS.cs delete mode 100644 src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/WIN2D_GET_DEVICE_ASSOCIATION_TYPE.cs delete mode 100644 src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/Win2D.cs delete mode 100644 src/ComputeSharp.D2D1.UI/Attributes/GeneratedCanvasEffectPropertyAttribute.cs delete mode 100644 src/ComputeSharp.D2D1.UI/Buffers/GraphicsEffectSourceBuffer.cs delete mode 100644 src/ComputeSharp.D2D1.UI/Buffers/ResourceTextureManagerBuffer.cs delete mode 100644 src/ComputeSharp.D2D1.UI/Buffers/SourceReference.cs delete mode 100644 src/ComputeSharp.D2D1.UI/CanvasEffect.Interop.cs delete mode 100644 src/ComputeSharp.D2D1.UI/CanvasEffect.cs delete mode 100644 src/ComputeSharp.D2D1.UI/CanvasEffectGraph.cs delete mode 100644 src/ComputeSharp.D2D1.UI/CanvasEffectInvalidationType.cs delete mode 100644 src/ComputeSharp.D2D1.UI/CanvasEffectNode{T}.cs delete mode 100644 src/ComputeSharp.D2D1.UI/Collections/FixedCountList{T}.cs delete mode 100644 src/ComputeSharp.D2D1.UI/Collections/IFixedCountList{T}.cs delete mode 100644 src/ComputeSharp.D2D1.UI/ComputeSharp.D2D1.UI.projitems delete mode 100644 src/ComputeSharp.D2D1.UI/ComputeSharp.D2D1.UI.shproj delete mode 100644 src/ComputeSharp.D2D1.UI/Extensions/ICanvasDeviceExtensions.cs delete mode 100644 src/ComputeSharp.D2D1.UI/Extensions/ID2D1DeviceContextExtensions.cs delete mode 100644 src/ComputeSharp.D2D1.UI/Extensions/ID2D1EffectExtensions.cs delete mode 100644 src/ComputeSharp.D2D1.UI/Extensions/IUnknownExtensions.cs delete mode 100644 src/ComputeSharp.D2D1.UI/Helpers/RcwMarshaller.cs delete mode 100644 src/ComputeSharp.D2D1.UI/Helpers/ResourceManager.cs delete mode 100644 src/ComputeSharp.D2D1.UI/ICanvasEffectNode.cs delete mode 100644 src/ComputeSharp.D2D1.UI/ICanvasEffectNode{T}.cs delete mode 100644 src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.ICanvasEffect.cs delete mode 100644 src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.ICanvasEffectFactoryNative.cs delete mode 100644 src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.ICanvasImage.cs delete mode 100644 src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.ICanvasImageInterop.cs delete mode 100644 src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.Properties.Interop.Sources.cs delete mode 100644 src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.Properties.Interop.cs delete mode 100644 src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.Properties.ResourceTextureManagerCollection.cs delete mode 100644 src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.Properties.SourceCollection.cs delete mode 100644 src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.Properties.cs delete mode 100644 src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.ReferenceTracking.cs delete mode 100644 src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.cs delete mode 100644 src/ComputeSharp.D2D1.Uwp.CodeFixers/ComputeSharp.D2D1.Uwp.CodeFixers.csproj delete mode 100644 src/ComputeSharp.D2D1.Uwp.SourceGenerators/AnalyzerReleases.Shipped.md delete mode 100644 src/ComputeSharp.D2D1.Uwp.SourceGenerators/AnalyzerReleases.Unshipped.md delete mode 100644 src/ComputeSharp.D2D1.Uwp.SourceGenerators/ComputeSharp.D2D1.Uwp.SourceGenerators.csproj delete mode 100644 src/ComputeSharp.D2D1.Uwp/ComputeSharp.D2D1.Uwp.csproj delete mode 100644 src/ComputeSharp.D2D1.Uwp/ComputeSharp.D2D1.Uwp.targets delete mode 100644 src/ComputeSharp.D2D1.Uwp/README.md delete mode 100644 src/ComputeSharp.D2D1.WinUI.CodeFixers/ComputeSharp.D2D1.WinUI.CodeFixers.csproj delete mode 100644 src/ComputeSharp.D2D1.WinUI.SourceGenerators/AnalyzerReleases.Shipped.md delete mode 100644 src/ComputeSharp.D2D1.WinUI.SourceGenerators/AnalyzerReleases.Unshipped.md delete mode 100644 src/ComputeSharp.D2D1.WinUI.SourceGenerators/ComputeSharp.D2D1.WinUI.SourceGenerators.csproj delete mode 100644 src/ComputeSharp.D2D1.WinUI/ComputeSharp.D2D1.WinUI.csproj delete mode 100644 src/ComputeSharp.D2D1.WinUI/ComputeSharp.D2D1.WinUI.targets delete mode 100644 src/ComputeSharp.D2D1.WinUI/README.md delete mode 100644 src/ComputeSharp.D2D1/Attributes/D2DCompileOptionsAttribute.cs delete mode 100644 src/ComputeSharp.D2D1/Attributes/D2DEffectAuthorAttribute.cs delete mode 100644 src/ComputeSharp.D2D1/Attributes/D2DEffectCategoryAttribute.cs delete mode 100644 src/ComputeSharp.D2D1/Attributes/D2DEffectDescriptionAttribute.cs delete mode 100644 src/ComputeSharp.D2D1/Attributes/D2DEffectDisplayNameAttribute.cs delete mode 100644 src/ComputeSharp.D2D1/Attributes/D2DEffectIdAttribute.cs delete mode 100644 src/ComputeSharp.D2D1/Attributes/D2DEnableRuntimeCompilation.cs delete mode 100644 src/ComputeSharp.D2D1/Attributes/D2DGeneratedPixelShaderDescriptorAttribute.cs delete mode 100644 src/ComputeSharp.D2D1/Attributes/D2DInputComplexAttribute.cs delete mode 100644 src/ComputeSharp.D2D1/Attributes/D2DInputCountAttribute.cs delete mode 100644 src/ComputeSharp.D2D1/Attributes/D2DInputDescriptionAttribute.cs delete mode 100644 src/ComputeSharp.D2D1/Attributes/D2DInputSimpleAttribute.cs delete mode 100644 src/ComputeSharp.D2D1/Attributes/D2DOutputBufferAttribute.cs delete mode 100644 src/ComputeSharp.D2D1/Attributes/D2DPixelOptionsAttribute.cs delete mode 100644 src/ComputeSharp.D2D1/Attributes/D2DPixelShaderSourceAttribute.cs delete mode 100644 src/ComputeSharp.D2D1/Attributes/D2DRequiresDoublePrecisionSupportAttribute.cs delete mode 100644 src/ComputeSharp.D2D1/Attributes/D2DRequiresScenePositionAttribute.cs delete mode 100644 src/ComputeSharp.D2D1/Attributes/D2DResourceTextureIndexAttribute.cs delete mode 100644 src/ComputeSharp.D2D1/Attributes/D2DShaderProfileAttribute.cs delete mode 100644 src/ComputeSharp.D2D1/Attributes/Enums/D2D1BufferPrecision.cs delete mode 100644 src/ComputeSharp.D2D1/Attributes/Enums/D2D1ChannelDepth.cs delete mode 100644 src/ComputeSharp.D2D1/Attributes/Enums/D2D1CompileOptions.cs delete mode 100644 src/ComputeSharp.D2D1/Attributes/Enums/D2D1Filter.cs delete mode 100644 src/ComputeSharp.D2D1/Attributes/Enums/D2D1PixelOptions.cs delete mode 100644 src/ComputeSharp.D2D1/Attributes/Enums/D2D1ShaderProfile.cs delete mode 100644 src/ComputeSharp.D2D1/ComputeSharp.D2D1.csproj delete mode 100644 src/ComputeSharp.D2D1/ComputeSharp.D2D1.targets delete mode 100644 src/ComputeSharp.D2D1/Extensions/ComPtrExtensions.cs delete mode 100644 src/ComputeSharp.D2D1/Extensions/HRESULTExtensions.cs delete mode 100644 src/ComputeSharp.D2D1/Extensions/RECTExtensions.cs delete mode 100644 src/ComputeSharp.D2D1/Extensions/RectangleExtensions.cs delete mode 100644 src/ComputeSharp.D2D1/Interfaces/Descriptors/ID2D1ConstantBufferLoader.cs delete mode 100644 src/ComputeSharp.D2D1/Interfaces/Descriptors/ID2D1PixelShaderDescriptor{T}.cs delete mode 100644 src/ComputeSharp.D2D1/Interfaces/ID2D1PixelShader.cs delete mode 100644 src/ComputeSharp.D2D1/Intrinsics/Attributes/HlslD2DIntrinsicInputTypeAttribute.cs delete mode 100644 src/ComputeSharp.D2D1/Intrinsics/D2D.cs delete mode 100644 src/ComputeSharp.D2D1/README.md delete mode 100644 src/ComputeSharp.D2D1/Resources/D2D1ResourceTexture1D{T}.cs delete mode 100644 src/ComputeSharp.D2D1/Resources/D2D1ResourceTexture2D{T}.cs delete mode 100644 src/ComputeSharp.D2D1/Resources/D2D1ResourceTexture3D{T}.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Exceptions/FxcCompilationException.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Buffers/ArrayPoolBinaryWriter.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/D2D1DrawInfoUpdateContext{T}.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/D2D1DrawTransformMapper{T}.Factories.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/D2D1DrawTransformMapper{T}.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/D2D1EffectRegistrationData.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/D2D1ExtendMode.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/D2D1InputDescription.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/D2D1PixelShader.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/D2D1PixelShaderEffect.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/D2D1PixelShaderEffectProperty.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/D2D1PixelShaderInputType.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/D2D1PropertyBinding.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/D2D1ReflectionServices.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/D2D1ResourceTextureDescription.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/D2D1ResourceTextureManager.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/D2D1ShaderCompiler.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/D2D1ShaderInfo.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/D3DFeatureLevel.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.Globals{T}.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.ID2D1DrawTransformMethods.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.ID2D1EffectImplMethods.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.Properties.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.Properties.g.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.Properties.tt delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.ResourceTextureManagerBuffer.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Effects/ResourceManagers/D2D1ResourceTextureManagerImpl.ID2D1ResourceTextureManager.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Effects/ResourceManagers/D2D1ResourceTextureManagerImpl.ID2D1ResourceTextureManagerInternal.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Effects/ResourceManagers/D2D1ResourceTextureManagerImpl.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Effects/ResourceManagers/ID2D1ResourceTextureManager.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Effects/ResourceManagers/ID2D1ResourceTextureManagerInternal.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawInfoUpdateContextImpl.ID2D1DrawInfoUpdateContex.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawInfoUpdateContextImpl.ID2D1DrawInfoUpdateContexInternal.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawInfoUpdateContextImpl.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawTransformMapperImpl.ID2D1DrawTransformMapper.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawTransformMapperImpl.ID2D1DrawTransformMapperInternal.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawTransformMapperImpl.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1DrawInfoUpdateContext.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1DrawInfoUpdateContextInternal.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1DrawTransformMapper.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1DrawTransformMapperInternal.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1DrawTransformMapperInterop.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Extensions/ID2D1EffectContextExtensions.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Factories/Abstract/D2D1TransformMapper{T,TParameters}.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Factories/D2D1AffineTransformMapper{T}.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Factories/D2D1InflateTransformMapper{T}.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Helpers/D2D1AssemblyAssociatedMemory.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Helpers/D2D1EffectXmlFactory.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Helpers/Point64.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Interop/Helpers/Rectangle64.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Loaders/D2D1ByteArrayConstantBufferLoader.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Loaders/D2D1ByteBufferConstantBufferLoader.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Loaders/D2D1DrawInfoConstantBufferLoader.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Loaders/D2D1DrawInfoUpdateContextConstantBufferLoader.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Loaders/D2D1EffectConstantBufferLoader.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Translation/ASCII.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Translation/D3DCompiler.ID3DInclude.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Translation/D3DCompiler.cs delete mode 100644 src/ComputeSharp.D2D1/Shaders/Translation/Headers/D2D1EffectHelpers.cs delete mode 100644 src/ComputeSharp.Pix/ComputeContextExtensions.cs delete mode 100644 src/ComputeSharp.Pix/ComputeSharp.Pix.csproj delete mode 100644 src/ComputeSharp.Pix/ComputeSharp.Pix.targets delete mode 100644 src/ComputeSharp.Pix/Interop/ID3D12GraphicsCommandListExtensions.cs delete mode 100644 src/ComputeSharp.Pix/Interop/Pix.cs delete mode 100644 src/ComputeSharp.Pix/Interop/Pix.h.cs delete mode 100644 src/ComputeSharp.Pix/LICENSE.txt delete mode 100644 src/ComputeSharp.Pix/README.md delete mode 100644 src/ComputeSharp.UI/ComputeSharp.UI.projitems delete mode 100644 src/ComputeSharp.UI/ComputeSharp.UI.shproj delete mode 100644 src/ComputeSharp.UI/Controls/AnimatedComputeShaderPanel.Properties.cs delete mode 100644 src/ComputeSharp.UI/Controls/AnimatedComputeShaderPanel.cs delete mode 100644 src/ComputeSharp.UI/Controls/ComputeShaderPanel.Properties.cs delete mode 100644 src/ComputeSharp.UI/Controls/ComputeShaderPanel.cs delete mode 100644 src/ComputeSharp.UI/Controls/RenderingFailedEventArgs.cs delete mode 100644 src/ComputeSharp.UI/Extensions/IDXGIAdapterExtensions.cs delete mode 100644 src/ComputeSharp.UI/Extensions/SemaphoreSlimExtensions.cs delete mode 100644 src/ComputeSharp.UI/Helpers/DynamicResolutionManager.cs delete mode 100644 src/ComputeSharp.UI/Helpers/SwapChainManager.Rendering.cs delete mode 100644 src/ComputeSharp.UI/Helpers/SwapChainManager.cs delete mode 100644 src/ComputeSharp.UI/Helpers/SwapChainPanelNativeMarshaller.cs delete mode 100644 src/ComputeSharp.UI/IFrameRequestQueue.cs delete mode 100644 src/ComputeSharp.UI/IShaderRunner.cs delete mode 100644 src/ComputeSharp.UI/ShaderRunner{T}.cs delete mode 100644 src/ComputeSharp.Uwp/ComputeSharp.Uwp.csproj delete mode 100644 src/ComputeSharp.Uwp/README.md delete mode 100644 src/ComputeSharp.Win32.D2D1/.editorconfig delete mode 100644 src/ComputeSharp.Win32.D2D1/ComputeSharp.Win32.D2D1.projitems delete mode 100644 src/ComputeSharp.Win32.D2D1/ComputeSharp.Win32.D2D1.shproj delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/headers/d3dcommon/D3D_FEATURE_LEVEL.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1/D2D1_EXTEND_MODE.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1/ID2D1Factory.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1/ID2D1Image.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/D2D1_BUFFER_PRECISION.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/D2D1_CHANNEL_DEPTH.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/D2D1_PROPERTY.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/D2D1_PROPERTY_TYPE.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/ID2D1CommandList.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/ID2D1DeviceContext.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/ID2D1Effect.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/ID2D1Factory1.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/ID2D1Multithread.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_2/ID2D1Device1.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/D2D1_CHANGE_TYPE.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/D2D1_FEATURE.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/D2D1_FEATURE_DATA_DOUBLES.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/D2D1_FILTER.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/D2D1_INPUT_DESCRIPTION.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/D2D1_PIXEL_OPTIONS.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/D2D1_PROPERTY_BINDING.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/D2D1_RESOURCE_TEXTURE_PROPERTIES.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/ID2D1DrawInfo.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/ID2D1DrawTransform.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/ID2D1EffectContext.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/ID2D1EffectImpl.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/ID2D1ResourceTexture.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/ID2D1Transform.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/ID2D1TransformGraph.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/ID2D1TransformNode.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effects/CLSID.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effects/D2D1_BORDER_MODE.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effects/D2D1_DPICOMPENSATION_INTERPOLATION_MODE.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effects/D2D1_DPICOMPENSATION_PROP.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d3d11shader/D3D11_SHADER_DESC.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d3d11shader/ID3D11ShaderReflection.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcommon/D3D_INCLUDE_TYPE.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcommon/D3D_SHADER_MACRO.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcommon/ID3DInclude.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcompiler/D3DCOMPILE.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcompiler/D3DCOMPILER_STRIP_FLAGS.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcompiler/D3D_BLOB_PART.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcompiler/DirectX.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/DirectX/um/dcommon/D2D_VECTOR_2F.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/Windows/other/helper-types/HSTRING.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/Windows/shared/windef/RECT.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/Windows/shared/winerror/D2DERR.cs delete mode 100644 src/ComputeSharp.Win32.D2D1/Windows/shared/winerror/RO.cs delete mode 100644 src/ComputeSharp.WinUI/ComputeSharp.WinUI.csproj delete mode 100644 src/ComputeSharp.WinUI/README.md delete mode 100644 tests/ComputeSharp.D2D1.Tests.AssemblyLevelAttributes/ComputeSharp.D2D1.Tests.AssemblyLevelAttributes.csproj delete mode 100644 tests/ComputeSharp.D2D1.Tests.AssemblyLevelAttributes/D2D1PixelShaderTests.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests.AssemblyLevelAttributes/Properties/AssemblyInfo.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests.SourceGenerators/ComputeSharp.D2D1.Tests.SourceGenerators.csproj delete mode 100644 tests/ComputeSharp.D2D1.Tests.SourceGenerators/Test_D2DPixelShaderDescriptorGenerator.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests.SourceGenerators/Test_D2DPixelShaderDescriptorGenerator_Analyzers.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests.SourceGenerators/Test_D2DPixelShaderDescriptorGenerator_Diagnostics.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests.SourceGenerators/Test_D2DPixelShaderDescriptorGenerator_Incrementality.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests.SourceGenerators/Test_D2DPixelShaderSourceGenerator_Analyzers.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests.SourceGenerators/Test_D2DPixelShaderSourceGenerator_Incrementality.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests.SourceGenerators/Test_MissingPixelShaderDescriptorOnPixelShaderCodeFixer.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests/Assets/ContouredLayers.png delete mode 100644 tests/ComputeSharp.D2D1.Tests/Assets/Green32x32.png delete mode 100644 tests/ComputeSharp.D2D1.Tests/Assets/Landscape.png delete mode 100644 tests/ComputeSharp.D2D1.Tests/Assets/Landscape_CheckerboardClip.png delete mode 100644 tests/ComputeSharp.D2D1.Tests/Assets/Landscape_Inverted.png delete mode 100644 tests/ComputeSharp.D2D1.Tests/Assets/Landscape_Pixelate.png delete mode 100644 tests/ComputeSharp.D2D1.Tests/Assets/PyramidPattern.png delete mode 100644 tests/ComputeSharp.D2D1.Tests/Assets/RadialFadeOut.png delete mode 100644 tests/ComputeSharp.D2D1.Tests/Assets/TerracedHills.png delete mode 100644 tests/ComputeSharp.D2D1.Tests/Assets/TriangleGridContouring.png delete mode 100644 tests/ComputeSharp.D2D1.Tests/Assets/TwoTiledTruchet.png delete mode 100644 tests/ComputeSharp.D2D1.Tests/Assets/Wallpaper0.png delete mode 100644 tests/ComputeSharp.D2D1.Tests/Assets/Wallpaper1.png delete mode 100644 tests/ComputeSharp.D2D1.Tests/Assets/WallpapersStack.png delete mode 100644 tests/ComputeSharp.D2D1.Tests/Assets/ZonePlate.png delete mode 100644 tests/ComputeSharp.D2D1.Tests/ComputeSharp.D2D1.Tests.csproj delete mode 100644 tests/ComputeSharp.D2D1.Tests/D2D1EffectRegistrationDataTests.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests/D2D1PixelShaderEffectTests.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests/D2D1PixelShaderTests.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests/D2D1ReflectionServicesTests.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests/D2D1ResourceTextureManagerTests.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests/D2D1ResourceTextureUninitializedFieldDiagnosticSuppressorTests.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests/D2D1ShaderCompilerTests.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests/D2D1TransformMapperTests.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests/D2DPixelShaderSourceTests.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests/Effects/BokehBlurEffect.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests/Effects/CheckerboardClipEffect.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests/Effects/InvertEffect.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests/Effects/InvertWithThresholdEffect.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests/Effects/InvertWithUserTypeAndMutuallyInvokingMethods.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests/Effects/InvertWithUserTypeWithConstructorEffect.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests/Effects/PixelateEffect.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests/Effects/ZonePlateEffect.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests/EffectsTests.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests/Extensions/ComPtrExtensions.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests/Extensions/HRESULTExtensions.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests/Helpers/D2D1Helper.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests/Helpers/D2D1TestRunner.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests/Helpers/ImageHelper.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests/ShaderRewriterTests.cs delete mode 100644 tests/ComputeSharp.D2D1.Tests/ShadersTests.cs delete mode 100644 tests/ComputeSharp.D2D1.WinUI.Tests.SourceGenerators/ComputeSharp.D2D1.WinUI.Tests.SourceGenerators.csproj delete mode 100644 tests/ComputeSharp.D2D1.WinUI.Tests.SourceGenerators/Helpers/CSharpCodeFixerTest{TAnalyzer,TCodeFixer}.cs delete mode 100644 tests/ComputeSharp.D2D1.WinUI.Tests.SourceGenerators/Test_CanvasEffectPropertyGenerator.cs delete mode 100644 tests/ComputeSharp.D2D1.WinUI.Tests.SourceGenerators/Test_CanvasEffectPropertyGenerator_Analyzers.cs delete mode 100644 tests/ComputeSharp.D2D1.WinUI.Tests.SourceGenerators/Test_CanvasEffectPropertyGenerator_Incrementality.cs delete mode 100644 tests/ComputeSharp.D2D1.WinUI.Tests.SourceGenerators/Test_UseGeneratedCanvasEffectPropertyOnSemiAutoPropertyCodeFixer.cs delete mode 100644 tests/ComputeSharp.D2D1.WinUI.Tests/App.xaml delete mode 100644 tests/ComputeSharp.D2D1.WinUI.Tests/App.xaml.cs delete mode 100644 tests/ComputeSharp.D2D1.WinUI.Tests/Assets/LockScreenLogo.scale-200.png delete mode 100644 tests/ComputeSharp.D2D1.WinUI.Tests/Assets/SplashScreen.scale-200.png delete mode 100644 tests/ComputeSharp.D2D1.WinUI.Tests/Assets/Square150x150Logo.scale-200.png delete mode 100644 tests/ComputeSharp.D2D1.WinUI.Tests/Assets/Square44x44Logo.scale-200.png delete mode 100644 tests/ComputeSharp.D2D1.WinUI.Tests/Assets/Square44x44Logo.targetsize-24_altform-unplated.png delete mode 100644 tests/ComputeSharp.D2D1.WinUI.Tests/Assets/StoreLogo.png delete mode 100644 tests/ComputeSharp.D2D1.WinUI.Tests/Assets/Wide310x150Logo.scale-200.png delete mode 100644 tests/ComputeSharp.D2D1.WinUI.Tests/ComputeSharp.D2D1.WinUI.Tests.csproj delete mode 100644 tests/ComputeSharp.D2D1.WinUI.Tests/Helpers/TolerantImageComparer.cs delete mode 100644 tests/ComputeSharp.D2D1.WinUI.Tests/Helpers/Win2DHelper.cs delete mode 100644 tests/ComputeSharp.D2D1.WinUI.Tests/Package.appxmanifest delete mode 100644 tests/ComputeSharp.D2D1.WinUI.Tests/Properties/PublishProfiles/win-arm64.pubxml delete mode 100644 tests/ComputeSharp.D2D1.WinUI.Tests/Properties/PublishProfiles/win-x64.pubxml delete mode 100644 tests/ComputeSharp.D2D1.WinUI.Tests/Properties/launchSettings.json delete mode 100644 tests/ComputeSharp.D2D1.WinUI.Tests/Tests/CanvasEffectTests.cs delete mode 100644 tests/ComputeSharp.D2D1.WinUI.Tests/Tests/PixelShaderEffectTests.cs delete mode 100644 tests/ComputeSharp.D2D1.WinUI.Tests/Tests/ShadersTests.cs delete mode 100644 tests/ComputeSharp.D2D1.WinUI.Tests/app.manifest delete mode 100644 tests/ComputeSharp.Dxc.NuGet/ComputeSharp.Dxc.NuGet.csproj delete mode 100644 tests/ComputeSharp.Dxc.NuGet/Program.cs delete mode 100644 tests/ComputeSharp.NuGet/ComputeSharp.NuGet.csproj delete mode 100644 tests/ComputeSharp.NuGet/Program.cs delete mode 100644 tests/ComputeSharp.Pix.NuGet/ComputeSharp.Pix.NuGet.csproj delete mode 100644 tests/ComputeSharp.Pix.NuGet/Program.cs delete mode 100644 tests/ComputeSharp.Tests.DeviceLost/ComputeSharp.Tests.DeviceLost.csproj delete mode 100644 tests/ComputeSharp.Tests.DeviceLost/DeviceDisposalTests.cs delete mode 100644 tests/ComputeSharp.Tests.DeviceLost/DeviceLostTests.cs delete mode 100644 tests/ComputeSharp.Tests.DeviceLost/Extensions/DeviceExtensions.cs delete mode 100644 tests/ComputeSharp.Tests.DeviceLost/GetDefaultDeviceTests.cs delete mode 100644 tests/ComputeSharp.Tests.DeviceLost/Helpers/GraphicsDeviceHelper.cs delete mode 100644 tests/ComputeSharp.Tests.DeviceLost/Properties/AssemblyInfo.cs delete mode 100644 tests/ComputeSharp.Tests.DisableDynamicCompilation/ComputeSharp.Tests.DisableDynamicCompilation.csproj delete mode 100644 tests/ComputeSharp.Tests.DisableDynamicCompilation/DispatchTests.cs delete mode 100644 tests/ComputeSharp.Tests.GlobalStatements/ComputeSharp.Tests.GlobalStatements.csproj delete mode 100644 tests/ComputeSharp.Tests.GlobalStatements/Program.cs delete mode 100644 tests/ComputeSharp.Tests.NativeLibrariesResolver/ComputeSharp.Tests.NativeLibrariesResolver.csproj delete mode 100644 tests/ComputeSharp.Tests.NativeLibrariesResolver/DxcNativeLibrariesResolverTests.cs delete mode 100644 tests/ComputeSharp.Tests.NativeLibrariesResolver/Helpers/NativeLibrariesResolverTestsBase.cs delete mode 100644 tests/ComputeSharp.Tests.NativeLibrariesResolver/NativeLibrariesResolverTests.cs delete mode 100644 tests/ComputeSharp.Tests.NativeLibrariesResolver/PixNativeLibrariesResolverTests.cs delete mode 100644 tests/ComputeSharp.Tests.NativeLibrariesResolver/Properties/AssemblyInfo.cs delete mode 100644 tests/ComputeSharp.Tests.SourceGenerators/ComputeSharp.Tests.SourceGenerators.csproj delete mode 100644 tests/ComputeSharp.Tests.SourceGenerators/Helpers/CSharpAnalyzerTest{TAnalyzer}.cs delete mode 100644 tests/ComputeSharp.Tests.SourceGenerators/Helpers/CSharpGeneratorTest{TGenerator}.cs delete mode 100644 tests/ComputeSharp.Tests.SourceGenerators/Test_ComputeShaderDescriptorGenerator.cs delete mode 100644 tests/ComputeSharp.Tests.SourceGenerators/Test_ComputeShaderDescriptorGenerator_Analyzers.cs delete mode 100644 tests/ComputeSharp.Tests.SourceGenerators/Test_ComputeShaderDescriptorGenerator_Diagnostics.cs delete mode 100644 tests/ComputeSharp.Tests.SourceGenerators/Test_ComputeShaderDescriptorGenerator_Incrementality.cs diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index dfc9c58e..345c92e6 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -62,19 +62,7 @@ jobs: run: dotnet pack src\ComputeSharp.Dxc\ComputeSharp.Dxc.csproj -c Release - name: Build ComputeSharp.D3D12MemoryAllocator package run: dotnet pack src\ComputeSharp.D3D12MemoryAllocator\ComputeSharp.D3D12MemoryAllocator.csproj -c Release - - name: Build ComputeSharp.D2D1 package - run: dotnet pack src\ComputeSharp.D2D1\ComputeSharp.D2D1.csproj -c Release - - name: Build ComputeSharp.Pix package - run: dotnet pack src\ComputeSharp.Pix\ComputeSharp.Pix.csproj -c Release - - name: Build ComputeSharp.Uwp package - run: msbuild src\ComputeSharp.Uwp\ComputeSharp.Uwp.csproj /restore -t:pack /p:Configuration=Release - - name: Build ComputeSharp.WinUI package - run: msbuild src\ComputeSharp.WinUI\ComputeSharp.WinUI.csproj /restore -t:pack /p:Configuration=Release - - name: Build ComputeSharp.D2D1.Uwp package - run: msbuild src\ComputeSharp.D2D1.Uwp\ComputeSharp.D2D1.Uwp.csproj /restore -t:pack /p:Configuration=Release - - name: Build ComputeSharp.D2D1.WinUI package - run: msbuild src\ComputeSharp.D2D1.WinUI\ComputeSharp.D2D1.WinUI.csproj /restore -t:pack /p:Configuration=Release - + # Upload the packages to the pipeline artifacts - name: Upload package artifacts uses: actions/upload-artifact@v4 @@ -99,37 +87,9 @@ jobs: # DirectX 12 unit tests - name: Run ComputeSharp.Tests run: dotnet test tests\ComputeSharp.Tests\ComputeSharp.Tests.csproj -c Release /p:Platform=x64 -v n -l "console;verbosity=detailed" - - name: Run ComputeSharp.Tests.DisableDynamicCompilation - run: dotnet test tests\ComputeSharp.Tests.DisableDynamicCompilation\ComputeSharp.Tests.DisableDynamicCompilation.csproj -c Release /p:Platform=x64 -v n -l "console;verbosity=detailed" - - name: Run ComputeSharp.Tests.GlobalStatements - run: dotnet run --project tests\ComputeSharp.Tests.GlobalStatements\ComputeSharp.Tests.GlobalStatements.csproj -c Release /p:Platform=x64 -v n -l "console;verbosity=detailed" - name: Run ComputeSharp.Tests.Internals run: dotnet test tests\ComputeSharp.Tests.Internals\ComputeSharp.Tests.Internals.csproj -c Release /p:Platform=x64 -v n -l "console;verbosity=detailed" - # Run the source generator tests as well (even though they're not really runtime specific) - - name: Run ComputeSharp.Tests.SourceGenerators - run: dotnet test tests\ComputeSharp.Tests.SourceGenerators\ComputeSharp.Tests.SourceGenerators.csproj -v n -l "console;verbosity=detailed" - - # DirectX 12 device lost unit tests. - # These tests are run one class at a time to ensure there's no accidental conflicts between any of them. This is because - # the code paths being tested in this project are heavily dependent on process-wide mutable state (ie. DirectX 12 devices). - - name: Run ComputeSharp.Tests.DeviceLost "DeviceDisposal" - run: dotnet test tests\ComputeSharp.Tests.DeviceLost\ComputeSharp.Tests.DeviceLost.csproj --filter "TestCategory=DeviceDisposal" -c Release -v n -l "console;verbosity=detailed" - - name: Run ComputeSharp.Tests.DeviceLost "DeviceLost" - run: dotnet test tests\ComputeSharp.Tests.DeviceLost\ComputeSharp.Tests.DeviceLost.csproj --filter "TestCategory=DeviceLost" -c Release -v n -l "console;verbosity=detailed" - - name: Run ComputeSharp.Tests.DeviceLost "GetDefaultDevice" - run: dotnet test tests\ComputeSharp.Tests.DeviceLost\ComputeSharp.Tests.DeviceLost.csproj --filter "TestCategory=GetDefaultDevice" -c Release -v n -l "console;verbosity=detailed" - - # D2D1 unit tests - - name: Run ComputeSharp.D2D1.Tests - run: dotnet test tests\ComputeSharp.D2D1.Tests\ComputeSharp.D2D1.Tests.csproj -c Release -v n -l "console;verbosity=detailed" - - name: Run ComputeSharp.D2D1.Tests.AssemblyLevelAttributes - run: dotnet test tests\ComputeSharp.D2D1.Tests.AssemblyLevelAttributes\ComputeSharp.D2D1.Tests.AssemblyLevelAttributes.csproj -c Release -v n -l "console;verbosity=detailed" - - # Run the D2D1 source generators tests as well - - name: Run ComputeSharp.D2D1.Tests.SourceGenerators - run: dotnet test tests\ComputeSharp.D2D1.Tests.SourceGenerators\ComputeSharp.D2D1.Tests.SourceGenerators.csproj -v n -l "console;verbosity=detailed" - # Run all unit tests using D3D12MA run-tests-d3d12ma: needs: [build-solution] @@ -140,277 +100,15 @@ jobs: - name: Git checkout uses: actions/checkout@v4 - # D3D12MA tests (main ComputeSharp tests, as well as the device lost ones) + # D3D12MA tests (main ComputeSharp tests) - name: Run ComputeSharp.Tests run: dotnet test tests\ComputeSharp.Tests\ComputeSharp.Tests.csproj -c Release /p:Platform=x64 /p:UseD3D12MemoryAllocator=true -v n -l "console;verbosity=detailed" - - name: Run ComputeSharp.Tests.DeviceLost "DeviceDisposal" - run: dotnet test tests\ComputeSharp.Tests.DeviceLost\ComputeSharp.Tests.DeviceLost.csproj --filter "TestCategory=DeviceDisposal" -c Release /p:UseD3D12MemoryAllocator=true -v n -l "console;verbosity=detailed" - - name: Run ComputeSharp.Tests.DeviceLost "DeviceLost" - run: dotnet test tests\ComputeSharp.Tests.DeviceLost\ComputeSharp.Tests.DeviceLost.csproj --filter "TestCategory=DeviceLost" -c Release /p:UseD3D12MemoryAllocator=true -v n -l "console;verbosity=detailed" - - name: Run ComputeSharp.Tests.DeviceLost "GetDefaultDevice" - run: dotnet test tests\ComputeSharp.Tests.DeviceLost\ComputeSharp.Tests.DeviceLost.csproj --filter "TestCategory=GetDefaultDevice" -c Release /p:UseD3D12MemoryAllocator=true -v n -l "console;verbosity=detailed" - - # Run all Win2D tests (separately, as they need VS Test) - run-tests-win2d: - needs: [build-solution] - runs-on: windows-2022 - steps: - - name: Git checkout - uses: actions/checkout@v4 - - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v2 - - # Build the D2D1 WinAppSDK unit tests - - name: Build ComputeSharp.D2D1.WinUI.Tests - run: msbuild tests\ComputeSharp.D2D1.WinUI.Tests\ComputeSharp.D2D1.WinUI.Tests.csproj /restore -t:build /p:Configuration=Release /p:Platform=x64 - - # Run the D2D1 WinAppSDK unit tests with VS Test - - name: Run ComputeSharp.D2D1.WinUI.Tests - run: > - $vs_path = vswhere -latest -products * -requires Microsoft.VisualStudio.Workload.ManagedDesktop -requiresAny -property installationPath; - $vstest_path = join-path $vs_path 'Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe'; - & $vstest_path /Platform:x64 tests\ComputeSharp.D2D1.WinUI.Tests\bin\x64\Release\net8.0-windows10.0.22621.0\win-x64\ComputeSharp.D2D1.WinUI.Tests.build.appxrecipe - - # Build the D2D1 WinAppSDK source generators tests - - name: Build ComputeSharp.D2D1.WinUI.Tests.SourceGenerators - run: msbuild tests\ComputeSharp.D2D1.WinUI.Tests.SourceGenerators\ComputeSharp.D2D1.WinUI.Tests.SourceGenerators.csproj /restore -t:build /p:Configuration=Release /p:Platform=x64 - - # Run the D2D1 WinAppSDK source generators tests (same as above) - - name: Run ComputeSharp.D2D1.WinUI.Tests.SourceGenerators - run: > - $vs_path = vswhere -latest -products * -requires Microsoft.VisualStudio.Workload.ManagedDesktop -requiresAny -property installationPath; - $vstest_path = join-path $vs_path 'Common7\IDE\CommonExtensions\Microsoft\TestWindow\vstest.console.exe'; - & $vstest_path /Platform:x64 tests\ComputeSharp.D2D1.WinUI.Tests.SourceGenerators\bin\x64\Release\net8.0-windows10.0.22621.0\ComputeSharp.D2D1.WinUI.Tests.SourceGenerators.dll - - # Run all the local samples to ensure they build and run with no errors - run-samples: - needs: [build-solution] - runs-on: windows-2022 - steps: - - name: Git checkout - uses: actions/checkout@v4 - - name: Build and run ComputeSharp.Sample - run: > - dotnet build samples\ComputeSharp.Sample\ComputeSharp.Sample.csproj -c Release -r win-x64 --no-self-contained -p:Platform=x64 -v n; - samples\ComputeSharp.Sample\bin\x64\Release\net8.0\win-x64\ComputeSharp.Sample.exe - - name: Build and run ComputeSharp.Sample.FSharp - run: > - dotnet build samples\ComputeSharp.Sample.FSharp\ComputeSharp.Sample.FSharp.fsproj -c Release -r win-x64 --no-self-contained -p:Platform=x64 -v n; - samples\ComputeSharp.Sample.FSharp\bin\x64\Release\net8.0\win-x64\ComputeSharp.Sample.FSharp.exe - - name: Build and run ComputeSharp.ImageProcessing.csproj - run: > - dotnet build samples\ComputeSharp.ImageProcessing\ComputeSharp.ImageProcessing.csproj -c Release -r win-x64 --no-self-contained -p:Platform=x64 -v n; - samples\ComputeSharp.ImageProcessing\bin\x64\Release\net8.0\win-x64\ComputeSharp.ImageProcessing.exe - - # Run the NativeAOT samples as well - run-samples-aot: - needs: [build-solution] - strategy: - matrix: - platform: [x64, arm64] - runs-on: windows-2022 - env: - CI_RUNNER_SAMPLES_INTEGRATION_TESTS: true - steps: - - name: Git checkout - uses: actions/checkout@v4 - - name: Add msbuild to PATH - uses: microsoft/setup-msbuild@v2 - - # Publish the NativeAOT CLI sample (optimized for speed) - - name: Publish ComputeSharp.SwapChain.Cli with NativeAOT (speed) - run: > - $env:COMPUTESHARP_SWAPCHAIN_CLI_PUBLISH_AOT='true'; - dotnet publish samples\ComputeSharp.SwapChain.Cli\ComputeSharp.SwapChain.Cli.csproj -r win-${{matrix.platform}} -v n - - # If on x64, also run it (this script will launch it and let it run for 2 seconds, before closing it). - # Note: for this and all other equivalent tests below, we're only throwing on failures that are not - # -1073741510 (STATUS_CONTROL_C_EXIT). That error is sometimes thrown when running the test in the CI. - # We don't want to fail in that case, as it still means the sample has in fact ran with no problems. - - if: matrix.platform == 'x64' - name: Run ComputeSharp.SwapChain.Cli (speed) - run: > - $process = (Start-Process samples\ComputeSharp.SwapChain.Cli\bin\Release\net8.0\win-x64\publish\computesharp.cli.exe -PassThru); - sleep -Seconds 2; - try - { - $process.CloseMainWindow() | Out-Null; - $process.WaitForExit(); - } - catch { } - if ($process.ExitCode -ne 0 -and $process.ExitCode -ne -1073741510) { throw $process.ExitCode; } - - # Upload the binary (to track binary size trends) - - if: matrix.platform == 'x64' - name: Upload NativeAOT CLI sample (speed) - uses: actions/upload-artifact@v4 - with: - name: computesharp.cli.opt-speed.exe - path: samples\ComputeSharp.SwapChain.Cli\bin\Release\net8.0\win-x64\publish\computesharp.cli.exe - if-no-files-found: error - - # Publish the NativeAOT CLI sample (optimized for size, and reflection-free) - - name: Publish ComputeSharp.SwapChain.Cli with NativeAOT (size) - run: > - $env:COMPUTESHARP_SWAPCHAIN_CLI_PUBLISH_AOT='true'; - $env:COMPUTESHARP_SWAPCHAIN_CLI_SIZE_OPTIMIZED='true'; - $env:COMPUTESHARP_SWAPCHAIN_CLI_DISABLE_REFLECTION='true'; - git clean -fdx; - dotnet publish samples\ComputeSharp.SwapChain.Cli\ComputeSharp.SwapChain.Cli.csproj -r win-${{matrix.platform}} -v n - - # Again only on x64, also run the sample and validate it works correctly - - if: matrix.platform == 'x64' - name: Run ComputeSharp.SwapChain.Cli (size) - run: > - $process = (Start-Process samples\ComputeSharp.SwapChain.Cli\bin\Release\net8.0\win-x64\publish\computesharp.cli.exe -PassThru); - sleep -Seconds 2; - try - { - $process.CloseMainWindow() | Out-Null; - $process.WaitForExit(); - } - catch { } - if ($process.ExitCode -ne 0 -and $process.ExitCode -ne -1073741510) { throw $process.ExitCode; } - - # Upload the binary again (with a different name) - - if: matrix.platform == 'x64' - name: Upload NativeAOT CLI sample (size) - uses: actions/upload-artifact@v4 - with: - name: computesharp.cli.opt-size.exe - path: samples\ComputeSharp.SwapChain.Cli\bin\Release\net8.0\win-x64\publish\computesharp.cli.exe - if-no-files-found: error - - # Also publish the Win2D sample (with R2R) - - name: Publish ComputeSharp.SwapChain.D2D1.Cli (R2R) - run: > - $env:COMPUTESHARP_SWAPCHAIN_D2D1_PUBLISH_R2R='true'; - $env:COMPUTESHARP_SWAPCHAIN_D2D1_PUBLISH_AOT='false'; - git clean -fdx; - msbuild samples\ComputeSharp.SwapChain.D2D1.Cli\ComputeSharp.SwapChain.D2D1.Cli.csproj /restore -t:publish - /p:Configuration=Release /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}} - - # Just like for the DX12 sample, run it on x64 to validate it works correctly - - if: matrix.platform == 'x64' - name: Run ComputeSharp.SwapChain.D2D1.Cli (R2R) - run: > - $process = (Start-Process samples\ComputeSharp.SwapChain.D2D1.Cli\bin\x64\Release\net8.0-windows10.0.22621\win-x64\publish\computesharp.d2d1.cli.exe -PassThru); - sleep -Seconds 2; - try - { - $process.CloseMainWindow() | Out-Null; - $process.WaitForExit(); - } - catch { } - if ($process.ExitCode -ne 0 -and $process.ExitCode -ne -1073741510) { throw $process.ExitCode; } - - # Publish the Win2D sample again (with NativeAOT) - - name: Publish ComputeSharp.SwapChain.D2D1.Cli (NativeAOT) - run: > - $env:COMPUTESHARP_SWAPCHAIN_D2D1_PUBLISH_R2R='false'; - $env:COMPUTESHARP_SWAPCHAIN_D2D1_PUBLISH_AOT='true'; - git clean -fdx; - msbuild samples\ComputeSharp.SwapChain.D2D1.Cli\ComputeSharp.SwapChain.D2D1.Cli.csproj /restore -t:publish - /p:Configuration=Release /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}} - - # Verify that the Win2D NativeAOT sample also runs correctly - - if: matrix.platform == 'x64' - name: Run ComputeSharp.SwapChain.D2D1.Cli (NativeAOT) - run: > - $process = (Start-Process samples\ComputeSharp.SwapChain.D2D1.Cli\bin\x64\Release\net8.0-windows10.0.22621\win-x64\publish\computesharp.d2d1.cli.exe -PassThru); - sleep -Seconds 2; - try - { - $process.CloseMainWindow() | Out-Null; - $process.WaitForExit(); - } - catch { } - if ($process.ExitCode -ne 0 -and $process.ExitCode -ne -1073741510) { throw $process.ExitCode; } - - # Publish the native library as a NativeAOT shared library - - name: Publish ComputeSharp.NativeLibrary - run: dotnet publish samples\ComputeSharp.NativeLibrary\ComputeSharp.NativeLibrary.csproj -r win-${{matrix.platform}} -v n - - # Publish the WinRT component with NativeAOT as well - - if: matrix.platform == 'x64' - name: Publish ComputeSharp.NativeLibrary.WinRT - run: > - msbuild samples\ComputeSharp.NativeLibrary.WinRT\ComputeSharp.NativeLibrary.WinRT.csproj /restore -t:publish - /p:Configuration=Release /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}} - - # Publish the WinUI 3 sample app with NativeAOT - - if: matrix.platform == 'x64' - name: Publish ComputeSharp.SwapChain.WinUI - run: > - msbuild samples\ComputeSharp.SwapChain.WinUI\ComputeSharp.SwapChain.WinUI.csproj /restore -t:publish - /p:Configuration=Release /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}} - - # Publish the D2D1 UWP (CoreApplication) sample app with NativeAOT - - if: matrix.platform == 'x64' - name: Publish ComputeSharp.SwapChain.D2D1.Uwp - run: > - msbuild samples\ComputeSharp.SwapChain.D2D1.Uwp\ComputeSharp.SwapChain.D2D1.Uwp.csproj /restore -t:publish - /p:Configuration=Release /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}} - - # Publish the D2D1 UWP sample app again with NativeAOT, with Xbox support - - if: matrix.platform == 'x64' - name: Publish ComputeSharp.SwapChain.D2D1.Uwp (Xbox) - run: > - $env:EXPERIMENTAL_XBOX_SUPPORT='true'; - msbuild samples\ComputeSharp.SwapChain.D2D1.Uwp\ComputeSharp.SwapChain.D2D1.Uwp.csproj /restore -t:publish - /p:Configuration=Release /p:Platform=${{matrix.platform}} /p:RuntimeIdentifier=win-${{matrix.platform}} - - # Download the NuGet packages generated in the previous job and use them - # to build and run the sample project referencing them. This is used as - # a test to ensure the NuGet packages work in a consuming project. - verify-packages: - needs: [build-packages] - runs-on: windows-2022 - steps: - - name: Git checkout - uses: actions/checkout@v4 - - name: Create local NuGet feed - run: mkdir artifacts - - name: Download package artifacts - uses: actions/download-artifact@v4 - with: - name: nuget_packages - path: artifacts - - name: Build and run ComputeSharp.NuGet - run: dotnet run --project tests\ComputeSharp.NuGet\ComputeSharp.NuGet.csproj -c Release -r win-x64 --no-self-contained -v n - - name: Build and run ComputeSharp.Dxc.NuGet - run: dotnet run --project tests\ComputeSharp.Dxc.NuGet\ComputeSharp.Dxc.NuGet.csproj -c Release -r win-x64 --no-self-contained -v n - - name: Build and run ComputeSharp.Pix.NuGet - run: dotnet run --project tests\ComputeSharp.Pix.NuGet\ComputeSharp.Pix.NuGet.csproj -c Release -r win-x64 --no-self-contained -v n - - # Run the extra tests to validate a number of build and publishing configurations. - # This is used to ensure the native dependencies can always be loaded correctly - # regardless of whether the app is shipping with R2R, self-contained, etc. - - name: Run ComputeSharp.Tests.NativeLibrariesResolver - run: dotnet test tests\ComputeSharp.Tests.NativeLibrariesResolver\ComputeSharp.Tests.NativeLibrariesResolver.csproj -v n -l "console;verbosity=detailed" - - # Also run the NativeAOT publishing tests - - name: Publish and run ComputeSharp.NuGet with NativeAOT - run: > - $env:COMPUTESHARP_NUGET_TESTS_PUBLISH_AOT='true'; - dotnet publish tests\ComputeSharp.NuGet\ComputeSharp.NuGet.csproj -r win-x64 -v n; - tests\ComputeSharp.NuGet\bin\Release\net8.0\win-x64\publish\ComputeSharp.NuGet.exe - - name: Publish and run ComputeSharp.Dxc.NuGet with NativeAOT - run: > - $env:COMPUTESHARP_NUGET_TESTS_PUBLISH_AOT='true'; - dotnet publish tests\ComputeSharp.Dxc.NuGet\ComputeSharp.Dxc.NuGet.csproj -r win-x64 -v n; - tests\ComputeSharp.Dxc.NuGet\bin\Release\net8.0\win-x64\publish\ComputeSharp.Dxc.NuGet.exe - - name: Publish and run ComputeSharp.Pix.NuGet with NativeAOT - run: > - $env:COMPUTESHARP_NUGET_TESTS_PUBLISH_AOT='true'; - dotnet publish tests\ComputeSharp.Pix.NuGet\ComputeSharp.Pix.NuGet.csproj -r win-x64 -v n; - tests\ComputeSharp.Pix.NuGet\bin\Release\net8.0\win-x64\publish\ComputeSharp.Pix.NuGet.exe # ビルドした NuGet パッケージ(.nupkg)を GitHub Release として公開する。 # GitHub Packages や Azure DevOps への push はフォークでは認証できず失敗する(403)ため、 # 代わりに自動生成のリリースノートを付けたリリースを作成し、.nupkg を資産として添付する。 publish-release: - needs: [run-tests, run-tests-d3d12ma, run-tests-win2d, run-samples, run-samples-aot, verify-packages] + needs: [run-tests, run-tests-d3d12ma, build-packages] runs-on: windows-2022 if: ${{github.event_name == 'push'}} permissions: diff --git a/ComputeSharp.sln b/ComputeSharp.sln index 08b74376..60c7a7a7 100644 --- a/ComputeSharp.sln +++ b/ComputeSharp.sln @@ -6,10 +6,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp", "src\Compute EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Samples", "Samples", "{0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Benchmark", "samples\ComputeSharp.Benchmark\ComputeSharp.Benchmark.csproj", "{34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.ImageProcessing", "samples\ComputeSharp.ImageProcessing\ComputeSharp.ImageProcessing.csproj", "{524CC5DD-1DEE-4A30-9515-AB90965E5207}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Tests", "tests\ComputeSharp.Tests\ComputeSharp.Tests.csproj", "{E91F4D24-922A-4921-A8D7-9C45A143C45D}" @@ -32,74 +28,20 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "_SolutionItems", "_Solution EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.SourceGenerators", "src\ComputeSharp.SourceGenerators\ComputeSharp.SourceGenerators.csproj", "{EB52CB67-4162-4722-874B-44EA8DA5450E}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Sample", "samples\ComputeSharp.Sample\ComputeSharp.Sample.csproj", "{7048DEEA-0A6F-46A0-B951-B682A8F1CB75}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Tests.SourceGenerators", "tests\ComputeSharp.Tests.SourceGenerators\ComputeSharp.Tests.SourceGenerators.csproj", "{BBBD0ADD-F2F9-49A3-BD5E-D223F0735D8B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Tests.NativeLibrariesResolver", "tests\ComputeSharp.Tests.NativeLibrariesResolver\ComputeSharp.Tests.NativeLibrariesResolver.csproj", "{BF52326F-E415-49E6-8595-62762216762B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.SwapChain", "samples\ComputeSharp.SwapChain\ComputeSharp.SwapChain.csproj", "{E7C9247D-016B-4819-AF9F-0E9B3591E04B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.SwapChain.Cli", "samples\ComputeSharp.SwapChain.Cli\ComputeSharp.SwapChain.Cli.csproj", "{C12D7ACE-98ED-4813-8118-6667C34F484F}" -EndProject -Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "ComputeSharp.Sample.FSharp", "samples\ComputeSharp.Sample.FSharp\ComputeSharp.Sample.FSharp.fsproj", "{7C625EC4-F599-4350-A915-F046DF2406D3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Sample.FSharp.Shaders", "samples\ComputeSharp.Sample.FSharp.Shaders\ComputeSharp.Sample.FSharp.Shaders.csproj", "{1F37A704-3CDF-45BB-8114-ED9137E5F2CF}" -EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.Win32.D3D12", "src\ComputeSharp.Win32.D3D12\ComputeSharp.Win32.D3D12.shproj", "{514FF00E-BBF0-4D55-A47C-EEEB6208ADCE}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.WinUI", "src\ComputeSharp.WinUI\ComputeSharp.WinUI.csproj", "{FA18BA9F-76BF-4DE0-8D24-02FC7657E6CB}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.SwapChain.WinUI", "samples\ComputeSharp.SwapChain.WinUI\ComputeSharp.SwapChain.WinUI.csproj", "{0071701E-B9C5-4098-BE5F-EF556C4553C6}" -EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.SwapChain.Shaders", "samples\ComputeSharp.SwapChain.Shaders\ComputeSharp.SwapChain.Shaders.shproj", "{0800BD51-499D-44C2-9417-FD1F7FDFE9C4}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Tests.DisableDynamicCompilation", "tests\ComputeSharp.Tests.DisableDynamicCompilation\ComputeSharp.Tests.DisableDynamicCompilation.csproj", "{4A8FCE22-851C-442A-8BC9-3EC3FD00B637}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Dxc", "src\ComputeSharp.Dxc\ComputeSharp.Dxc.csproj", "{76C66257-FDAA-47AB-85E7-EF757EAB10C0}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.D2D1", "src\ComputeSharp.D2D1\ComputeSharp.D2D1.csproj", "{4D7D9BA8-A821-4B1C-9EE2-CBCF5849906E}" -EndProject -Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.Win32.D2D1", "src\ComputeSharp.Win32.D2D1\ComputeSharp.Win32.D2D1.shproj", "{9DA1DA9F-F8B2-4B25-BE80-C21F773029E3}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Core", "src\ComputeSharp.Core\ComputeSharp.Core.csproj", "{764BC0F5-0C5E-49AD-ABAA-E3874C0F3286}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Core.SourceGenerators", "src\ComputeSharp.Core.SourceGenerators\ComputeSharp.Core.SourceGenerators.csproj", "{BFB003D1-788B-48DE-8065-39479C162CB0}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.D2D1.SourceGenerators", "src\ComputeSharp.D2D1.SourceGenerators\ComputeSharp.D2D1.SourceGenerators.csproj", "{E44053BD-A761-47FB-AA78-087A599672EA}" -EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.SourceGeneration", "src\ComputeSharp.SourceGeneration\ComputeSharp.SourceGeneration.shproj", "{51D5A422-D3A5-4C4D-8A6D-A048940BF279}" EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.SourceGeneration.Hlsl", "src\ComputeSharp.SourceGeneration.Hlsl\ComputeSharp.SourceGeneration.Hlsl.shproj", "{9AC496A3-BBF0-4C8F-A50D-A20BF01C5E05}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.D2D1.Tests", "tests\ComputeSharp.D2D1.Tests\ComputeSharp.D2D1.Tests.csproj", "{209C95A3-FA53-431B-B688-3299CA6C29D2}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.D2D1.Tests.AssemblyLevelAttributes", "tests\ComputeSharp.D2D1.Tests.AssemblyLevelAttributes\ComputeSharp.D2D1.Tests.AssemblyLevelAttributes.csproj", "{94178D51-0097-4AD2-B3D0-827E40D62F2E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Pix", "src\ComputeSharp.Pix\ComputeSharp.Pix.csproj", "{14EF12A3-90E6-4683-BD71-9896AF87026B}" -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ComputeSharp.Dxc.NuGet", "ComputeSharp.Dxc.NuGet", "{CBA545B4-31EF-4E9F-A1A8-2A1290B54046}" - ProjectSection(SolutionItems) = preProject - tests\ComputeSharp.Dxc.NuGet\ComputeSharp.Dxc.NuGet.csproj = tests\ComputeSharp.Dxc.NuGet\ComputeSharp.Dxc.NuGet.csproj - tests\ComputeSharp.Dxc.NuGet\Program.cs = tests\ComputeSharp.Dxc.NuGet\Program.cs - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ComputeSharp.Pix.NuGet", "ComputeSharp.Pix.NuGet", "{C0B903AA-F32C-4760-B4B6-199AC4FE1C5A}" - ProjectSection(SolutionItems) = preProject - tests\ComputeSharp.Pix.NuGet\ComputeSharp.Pix.NuGet.csproj = tests\ComputeSharp.Pix.NuGet\ComputeSharp.Pix.NuGet.csproj - tests\ComputeSharp.Pix.NuGet\Program.cs = tests\ComputeSharp.Pix.NuGet\Program.cs - EndProjectSection -EndProject -Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ComputeSharp.NuGet", "ComputeSharp.NuGet", "{E3403F19-A0D8-4317-8A54-322C7A13F2A2}" - ProjectSection(SolutionItems) = preProject - tests\ComputeSharp.NuGet\ComputeSharp.NuGet.csproj = tests\ComputeSharp.NuGet\ComputeSharp.NuGet.csproj - tests\ComputeSharp.NuGet\Program.cs = tests\ComputeSharp.NuGet\Program.cs - EndProjectSection -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Tests.DeviceLost", "tests\ComputeSharp.Tests.DeviceLost\ComputeSharp.Tests.DeviceLost.csproj", "{5DE90C85-ED26-4B5A-A0D7-2FF966A210AC}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Tests.GlobalStatements", "tests\ComputeSharp.Tests.GlobalStatements\ComputeSharp.Tests.GlobalStatements.csproj", "{669A414F-3B46-4B55-B587-061AF63C3067}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{B86A48A7-18BD-4946-B995-3CE26B092DDF}" ProjectSection(SolutionItems) = preProject src\Directory.Build.BeforeMicrosoftNETSdkTargets.targets = src\Directory.Build.BeforeMicrosoftNETSdkTargets.targets @@ -107,10 +49,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{B86A48A7-18B src\Directory.Build.targets = src\Directory.Build.targets EndProjectSection EndProject -Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.SwapChain.Shaders.D2D1", "samples\ComputeSharp.SwapChain.Shaders.D2D1\ComputeSharp.SwapChain.Shaders.D2D1.shproj", "{F8BF7666-7CCF-4FE4-B055-2EBA4BCD4564}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.D2D1.WinUI", "src\ComputeSharp.D2D1.WinUI\ComputeSharp.D2D1.WinUI.csproj", "{BD9E6556-357E-4C20-BFCD-FB131F9372FA}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{568E7009-5C13-4153-9C94-0AC7A3E6883C}" ProjectSection(SolutionItems) = preProject samples\Directory.Build.props = samples\Directory.Build.props @@ -124,8 +62,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "tests", "tests", "{B54B6DCA tests\Directory.Build.targets = tests\Directory.Build.targets EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.SwapChain.D2D1.Cli", "samples\ComputeSharp.SwapChain.D2D1.Cli\ComputeSharp.SwapChain.D2D1.Cli.csproj", "{9EA5AE9D-C39A-4F43-B03E-0A848EA2558A}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Assets", "Assets", "{345F62CF-5320-4531-A087-DA5B488FDDE6}" ProjectSection(SolutionItems) = preProject assets\icon.ico = assets\icon.ico @@ -133,14 +69,8 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Assets", "Assets", "{345F62 assets\icon_highres.png = assets\icon_highres.png EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.D2D1.WinUI.Tests", "tests\ComputeSharp.D2D1.WinUI.Tests\ComputeSharp.D2D1.WinUI.Tests.csproj", "{73C32D0F-64DB-4674-84E9-8FCC41228474}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.D3D12MemoryAllocator", "src\ComputeSharp.D3D12MemoryAllocator\ComputeSharp.D3D12MemoryAllocator.csproj", "{E017B3B6-C7D3-4E53-A7F6-1036178E98C3}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.D2D1.CodeFixers", "src\ComputeSharp.D2D1.CodeFixers\ComputeSharp.D2D1.CodeFixers.csproj", "{54654960-54B5-4E19-B3ED-993591CA39E5}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.D2D1.Tests.SourceGenerators", "tests\ComputeSharp.D2D1.Tests.SourceGenerators\ComputeSharp.D2D1.Tests.SourceGenerators.csproj", "{59A17380-24A0-4BD7-9012-B105A9E7D46F}" -EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Win32", "Win32", "{D991153C-A34D-4042-B76F-822ADB111DD0}" EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.CodeFixing", "src\ComputeSharp.CodeFixing\ComputeSharp.CodeFixing.shproj", "{29F6E256-BA0E-4F3B-854E-50839D67C6DD}" @@ -165,38 +95,6 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "arm64", "arm64", "{B4F6A41C libs\arm64\WinPixEventRuntime_UAP.dll = libs\arm64\WinPixEventRuntime_UAP.dll EndProjectSection EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.NativeLibrary", "samples\ComputeSharp.NativeLibrary\ComputeSharp.NativeLibrary.csproj", "{1A3E20B3-F711-41C0-82EA-3B53A575955C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.NativeLibrary.WinRT", "samples\ComputeSharp.NativeLibrary.WinRT\ComputeSharp.NativeLibrary.WinRT.csproj", "{551EF4FB-F34F-412A-B3E6-E345797560ED}" -EndProject -Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.UI", "src\ComputeSharp.UI\ComputeSharp.UI.shproj", "{1CD1D9C5-7E00-43FB-A8C3-CFE98A885D3B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.Uwp", "src\ComputeSharp.Uwp\ComputeSharp.Uwp.csproj", "{2C4C1A6B-7E38-41EC-84D9-007676571441}" -EndProject -Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.D2D1.UI", "src\ComputeSharp.D2D1.UI\ComputeSharp.D2D1.UI.shproj", "{A2A2171B-0BAF-4A2A-BFB3-3357EF714BF0}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.D2D1.Uwp", "src\ComputeSharp.D2D1.Uwp\ComputeSharp.D2D1.Uwp.csproj", "{716DF19E-69BA-4A9C-9CA4-BFD196152F46}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.SwapChain.D2D1.Uwp", "samples\ComputeSharp.SwapChain.D2D1.Uwp\ComputeSharp.SwapChain.D2D1.Uwp.csproj", "{9FBE070E-A210-4CEF-9F04-61C2B269C600}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComputeSharp.D2D1.WinUI.SourceGenerators", "src\ComputeSharp.D2D1.WinUI.SourceGenerators\ComputeSharp.D2D1.WinUI.SourceGenerators.csproj", "{FEBEC83A-FE70-4D4B-9B00-76DB31E75F17}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.D2D1.WinUI.Tests.SourceGenerators", "tests\ComputeSharp.D2D1.WinUI.Tests.SourceGenerators\ComputeSharp.D2D1.WinUI.Tests.SourceGenerators.csproj", "{916331A5-1EA6-41D7-B199-2E50C513EFDE}" -EndProject -Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.D2D1.UI.SourceGenerators", "src\ComputeSharp.D2D1.UI.SourceGenerators\ComputeSharp.D2D1.UI.SourceGenerators.shproj", "{D20E610F-EB37-46E7-B028-04784D7400D5}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComputeSharp.D2D1.Uwp.SourceGenerators", "src\ComputeSharp.D2D1.Uwp.SourceGenerators\ComputeSharp.D2D1.Uwp.SourceGenerators.csproj", "{690C4014-A06B-44DB-B717-AEA4CAFA9D68}" -EndProject -Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.D2D1.UI.CodeFixers", "src\ComputeSharp.D2D1.UI.CodeFixers\ComputeSharp.D2D1.UI.CodeFixers.shproj", "{CE85DC5A-E455-42FE-9B64-0D5F0D7EE366}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComputeSharp.D2D1.WinUI.CodeFixers", "src\ComputeSharp.D2D1.WinUI.CodeFixers\ComputeSharp.D2D1.WinUI.CodeFixers.csproj", "{9D3C872E-D64E-47E7-BDC8-077A151DBB7D}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComputeSharp.D2D1.Uwp.CodeFixers", "src\ComputeSharp.D2D1.Uwp.CodeFixers\ComputeSharp.D2D1.Uwp.CodeFixers.csproj", "{8BE73DB3-16E0-41F4-A87F-0C2AB43856A2}" -EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComputeSharp.SwapChain.Uwp", "samples\ComputeSharp.SwapChain.Uwp\ComputeSharp.SwapChain.Uwp.csproj", "{6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}" -EndProject -Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.SwapChain.UI", "samples\ComputeSharp.SwapChain.UI\ComputeSharp.SwapChain.UI.shproj", "{6BC471C6-72F9-43CF-AE1E-F6D3E5ED3129}" -EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|x64 = Debug|x64 @@ -213,22 +111,6 @@ Global {314EB353-E7E3-4146-8111-685CC83EC1DE}.Release|ARM64.Build.0 = Release|Any CPU {314EB353-E7E3-4146-8111-685CC83EC1DE}.Release|x64.ActiveCfg = Release|Any CPU {314EB353-E7E3-4146-8111-685CC83EC1DE}.Release|x64.Build.0 = Release|Any CPU - {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Debug|ARM64.Build.0 = Debug|Any CPU - {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Debug|x64.ActiveCfg = Debug|Any CPU - {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Debug|x64.Build.0 = Debug|Any CPU - {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Release|ARM64.ActiveCfg = Release|Any CPU - {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Release|ARM64.Build.0 = Release|Any CPU - {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Release|x64.ActiveCfg = Release|Any CPU - {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF}.Release|x64.Build.0 = Release|Any CPU - {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Debug|ARM64.Build.0 = Debug|Any CPU - {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Debug|x64.ActiveCfg = Debug|Any CPU - {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Debug|x64.Build.0 = Debug|Any CPU - {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Release|ARM64.ActiveCfg = Release|Any CPU - {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Release|ARM64.Build.0 = Release|Any CPU - {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Release|x64.ActiveCfg = Release|Any CPU - {524CC5DD-1DEE-4A30-9515-AB90965E5207}.Release|x64.Build.0 = Release|Any CPU {E91F4D24-922A-4921-A8D7-9C45A143C45D}.Debug|ARM64.ActiveCfg = Debug|Any CPU {E91F4D24-922A-4921-A8D7-9C45A143C45D}.Debug|ARM64.Build.0 = Debug|Any CPU {E91F4D24-922A-4921-A8D7-9C45A143C45D}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -253,90 +135,6 @@ Global {EB52CB67-4162-4722-874B-44EA8DA5450E}.Release|ARM64.Build.0 = Release|Any CPU {EB52CB67-4162-4722-874B-44EA8DA5450E}.Release|x64.ActiveCfg = Release|Any CPU {EB52CB67-4162-4722-874B-44EA8DA5450E}.Release|x64.Build.0 = Release|Any CPU - {7048DEEA-0A6F-46A0-B951-B682A8F1CB75}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {7048DEEA-0A6F-46A0-B951-B682A8F1CB75}.Debug|ARM64.Build.0 = Debug|Any CPU - {7048DEEA-0A6F-46A0-B951-B682A8F1CB75}.Debug|x64.ActiveCfg = Debug|Any CPU - {7048DEEA-0A6F-46A0-B951-B682A8F1CB75}.Debug|x64.Build.0 = Debug|Any CPU - {7048DEEA-0A6F-46A0-B951-B682A8F1CB75}.Release|ARM64.ActiveCfg = Release|Any CPU - {7048DEEA-0A6F-46A0-B951-B682A8F1CB75}.Release|ARM64.Build.0 = Release|Any CPU - {7048DEEA-0A6F-46A0-B951-B682A8F1CB75}.Release|x64.ActiveCfg = Release|Any CPU - {7048DEEA-0A6F-46A0-B951-B682A8F1CB75}.Release|x64.Build.0 = Release|Any CPU - {BBBD0ADD-F2F9-49A3-BD5E-D223F0735D8B}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {BBBD0ADD-F2F9-49A3-BD5E-D223F0735D8B}.Debug|ARM64.Build.0 = Debug|Any CPU - {BBBD0ADD-F2F9-49A3-BD5E-D223F0735D8B}.Debug|x64.ActiveCfg = Debug|Any CPU - {BBBD0ADD-F2F9-49A3-BD5E-D223F0735D8B}.Debug|x64.Build.0 = Debug|Any CPU - {BBBD0ADD-F2F9-49A3-BD5E-D223F0735D8B}.Release|ARM64.ActiveCfg = Release|Any CPU - {BBBD0ADD-F2F9-49A3-BD5E-D223F0735D8B}.Release|ARM64.Build.0 = Release|Any CPU - {BBBD0ADD-F2F9-49A3-BD5E-D223F0735D8B}.Release|x64.ActiveCfg = Release|Any CPU - {BBBD0ADD-F2F9-49A3-BD5E-D223F0735D8B}.Release|x64.Build.0 = Release|Any CPU - {BF52326F-E415-49E6-8595-62762216762B}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {BF52326F-E415-49E6-8595-62762216762B}.Debug|ARM64.Build.0 = Debug|Any CPU - {BF52326F-E415-49E6-8595-62762216762B}.Debug|x64.ActiveCfg = Debug|Any CPU - {BF52326F-E415-49E6-8595-62762216762B}.Debug|x64.Build.0 = Debug|Any CPU - {BF52326F-E415-49E6-8595-62762216762B}.Release|ARM64.ActiveCfg = Release|Any CPU - {BF52326F-E415-49E6-8595-62762216762B}.Release|ARM64.Build.0 = Release|Any CPU - {BF52326F-E415-49E6-8595-62762216762B}.Release|x64.ActiveCfg = Release|Any CPU - {BF52326F-E415-49E6-8595-62762216762B}.Release|x64.Build.0 = Release|Any CPU - {E7C9247D-016B-4819-AF9F-0E9B3591E04B}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {E7C9247D-016B-4819-AF9F-0E9B3591E04B}.Debug|ARM64.Build.0 = Debug|ARM64 - {E7C9247D-016B-4819-AF9F-0E9B3591E04B}.Debug|x64.ActiveCfg = Debug|x64 - {E7C9247D-016B-4819-AF9F-0E9B3591E04B}.Debug|x64.Build.0 = Debug|x64 - {E7C9247D-016B-4819-AF9F-0E9B3591E04B}.Release|ARM64.ActiveCfg = Release|ARM64 - {E7C9247D-016B-4819-AF9F-0E9B3591E04B}.Release|ARM64.Build.0 = Release|ARM64 - {E7C9247D-016B-4819-AF9F-0E9B3591E04B}.Release|x64.ActiveCfg = Release|x64 - {E7C9247D-016B-4819-AF9F-0E9B3591E04B}.Release|x64.Build.0 = Release|x64 - {C12D7ACE-98ED-4813-8118-6667C34F484F}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {C12D7ACE-98ED-4813-8118-6667C34F484F}.Debug|ARM64.Build.0 = Debug|ARM64 - {C12D7ACE-98ED-4813-8118-6667C34F484F}.Debug|x64.ActiveCfg = Debug|x64 - {C12D7ACE-98ED-4813-8118-6667C34F484F}.Debug|x64.Build.0 = Debug|x64 - {C12D7ACE-98ED-4813-8118-6667C34F484F}.Release|ARM64.ActiveCfg = Release|ARM64 - {C12D7ACE-98ED-4813-8118-6667C34F484F}.Release|ARM64.Build.0 = Release|ARM64 - {C12D7ACE-98ED-4813-8118-6667C34F484F}.Release|x64.ActiveCfg = Release|x64 - {C12D7ACE-98ED-4813-8118-6667C34F484F}.Release|x64.Build.0 = Release|x64 - {7C625EC4-F599-4350-A915-F046DF2406D3}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {7C625EC4-F599-4350-A915-F046DF2406D3}.Debug|ARM64.Build.0 = Debug|Any CPU - {7C625EC4-F599-4350-A915-F046DF2406D3}.Debug|x64.ActiveCfg = Debug|Any CPU - {7C625EC4-F599-4350-A915-F046DF2406D3}.Debug|x64.Build.0 = Debug|Any CPU - {7C625EC4-F599-4350-A915-F046DF2406D3}.Release|ARM64.ActiveCfg = Release|Any CPU - {7C625EC4-F599-4350-A915-F046DF2406D3}.Release|ARM64.Build.0 = Release|Any CPU - {7C625EC4-F599-4350-A915-F046DF2406D3}.Release|x64.ActiveCfg = Release|Any CPU - {7C625EC4-F599-4350-A915-F046DF2406D3}.Release|x64.Build.0 = Release|Any CPU - {1F37A704-3CDF-45BB-8114-ED9137E5F2CF}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {1F37A704-3CDF-45BB-8114-ED9137E5F2CF}.Debug|ARM64.Build.0 = Debug|Any CPU - {1F37A704-3CDF-45BB-8114-ED9137E5F2CF}.Debug|x64.ActiveCfg = Debug|Any CPU - {1F37A704-3CDF-45BB-8114-ED9137E5F2CF}.Debug|x64.Build.0 = Debug|Any CPU - {1F37A704-3CDF-45BB-8114-ED9137E5F2CF}.Release|ARM64.ActiveCfg = Release|Any CPU - {1F37A704-3CDF-45BB-8114-ED9137E5F2CF}.Release|ARM64.Build.0 = Release|Any CPU - {1F37A704-3CDF-45BB-8114-ED9137E5F2CF}.Release|x64.ActiveCfg = Release|Any CPU - {1F37A704-3CDF-45BB-8114-ED9137E5F2CF}.Release|x64.Build.0 = Release|Any CPU - {FA18BA9F-76BF-4DE0-8D24-02FC7657E6CB}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {FA18BA9F-76BF-4DE0-8D24-02FC7657E6CB}.Debug|ARM64.Build.0 = Debug|ARM64 - {FA18BA9F-76BF-4DE0-8D24-02FC7657E6CB}.Debug|x64.ActiveCfg = Debug|x64 - {FA18BA9F-76BF-4DE0-8D24-02FC7657E6CB}.Debug|x64.Build.0 = Debug|x64 - {FA18BA9F-76BF-4DE0-8D24-02FC7657E6CB}.Release|ARM64.ActiveCfg = Release|ARM64 - {FA18BA9F-76BF-4DE0-8D24-02FC7657E6CB}.Release|ARM64.Build.0 = Release|ARM64 - {FA18BA9F-76BF-4DE0-8D24-02FC7657E6CB}.Release|x64.ActiveCfg = Release|x64 - {FA18BA9F-76BF-4DE0-8D24-02FC7657E6CB}.Release|x64.Build.0 = Release|x64 - {0071701E-B9C5-4098-BE5F-EF556C4553C6}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {0071701E-B9C5-4098-BE5F-EF556C4553C6}.Debug|ARM64.Build.0 = Debug|ARM64 - {0071701E-B9C5-4098-BE5F-EF556C4553C6}.Debug|ARM64.Deploy.0 = Debug|ARM64 - {0071701E-B9C5-4098-BE5F-EF556C4553C6}.Debug|x64.ActiveCfg = Debug|x64 - {0071701E-B9C5-4098-BE5F-EF556C4553C6}.Debug|x64.Build.0 = Debug|x64 - {0071701E-B9C5-4098-BE5F-EF556C4553C6}.Debug|x64.Deploy.0 = Debug|x64 - {0071701E-B9C5-4098-BE5F-EF556C4553C6}.Release|ARM64.ActiveCfg = Release|ARM64 - {0071701E-B9C5-4098-BE5F-EF556C4553C6}.Release|ARM64.Build.0 = Release|ARM64 - {0071701E-B9C5-4098-BE5F-EF556C4553C6}.Release|ARM64.Deploy.0 = Release|ARM64 - {0071701E-B9C5-4098-BE5F-EF556C4553C6}.Release|x64.ActiveCfg = Release|x64 - {0071701E-B9C5-4098-BE5F-EF556C4553C6}.Release|x64.Build.0 = Release|x64 - {0071701E-B9C5-4098-BE5F-EF556C4553C6}.Release|x64.Deploy.0 = Release|x64 - {4A8FCE22-851C-442A-8BC9-3EC3FD00B637}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {4A8FCE22-851C-442A-8BC9-3EC3FD00B637}.Debug|ARM64.Build.0 = Debug|Any CPU - {4A8FCE22-851C-442A-8BC9-3EC3FD00B637}.Debug|x64.ActiveCfg = Debug|Any CPU - {4A8FCE22-851C-442A-8BC9-3EC3FD00B637}.Debug|x64.Build.0 = Debug|Any CPU - {4A8FCE22-851C-442A-8BC9-3EC3FD00B637}.Release|ARM64.ActiveCfg = Release|Any CPU - {4A8FCE22-851C-442A-8BC9-3EC3FD00B637}.Release|ARM64.Build.0 = Release|Any CPU - {4A8FCE22-851C-442A-8BC9-3EC3FD00B637}.Release|x64.ActiveCfg = Release|Any CPU - {4A8FCE22-851C-442A-8BC9-3EC3FD00B637}.Release|x64.Build.0 = Release|Any CPU {76C66257-FDAA-47AB-85E7-EF757EAB10C0}.Debug|ARM64.ActiveCfg = Debug|ARM64 {76C66257-FDAA-47AB-85E7-EF757EAB10C0}.Debug|ARM64.Build.0 = Debug|ARM64 {76C66257-FDAA-47AB-85E7-EF757EAB10C0}.Debug|x64.ActiveCfg = Debug|x64 @@ -345,14 +143,6 @@ Global {76C66257-FDAA-47AB-85E7-EF757EAB10C0}.Release|ARM64.Build.0 = Release|ARM64 {76C66257-FDAA-47AB-85E7-EF757EAB10C0}.Release|x64.ActiveCfg = Release|x64 {76C66257-FDAA-47AB-85E7-EF757EAB10C0}.Release|x64.Build.0 = Release|x64 - {4D7D9BA8-A821-4B1C-9EE2-CBCF5849906E}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {4D7D9BA8-A821-4B1C-9EE2-CBCF5849906E}.Debug|ARM64.Build.0 = Debug|Any CPU - {4D7D9BA8-A821-4B1C-9EE2-CBCF5849906E}.Debug|x64.ActiveCfg = Debug|Any CPU - {4D7D9BA8-A821-4B1C-9EE2-CBCF5849906E}.Debug|x64.Build.0 = Debug|Any CPU - {4D7D9BA8-A821-4B1C-9EE2-CBCF5849906E}.Release|ARM64.ActiveCfg = Release|Any CPU - {4D7D9BA8-A821-4B1C-9EE2-CBCF5849906E}.Release|ARM64.Build.0 = Release|Any CPU - {4D7D9BA8-A821-4B1C-9EE2-CBCF5849906E}.Release|x64.ActiveCfg = Release|Any CPU - {4D7D9BA8-A821-4B1C-9EE2-CBCF5849906E}.Release|x64.Build.0 = Release|Any CPU {764BC0F5-0C5E-49AD-ABAA-E3874C0F3286}.Debug|ARM64.ActiveCfg = Debug|Any CPU {764BC0F5-0C5E-49AD-ABAA-E3874C0F3286}.Debug|ARM64.Build.0 = Debug|Any CPU {764BC0F5-0C5E-49AD-ABAA-E3874C0F3286}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -369,82 +159,6 @@ Global {BFB003D1-788B-48DE-8065-39479C162CB0}.Release|ARM64.Build.0 = Release|Any CPU {BFB003D1-788B-48DE-8065-39479C162CB0}.Release|x64.ActiveCfg = Release|Any CPU {BFB003D1-788B-48DE-8065-39479C162CB0}.Release|x64.Build.0 = Release|Any CPU - {E44053BD-A761-47FB-AA78-087A599672EA}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {E44053BD-A761-47FB-AA78-087A599672EA}.Debug|ARM64.Build.0 = Debug|Any CPU - {E44053BD-A761-47FB-AA78-087A599672EA}.Debug|x64.ActiveCfg = Debug|Any CPU - {E44053BD-A761-47FB-AA78-087A599672EA}.Debug|x64.Build.0 = Debug|Any CPU - {E44053BD-A761-47FB-AA78-087A599672EA}.Release|ARM64.ActiveCfg = Release|Any CPU - {E44053BD-A761-47FB-AA78-087A599672EA}.Release|ARM64.Build.0 = Release|Any CPU - {E44053BD-A761-47FB-AA78-087A599672EA}.Release|x64.ActiveCfg = Release|Any CPU - {E44053BD-A761-47FB-AA78-087A599672EA}.Release|x64.Build.0 = Release|Any CPU - {209C95A3-FA53-431B-B688-3299CA6C29D2}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {209C95A3-FA53-431B-B688-3299CA6C29D2}.Debug|ARM64.Build.0 = Debug|Any CPU - {209C95A3-FA53-431B-B688-3299CA6C29D2}.Debug|x64.ActiveCfg = Debug|Any CPU - {209C95A3-FA53-431B-B688-3299CA6C29D2}.Debug|x64.Build.0 = Debug|Any CPU - {209C95A3-FA53-431B-B688-3299CA6C29D2}.Release|ARM64.ActiveCfg = Release|Any CPU - {209C95A3-FA53-431B-B688-3299CA6C29D2}.Release|ARM64.Build.0 = Release|Any CPU - {209C95A3-FA53-431B-B688-3299CA6C29D2}.Release|x64.ActiveCfg = Release|Any CPU - {209C95A3-FA53-431B-B688-3299CA6C29D2}.Release|x64.Build.0 = Release|Any CPU - {94178D51-0097-4AD2-B3D0-827E40D62F2E}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {94178D51-0097-4AD2-B3D0-827E40D62F2E}.Debug|ARM64.Build.0 = Debug|Any CPU - {94178D51-0097-4AD2-B3D0-827E40D62F2E}.Debug|x64.ActiveCfg = Debug|Any CPU - {94178D51-0097-4AD2-B3D0-827E40D62F2E}.Debug|x64.Build.0 = Debug|Any CPU - {94178D51-0097-4AD2-B3D0-827E40D62F2E}.Release|ARM64.ActiveCfg = Release|Any CPU - {94178D51-0097-4AD2-B3D0-827E40D62F2E}.Release|ARM64.Build.0 = Release|Any CPU - {94178D51-0097-4AD2-B3D0-827E40D62F2E}.Release|x64.ActiveCfg = Release|Any CPU - {94178D51-0097-4AD2-B3D0-827E40D62F2E}.Release|x64.Build.0 = Release|Any CPU - {14EF12A3-90E6-4683-BD71-9896AF87026B}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {14EF12A3-90E6-4683-BD71-9896AF87026B}.Debug|ARM64.Build.0 = Debug|Any CPU - {14EF12A3-90E6-4683-BD71-9896AF87026B}.Debug|x64.ActiveCfg = Debug|Any CPU - {14EF12A3-90E6-4683-BD71-9896AF87026B}.Debug|x64.Build.0 = Debug|Any CPU - {14EF12A3-90E6-4683-BD71-9896AF87026B}.Release|ARM64.ActiveCfg = Release|Any CPU - {14EF12A3-90E6-4683-BD71-9896AF87026B}.Release|ARM64.Build.0 = Release|Any CPU - {14EF12A3-90E6-4683-BD71-9896AF87026B}.Release|x64.ActiveCfg = Release|Any CPU - {14EF12A3-90E6-4683-BD71-9896AF87026B}.Release|x64.Build.0 = Release|Any CPU - {5DE90C85-ED26-4B5A-A0D7-2FF966A210AC}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {5DE90C85-ED26-4B5A-A0D7-2FF966A210AC}.Debug|ARM64.Build.0 = Debug|Any CPU - {5DE90C85-ED26-4B5A-A0D7-2FF966A210AC}.Debug|x64.ActiveCfg = Debug|Any CPU - {5DE90C85-ED26-4B5A-A0D7-2FF966A210AC}.Debug|x64.Build.0 = Debug|Any CPU - {5DE90C85-ED26-4B5A-A0D7-2FF966A210AC}.Release|ARM64.ActiveCfg = Release|Any CPU - {5DE90C85-ED26-4B5A-A0D7-2FF966A210AC}.Release|ARM64.Build.0 = Release|Any CPU - {5DE90C85-ED26-4B5A-A0D7-2FF966A210AC}.Release|x64.ActiveCfg = Release|Any CPU - {5DE90C85-ED26-4B5A-A0D7-2FF966A210AC}.Release|x64.Build.0 = Release|Any CPU - {669A414F-3B46-4B55-B587-061AF63C3067}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {669A414F-3B46-4B55-B587-061AF63C3067}.Debug|ARM64.Build.0 = Debug|Any CPU - {669A414F-3B46-4B55-B587-061AF63C3067}.Debug|x64.ActiveCfg = Debug|Any CPU - {669A414F-3B46-4B55-B587-061AF63C3067}.Debug|x64.Build.0 = Debug|Any CPU - {669A414F-3B46-4B55-B587-061AF63C3067}.Release|ARM64.ActiveCfg = Release|Any CPU - {669A414F-3B46-4B55-B587-061AF63C3067}.Release|ARM64.Build.0 = Release|Any CPU - {669A414F-3B46-4B55-B587-061AF63C3067}.Release|x64.ActiveCfg = Release|Any CPU - {669A414F-3B46-4B55-B587-061AF63C3067}.Release|x64.Build.0 = Release|Any CPU - {BD9E6556-357E-4C20-BFCD-FB131F9372FA}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {BD9E6556-357E-4C20-BFCD-FB131F9372FA}.Debug|ARM64.Build.0 = Debug|ARM64 - {BD9E6556-357E-4C20-BFCD-FB131F9372FA}.Debug|x64.ActiveCfg = Debug|x64 - {BD9E6556-357E-4C20-BFCD-FB131F9372FA}.Debug|x64.Build.0 = Debug|x64 - {BD9E6556-357E-4C20-BFCD-FB131F9372FA}.Release|ARM64.ActiveCfg = Release|ARM64 - {BD9E6556-357E-4C20-BFCD-FB131F9372FA}.Release|ARM64.Build.0 = Release|ARM64 - {BD9E6556-357E-4C20-BFCD-FB131F9372FA}.Release|x64.ActiveCfg = Release|x64 - {BD9E6556-357E-4C20-BFCD-FB131F9372FA}.Release|x64.Build.0 = Release|x64 - {9EA5AE9D-C39A-4F43-B03E-0A848EA2558A}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {9EA5AE9D-C39A-4F43-B03E-0A848EA2558A}.Debug|ARM64.Build.0 = Debug|ARM64 - {9EA5AE9D-C39A-4F43-B03E-0A848EA2558A}.Debug|x64.ActiveCfg = Debug|x64 - {9EA5AE9D-C39A-4F43-B03E-0A848EA2558A}.Debug|x64.Build.0 = Debug|x64 - {9EA5AE9D-C39A-4F43-B03E-0A848EA2558A}.Release|ARM64.ActiveCfg = Release|ARM64 - {9EA5AE9D-C39A-4F43-B03E-0A848EA2558A}.Release|ARM64.Build.0 = Release|ARM64 - {9EA5AE9D-C39A-4F43-B03E-0A848EA2558A}.Release|x64.ActiveCfg = Release|x64 - {9EA5AE9D-C39A-4F43-B03E-0A848EA2558A}.Release|x64.Build.0 = Release|x64 - {73C32D0F-64DB-4674-84E9-8FCC41228474}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {73C32D0F-64DB-4674-84E9-8FCC41228474}.Debug|ARM64.Build.0 = Debug|ARM64 - {73C32D0F-64DB-4674-84E9-8FCC41228474}.Debug|ARM64.Deploy.0 = Debug|ARM64 - {73C32D0F-64DB-4674-84E9-8FCC41228474}.Debug|x64.ActiveCfg = Debug|x64 - {73C32D0F-64DB-4674-84E9-8FCC41228474}.Debug|x64.Build.0 = Debug|x64 - {73C32D0F-64DB-4674-84E9-8FCC41228474}.Debug|x64.Deploy.0 = Debug|x64 - {73C32D0F-64DB-4674-84E9-8FCC41228474}.Release|ARM64.ActiveCfg = Release|ARM64 - {73C32D0F-64DB-4674-84E9-8FCC41228474}.Release|ARM64.Build.0 = Release|ARM64 - {73C32D0F-64DB-4674-84E9-8FCC41228474}.Release|ARM64.Deploy.0 = Release|ARM64 - {73C32D0F-64DB-4674-84E9-8FCC41228474}.Release|x64.ActiveCfg = Release|x64 - {73C32D0F-64DB-4674-84E9-8FCC41228474}.Release|x64.Build.0 = Release|x64 - {73C32D0F-64DB-4674-84E9-8FCC41228474}.Release|x64.Deploy.0 = Release|x64 {E017B3B6-C7D3-4E53-A7F6-1036178E98C3}.Debug|ARM64.ActiveCfg = Debug|Any CPU {E017B3B6-C7D3-4E53-A7F6-1036178E98C3}.Debug|ARM64.Build.0 = Debug|Any CPU {E017B3B6-C7D3-4E53-A7F6-1036178E98C3}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -453,22 +167,6 @@ Global {E017B3B6-C7D3-4E53-A7F6-1036178E98C3}.Release|ARM64.Build.0 = Release|Any CPU {E017B3B6-C7D3-4E53-A7F6-1036178E98C3}.Release|x64.ActiveCfg = Release|Any CPU {E017B3B6-C7D3-4E53-A7F6-1036178E98C3}.Release|x64.Build.0 = Release|Any CPU - {54654960-54B5-4E19-B3ED-993591CA39E5}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {54654960-54B5-4E19-B3ED-993591CA39E5}.Debug|ARM64.Build.0 = Debug|Any CPU - {54654960-54B5-4E19-B3ED-993591CA39E5}.Debug|x64.ActiveCfg = Debug|Any CPU - {54654960-54B5-4E19-B3ED-993591CA39E5}.Debug|x64.Build.0 = Debug|Any CPU - {54654960-54B5-4E19-B3ED-993591CA39E5}.Release|ARM64.ActiveCfg = Release|Any CPU - {54654960-54B5-4E19-B3ED-993591CA39E5}.Release|ARM64.Build.0 = Release|Any CPU - {54654960-54B5-4E19-B3ED-993591CA39E5}.Release|x64.ActiveCfg = Release|Any CPU - {54654960-54B5-4E19-B3ED-993591CA39E5}.Release|x64.Build.0 = Release|Any CPU - {59A17380-24A0-4BD7-9012-B105A9E7D46F}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {59A17380-24A0-4BD7-9012-B105A9E7D46F}.Debug|ARM64.Build.0 = Debug|Any CPU - {59A17380-24A0-4BD7-9012-B105A9E7D46F}.Debug|x64.ActiveCfg = Debug|Any CPU - {59A17380-24A0-4BD7-9012-B105A9E7D46F}.Debug|x64.Build.0 = Debug|Any CPU - {59A17380-24A0-4BD7-9012-B105A9E7D46F}.Release|ARM64.ActiveCfg = Release|Any CPU - {59A17380-24A0-4BD7-9012-B105A9E7D46F}.Release|ARM64.Build.0 = Release|Any CPU - {59A17380-24A0-4BD7-9012-B105A9E7D46F}.Release|x64.ActiveCfg = Release|Any CPU - {59A17380-24A0-4BD7-9012-B105A9E7D46F}.Release|x64.Build.0 = Release|Any CPU {9B4448B1-200F-4966-8A13-A508691B3003}.Debug|ARM64.ActiveCfg = Debug|Any CPU {9B4448B1-200F-4966-8A13-A508691B3003}.Debug|ARM64.Build.0 = Debug|Any CPU {9B4448B1-200F-4966-8A13-A508691B3003}.Debug|x64.ActiveCfg = Debug|Any CPU @@ -477,145 +175,20 @@ Global {9B4448B1-200F-4966-8A13-A508691B3003}.Release|ARM64.Build.0 = Release|Any CPU {9B4448B1-200F-4966-8A13-A508691B3003}.Release|x64.ActiveCfg = Release|Any CPU {9B4448B1-200F-4966-8A13-A508691B3003}.Release|x64.Build.0 = Release|Any CPU - {1A3E20B3-F711-41C0-82EA-3B53A575955C}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {1A3E20B3-F711-41C0-82EA-3B53A575955C}.Debug|ARM64.Build.0 = Debug|Any CPU - {1A3E20B3-F711-41C0-82EA-3B53A575955C}.Debug|x64.ActiveCfg = Debug|Any CPU - {1A3E20B3-F711-41C0-82EA-3B53A575955C}.Debug|x64.Build.0 = Debug|Any CPU - {1A3E20B3-F711-41C0-82EA-3B53A575955C}.Release|ARM64.ActiveCfg = Release|Any CPU - {1A3E20B3-F711-41C0-82EA-3B53A575955C}.Release|ARM64.Build.0 = Release|Any CPU - {1A3E20B3-F711-41C0-82EA-3B53A575955C}.Release|x64.ActiveCfg = Release|Any CPU - {1A3E20B3-F711-41C0-82EA-3B53A575955C}.Release|x64.Build.0 = Release|Any CPU - {551EF4FB-F34F-412A-B3E6-E345797560ED}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {551EF4FB-F34F-412A-B3E6-E345797560ED}.Debug|ARM64.Build.0 = Debug|ARM64 - {551EF4FB-F34F-412A-B3E6-E345797560ED}.Debug|x64.ActiveCfg = Debug|x64 - {551EF4FB-F34F-412A-B3E6-E345797560ED}.Debug|x64.Build.0 = Debug|x64 - {551EF4FB-F34F-412A-B3E6-E345797560ED}.Release|ARM64.ActiveCfg = Release|ARM64 - {551EF4FB-F34F-412A-B3E6-E345797560ED}.Release|ARM64.Build.0 = Release|ARM64 - {551EF4FB-F34F-412A-B3E6-E345797560ED}.Release|x64.ActiveCfg = Release|x64 - {551EF4FB-F34F-412A-B3E6-E345797560ED}.Release|x64.Build.0 = Release|x64 - {2C4C1A6B-7E38-41EC-84D9-007676571441}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {2C4C1A6B-7E38-41EC-84D9-007676571441}.Debug|ARM64.Build.0 = Debug|ARM64 - {2C4C1A6B-7E38-41EC-84D9-007676571441}.Debug|x64.ActiveCfg = Debug|x64 - {2C4C1A6B-7E38-41EC-84D9-007676571441}.Debug|x64.Build.0 = Debug|x64 - {2C4C1A6B-7E38-41EC-84D9-007676571441}.Release|ARM64.ActiveCfg = Release|ARM64 - {2C4C1A6B-7E38-41EC-84D9-007676571441}.Release|ARM64.Build.0 = Release|ARM64 - {2C4C1A6B-7E38-41EC-84D9-007676571441}.Release|x64.ActiveCfg = Release|x64 - {2C4C1A6B-7E38-41EC-84D9-007676571441}.Release|x64.Build.0 = Release|x64 - {716DF19E-69BA-4A9C-9CA4-BFD196152F46}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {716DF19E-69BA-4A9C-9CA4-BFD196152F46}.Debug|ARM64.Build.0 = Debug|ARM64 - {716DF19E-69BA-4A9C-9CA4-BFD196152F46}.Debug|x64.ActiveCfg = Debug|x64 - {716DF19E-69BA-4A9C-9CA4-BFD196152F46}.Debug|x64.Build.0 = Debug|x64 - {716DF19E-69BA-4A9C-9CA4-BFD196152F46}.Release|ARM64.ActiveCfg = Release|ARM64 - {716DF19E-69BA-4A9C-9CA4-BFD196152F46}.Release|ARM64.Build.0 = Release|ARM64 - {716DF19E-69BA-4A9C-9CA4-BFD196152F46}.Release|x64.ActiveCfg = Release|x64 - {716DF19E-69BA-4A9C-9CA4-BFD196152F46}.Release|x64.Build.0 = Release|x64 - {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Debug|ARM64.Build.0 = Debug|ARM64 - {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Debug|ARM64.Deploy.0 = Debug|ARM64 - {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Debug|x64.ActiveCfg = Debug|x64 - {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Debug|x64.Build.0 = Debug|x64 - {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Debug|x64.Deploy.0 = Debug|x64 - {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Release|ARM64.ActiveCfg = Release|ARM64 - {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Release|ARM64.Build.0 = Release|ARM64 - {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Release|ARM64.Deploy.0 = Release|ARM64 - {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Release|x64.ActiveCfg = Release|x64 - {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Release|x64.Build.0 = Release|x64 - {9FBE070E-A210-4CEF-9F04-61C2B269C600}.Release|x64.Deploy.0 = Release|x64 - {FEBEC83A-FE70-4D4B-9B00-76DB31E75F17}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {FEBEC83A-FE70-4D4B-9B00-76DB31E75F17}.Debug|ARM64.Build.0 = Debug|Any CPU - {FEBEC83A-FE70-4D4B-9B00-76DB31E75F17}.Debug|x64.ActiveCfg = Debug|Any CPU - {FEBEC83A-FE70-4D4B-9B00-76DB31E75F17}.Debug|x64.Build.0 = Debug|Any CPU - {FEBEC83A-FE70-4D4B-9B00-76DB31E75F17}.Release|ARM64.ActiveCfg = Release|Any CPU - {FEBEC83A-FE70-4D4B-9B00-76DB31E75F17}.Release|ARM64.Build.0 = Release|Any CPU - {FEBEC83A-FE70-4D4B-9B00-76DB31E75F17}.Release|x64.ActiveCfg = Release|Any CPU - {FEBEC83A-FE70-4D4B-9B00-76DB31E75F17}.Release|x64.Build.0 = Release|Any CPU - {916331A5-1EA6-41D7-B199-2E50C513EFDE}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {916331A5-1EA6-41D7-B199-2E50C513EFDE}.Debug|ARM64.Build.0 = Debug|ARM64 - {916331A5-1EA6-41D7-B199-2E50C513EFDE}.Debug|x64.ActiveCfg = Debug|x64 - {916331A5-1EA6-41D7-B199-2E50C513EFDE}.Debug|x64.Build.0 = Debug|x64 - {916331A5-1EA6-41D7-B199-2E50C513EFDE}.Release|ARM64.ActiveCfg = Release|ARM64 - {916331A5-1EA6-41D7-B199-2E50C513EFDE}.Release|ARM64.Build.0 = Release|ARM64 - {916331A5-1EA6-41D7-B199-2E50C513EFDE}.Release|x64.ActiveCfg = Release|x64 - {916331A5-1EA6-41D7-B199-2E50C513EFDE}.Release|x64.Build.0 = Release|x64 - {690C4014-A06B-44DB-B717-AEA4CAFA9D68}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {690C4014-A06B-44DB-B717-AEA4CAFA9D68}.Debug|ARM64.Build.0 = Debug|Any CPU - {690C4014-A06B-44DB-B717-AEA4CAFA9D68}.Debug|x64.ActiveCfg = Debug|Any CPU - {690C4014-A06B-44DB-B717-AEA4CAFA9D68}.Debug|x64.Build.0 = Debug|Any CPU - {690C4014-A06B-44DB-B717-AEA4CAFA9D68}.Release|ARM64.ActiveCfg = Release|Any CPU - {690C4014-A06B-44DB-B717-AEA4CAFA9D68}.Release|ARM64.Build.0 = Release|Any CPU - {690C4014-A06B-44DB-B717-AEA4CAFA9D68}.Release|x64.ActiveCfg = Release|Any CPU - {690C4014-A06B-44DB-B717-AEA4CAFA9D68}.Release|x64.Build.0 = Release|Any CPU - {9D3C872E-D64E-47E7-BDC8-077A151DBB7D}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {9D3C872E-D64E-47E7-BDC8-077A151DBB7D}.Debug|ARM64.Build.0 = Debug|Any CPU - {9D3C872E-D64E-47E7-BDC8-077A151DBB7D}.Debug|x64.ActiveCfg = Debug|Any CPU - {9D3C872E-D64E-47E7-BDC8-077A151DBB7D}.Debug|x64.Build.0 = Debug|Any CPU - {9D3C872E-D64E-47E7-BDC8-077A151DBB7D}.Release|ARM64.ActiveCfg = Release|Any CPU - {9D3C872E-D64E-47E7-BDC8-077A151DBB7D}.Release|ARM64.Build.0 = Release|Any CPU - {9D3C872E-D64E-47E7-BDC8-077A151DBB7D}.Release|x64.ActiveCfg = Release|Any CPU - {9D3C872E-D64E-47E7-BDC8-077A151DBB7D}.Release|x64.Build.0 = Release|Any CPU - {8BE73DB3-16E0-41F4-A87F-0C2AB43856A2}.Debug|ARM64.ActiveCfg = Debug|Any CPU - {8BE73DB3-16E0-41F4-A87F-0C2AB43856A2}.Debug|ARM64.Build.0 = Debug|Any CPU - {8BE73DB3-16E0-41F4-A87F-0C2AB43856A2}.Debug|x64.ActiveCfg = Debug|Any CPU - {8BE73DB3-16E0-41F4-A87F-0C2AB43856A2}.Debug|x64.Build.0 = Debug|Any CPU - {8BE73DB3-16E0-41F4-A87F-0C2AB43856A2}.Release|ARM64.ActiveCfg = Release|Any CPU - {8BE73DB3-16E0-41F4-A87F-0C2AB43856A2}.Release|ARM64.Build.0 = Release|Any CPU - {8BE73DB3-16E0-41F4-A87F-0C2AB43856A2}.Release|x64.ActiveCfg = Release|Any CPU - {8BE73DB3-16E0-41F4-A87F-0C2AB43856A2}.Release|x64.Build.0 = Release|Any CPU - {6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Debug|ARM64.Build.0 = Debug|ARM64 - {6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Debug|ARM64.Deploy.0 = Debug|ARM64 - {6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Debug|x64.ActiveCfg = Debug|x64 - {6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Debug|x64.Build.0 = Debug|x64 - {6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Debug|x64.Deploy.0 = Debug|x64 - {6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Release|ARM64.ActiveCfg = Release|ARM64 - {6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Release|ARM64.Build.0 = Release|ARM64 - {6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Release|ARM64.Deploy.0 = Release|ARM64 - {6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Release|x64.ActiveCfg = Release|x64 - {6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Release|x64.Build.0 = Release|x64 - {6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8}.Release|x64.Deploy.0 = Release|x64 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection GlobalSection(NestedProjects) = preSolution - {34AFE6E6-9A4C-4C3F-AE69-DD3693086DAF} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1} - {524CC5DD-1DEE-4A30-9515-AB90965E5207} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1} {E91F4D24-922A-4921-A8D7-9C45A143C45D} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7} {E889E6D6-A814-4950-AAC1-68F1ECFC5BD6} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7} - {7048DEEA-0A6F-46A0-B951-B682A8F1CB75} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1} - {BBBD0ADD-F2F9-49A3-BD5E-D223F0735D8B} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7} - {BF52326F-E415-49E6-8595-62762216762B} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7} - {E7C9247D-016B-4819-AF9F-0E9B3591E04B} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1} - {C12D7ACE-98ED-4813-8118-6667C34F484F} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1} - {7C625EC4-F599-4350-A915-F046DF2406D3} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1} - {1F37A704-3CDF-45BB-8114-ED9137E5F2CF} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1} {514FF00E-BBF0-4D55-A47C-EEEB6208ADCE} = {D991153C-A34D-4042-B76F-822ADB111DD0} - {0071701E-B9C5-4098-BE5F-EF556C4553C6} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1} {0800BD51-499D-44C2-9417-FD1F7FDFE9C4} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1} - {4A8FCE22-851C-442A-8BC9-3EC3FD00B637} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7} - {9DA1DA9F-F8B2-4B25-BE80-C21F773029E3} = {D991153C-A34D-4042-B76F-822ADB111DD0} - {209C95A3-FA53-431B-B688-3299CA6C29D2} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7} - {94178D51-0097-4AD2-B3D0-827E40D62F2E} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7} - {CBA545B4-31EF-4E9F-A1A8-2A1290B54046} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7} - {C0B903AA-F32C-4760-B4B6-199AC4FE1C5A} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7} - {E3403F19-A0D8-4317-8A54-322C7A13F2A2} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7} - {5DE90C85-ED26-4B5A-A0D7-2FF966A210AC} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7} - {669A414F-3B46-4B55-B587-061AF63C3067} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7} {B86A48A7-18BD-4946-B995-3CE26B092DDF} = {1A9C4108-F61A-4ABE-B5CF-F524521EAE2D} - {F8BF7666-7CCF-4FE4-B055-2EBA4BCD4564} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1} {568E7009-5C13-4153-9C94-0AC7A3E6883C} = {1A9C4108-F61A-4ABE-B5CF-F524521EAE2D} {B54B6DCA-6EAB-46A8-83D3-15154659F47F} = {1A9C4108-F61A-4ABE-B5CF-F524521EAE2D} - {9EA5AE9D-C39A-4F43-B03E-0A848EA2558A} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1} - {73C32D0F-64DB-4674-84E9-8FCC41228474} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7} - {59A17380-24A0-4BD7-9012-B105A9E7D46F} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7} {79FD7862-4707-4DE0-8777-3872558E4C1C} = {A5013F9B-92EC-419F-B0B3-3D6B721E7104} {B4F6A41C-AA9A-4302-92B3-AC64CF2E30F5} = {A5013F9B-92EC-419F-B0B3-3D6B721E7104} - {1A3E20B3-F711-41C0-82EA-3B53A575955C} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1} - {551EF4FB-F34F-412A-B3E6-E345797560ED} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1} - {9FBE070E-A210-4CEF-9F04-61C2B269C600} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1} - {916331A5-1EA6-41D7-B199-2E50C513EFDE} = {F8EFBB27-4EE2-4463-A75B-7EFDFB55D0F7} - {6A861D53-2DBD-4B4F-8543-90DC8C0F2DC8} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1} - {6BC471C6-72F9-43CF-AE1E-F6D3E5ED3129} = {0ED8F632-5E17-46BE-8CC3-B14A82D4AEB1} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {4664C5E3-0340-4E22-BCFD-98AAEDF5F2DC} diff --git a/samples/ComputeSharp.Benchmark/Blas/BlasBenchmark.cs b/samples/ComputeSharp.Benchmark/Blas/BlasBenchmark.cs deleted file mode 100644 index 95ed9cbd..00000000 --- a/samples/ComputeSharp.Benchmark/Blas/BlasBenchmark.cs +++ /dev/null @@ -1,163 +0,0 @@ -using System; -using System.Buffers; -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Engines; - -#pragma warning disable CA1063 - -namespace ComputeSharp.Benchmark.Blas; - -/// -/// A that benchmarks the APIs in the class, on both CPU and GPU. -/// -[SimpleJob(RunStrategy.Monitoring)] -public class BlasBenchmark : IDisposable -{ - /// - /// The number of samples. - /// - private const int C = 128; - - /// - /// The nummber of rows in the matrix. - /// - private const int N = 512; - - /// - /// The number of columns in the matrix (same as the number of rows in the matrix) - /// - private const int M = 512; - - /// - /// The number of columns in the matrix. - /// - private const int P = 256; - - /// - /// The input tensor. - /// - private float[]? x; - - /// - /// The weights tensor. - /// - private float[]? w; - - /// - /// The bias tensor. - /// - private float[]? b; - - /// - /// The result tensor. - /// - private float[]? y; - - /// - /// The input tensor (GPU). - /// - private ReadOnlyBuffer? bufferX; - - /// - /// The weights tensor (GPU). - /// - private ReadOnlyBuffer? bufferW; - - /// - /// The bias tensor (GPU). - /// - private ReadOnlyBuffer? bufferB; - - /// - /// The result tensor (GPU). - /// - private ReadWriteBuffer? bufferY; - - /// - /// A instance to initialize the tensors. - /// - private readonly Random random = new(); - - /// - /// Initial setup for a benchmarking session. - /// - [GlobalSetup] - public void Setup() - { - // Creates a new random normalized float[] array of a given size - float[] CreateRandomArray(int size) - { - float[] array = ArrayPool.Shared.Rent(size); - - foreach (ref float x in array.AsSpan()) - { - x = (float)this.random.NextDouble(); - } - - return array; - } - - this.x = CreateRandomArray(C * N * M); - this.w = CreateRandomArray(M * P); - this.b = CreateRandomArray(P); - this.y = CreateRandomArray(C * N * P); - - this.bufferX = GraphicsDevice.GetDefault().AllocateReadOnlyBuffer(this.x); - this.bufferW = GraphicsDevice.GetDefault().AllocateReadOnlyBuffer(this.w); - this.bufferB = GraphicsDevice.GetDefault().AllocateReadOnlyBuffer(this.b); - this.bufferY = GraphicsDevice.GetDefault().AllocateReadWriteBuffer(this.y); - - Cpu(); - GpuWithNoTemporaryBuffers(); - GpuWithTemporaryBuffers(); - } - - /// - [GlobalCleanup] - public void Dispose() - { - ArrayPool.Shared.Return(this.x!); - ArrayPool.Shared.Return(this.w!); - ArrayPool.Shared.Return(this.b!); - ArrayPool.Shared.Return(this.y!); - - this.bufferX!.Dispose(); - this.bufferW!.Dispose(); - this.bufferB!.Dispose(); - this.bufferY!.Dispose(); - } - - /// - /// Runs a fully connected forward operation on the CPU. - /// - [Benchmark(Baseline = true)] - public void Cpu() - { - BlasHelpers.FullyConnectedForwardCpu(C, N, M, P, this.x!, this.w!, this.b!, this.y!); - } - - /// - /// Runs a fully connected forward operation on the GPU. - /// - [Benchmark] - public void GpuWithNoTemporaryBuffers() - { - BlasHelpers.FullyConnectedForwardGpu(GraphicsDevice.GetDefault(), C, N, M, P, this.bufferX!, this.bufferW!, this.bufferB!, this.bufferY!); - } - - /// - /// Runs a fully connected forward operation on the GPU, creating temporary GPU buffers to perform the operations. - /// - [Benchmark] - public void GpuWithTemporaryBuffers() - { - using ReadOnlyBuffer x = GraphicsDevice.GetDefault().AllocateReadOnlyBuffer(this.x!); - using ReadOnlyBuffer w = GraphicsDevice.GetDefault().AllocateReadOnlyBuffer(this.w!); - using ReadOnlyBuffer b = GraphicsDevice.GetDefault().AllocateReadOnlyBuffer(this.b!); - using ReadWriteBuffer y = GraphicsDevice.GetDefault().AllocateReadWriteBuffer(this.y!.Length); - - BlasHelpers.FullyConnectedForwardGpu(GraphicsDevice.GetDefault(), C, N, M, P, x, w, b, y); - - y.CopyTo(this.y); - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.Benchmark/Blas/BlasHelpers.cs b/samples/ComputeSharp.Benchmark/Blas/BlasHelpers.cs deleted file mode 100644 index 8c9e68d2..00000000 --- a/samples/ComputeSharp.Benchmark/Blas/BlasHelpers.cs +++ /dev/null @@ -1,108 +0,0 @@ -using System.Runtime.CompilerServices; -using System.Threading.Tasks; - -namespace ComputeSharp.Benchmark.Blas; - -/// -/// A that contains primitives to run certain operations of a neural network. -/// -internal static partial class BlasHelpers -{ - /// - /// Executes the forward pass on a fully connected layer on the CPU. - /// - /// The number of samples in the input tensor. - /// The number of rows in the input matrix. - /// The number of columns in the input matrix. - /// The number of columns in the output matrix. - /// The input tensor. - /// The weights tensor. - /// The bias tensor. - /// The result tensor. - public static void FullyConnectedForwardCpu(int c, int n, int m, int p, float[] x, float[] w, float[] b, float[] y) - { - void Kernel(int s) - { - ref float rx = ref x[s * n * m]; - ref float rw = ref w[0]; - ref float rb = ref b[0]; - ref float ry = ref y[s * n * p]; - - for (int i = 0; i < n; i++) - { - int x_offset = i * m; - int y_offset = i * p; - - for (int j = 0; j < p; j++) - { - float result = 0f; - - for (int k = 0; k < m; k++) - { - result += Unsafe.Add(ref rx, x_offset + k) * Unsafe.Add(ref rw, (k * p) + j); - } - - Unsafe.Add(ref ry, y_offset + j) = result + Unsafe.Add(ref rb, j); - } - } - } - - _ = Parallel.For(0, c, Kernel); - } - - /// - /// Executes the forward pass on a fully connected layer on the GPU. - /// - /// The device to run the computation on. - /// The number of samples in the input tensor. - /// The number of rows in the input matrix. - /// The number of columns in the input matrix. - /// The number of columns in the output matrix. - /// The input tensor. - /// The weights tensor. - /// The bias tensor. - /// The result tensor. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void FullyConnectedForwardGpu( - GraphicsDevice device, - int c, - int n, - int m, - int p, - ReadOnlyBuffer x, - ReadOnlyBuffer w, - ReadOnlyBuffer b, - ReadWriteBuffer y) - { - device.For(c, n, p, new FullyConnectedForwardKernel(n, m, p, x, w, b, y)); - } - - /// - /// Kernel for . - /// - [ThreadGroupSize(DefaultThreadGroupSizes.XYZ)] - [GeneratedComputeShaderDescriptor] - public readonly partial struct FullyConnectedForwardKernel( - int n, - int m, - int p, - ReadOnlyBuffer x, - ReadOnlyBuffer w, - ReadOnlyBuffer b, - ReadWriteBuffer y) : IComputeShader - { - /// - public void Execute() - { - int x_offset = (ThreadIds.X * n * m) + (ThreadIds.Y * m); - float result = 0f; - - for (int k = 0; k < m; k++) - { - result += x[x_offset + k] * w[(k * p) + ThreadIds.Z]; - } - - y[(ThreadIds.X * n * p) + (ThreadIds.Y * p) + ThreadIds.Z] = result + b[ThreadIds.Z]; - } - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.Benchmark/ComputeSharp.Benchmark.csproj b/samples/ComputeSharp.Benchmark/ComputeSharp.Benchmark.csproj deleted file mode 100644 index 01a18046..00000000 --- a/samples/ComputeSharp.Benchmark/ComputeSharp.Benchmark.csproj +++ /dev/null @@ -1,31 +0,0 @@ - - - Exe - net8.0 - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/ComputeSharp.Benchmark/Dispatching/DispatchingBenchmark.cs b/samples/ComputeSharp.Benchmark/Dispatching/DispatchingBenchmark.cs deleted file mode 100644 index 541c21aa..00000000 --- a/samples/ComputeSharp.Benchmark/Dispatching/DispatchingBenchmark.cs +++ /dev/null @@ -1,122 +0,0 @@ -using System; -using System.Threading.Tasks; -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Configs; - -#pragma warning disable CA1063, IDE0052 - -namespace ComputeSharp.Benchmark.Blas; - -/// -/// A that benchmarks the shader dispatch times. -/// -[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)] -[MemoryDiagnoser] -public partial class DispatchingBenchmark : IDisposable -{ - /// - /// The test buffer. - /// - private ReadWriteBuffer? buffer; - - /// - /// Initial setup for a benchmarking session. - /// - [GlobalSetup] - public void Setup() - { - this.buffer = GraphicsDevice.GetDefault().AllocateReadWriteBuffer(128); - } - - /// - [GlobalCleanup] - public void Dispose() - { - this.buffer!.Dispose(); - } - - /// - /// Invokes a single shader, manually. - /// - [Benchmark(Baseline = true)] - [BenchmarkCategory("SINGLE")] - public void Compute_Single() - { - GraphicsDevice.GetDefault().For(64, new TestShader(this.buffer!)); - } - - /// - /// Invokes a single shader through a compute context. - /// - [Benchmark] - [BenchmarkCategory("SINGLE")] - public void Compute_Single_WithContext() - { - using ComputeContext context = GraphicsDevice.GetDefault().CreateComputeContext(); - - context.For(64, new TestShader(this.buffer!)); - } - - /// - /// Invokes a single shader through a compute context, asynchronously. - /// - [Benchmark] - [BenchmarkCategory("SINGLE")] - public async Task Compute_Single_WithContext_Async() - { - await using ComputeContext context = GraphicsDevice.GetDefault().CreateComputeContext(); - - context.For(64, new TestShader(this.buffer!)); - } - - /// - /// Invokes two empty compute shaders one by one. - /// - [Benchmark(Baseline = true)] - [BenchmarkCategory("MULTIPLE")] - public void Compute_Multiple() - { - GraphicsDevice.GetDefault().For(64, new TestShader(this.buffer!)); - GraphicsDevice.GetDefault().For(64, new TestShader(this.buffer!)); - } - - /// - /// Invokes two empty compute shaders in a batch. - /// - [Benchmark] - [BenchmarkCategory("MULTIPLE")] - public void Compute_Multiple_WithContext() - { - using ComputeContext context = GraphicsDevice.GetDefault().CreateComputeContext(); - - context.For(64, new TestShader(this.buffer!)); - context.Barrier(this.buffer!); - context.For(64, new TestShader(this.buffer!)); - } - - /// - /// Invokes two empty compute shaders in a batch, asynchronously. - /// - [Benchmark] - [BenchmarkCategory("MULTIPLE")] - public async Task Compute_Multiple_WithContext_Async() - { - await using ComputeContext context = GraphicsDevice.GetDefault().CreateComputeContext(); - - context.For(64, new TestShader(this.buffer!)); - context.Barrier(this.buffer!); - context.For(64, new TestShader(this.buffer!)); - } - - [ThreadGroupSize(DefaultThreadGroupSizes.X)] - [GeneratedComputeShaderDescriptor] - internal readonly partial struct TestShader(ReadWriteBuffer buffer) : IComputeShader - { - private readonly ReadWriteBuffer buffer = buffer; - - /// - public void Execute() - { - } - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.Benchmark/Imaging/ImagingBenchmark.cs b/samples/ComputeSharp.Benchmark/Imaging/ImagingBenchmark.cs deleted file mode 100644 index 84ef323f..00000000 --- a/samples/ComputeSharp.Benchmark/Imaging/ImagingBenchmark.cs +++ /dev/null @@ -1,94 +0,0 @@ -using System; -using System.IO; -using System.Reflection; -using BenchmarkDotNet.Attributes; -using BenchmarkDotNet.Configs; -using BenchmarkDotNet.Engines; -using ComputeSharp.BokehBlur.Processors; -using SixLabors.ImageSharp; -using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Processors.Convolution; -using ImageSharpRgba32 = SixLabors.ImageSharp.PixelFormats.Rgba32; - -#pragma warning disable CA1063 - -namespace ComputeSharp.Benchmark.Imaging; - -/// -/// A that benchmarks the image processors against the reference in ImageSharp. -/// -[SimpleJob(RunStrategy.Monitoring)] -[CategoriesColumn] -[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByCategory)] -public class ImagingBenchmark : IDisposable -{ - /// - /// The loaded image. - /// - private Image? image; - - /// - /// Initial setup for a benchmarking session. - /// - [GlobalSetup] - public void Setup() - { - Configuration.Default.PreferContiguousImageBuffers = true; - - string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "Imaging", "city.jpg"); - - this.image = Image.Load(path); - - Bokeh_Cpu(); - Bokeh_Gpu(); - Gaussian_Cpu(); - Gaussian_Gpu(); - } - - /// - [GlobalCleanup] - public void Dispose() - { - this.image!.Dispose(); - } - - /// - /// Runs a bokeh blur effect on the CPU. - /// - [Benchmark(Baseline = true)] - [BenchmarkCategory("BOKEH")] - public void Bokeh_Cpu() - { - this.image!.Mutate(c => c.ApplyProcessor(new BokehBlurProcessor(80, 2, 3))); - } - - /// - /// Runs a bokeh blur effect on the GPU. - /// - [Benchmark] - [BenchmarkCategory("BOKEH")] - public void Bokeh_Gpu() - { - this.image!.Mutate(c => c.ApplyProcessor(new HlslBokehBlurProcessor(80, 2))); - } - - /// - /// Runs a gaussian blur effect on the CPU. - /// - [Benchmark(Baseline = true)] - [BenchmarkCategory("GAUSSIAN")] - public void Gaussian_Cpu() - { - this.image!.Mutate(c => c.ApplyProcessor(new GaussianBlurProcessor(80))); - } - - /// - /// Runs a gaussian blur effect on the GPU. - /// - [Benchmark] - [BenchmarkCategory("GAUSSIAN")] - public void Gaussian_Gpu() - { - this.image!.Mutate(c => c.ApplyProcessor(new HlslGaussianBlurProcessor(80))); - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.Benchmark/Program.cs b/samples/ComputeSharp.Benchmark/Program.cs deleted file mode 100644 index ee6b7824..00000000 --- a/samples/ComputeSharp.Benchmark/Program.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System.Reflection; -using BenchmarkDotNet.Running; - -// ================= -// BenchmarkDotNet -// ================ -// In order to run this benchmark, switch to Release mode and either run select -// it as the startup project for the solution and run it without the debugger -// (CTRL + F5), or compile it and then go to its bin\Release\net8.0 folder, -// open a cmd prompt and run "dotnet ComputeSharp.Benchmark.dll". -BenchmarkSwitcher.FromAssembly(Assembly.GetExecutingAssembly()).Run(args); \ No newline at end of file diff --git a/samples/ComputeSharp.ImageProcessing/ComputeSharp.ImageProcessing.csproj b/samples/ComputeSharp.ImageProcessing/ComputeSharp.ImageProcessing.csproj deleted file mode 100644 index 211fbc4b..00000000 --- a/samples/ComputeSharp.ImageProcessing/ComputeSharp.ImageProcessing.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - Exe - net8.0 - - - - - - - - - - - - - - - - - diff --git a/samples/ComputeSharp.ImageProcessing/Program.cs b/samples/ComputeSharp.ImageProcessing/Program.cs deleted file mode 100644 index 7b764178..00000000 --- a/samples/ComputeSharp.ImageProcessing/Program.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.IO; -using System.Reflection; -using ComputeSharp.BokehBlur.Processors; -using SixLabors.ImageSharp; -using SixLabors.ImageSharp.Processing; -using SixLabors.ImageSharp.Processing.Processors; -using ImageSharpRgba32 = SixLabors.ImageSharp.PixelFormats.Rgba32; - -Configuration.Default.PreferContiguousImageBuffers = true; - -Console.WriteLine(">> Loading image"); - -string path = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location)!, "city.jpg"); -using Image image = Image.Load(path); - -// Apply a series of processors and save the results -foreach ((string Name, IImageProcessor Processor) effect in new (string Name, IImageProcessor Processor)[] -{ - ("bokeh", new HlslBokehBlurProcessor(80, 2)), - ("gaussian", new HlslGaussianBlurProcessor(80)) -}) -{ - Console.WriteLine($">> Applying {effect.Name}"); - - using Image copy = image.Clone(c => c.ApplyProcessor(effect.Processor)); - - Console.WriteLine($">> Saving {effect.Name} to disk"); - - string targetPath = Path.GetDirectoryName(path)!; - - while (Path.GetFileName(targetPath) != "ComputeSharp.ImageProcessing") - { - targetPath = Path.GetDirectoryName(targetPath)!; - } - - targetPath = Path.Combine(targetPath, $"{Path.GetFileNameWithoutExtension(path)}_{effect.Name}{Path.GetExtension(path)}"); - - copy.Save(targetPath); -} \ No newline at end of file diff --git a/samples/ComputeSharp.NativeLibrary.WinRT/ComputeSharp.NativeLibrary.WinRT.csproj b/samples/ComputeSharp.NativeLibrary.WinRT/ComputeSharp.NativeLibrary.WinRT.csproj deleted file mode 100644 index 86efff1b..00000000 --- a/samples/ComputeSharp.NativeLibrary.WinRT/ComputeSharp.NativeLibrary.WinRT.csproj +++ /dev/null @@ -1,56 +0,0 @@ - - - net8.0-windows10.0.22621.0 - x64;ARM64 - win-x64;win-arm64 - - - - true - - - ComputeSharp.NativeLibrary - - - false - true - false - false - false - false - - - $(NoWarn);LNK4104 - - - - - true - true - true - Size - false - false - false - - - - - - - - - - - - - - - diff --git a/samples/ComputeSharp.NativeLibrary.WinRT/HelloWorldEffect.cs b/samples/ComputeSharp.NativeLibrary.WinRT/HelloWorldEffect.cs deleted file mode 100644 index 4c8de82a..00000000 --- a/samples/ComputeSharp.NativeLibrary.WinRT/HelloWorldEffect.cs +++ /dev/null @@ -1,70 +0,0 @@ -using ComputeSharp.D2D1; -using ComputeSharp.D2D1.WinUI; -using Windows.Foundation; - -namespace ComputeSharp.NativeLibrary; - -/// -/// A hello world effect that displays a color gradient. -/// -public sealed partial class HelloWorldEffect : CanvasEffect -{ - /// - /// The node in use. - /// - private static readonly CanvasEffectNode> EffectNode = new(); - - /// - /// Gets or sets the current time since the start of the application. - /// - [GeneratedCanvasEffectProperty] - public partial float Time { get; set; } - - /// - /// Gets or sets the dispatch area for the current output. - /// - [GeneratedCanvasEffectProperty] - public partial Rect DispatchArea { get; set; } - - /// - protected override void BuildEffectGraph(CanvasEffectGraph effectGraph) - { - effectGraph.RegisterOutputNode(EffectNode, new PixelShaderEffect()); - } - - /// - protected override void ConfigureEffectGraph(CanvasEffectGraph effectGraph) - { - effectGraph.GetNode(EffectNode).ConstantBuffer = new Shader( - time: Time, - dispatchSize: new int2( - x: (int)double.Round(DispatchArea.Width), - y: (int)double.Round(DispatchArea.Height))); - } - - /// - /// A hello world effect that displays a color gradient. - /// - /// The current time since the start of the application. - /// The dispatch size for the current output. - [D2DEffectDisplayName(nameof(HelloWorldEffect))] - [D2DEffectDescription("A hello world effect that displays a color gradient.")] - [D2DEffectCategory("Render")] - [D2DEffectAuthor("ComputeSharp.D2D1")] - [D2DInputCount(0)] - [D2DRequiresScenePosition] - [D2DShaderProfile(D2D1ShaderProfile.PixelShader50)] - [D2DGeneratedPixelShaderDescriptor] - internal readonly partial struct Shader(float time, int2 dispatchSize) : ID2D1PixelShader - { - /// - public float4 Execute() - { - int2 xy = (int2)D2D.GetScenePosition().XY; - float2 uv = xy / (float2)dispatchSize; - float3 color = 0.5f + (0.5f * Hlsl.Cos(time + new float3(uv, uv.X) + new float3(0, 2, 4))); - - return new(color, 1f); - } - } -} diff --git a/samples/ComputeSharp.NativeLibrary/ComputeSharp.NativeLibrary.csproj b/samples/ComputeSharp.NativeLibrary/ComputeSharp.NativeLibrary.csproj deleted file mode 100644 index f65a84fe..00000000 --- a/samples/ComputeSharp.NativeLibrary/ComputeSharp.NativeLibrary.csproj +++ /dev/null @@ -1,29 +0,0 @@ - - - net8.0 - - - - - true - true - true - Size - false - - - false - false - - - true - true - - - - - - - - - diff --git a/samples/ComputeSharp.NativeLibrary/NativeLibrary.cs b/samples/ComputeSharp.NativeLibrary/NativeLibrary.cs deleted file mode 100644 index ce1c77a3..00000000 --- a/samples/ComputeSharp.NativeLibrary/NativeLibrary.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Runtime.Versioning; -using ComputeSharp; -using ComputeSharp.D2D1; -using ComputeSharp.D2D1.Interop; - -[assembly: SupportedOSPlatform("windows6.1")] - -/// -/// Native exports for the library. -/// -public static unsafe class Library -{ - /// - /// Registers the effect into a target ID2D1Factory1 instance. - /// - /// - /// - /// The HRESULT for the operation. - [UnmanagedCallersOnly(EntryPoint = nameof(RegisterHelloWorldEffect))] - public static int RegisterHelloWorldEffect(void* d2D1Factory1, Guid* effectId) - { - try - { - D2D1PixelShaderEffect.RegisterForD2D1Factory1(d2D1Factory1, out *effectId); - - return 0; - } - catch (Exception e) - { - return Marshal.GetHRForException(e); - } - } - - /// - /// Sets the constant buffer for the input ID2D1Effect (assumed to be ). - /// - /// - /// - /// The horizontal dispatch size for the current output. - /// The vertical dispatch size for the current output. - /// - [UnmanagedCallersOnly(EntryPoint = nameof(SetHelloWorldEffectConstantBuffer))] - public static int SetHelloWorldEffectConstantBuffer(void* d2D1Effect, float time, int dispatchWidth, int dispatchHeight) - { - try - { - D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(d2D1Effect, new HelloWorld(time, new int2(dispatchWidth, dispatchHeight))); - - return 0; - } - catch (Exception e) - { - return Marshal.GetHRForException(e); - } - } -} - -/// -/// A hello world effect that displays a color gradient. -/// -/// The current time since the start of the application. -/// The dispatch size for the current output. -[D2DEffectDisplayName(nameof(HelloWorld))] -[D2DEffectDescription("A hello world effect that displays a color gradient.")] -[D2DEffectCategory("Render")] -[D2DEffectAuthor("ComputeSharp.D2D1")] -[D2DInputCount(0)] -[D2DRequiresScenePosition] -[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)] -[D2DGeneratedPixelShaderDescriptor] -internal readonly partial struct HelloWorld(float time, int2 dispatchSize) : ID2D1PixelShader -{ - /// - public float4 Execute() - { - int2 xy = (int2)D2D.GetScenePosition().XY; - float2 uv = xy / (float2)dispatchSize; - float3 color = 0.5f + (0.5f * Hlsl.Cos(time + new float3(uv, uv.X) + new float3(0, 2, 4))); - - return new(color, 1f); - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.Sample.FSharp.Shaders/ComputeSharp.Sample.FSharp.Shaders.csproj b/samples/ComputeSharp.Sample.FSharp.Shaders/ComputeSharp.Sample.FSharp.Shaders.csproj deleted file mode 100644 index 65efaf2c..00000000 --- a/samples/ComputeSharp.Sample.FSharp.Shaders/ComputeSharp.Sample.FSharp.Shaders.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - net8.0 - - - - - - - - - diff --git a/samples/ComputeSharp.Sample.FSharp.Shaders/MultiplyByTwo.cs b/samples/ComputeSharp.Sample.FSharp.Shaders/MultiplyByTwo.cs deleted file mode 100644 index 545a2736..00000000 --- a/samples/ComputeSharp.Sample.FSharp.Shaders/MultiplyByTwo.cs +++ /dev/null @@ -1,15 +0,0 @@ -namespace ComputeSharp.Sample.FSharp.Shaders; - -/// -/// A sample shader thaat just multiplies items in a buffer by two. -/// -[ThreadGroupSize(DefaultThreadGroupSizes.X)] -[GeneratedComputeShaderDescriptor] -public readonly partial struct MultiplyByTwo(ReadWriteBuffer buffer) : IComputeShader -{ - /// - public void Execute() - { - buffer[ThreadIds.X] *= 2; - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.Sample.FSharp/ComputeSharp.Sample.FSharp.fsproj b/samples/ComputeSharp.Sample.FSharp/ComputeSharp.Sample.FSharp.fsproj deleted file mode 100644 index 11b6816d..00000000 --- a/samples/ComputeSharp.Sample.FSharp/ComputeSharp.Sample.FSharp.fsproj +++ /dev/null @@ -1,25 +0,0 @@ - - - - Exe - net8.0 - 9.0 - - - - - - - - - - - - - - - - - - - diff --git a/samples/ComputeSharp.Sample.FSharp/Program.fs b/samples/ComputeSharp.Sample.FSharp/Program.fs deleted file mode 100644 index aa376b86..00000000 --- a/samples/ComputeSharp.Sample.FSharp/Program.fs +++ /dev/null @@ -1,51 +0,0 @@ -// Learn more about F# at http://docs.microsoft.com/dotnet/fsharp - -open System -open System.Globalization -open System.Linq -open ComputeSharp -open ComputeSharp.Sample.FSharp.Shaders - -/// Prints a matrix in a properly formatted way. -/// The input array representing the matrix to print. -/// The width of the array to print. -/// The height of the array to print. -/// The name of the matrix to print. -let printMatrix (array : float32[]) width height (name : string) = - let pad = 48 - name.Length - let title = $"%s{new string('=', pad / 2)} %s{name} %s{new string('=', (pad + 1) / 2)}" - let numberWidth = Math.Max(array.Max().ToString(CultureInfo.InvariantCulture).Length, 4) - - printfn "%s" title - - for i in 0 .. height - 1 do - let row = array.[i * width .. (i + 1) * width - 1] - let text = String.Join(",", [for x in row -> x.ToString(CultureInfo.InvariantCulture).PadLeft(numberWidth)]) - - printfn "%s" text - - printfn "%s" (new string('=', 50)) - -[] -let main _ = - - let array = [| for i in 1 .. 100 -> (float32)i |] - - // Create the graphics buffer - use buffer = GraphicsDevice.GetDefault().AllocateReadWriteBuffer(array) - - let shader = new MultiplyByTwo(buffer) - - // Run the shader (passed by reference) - GraphicsDevice.GetDefault().For(100, &shader) - - // Print the initial matrix - printMatrix array 10 10 "BEFORE" - - // Get the data back - buffer.CopyTo array - - // Print the updated matrix - printMatrix array 10 10 "AFTER" - - 0 diff --git a/samples/ComputeSharp.Sample/ComputeSharp.Sample.csproj b/samples/ComputeSharp.Sample/ComputeSharp.Sample.csproj deleted file mode 100644 index 7f09f68a..00000000 --- a/samples/ComputeSharp.Sample/ComputeSharp.Sample.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - Exe - net8.0 - - - - - - - - - diff --git a/samples/ComputeSharp.Sample/Helpers/Formatting.cs b/samples/ComputeSharp.Sample/Helpers/Formatting.cs deleted file mode 100644 index 076512e2..00000000 --- a/samples/ComputeSharp.Sample/Helpers/Formatting.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Globalization; -using System.Linq; - -namespace ComputeSharp.Sample; - -/// -/// Internal helpers for the sample to format values. -/// -internal static class Formatting -{ - /// - /// Prints a matrix in a properly formatted way. - /// - /// The input array representing the matrix to print. - /// The width of the array to print. - /// The height of the array to print. - /// The name of the matrix to print. - public static void PrintMatrix(float[] array, int width, int height, string name) - { - int pad = 48 - name.Length; - string title = $"{new string('=', pad / 2)} {name} {new string('=', (pad + 1) / 2)}"; - - Console.WriteLine(title); - - int numberWidth = Math.Max(array.Max().ToString(CultureInfo.InvariantCulture).Length, 4); - - for (int i = 0; i < height; i++) - { - float[] row = [.. array.AsSpan(i * width, width)]; - string text = string.Join(",", row.Select(x => x.ToString(CultureInfo.InvariantCulture).PadLeft(numberWidth))); - - Console.WriteLine(text); - } - - Console.WriteLine(new string('=', 50)); - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.Sample/Program.cs b/samples/ComputeSharp.Sample/Program.cs deleted file mode 100644 index 9daa34fe..00000000 --- a/samples/ComputeSharp.Sample/Program.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Linq; -using ComputeSharp; -using ComputeSharp.Sample; - -float[] array = [.. Enumerable.Range(1, 100)]; - -// Create the graphics buffer -using ReadWriteBuffer gpuBuffer = GraphicsDevice.GetDefault().AllocateReadWriteBuffer(array); - -// Run the shader -GraphicsDevice.GetDefault().For(100, new MultiplyByTwo(gpuBuffer)); - -// Print the initial matrix -Formatting.PrintMatrix(array, 10, 10, "BEFORE"); - -// Get the data back -gpuBuffer.CopyTo(array); - -// Print the updated matrix -Formatting.PrintMatrix(array, 10, 10, "AFTER"); - -/// -/// The sample kernel that multiples all items by two. -/// -[ThreadGroupSize(DefaultThreadGroupSizes.X)] -[GeneratedComputeShaderDescriptor] -internal readonly partial struct MultiplyByTwo(ReadWriteBuffer buffer) : IComputeShader -{ - /// - public void Execute() - { - buffer[ThreadIds.X] *= 2; - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.Cli/ComputeSharp.SwapChain.Cli.csproj b/samples/ComputeSharp.SwapChain.Cli/ComputeSharp.SwapChain.Cli.csproj deleted file mode 100644 index 5eae7e40..00000000 --- a/samples/ComputeSharp.SwapChain.Cli/ComputeSharp.SwapChain.Cli.csproj +++ /dev/null @@ -1,70 +0,0 @@ - - - - - Exe - WinExe - net8.0 - x64;ARM64 - computesharp.cli - - - ..\..\assets\icon.ico - - - - - true - true - true - false - Size - Speed - true - true - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/ComputeSharp.SwapChain.Cli/Program.cs b/samples/ComputeSharp.SwapChain.Cli/Program.cs deleted file mode 100644 index 23c5da40..00000000 --- a/samples/ComputeSharp.SwapChain.Cli/Program.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System; -using ComputeSharp; -using ComputeSharp.SwapChain.Backend; -using ComputeSharp.SwapChain.Shaders; -using TerraFX.Interop.Windows; - -// Accepted inputs: -// - [] -// - [] -if (args is [] or [_]) -{ - // If there are no args, just run the default shader - if (args is not [string shaderName]) - { - shaderName = nameof(ColorfulInfinity); - } - - // This CLI shader is heavily tuned for the smallest binary size possible when doing NativeAOT publish builds. - // As a result, the code is intentionally not really standard, and pulling all sorts of tricks to minimize the - // final binary size. These are callback functions to draw a shader, which are passed to the shared Win32 runner - // as function pointers. This is done to avoid the additional binary size increase due to delegate instantiations. - // Similarly, there is a single type hosting all rendering code to avoid per-shader reified generic instantiations. - static void _0(IReadWriteNormalizedTexture2D texture, TimeSpan time) => texture.GraphicsDevice.ForEach(texture, new HelloWorld((float)time.TotalSeconds)); - static void _1(IReadWriteNormalizedTexture2D texture, TimeSpan time) => texture.GraphicsDevice.ForEach(texture, new ColorfulInfinity((float)time.TotalSeconds)); - static void _2(IReadWriteNormalizedTexture2D texture, TimeSpan time) => texture.GraphicsDevice.ForEach(texture, new FractalTiling((float)time.TotalSeconds)); - static void _3(IReadWriteNormalizedTexture2D texture, TimeSpan time) => texture.GraphicsDevice.ForEach(texture, new TwoTiledTruchet((float)time.TotalSeconds)); - static void _4(IReadWriteNormalizedTexture2D texture, TimeSpan time) => texture.GraphicsDevice.ForEach(texture, new MengerJourney((float)time.TotalSeconds)); - static void _5(IReadWriteNormalizedTexture2D texture, TimeSpan time) => texture.GraphicsDevice.ForEach(texture, new Octagrams((float)time.TotalSeconds)); - static void _6(IReadWriteNormalizedTexture2D texture, TimeSpan time) => texture.GraphicsDevice.ForEach(texture, new ProteanClouds((float)time.TotalSeconds)); - static void _7(IReadWriteNormalizedTexture2D texture, TimeSpan time) => texture.GraphicsDevice.ForEach(texture, new ExtrudedTruchetPattern((float)time.TotalSeconds)); - static void _8(IReadWriteNormalizedTexture2D texture, TimeSpan time) => texture.GraphicsDevice.ForEach(texture, new PyramidPattern((float)time.TotalSeconds)); - static void _9(IReadWriteNormalizedTexture2D texture, TimeSpan time) => texture.GraphicsDevice.ForEach(texture, new TriangleGridContouring((float)time.TotalSeconds)); - static void _A(IReadWriteNormalizedTexture2D texture, TimeSpan time) => texture.GraphicsDevice.ForEach(texture, new TerracedHills((float)time.TotalSeconds)); - - unsafe - { - // Get the requested shader, if possible - delegate*, TimeSpan, void> shaderCallback = shaderName.ToLowerInvariant() switch - { - "helloworld" => &_0, - "colorfulinfinity" => &_1, - "fractaltiling" => &_2, - "twotiledtruchet" => &_3, - "mengerjourney" => &_4, - "octagrams" => &_5, - "proteanclouds" => &_6, - "extrudedtruchetpattern" => &_7, - "pyramidpattern" => &_8, - "trianglegridcontouring" => &_9, - "terracedhills" => &_A, - _ => null - }; - - // Initialize the application instance and run it - if (shaderCallback is not null) - { - Win32Application? application = new(shaderCallback); - - return Win32ApplicationRunner.Run(application, "ComputeSharp", "ComputeSharp"); - } - } -} - -return E.E_INVALIDARG; \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.D2D1.Cli/Backend/PixelShaderEffect.cs b/samples/ComputeSharp.SwapChain.D2D1.Cli/Backend/PixelShaderEffect.cs deleted file mode 100644 index 73b56c59..00000000 --- a/samples/ComputeSharp.SwapChain.D2D1.Cli/Backend/PixelShaderEffect.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System; -using ComputeSharp.D2D1; -using ComputeSharp.D2D1.Descriptors; -using ComputeSharp.D2D1.WinUI; - -namespace ComputeSharp.SwapChain.D2D1.Backend; - -/// -/// An base effect for an animated pixel shader. -/// -internal abstract partial class PixelShaderEffect : CanvasEffect -{ - /// - /// Gets or sets the total elapsed time. - /// - [GeneratedCanvasEffectProperty] - public partial TimeSpan ElapsedTime { get; set; } - - /// - /// Gets or sets the screen width in raw pixels. - /// - [GeneratedCanvasEffectProperty] - public partial int ScreenWidth { get; set; } - - /// - /// Gets or sets the screen height in raw pixels. - /// - [GeneratedCanvasEffectProperty] - public partial int ScreenHeight { get; set; } - - /// - /// An effect for an animated pixel shader. - /// - /// The type of pixel shader to render. - /// The input factory. - public sealed partial class For(For.Factory factory) : PixelShaderEffect - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - /// - /// The node in use. - /// - private static readonly CanvasEffectNode> Effect = new(); - - /// - protected override void BuildEffectGraph(CanvasEffectGraph effectGraph) - { - effectGraph.RegisterOutputNode(Effect, new PixelShaderEffect()); - } - - /// - protected override void ConfigureEffectGraph(CanvasEffectGraph effectGraph) - { - effectGraph.GetNode(Effect).ConstantBuffer = factory(ElapsedTime, ScreenWidth, ScreenHeight); - } - - /// - /// A factory of a given shader instance. - /// - /// The total elapsed time. - /// The screen width in raw pixels. - /// The screen height in raw pixels. - /// A shader instance to render. - public delegate T Factory(TimeSpan elapsedTime, int screenWidth, int screenHeight); - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.D2D1.Cli/Backend/Win32Application.cs b/samples/ComputeSharp.SwapChain.D2D1.Cli/Backend/Win32Application.cs deleted file mode 100644 index 1ac88d0c..00000000 --- a/samples/ComputeSharp.SwapChain.D2D1.Cli/Backend/Win32Application.cs +++ /dev/null @@ -1,149 +0,0 @@ -using System; -using System.Diagnostics.CodeAnalysis; -using Microsoft.UI.Windowing; - -namespace ComputeSharp.SwapChain.D2D1.Backend; - -using BitmapSize = Windows.Graphics.Imaging.BitmapSize; -using CanvasDevice = Microsoft.Graphics.Canvas.CanvasDevice; -using CanvasDrawingSession = Microsoft.Graphics.Canvas.CanvasDrawingSession; -using CanvasSwapChain = Microsoft.Graphics.Canvas.CanvasSwapChain; -using DirectXPixelFormat = Windows.Graphics.DirectX.DirectXPixelFormat; - -/// -/// A simple Win32 application handling a D2D swapchain. -/// -internal sealed class Win32Application -{ - /// - /// The instance to use. - /// - private CanvasDevice? canvasDevice; - - /// - /// The instance to use to render frames. - /// - private CanvasSwapChain? canvasSwapChain; - - /// - /// Whether or not the window has been resized and requires the buffers to be updated. - /// - private volatile bool isResizePending; - - /// - /// The current screen width in raw pixels. - /// - private uint screenWidth; - - /// - /// The current screen height in raw pixels. - /// - private uint screenHeight; - - /// - /// Raised whenever a draw operation can be performed. - /// - public event EventHandler? Draw; - - /// - /// Initializes the current application. - /// - /// The window to show. - [MemberNotNull(nameof(canvasDevice))] - [MemberNotNull(nameof(canvasSwapChain))] - public unsafe void OnInitialize(AppWindow appWindow) - { - // Create a new canvas device, which will handle DX11/D2D initialization - CanvasDevice canvasDevice = new(); - CanvasSwapChain canvasSwapChain = CanvasSwapChain.CreateForWindowId( - resourceCreator: canvasDevice, - windowId: appWindow.Id, - width: this.screenWidth = 1, - height: this.screenHeight = 1, - dpi: 96.0f); - - // Save the Win2D objects for later use - this.canvasDevice = canvasDevice; - this.canvasSwapChain = canvasSwapChain; - - // Request a resize before the first draw operation - this.isResizePending = true; - } - - /// - /// Resizes the current application. - /// - public void OnResize() - { - this.isResizePending = true; - } - - /// - /// Updates the current application. - /// - /// The current time since the start of the application. - public void OnUpdate(TimeSpan time) - { - if (this.isResizePending) - { - // Resize the swapchain if needed (the size is calculated automatically) - this.canvasSwapChain!.ResizeBuffers( - newWidth: 0, - newHeight: 0, - newDpi: 96.0f, - newFormat: DirectXPixelFormat.Unknown, - bufferCount: 0); - - BitmapSize bitmapSize = this.canvasSwapChain!.SizeInPixels; - - this.screenWidth = bitmapSize.Width; - this.screenHeight = bitmapSize.Height; - - this.isResizePending = false; - } - - // Create the drawing session and invoke all registered draw handler - using (CanvasDrawingSession canvasDrawingSession = this.canvasSwapChain!.CreateDrawingSession(default)) - { - Draw?.Invoke(this, new DrawEventArgs - { - ScreenWidth = this.screenWidth, - ScreenHeight = this.screenHeight, - TotalTime = time, - DrawingSession = canvasDrawingSession - }); - } - - // Wait for v-sync - this.canvasSwapChain.WaitForVerticalBlank(); - - // Present the new frame - this.canvasSwapChain.Present(syncInterval: 1); - } - - /// - /// Arguments for . - /// - public sealed class DrawEventArgs : EventArgs - { - /// - /// Gets the screen width in raw pixels. - /// - public required uint ScreenWidth { get; init; } - - /// - /// Gets the screen height in raw pixels. - /// - public required uint ScreenHeight { get; init; } - - /// - /// Gets the total time for the rendering loop. - /// - public required TimeSpan TotalTime { get; init; } - - /// - /// Gets the instance to use. - /// - public required CanvasDrawingSession DrawingSession { get; init; } - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.D2D1.Cli/Backend/Win32ApplicationRunner.cs b/samples/ComputeSharp.SwapChain.D2D1.Cli/Backend/Win32ApplicationRunner.cs deleted file mode 100644 index c31266e7..00000000 --- a/samples/ComputeSharp.SwapChain.D2D1.Cli/Backend/Win32ApplicationRunner.cs +++ /dev/null @@ -1,96 +0,0 @@ -using System.Diagnostics; -using System.Threading; -using Microsoft.UI; -using Microsoft.UI.Dispatching; -using Microsoft.UI.Windowing; -using Windows.UI; - -namespace ComputeSharp.SwapChain.D2D1.Backend; - -/// -/// A helper class to manage the creation and execution of Win32 applications. -/// -internal static unsafe class Win32ApplicationRunner -{ - /// - /// Runs a specified application and starts the main loop to update its state. This is the entry point for a given application, - /// and it should be called as soon as the process is launched, excluding any other additional initialization needed. - /// - /// The input application instance to run. - /// The title to use for the window being opened. - public static void Run(Win32Application application, string windowTitle) - { - // Create the 'AppWindow' instance (a thin wrapper for an 'HWND') - AppWindow appWindow = AppWindow.Create(); - - appWindow.Title = windowTitle; - appWindow.TitleBar.ExtendsContentIntoTitleBar = true; - - // Transparent colors for the title bar - appWindow.TitleBar.ForegroundColor = Colors.Transparent; - appWindow.TitleBar.BackgroundColor = Colors.Transparent; - appWindow.TitleBar.ButtonBackgroundColor = Colors.Transparent; - appWindow.TitleBar.InactiveBackgroundColor = Colors.Transparent; - appWindow.TitleBar.ButtonInactiveBackgroundColor = Colors.Transparent; - - // Theme aware colors for the title bar - appWindow.TitleBar.ButtonForegroundColor = Colors.White; - appWindow.TitleBar.ButtonHoverForegroundColor = Colors.White; - appWindow.TitleBar.ButtonPressedForegroundColor = Colors.White; - appWindow.TitleBar.ButtonHoverBackgroundColor = Color.FromArgb(0x20, 0xFF, 0xFF, 0xFF); - appWindow.TitleBar.ButtonPressedBackgroundColor = Color.FromArgb(0x40, 0xFF, 0xFF, 0xFF); - appWindow.TitleBar.ButtonInactiveForegroundColor = Color.FromArgb(0xC0, 0xFF, 0xFF, 0xFF); - appWindow.TitleBar.InactiveForegroundColor = Color.FromArgb(0xA0, 0xA0, 0xA0, 0xA0); - - // Initialize the application - application.OnInitialize(appWindow); - - // Setup the render thread that enables smooth resizing of the window - Thread renderThread = new(static args => - { - (Win32Application application, CancellationToken token) = ((Win32Application, CancellationToken))args!; - - Stopwatch stopwatch = Stopwatch.StartNew(); - - while (!token.IsCancellationRequested) - { - application.OnUpdate(stopwatch.Elapsed); - } - }); - - CancellationTokenSource tokenSource = new(); - - // Start the render thread before activating the window. - // This allows the app to show up while already drawing. - renderThread.Start((application, tokenSource.Token)); - - // Register a callback to monitor resize operations - appWindow.Changed += (s, e) => - { - if (e.DidSizeChange) - { - application.OnResize(); - } - }; - - DispatcherQueueController dispatcherQueueController = DispatcherQueueController.CreateOnCurrentThread(); - - // Bind the window to a 'DispatcherQueue' instance, so it can flow the exit message - appWindow.AssociateWithDispatcherQueue(dispatcherQueueController.DispatcherQueue); - - // Enqueue the exit message when the window is closed. This ensures that - // the process actually terminates after closing the window, as expected. - appWindow.Closing += static (s, e) => s.DispatcherQueue.EnqueueEventLoopExit(); - - // Display the window - appWindow.Show(activateWindow: true); - - // Process any messages in the queue - dispatcherQueueController.DispatcherQueue.RunEventLoop(DispatcherRunOptions.QuitOnlyLocalLoop, deferral: null); - - tokenSource.Cancel(); - - // Wait for the render thread to stop before terminating - renderThread.Join(); - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.D2D1.Cli/ComputeSharp.SwapChain.D2D1.Cli.csproj b/samples/ComputeSharp.SwapChain.D2D1.Cli/ComputeSharp.SwapChain.D2D1.Cli.csproj deleted file mode 100644 index a50d58cc..00000000 --- a/samples/ComputeSharp.SwapChain.D2D1.Cli/ComputeSharp.SwapChain.D2D1.Cli.csproj +++ /dev/null @@ -1,82 +0,0 @@ - - - Exe - WinExe - net8.0-windows10.0.22621 - app.manifest - x64;ARM64 - win-x64;win-arm64 - computesharp.d2d1.cli - ..\..\assets\icon.ico - - - true - None - - - - - - full - - - $(NoWarn);IDE0065 - - - - - false - true - false - false - false - - - - - true - true - true - true - - - true - - - - - true - true - true - false - Speed - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/ComputeSharp.SwapChain.D2D1.Cli/Program.cs b/samples/ComputeSharp.SwapChain.D2D1.Cli/Program.cs deleted file mode 100644 index 629eea49..00000000 --- a/samples/ComputeSharp.SwapChain.D2D1.Cli/Program.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; -using ComputeSharp.SwapChain.D2D1.Backend; -using ComputeSharp.SwapChain.Shaders.D2D1; -using TerraFX.Interop.Windows; - -// Accepted inputs: -// - [] -// - [] -if (args is [] or [_]) -{ - // If there are no args, just run the default shader - if (args is not [string shaderName]) - { - shaderName = nameof(ColorfulInfinity); - } - - // Get the requested shader, if possible - PixelShaderEffect? effect = shaderName.ToLowerInvariant() switch - { - "helloworld" => new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))), - "colorfulinfinity" => new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))), - "fractaltiling" => new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))), - "twotiledtruchet" => new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))), - "mengerjourney" => new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))), - "octagrams" => new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))), - "proteanclouds" => new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))), - "pyramidpattern" => new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))), - "trianglegridcontouring" => new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))), - "terracedhills" => new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))), - _ => null - }; - - // If a shader is found, run it - if (effect is not null) - { - Win32Application application = new(); - - application.Draw += (_, e) => - { - // Set the effect properties - effect.ElapsedTime = e.TotalTime; - effect.ScreenWidth = (int)e.ScreenWidth; - effect.ScreenHeight = (int)e.ScreenHeight; - - // Draw the effect - e.DrawingSession.DrawImage(effect); - }; - - Win32ApplicationRunner.Run(application, "ComputeSharp.D2D1"); - - return S.S_OK; - } - - // If no shader matches, check if help was requested - if (shaderName is "-h") - { - Console.WriteLine($""" - Available shaders: - - - {nameof(HelloWorld)} - - {nameof(ColorfulInfinity)} - - {nameof(FractalTiling)} - - {nameof(TwoTiledTruchet)} - - {nameof(MengerJourney)} - - {nameof(Octagrams)} - - {nameof(ProteanClouds)} - - {nameof(PyramidPattern)} - - {nameof(TriangleGridContouring)} - - {nameof(TerracedHills)} - """); - - return S.S_OK; - } -} - -return E.E_INVALIDARG; \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.D2D1.Cli/app.manifest b/samples/ComputeSharp.SwapChain.D2D1.Cli/app.manifest deleted file mode 100644 index 526a6e63..00000000 --- a/samples/ComputeSharp.SwapChain.D2D1.Cli/app.manifest +++ /dev/null @@ -1,9 +0,0 @@ - - - - - true - PerMonitorV2 - - - diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/App.cs b/samples/ComputeSharp.SwapChain.D2D1.Uwp/App.cs deleted file mode 100644 index 1b3ffd11..00000000 --- a/samples/ComputeSharp.SwapChain.D2D1.Uwp/App.cs +++ /dev/null @@ -1,120 +0,0 @@ -using System.Diagnostics.CodeAnalysis; -using ComputeSharp.SwapChain.D2D1.Backend; -using ComputeSharp.SwapChain.D2D1.Extensions; -using ComputeSharp.SwapChain.Shaders.D2D1; -using Windows.ApplicationModel.Core; -using Windows.UI.Core; -using Windows.UI.ViewManagement; - -namespace ComputeSharp.SwapChain.D2D1; - -/// -/// A sample app rendering D2D shaders into a instance. -/// -public sealed partial class App : IFrameworkViewSource, IFrameworkView -{ - /// - /// The collection of available pixel shader effects. - /// - private static readonly PixelShaderEffect[] Effects = - [ - new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))), - new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))), - new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))), - new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))), - new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))), - new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))), - new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))), - new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))), - new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height))) - ]; - - /// - /// The for the current app instance. - /// - private CoreApplicationView? applicationView; - - /// - /// The used to display the app content. - /// - private CoreWindow? window; - - /// - /// The currently selected effect (one of the items in ). - /// - private PixelShaderEffect selectedEffect = Effects[0]; - - /// - /// The entry point for the application. - /// - public static void Main() - { - CoreApplication.Run(new App()); - } - - /// - public IFrameworkView CreateView() - { - return this; - } - - /// - [MemberNotNull(nameof(applicationView))] - public void Initialize(CoreApplicationView applicationView) - { - this.applicationView = applicationView; - } - - /// - [MemberNotNull(nameof(window))] - public void SetWindow(CoreWindow window) - { - this.window = window; - } - - /// - public void Load(string entryPoint) - { - } - - /// - public void Run() - { - this.applicationView!.TitleBar.ExtendViewIntoTitleBar = true; - - ApplicationView.GetForCurrentView().TitleBar.StyleTitleBarForExtendedIntoViewMode(); - - // Switch the shader to use when pressing the number keys - this.window!.CharacterReceived += (s, e) => - { - if (e.KeyCode is >= '1' and <= '9') - { - this.selectedEffect = Effects[(int)(e.KeyCode - '1')]; - - e.Handled = true; - } - }; - - CoreWindowApplication application = new(); - - application.Draw += (s, e) => - { - PixelShaderEffect effect = this.selectedEffect; - - // Set the effect properties - effect.ElapsedTime = e.TotalTime; - effect.ScreenWidth = (int)e.ScreenWidth; - effect.ScreenHeight = (int)e.ScreenHeight; - - // Draw the effect - e.DrawingSession.DrawImage(effect); - }; - - CoreWindowApplicationRunner.Run(application, this.window); - } - - /// - public void Uninitialize() - { - } -} diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/LockScreenLogo.scale-200.png b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/LockScreenLogo.scale-200.png deleted file mode 100644 index 7440f0d4bf7c7e26e4e36328738c68e624ee851e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 432 zcmeAS@N?(olHy`uVBq!ia0vp^1|ZDA1|-9oezr3(FqV6|IEGZ*x-#9g>~Mkr+x6^F zy~CDX2QIMs&Gcs3RnRBoxBA!*(Mfw0KTCYuYk0WlEIV>qBmPl! zq4ukrvfADX@#p8fbLY(H47N+k`FZ(FZh?cDro7>{8mkBO3>^oaIx`3!Jl)Qq)HI!+ z(S=1{o~eT)&W^=Ea8C`-17(Jv5(nHFJ{dOjGdxLVkY_y6&S1whfuFI4MM0kF0f&cO zPDVpV%nz;Id$>+0Ga5e9625-JcI)oq=#Pa3p^>8BB}21BUw@eN!-6@w%X+^`+Vn?! zryu|3T>kVWNBYyBc=7Y6H#s1Ah!OI_nezW zXTqOdkv2Az6KKBV=$yHdF^R3Fqw(TZEoNSZX>reXJ#bwX42%f|Pgg&ebxsLQ010xn AssI20 diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/SplashScreen.scale-200.png b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/SplashScreen.scale-200.png deleted file mode 100644 index 1df2cb624fb4a39fb64691083bf756821241572b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8537 zcmeHMiC0rsx4%$@qC$!kr3Qi%IDryW~YKvL{Yj=q)BFYCJz*?5V4lkK&z4*q~~Sl)$*h$j>eT3e*O zQ>3ZmZ=Sx+OM)@e(@uSn9uirSi*&qdF|)akqSjU+{1rjS?B4C(dPWKK)uvTv{`WE$ zc^>@Fkc-VtwWRs&TR803G6=J4k)p*^lk5%YVC;*HQvn< zE2N+EIT;~8U|CZqT0CPsSNCDjc*+tk#+(U!mb~F{Al>h`w*+&yI3)_DmNR$3b5yH)aEV1 z1T5p078F7h)Ct&N$9eVOGIyJZg{+&^G?f7zt@ZsT3SuIF6TUK%I+P%Zx(ly(tWe^IW_cE zAm2fy*M`AL`jV6jjX@0d9p(>uUnQ#QX%J4>yVzPsr`T(mkSiyT?Uf;Qpkk&3K+&a| z+2ES_m&d+*sGh{6w_3ay7O<=9-}zp}a@%1L5YyHJ@>&hMw42h0AJsp8l#{~ZTW+?V+)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ZZhQ zfFoBS$lgwSDUEd^G~_Z+js!v8uscTg4$kJY2|zpf7&QJ&a;y?2P38F3EAU_y)1P8W=jnLTwn__f!pP{CaGhiLyV z^^CT515ip;fG;6V7W6OljAQOS==upn$khm1|KdY*A+RZcvKzR(1(dQ*+98P-wkE_f z{SriB8)RzLM21+h+t{VU22)O0;3mPP2-==LQFKW+?T$tL3HHn@A5dPn^3V*sVRBUU)2=vwLnYJ<48$2zb5{XzdEH_9?Jm9IgB*7LC9h zn3I2dY&6R(MlCtA^KHX<5bj>sz8p_2bxw{=$Sg703?j(`;GRnI$sW#%0z(E^BT-GD zN>|gQYK6(M8~g!i<$#H#OP~O|X&Yi+n5cml;ov&R%}pE3B&Tsed-#C2CVO%0nR~0} zTsQ6uz&9DN`tnqEH_Aa1fBP+fP3Y&7gXNvk{t@rdoKgh5;rg^)PJKH35GXPN(dk#! zf?OWY{d3`iK44paArw>qPNpTMP{X1jGddM!3?CZcgl7601p`44xlUUF2uo}6g7BU# z-9%nemU`8!9XS1#V6EcG<-zV=+JB3n0dTG#40B7H9csExqeT#Y&j<{8h9L&79XJUf zDE)Reqyx4Vb3ZAw))4jsDLZZHqsiv@ZsE^1pa+gSRGE9iop|u?T>my2>>^(j0%xvJ1RyJAf}{6Ryz-NgQJG*PCp3C;vu;8VBO3+2n!44TqtM?1kW92 zrHB7C+Apsm0NkRME_Q=(3ecaxn=sVJn{{s}7b$0*& diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/Square150x150Logo.scale-200.png b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/Square150x150Logo.scale-200.png deleted file mode 100644 index 84faf5ffbb50e0625c3147ef67806471572af2f1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3760 zcmds4`8!+d7T)HX>KvtNIEJXH99ki&Xga8QDn-nxN~od6su)VOrBR}a7^{PhrX+?? zF{O&e*iussRfHnuAtlI-bMJp}?sM;b?ho(tJ$rp?uf5;3-?i5M&^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DV;s)D&{Zzlozj4mO)ZyQbaNrZ{UL4fGuvxJ^6j;4RO3 z_o2J+Mb`5XOzh{|>2iH)O=6sWxPz={sOsL&fU`Bo!We{Db02S~e|@xjybkZM1w^zP z1eQYGxUF_07+CYJ_AzSCRk7cd5x*28ZiEt|$Q0V{a1IY=#<*uA*mNrxl+{)yu)rrZ VZ|5IS#5#fkrkAV?%Pzp<{{g+2zOeuR diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/Square44x44Logo.scale-200.png b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/Square44x44Logo.scale-200.png deleted file mode 100644 index f02661b2f4cabfe8fbf2580a4724f40155ed4b94..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1723 zcmZWqX*e5*7L5oJs&*=|rlv+|hN@*mi8a)cDQU+#6b-3_SgIOpN@AO7(|%f1o0-;< z>a^Bcqo^|4($O%8grumY(Ns{>Qbyl<-~5>OHQve)AYnXKuB)>2>^ilH(yJ_-N!%-07w(vogJ{rcSLswV_`0;eVx%Y zW1XcvPlOT&KXJ9_K5MGw>T1@CAV*TBQ|x0!pAnT)Ti+Rw^0Pr3IxQps)}V)i1wyL8 zY$uFEuB6sOAEY;-CgTxt?zIh`P;=?SfSodO^|}^v{ljO`*i6X=zr&Nz-rV|&U#bLA zfd~{e0!DmEq0D zIT>$vV>2XLZ50c)F-gejQEirj7p2tCzb*5cAYe#1SH9x@d-k>Wsyf=QV+8<_gW0+LijnmESbfnaQ)H`Dfm@Z z4yR>Xg^tPT9A^|XE`ArjCi3`Vi50f&Oi7>WJ=rKvwbet+J(;)2vL}u~;bTOG6+$1k7&7SO}j{lY%EYtA9?BAE4 zK|k-TPrF#R_o~U5A=nY3TN-Ixnx}HJAkD?(R{n+!&;&Tv^K!Cv+g$tvXswS>4#uV; za$sYKgOF5A?)Ljgdq6@y^*q=LsTNJP%Zg`dAn234xH z(=qql9J0G*Dv})RqHcNL>N#1~@ro|5=*l%M5{)Y|NX#VPSs57P-2WS-R*j*$A%ufT zHz}^{t1^`q=SM2R@WNb62Q|hJEnbZ??kf!~+h1LsV&1(R(%EsK=xB_qD%H&q zo=&$aLg-yuyr^{4*prZa9II2WKO6d`?2>Z}U+nP%nv0qu`!vmGx`fK6$VB%ZnSC|A zx{?$D>&a=_diHyOr8A`@>wngz)c^t;K9{VtBEIAmAMGEhpblxCve>nk;#^3Utv&p0 zdS%3>^lZX>{Z#CcpgN1GV+RmXeLk7mfDnl$+;T$2C~DbV^U&$ycvKaf7tc|YN|oZ= z?j4M48<=@;jcK{8RFv&0v2N7$uY?e*g+{B}H}kX~PM_V-=e}q{*FRe+=sM%VhyItE zKklyj=j*D&-y;z`8n0H@bxB5Lw4pEJxnoS5Eav{cu7J8yk+IKkP5va6VO6QA)!T=3q3gQu(X%W8D@l9Dz?UCD;Oer#8;-pb$qMgVsgZ|7>q H&?|ofVWB5h diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/Square44x44Logo.targetsize-24_altform-unplated.png deleted file mode 100644 index 3e58e5b69c586ea4dc65a98937d11e6a5ed4d83e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 796 zcmV+%1LOROP)m|9I&p(x5G zaBxbphz>-lIc{~RmY{55D0LabS9+jpDrcnT!L(g4RRLqFaC2w@$MwjE$xV6O$HD5S z4dm9o17~9-5fkG90uwh z65^d5$UnV z(BjtiE=raD?!Jj4^$%^~vu(iowS$rp$UsGv61l-M@S%rxZqP4}fFnkSm*|RBZQ;`u zhe0~W>9-l`2o5Y+a9kEY(&H)7{NS?qVOsUsS4Y6Jg(H()N13FE&~DS?19<JAZR!02&_sKKA9S>O2jdCtrs2XQDF}cT#`Q16C_cYB#MZ>OT=_q-zrqG7Cj z_>9u_Ptr4Vcw5s|Y>Ogdj0rc#am0b@npWepy8czHaRh;m+{Zj}D;x5{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CVW1`0i(uZ@*OFfpnO@QN%-A_iK<+-Lp!vTG3K_p7)Z zSOOU{Xuqit&_pId#-(Iue`(qZQ%teOxuE| zO(>*7&6@)lk)2Yd2PqyhWh2(Rdcpr7k}Pp?z+w>rK?C zVIGjfuvSPI_clbdjFLaXw;T{&^PagQb|)Vb2gST*(k6J}I-6-g_sH#@O6jheXuvq> ziIH?FRqpU9YD+FK0(g;u39He0Ok}Lz!TWTp;f|W1(sO9{{R30 diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/Wide310x150Logo.scale-200.png b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Assets/Wide310x150Logo.scale-200.png deleted file mode 100644 index d800c4a0e04442dc27233e5cc36973bae2be3bcd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4291 zcmds5`8!*A+dqn+8cL_?m0G&czAe=%u@yDiQB}cI6tR^WN)pi`N{I5#plazDOD$3D zRE7vqTP+D0G__M(ED2@oq}3v|M4prR8=kqY=XrlP*E!cY-}^rI{kcE){r#Mi--~bu`#I&U$;GG!FPeb5I26w~tApj_8iViWGA5VV3a>-5cz zBFbMEpJ_?r7cYhy`ZN!3Tmi6U9&}{tJ9;sh*`dV_a0xoR`znVEd{NOi6GOn65FkC@ zTO7E7posye&#(dD*CQYh9Wrnr_Adz-aP>hP6womKf4Iz>q-AFhq&iZTWLgSrY0N87 zYlYp?lp`-VsV+-MqD=|uQ-+|}UmSm&3Hj=vLVZ%>wbOBCc1@mOHCXkyes>|8p<*Ej zDtzK%;X$v`?mK{037%`8*44o|#X;x&h>B_SO-97V1P>FbbrHX^X4&?0#r2Io>(DzV zBgsG2J!pRT+4;6JS8E0;XGLQk$9#h3kq#VB?h-g&YdkVIT>TN-=6&Yn=7Xa_^mCIV zatE+sTYc0lEAnRuSewA1T*$uv>1e{ngNP(WSmRp@ggN|(hmwoCQYO>|b-{NRHwbc)378lAGAwFO@x%joB z!8e5%nwcpfvfd1ZY250+@0#+JDTz>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9DAn)az0bS~ir7co_2yGY^ghW`0 zPtzn|-Cg(el51YiB{IW@gW{mEtqSOi_Hzyau6`?CwJngAA{lrN`Az4DM^yu)<(V`* zhoXo+UuE@b_8Crm+5xn`?Rq!pj&9ZKbK~z&AK#t@62REFouzJLtXjNHg&6KEsG8R@ zqtU(Xkd}|2eVrnDZb)q~8f~@91|nKP4<5$qsLdZ&%71vegQV5pItm0o^^TwYfJ$c5 z*&Et`%hfn&YHO(aL}_x1xX4|qReky5kGd~!bAE_2j|Ey_C)v|)e;clO(+QspicsRNX4NPi*EBqqOYq_iW=vLJQU-9W$8MqN* zt`#z;hm6O_f=j?pC>AF2`MDZM%i0k%F29_^g8xr~9~{6YfYCW^Rb~b~$qE2L`T%Lc zD4=nZH-FFkTDgXC1!ZNeG~5X5mr3!XV)hYE2+VLAu~q{0HJB*Y}^7|fH-KbLoaJ&sR#S& zaWoj;uio*+p>kW5Q2r_yJ}4{nOY*tC3*Qe`{rz2M_nhZ@KD*=%ST(8)JfIWA?~5o| zPGXk427m*HS+0}0rW*KYZ3n8Q+hDK5Ddp= zE?#Ob_oXee8d_VB291S@Oh%aIwflY|ywbsV?0jm|dX`lH!xQWmA%5x;53V($II1#+ zfTtDBa6(n67j-?*!1`Uq>B#QVcbG7rSSU6ZYm5+5ys%w8h)9%z4w!>Uyo zs0EXz$iUyfbhiy{NTVLRH2zgg0`NS+*2s9%FoH@^=9$o?fQrNDbUS11gTN?wVFT8J z!*ce_{hJ^E=N<3fDJ9>jR{NUEyz9t>fODTPzBaaG1~FA)138LleX6199_#!~8WnwQ z)jgjhm5Ve#RBgdCFoPoCpMKM)4DUp)ra>;L8JJ~U*+LETUz?&l&QBeqp!;by+s(;# feQ_CULb1!RBQVC3Bcw$;#&Fl-f{l|=(d;C diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Backend/CoreWindowApplication.cs b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Backend/CoreWindowApplication.cs deleted file mode 100644 index 4640c165..00000000 --- a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Backend/CoreWindowApplication.cs +++ /dev/null @@ -1,142 +0,0 @@ -using System; -using System.Diagnostics.CodeAnalysis; -using Microsoft.Graphics.Canvas; -using Windows.Graphics.Display; -using Windows.Graphics.Imaging; -using Windows.UI.Core; - -namespace ComputeSharp.SwapChain.D2D1.Backend; - -/// -/// A simple application handling a D2D swapchain. -/// -internal sealed class CoreWindowApplication -{ - /// - /// The instance to use. - /// - private CanvasDevice? canvasDevice; - - /// - /// The instance to use to render frames. - /// - private CanvasSwapChain? canvasSwapChain; - - /// - /// Whether or not the window has been resized and requires the buffers to be updated. - /// - private volatile bool isResizePending; - - /// - /// The current screen width in raw pixels. - /// - private uint screenWidth; - - /// - /// The current screen height in raw pixels. - /// - private uint screenHeight; - - /// - /// Raised whenever a draw operation can be performed. - /// - public event EventHandler? Draw; - - /// - /// Initializes the current application. - /// - /// The instance. - [MemberNotNull(nameof(canvasDevice))] - [MemberNotNull(nameof(canvasSwapChain))] - public unsafe void OnInitialize(CoreWindow window) - { - // Create a new canvas device, which will handle DX11/D2D initialization - CanvasDevice canvasDevice = new(); - - // Create the swapchain for rendering (it is automatically tied to the window) - CanvasSwapChain canvasSwapChain = CanvasSwapChain.CreateForCoreWindow( - resourceCreator: canvasDevice, - coreWindow: window, - dpi: DisplayInformation.GetForCurrentView().LogicalDpi); - - // Save the Win2D objects for later use - this.canvasDevice = canvasDevice; - this.canvasSwapChain = canvasSwapChain; - - // Store the initial size of the screen - this.screenWidth = canvasSwapChain.SizeInPixels.Width; - this.screenHeight = canvasSwapChain.SizeInPixels.Height; - } - - /// - /// Resizes the current application. - /// - public void OnResize() - { - this.isResizePending = true; - } - - /// - /// Updates the current application. - /// - /// The current time since the start of the application. - public void OnUpdate(TimeSpan time) - { - if (this.isResizePending) - { - // Resize the swapchain if needed (the size is calculated automatically) - this.canvasSwapChain!.ResizeBuffers(0, 0); - - BitmapSize bitmapSize = this.canvasSwapChain!.SizeInPixels; - - this.screenWidth = bitmapSize.Width; - this.screenHeight = bitmapSize.Height; - - this.isResizePending = false; - } - - // Create the drawing session and invoke all registered draw handler - using (CanvasDrawingSession canvasDrawingSession = this.canvasSwapChain!.CreateDrawingSession(default)) - { - Draw?.Invoke(this, new DrawEventArgs - { - ScreenWidth = this.screenWidth, - ScreenHeight = this.screenHeight, - TotalTime = time, - DrawingSession = canvasDrawingSession - }); - } - - // Wait for v-sync - this.canvasSwapChain.WaitForVerticalBlank(); - - // Present the new frame - this.canvasSwapChain.Present(syncInterval: 1); - } - - /// - /// Arguments for . - /// - public sealed class DrawEventArgs : EventArgs - { - /// - /// Gets the screen width in raw pixels. - /// - public required uint ScreenWidth { get; init; } - - /// - /// Gets the screen height in raw pixels. - /// - public required uint ScreenHeight { get; init; } - - /// - /// Gets the total time for the rendering loop. - /// - public required TimeSpan TotalTime { get; init; } - - /// - /// Gets the instance to use. - /// - public required CanvasDrawingSession DrawingSession { get; init; } - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Backend/CoreWindowApplicationRunner.cs b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Backend/CoreWindowApplicationRunner.cs deleted file mode 100644 index 4d1a868d..00000000 --- a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Backend/CoreWindowApplicationRunner.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System.Diagnostics; -using System.Threading; -using Windows.UI.Core; - -namespace ComputeSharp.SwapChain.D2D1.Backend; - -/// -/// A helper class to manage the creation and execution of applications. -/// -internal static class CoreWindowApplicationRunner -{ - /// - /// Runs a specified application and starts the main loop to update its state. This is the entry point for a given application, - /// and it should be called as soon as the process is launched, excluding any other additional initialization needed. - /// - /// The input application instance to run. - /// The instance. - public static void Run(CoreWindowApplication application, CoreWindow window) - { - // Initialize the application - application.OnInitialize(window); - - // Setup the render thread that enables smooth resizing of the window - Thread renderThread = new(static args => - { - (CoreWindowApplication application, CancellationToken token) = ((CoreWindowApplication, CancellationToken))args!; - - Stopwatch stopwatch = Stopwatch.StartNew(); - - while (!token.IsCancellationRequested) - { - application.OnUpdate(stopwatch.Elapsed); - } - }); - - CancellationTokenSource tokenSource = new(); - - // Start the render thread before activating the window. - // This allows the app to show up while already drawing. - renderThread.Start((application, tokenSource.Token)); - - // Register a callback to monitor resize operations - window.ResizeCompleted += (s, e) => application.OnResize(); - - // Activate the window - window.Activate(); - - // Process any messages in the queue - window.Dispatcher.ProcessEvents(CoreProcessEventsOption.ProcessUntilQuit); - - tokenSource.Cancel(); - - // Wait for the render thread to stop before terminating - renderThread.Join(); - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Backend/PixelShaderEffect.cs b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Backend/PixelShaderEffect.cs deleted file mode 100644 index 904dbe4b..00000000 --- a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Backend/PixelShaderEffect.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System; -using ComputeSharp.D2D1; -using ComputeSharp.D2D1.Descriptors; -using ComputeSharp.D2D1.Uwp; - -namespace ComputeSharp.SwapChain.D2D1.Backend; - -/// -/// An base effect for an animated pixel shader. -/// -internal abstract partial class PixelShaderEffect : CanvasEffect -{ - /// - /// Gets or sets the total elapsed time. - /// - [GeneratedCanvasEffectProperty] - public partial TimeSpan ElapsedTime { get; set; } - - /// - /// Gets or sets the screen width in raw pixels. - /// - [GeneratedCanvasEffectProperty] - public partial int ScreenWidth { get; set; } - - /// - /// Gets or sets the screen height in raw pixels. - /// - [GeneratedCanvasEffectProperty] - public partial int ScreenHeight { get; set; } - - /// - /// An effect for an animated pixel shader. - /// - /// The type of pixel shader to render. - /// The input factory. - public sealed partial class For(For.Factory factory) : PixelShaderEffect - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - /// - /// The node in use. - /// - private static readonly CanvasEffectNode> Effect = new(); - - /// - protected override void BuildEffectGraph(CanvasEffectGraph effectGraph) - { - effectGraph.RegisterOutputNode(Effect, new PixelShaderEffect()); - } - - /// - protected override void ConfigureEffectGraph(CanvasEffectGraph effectGraph) - { - effectGraph.GetNode(Effect).ConstantBuffer = factory(ElapsedTime, ScreenWidth, ScreenHeight); - } - - /// - /// A factory of a given shader instance. - /// - /// The total elapsed time. - /// The screen width in raw pixels. - /// The screen height in raw pixels. - /// A shader instance to render. - public delegate T Factory(TimeSpan elapsedTime, int screenWidth, int screenHeight); - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/ComputeSharp.SwapChain.D2D1.Uwp.csproj b/samples/ComputeSharp.SwapChain.D2D1.Uwp/ComputeSharp.SwapChain.D2D1.Uwp.csproj deleted file mode 100644 index d3e34c58..00000000 --- a/samples/ComputeSharp.SwapChain.D2D1.Uwp/ComputeSharp.SwapChain.D2D1.Uwp.csproj +++ /dev/null @@ -1,54 +0,0 @@ - - - WinExe - net8.0-windows10.0.22621.0 - 10.0.17763.0 - true - x64;ARM64 - win-x64;win-arm64 - en-US - win-$(Platform).pubxml - true - false - - - 1.3.20250314.1 - - - - - true - true - true - false - Speed - false - true - false - false - false - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Extensions/ApplicationViewTitleBarExtensions.cs b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Extensions/ApplicationViewTitleBarExtensions.cs deleted file mode 100644 index 5e8325b1..00000000 --- a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Extensions/ApplicationViewTitleBarExtensions.cs +++ /dev/null @@ -1,33 +0,0 @@ -using Windows.UI; -using Windows.UI.ViewManagement; - -namespace ComputeSharp.SwapChain.D2D1.Extensions; - -/// -/// Extensions for . -/// -internal static class ApplicationViewTitleBarExtensions -{ - /// - /// Styles the title bar to look correctly when the view is expanded into it. - /// - /// The input title bar. - public static void StyleTitleBarForExtendedIntoViewMode(this ApplicationViewTitleBar titleBar) - { - // Transparent colors - titleBar.ForegroundColor = Colors.Transparent; - titleBar.BackgroundColor = Colors.Transparent; - titleBar.ButtonBackgroundColor = Colors.Transparent; - titleBar.InactiveBackgroundColor = Colors.Transparent; - titleBar.ButtonInactiveBackgroundColor = Colors.Transparent; - - // Theme aware colors - titleBar.ButtonForegroundColor = Colors.White; - titleBar.ButtonHoverForegroundColor = Colors.White; - titleBar.ButtonPressedForegroundColor = Colors.White; - titleBar.ButtonHoverBackgroundColor = Color.FromArgb(0x20, 0xFF, 0xFF, 0xFF); - titleBar.ButtonPressedBackgroundColor = Color.FromArgb(0x40, 0xFF, 0xFF, 0xFF); - titleBar.ButtonInactiveForegroundColor = Color.FromArgb(0xC0, 0xFF, 0xFF, 0xFF); - titleBar.InactiveForegroundColor = Color.FromArgb(0xA0, 0xA0, 0xA0, 0xA0); - } -} diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Package.appxmanifest b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Package.appxmanifest deleted file mode 100644 index 71dd299a..00000000 --- a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Package.appxmanifest +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - ComputeSharp Sample App (Core) - Sergio Pedri - Assets\StoreLogo.png - - - - - - - - - - - - - - - - - - - diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Properties/PublishProfiles/win-arm64.pubxml b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Properties/PublishProfiles/win-arm64.pubxml deleted file mode 100644 index 5de0b991..00000000 --- a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Properties/PublishProfiles/win-arm64.pubxml +++ /dev/null @@ -1,11 +0,0 @@ - - - - FileSystem - ARM64 - win-arm64 - bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ - true - true - - \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Properties/PublishProfiles/win-x64.pubxml b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Properties/PublishProfiles/win-x64.pubxml deleted file mode 100644 index 89844a87..00000000 --- a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Properties/PublishProfiles/win-x64.pubxml +++ /dev/null @@ -1,11 +0,0 @@ - - - - FileSystem - x64 - win-x64 - bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ - true - true - - \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Properties/launchSettings.json b/samples/ComputeSharp.SwapChain.D2D1.Uwp/Properties/launchSettings.json deleted file mode 100644 index 2dcd9bf6..00000000 --- a/samples/ComputeSharp.SwapChain.D2D1.Uwp/Properties/launchSettings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "profiles": { - "ComputeSharp.SwapChain.D2D1.Uwp": { - "commandName": "MsixPackage" - } - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.Shaders.D2D1/ColorfulInfinity.cs b/samples/ComputeSharp.SwapChain.Shaders.D2D1/ColorfulInfinity.cs deleted file mode 100644 index f47a7c8a..00000000 --- a/samples/ComputeSharp.SwapChain.Shaders.D2D1/ColorfulInfinity.cs +++ /dev/null @@ -1,71 +0,0 @@ -using ComputeSharp.D2D1; - -namespace ComputeSharp.SwapChain.Shaders.D2D1; - -/// -/// A shader creating an abstract and colorful animation. -/// Ported from . -/// Created by Benoit Marini. -/// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. -/// -/// The current time since the start of the application. -/// The dispatch size for the current output. -[D2DInputCount(0)] -[D2DRequiresScenePosition] -[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)] -[D2DGeneratedPixelShaderDescriptor] -internal readonly partial struct ColorfulInfinity(float time, int2 dispatchSize) : ID2D1PixelShader -{ - /// - /// The total number of layers for the final animation. - /// - private const float NumberOfLayers = 16.0f; - - /// - /// The number of iterations to calculate a texel value. - /// - private const int NumberOfIterations = 23; - - /// - /// Makes some magic happen. - /// - private float4 Tex(float3 p) - { - float t = time + 78.0f; - float4 o = new(p.X, p.Y, p.Z, 3.0f * Hlsl.Sin(t * 0.1f)); - float4 dec = - new float4(1.0f, 0.9f, 0.1f, 0.15f) + - new float4(0.06f * Hlsl.Cos(t * 0.1f), 0, 0, 0.14f * Hlsl.Cos(t * 0.23f)); - - for (int i = 0; i++ < NumberOfIterations;) - { - o.XZYW = Hlsl.Abs((o / Hlsl.Dot(o, o)) - dec); - } - - return o; - } - - /// - public float4 Execute() - { - int2 xy = (int2)D2D.GetScenePosition().XY; - float2 uv = (xy - ((float2)dispatchSize * 0.5f)) / dispatchSize.Y; - float3 col = 0; - float t = time * 0.3f; - - for (float i = 0.0f; i <= 1.0f; i += 1.0f / NumberOfLayers) - { - float d = Hlsl.Frac(i + t); - float s = Hlsl.Lerp(5.0f, 0.5f, d); - float f = d * Hlsl.SmoothStep(1.0f, 0.9f, d); - - col += Tex(new float3(uv.X * s, uv.Y * s, i * 4.0f)).XYZ * f; - } - - col /= NumberOfLayers; - col *= new float3(2, 1.0f, 2.0f); - col = Hlsl.Pow(col, 0.5f); - - return new(col.X, col.Y, col.Z, 1.0f); - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.Shaders.D2D1/ComputeSharp.SwapChain.Shaders.D2D1.projitems b/samples/ComputeSharp.SwapChain.Shaders.D2D1/ComputeSharp.SwapChain.Shaders.D2D1.projitems deleted file mode 100644 index 68e39943..00000000 --- a/samples/ComputeSharp.SwapChain.Shaders.D2D1/ComputeSharp.SwapChain.Shaders.D2D1.projitems +++ /dev/null @@ -1,24 +0,0 @@ - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - true - f8bf7666-7ccf-4fe4-b055-2eba4bcd4564 - - - ComputeSharp.SwapChain.Shaders.D2D1 - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.Shaders.D2D1/ComputeSharp.SwapChain.Shaders.D2D1.shproj b/samples/ComputeSharp.SwapChain.Shaders.D2D1/ComputeSharp.SwapChain.Shaders.D2D1.shproj deleted file mode 100644 index c2c2af49..00000000 --- a/samples/ComputeSharp.SwapChain.Shaders.D2D1/ComputeSharp.SwapChain.Shaders.D2D1.shproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - f8bf7666-7ccf-4fe4-b055-2eba4bcd4564 - 14.0 - - - - - - - diff --git a/samples/ComputeSharp.SwapChain.Shaders.D2D1/ContouredLayers.cs b/samples/ComputeSharp.SwapChain.Shaders.D2D1/ContouredLayers.cs deleted file mode 100644 index 4a5c165d..00000000 --- a/samples/ComputeSharp.SwapChain.Shaders.D2D1/ContouredLayers.cs +++ /dev/null @@ -1,203 +0,0 @@ -using ComputeSharp.D2D1; - -namespace ComputeSharp.SwapChain.Shaders.D2D1; - -/// -/// Constructing some concise contoured layers, then applying various edge and shading effects to produce some faux depth. -/// Ported from . -/// Created by Shane. -/// -/// The current time since the start of the application. -/// The dispatch size for the current output. -[D2DInputCount(0)] -[D2DRequiresScenePosition] -[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)] -[D2DGeneratedPixelShaderDescriptor] -internal readonly partial struct ContouredLayers(float time, int2 dispatchSize) : ID2D1PixelShader -{ - /// - /// The background texture to sample. - /// - [D2DResourceTextureIndex(0)] - private readonly D2D1ResourceTexture2D texture; - - // float3 to float hash. - private static float Hash21(float2 p) - { - return Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(p, new float2(41, 289))) * 45758.5453f); - } - - // float2 to float2 hash. - private float2 Hash22(float2 p) - { - float n = Hlsl.Sin(Hlsl.Dot(p, new float2(1, 113))); - - p = Hlsl.Frac(new float2(262144, 32768) * n); - - return Hlsl.Sin((p * 6.2831853f) + time); - } - - // float2 to float2 hash. - private static float2 Hash22B(float2 p) - { - float n = Hlsl.Sin(Hlsl.Dot(p, new float2(41, 289))); - - return (Hlsl.Frac(new float2(262144, 32768) * n) * 2.0f) - 1.0f; - } - - // Smooth 2D noise - private static float Noise2D(float2 p) - { - float2 i = Hlsl.Floor(p); - - p -= i; - - float4 v = default; - - v.X = Hlsl.Dot(Hash22B(i), p); - v.Y = Hlsl.Dot(Hash22B(i + float2.UnitX), p - float2.UnitX); - v.Z = Hlsl.Dot(Hash22B(i + float2.UnitY), p - float2.UnitY); - v.W = Hlsl.Dot(Hash22B(i + 1.0f), p - 1.0f); - - p = p * p * (3.0f - (2.0f * p)); - - return Hlsl.Lerp(Hlsl.Lerp(v.X, v.Y, p.X), Hlsl.Lerp(v.Z, v.W, p.X), p.Y); - } - - // Based on IQ's gradient noise formula. - private float Noise2D3G(float2 p) - { - float2 i = Hlsl.Floor(p); - - p -= i; - - float4 v = default; - - v.X = Hlsl.Dot(Hash22(i), p); - v.Y = Hlsl.Dot(Hash22(i + float2.UnitX), p - float2.UnitX); - v.Z = Hlsl.Dot(Hash22(i + float2.UnitY), p - float2.UnitY); - v.W = Hlsl.Dot(Hash22(i + 1.0f), p - 1.0f); - - p = p * p * p * ((p * ((p * 6.0f) - 15.0f)) + 10.0f); - - return Hlsl.Lerp(Hlsl.Lerp(v.X, v.Y, p.X), Hlsl.Lerp(v.Z, v.W, p.X), p.Y); - } - - // Map function with noise layers - private float MapNoise(float3 p, float i) - { - return (Noise2D3G(p.XY * 3.0f) * 0.66f) + (Noise2D3G(p.XY * 6.0f) * 0.34f) + (i / 10.0f * 1.0f) - 0.15f; - } - - // 2D derivative function. - private float3 GetNormal(in float3 p, float m, float i) - { - float2 e = new(0.001f, 0); - - return new float3(m - MapNoise(p - e.XYY, i), m - MapNoise(p - e.YXY, i), 0.0f) / e.X * 1.4142f; - } - - // The map layer and its derivative - private float4 MapLayer(in float3 p, float i) - { - float4 d = default; - - d.X = MapNoise(p, i); - d.YZW = GetNormal(p, d.X, i); - - return d; - } - - // Layer color. Based on the shade, layer number and smoothing factor. - private float3 GetColor(float2 p, float sh, float fi) - { - float3 tx = this.texture.Sample(p + Hash21(new float2(sh, fi))).XYZ; - - tx *= tx; - - float3 col; - - col = (float3)1.0f * (1.0f - (0.75f / (1.0f + (sh * sh * 2.0f)))); - col = Hlsl.Min(col * tx * 3.0f, 1.0f); - - return col; - } - - // A hatch-like algorithm, or a stipple... or some kind of textured pattern. - private float Hatch(float2 p, float res) - { - p *= res / 16.0f; - - float hatch = Hlsl.Clamp((Hlsl.Sin((p.X - p.Y) * 3.14159f * 200.0f) * 2.0f) + 0.5f, 0.0f, 1.0f); - - float hRnd = Hash21(Hlsl.Floor(p * 6.0f) + 0.73f); - if (hRnd > 0.66f) - { - hatch = hRnd; - } - - hatch = (hatch * 0.75f) + 0.5f; - - return hatch; - } - - /// - public float4 Execute() - { - int2 xy = (int2)D2D.GetScenePosition().XY; - float2 fragCoord = new(xy.X, dispatchSize.Y - xy.Y); - float res = Hlsl.Min(dispatchSize.Y, 700.0f); - float2 uv = (fragCoord - ((float2)dispatchSize * 0.5f)) / res; - float sf = 1.0f / dispatchSize.Y; - float3 col = GetColor(uv, 0.0f, 0.0f); - float pL = 0.0f; - float hatch = Hatch(uv, res); - - col *= hatch; - - const int lNum = 5; - float flNum = lNum; - - for (int i = 0; i < lNum; i++) - { - float fi = i; - - hatch = Hatch(uv + Hlsl.Sin(new float2(41.0f, 289.0f) * (fi + 1.0f)), res); - - float4 c = MapLayer(new float3(uv, 1.0f), fi); - float4 cSh = MapLayer(new float3(uv - (new float2(0.03f, -0.03f) * (((flNum - fi) / flNum * 0.5f) + 0.5f)), 1.0f), fi); - float sh = (fi + 1.0f) / flNum; - float3 lCol = GetColor(uv, sh, fi + 1.0f); - float3 ld = Hlsl.Normalize(new float3(-1, 1, -0.25f)); - float3 n = Hlsl.Normalize(new float3(0.0f, 0.0f, -1.0f) + c.YZW); - float diff = Hlsl.Max(Hlsl.Dot(ld, n), 0.0f); - - diff *= 2.5f; - - float3 eCol = lCol * (diff + 1.0f); - float sfL = sf * Hlsl.Length(c.YZX) * 2.0f; - float sfLSh = sf * Hlsl.Length(cSh.YZX) * 6.0f; - const float shF = 0.5f; - - col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sfLSh, Hlsl.Max(cSh.X, pL))) * shF); - col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sfL * 3.0f, c.X)) * 0.25f); - col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sfL, c.X)) * 0.85f); - col = Hlsl.Lerp(col, eCol * hatch, 1.0f - Hlsl.SmoothStep(0.0f, sfL, c.X + (Hlsl.Length(c.YZX) * 0.003f))); - col = Hlsl.Lerp(col, lCol * hatch, 1.0f - Hlsl.SmoothStep(0.0f, sfL, c.X + (Hlsl.Length(c.YZX) * 0.006f))); - - pL = c.X; - } - - col *= Hlsl.Lerp(new float3(1.8f, 1, 0.7f).ZYX, new float3(1.8f, 1, 0.7f).XZY, Noise2D(uv * 2.0f)); - - float3 rn3 = Noise2D((uv * dispatchSize.Y / 1.0f) + 1.7f) - Noise2D((uv * dispatchSize.Y / 1.0f) + 3.4f); - - col *= 0.93f + (0.07f * rn3.XYZ) + (0.07f * Hlsl.Dot(rn3, new float3(0.299f, 0.587f, 0.114f))); - - uv = fragCoord / dispatchSize.XY; - - col *= Hlsl.Pow(Hlsl.Abs(16.0f * uv.X * uv.Y * (1.0f - uv.X) * (1.0f - uv.Y)), 0.0625f); - - return new float4(Hlsl.Sqrt(Hlsl.Max(col, 0.0f)), 1); - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.Shaders.D2D1/FractalTiling.cs b/samples/ComputeSharp.SwapChain.Shaders.D2D1/FractalTiling.cs deleted file mode 100644 index 68f0a79a..00000000 --- a/samples/ComputeSharp.SwapChain.Shaders.D2D1/FractalTiling.cs +++ /dev/null @@ -1,48 +0,0 @@ -using ComputeSharp.D2D1; - -namespace ComputeSharp.SwapChain.Shaders.D2D1; - -/// -/// A shader creating a fractal tiling animation. -/// Ported from . -/// Created by Inigo Quilez. -/// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. -/// -/// The current time since the start of the application. -/// The dispatch size for the current output. -[D2DInputCount(0)] -[D2DRequiresScenePosition] -[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)] -[D2DGeneratedPixelShaderDescriptor] -internal readonly partial struct FractalTiling(float time, int2 dispatchSize) : ID2D1PixelShader -{ - /// - public float4 Execute() - { - int2 xy = (int2)D2D.GetScenePosition().XY; - float2 position = (((float2)(256 * xy)) / dispatchSize.X) + time; - float4 color = 0; - - for (int i = 0; i < 6; i++) - { - float2 a = Hlsl.Floor(position); - float2 b = Hlsl.Frac(position); - float4 w = Hlsl.Frac( - (Hlsl.Sin((a.X * 7) + (31.0f * a.Y) + (0.01f * time)) + - new float4(0.035f, 0.01f, 0, 0.7f)) - * 13.545317f); - - color.XYZ += w.XYZ * - 2.0f * Hlsl.SmoothStep(0.45f, 0.55f, w.W) * - Hlsl.Sqrt(16.0f * b.X * b.Y * (1.0f - b.X) * (1.0f - b.Y)); - - position /= 2.0f; - color /= 2.0f; - } - - color.XYZ = Hlsl.Pow(color.XYZ, new float3(0.7f, 0.8f, 0.5f)); - color.W = 1.0f; - - return color; - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.Shaders.D2D1/HelloWorld.cs b/samples/ComputeSharp.SwapChain.Shaders.D2D1/HelloWorld.cs deleted file mode 100644 index a6f021e0..00000000 --- a/samples/ComputeSharp.SwapChain.Shaders.D2D1/HelloWorld.cs +++ /dev/null @@ -1,31 +0,0 @@ -using ComputeSharp.D2D1; - -namespace ComputeSharp.SwapChain.Shaders.D2D1; - -/// -/// A simple shader to get started with based on shadertoy new shader template. -/// Ported from . -/// -/// The current time since the start of the application. -/// The dispatch size for the current output. -[D2DInputCount(0)] -[D2DRequiresScenePosition] -[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)] -[D2DGeneratedPixelShaderDescriptor] -internal readonly partial struct HelloWorld(float time, int2 dispatchSize) : ID2D1PixelShader -{ - /// - public float4 Execute() - { - int2 xy = (int2)D2D.GetScenePosition().XY; - - // Normalized screen space UV coordinates from 0.0 to 1.0 - float2 uv = xy / (float2)dispatchSize; - - // Time varying pixel color - float3 col = 0.5f + (0.5f * Hlsl.Cos(time + new float3(uv, uv.X) + new float3(0, 2, 4))); - - // Output to screen - return new(col, 1f); - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.Shaders.D2D1/MengerJourney.cs b/samples/ComputeSharp.SwapChain.Shaders.D2D1/MengerJourney.cs deleted file mode 100644 index 159d64a3..00000000 --- a/samples/ComputeSharp.SwapChain.Shaders.D2D1/MengerJourney.cs +++ /dev/null @@ -1,177 +0,0 @@ -using ComputeSharp.D2D1; - -namespace ComputeSharp.SwapChain.Shaders.D2D1; - -/// -/// A shader creating a flythrough in a Menger system. -/// Ported from . -/// Created by Syntopia. -/// -/// The current time since the start of the application. -/// The dispatch size for the current output. -[D2DInputCount(0)] -[D2DRequiresScenePosition] -[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)] -[D2DGeneratedPixelShaderDescriptor] -internal readonly partial struct MengerJourney(float time, int2 dispatchSize) : ID2D1PixelShader -{ - private const int MaxSteps = 30; - private const float MinimumDistance = 0.0009f; - private const float NormalDistance = 0.0002f; - private const int Iterations = 7; - private const float Scale = 3.0f; - private const float FieldOfView = 1.0f; - private const float Jitter = 0.05f; - private const float FudgeFactor = 0.7f; - private const float NonLinearPerspective = 2.0f; - private const float Ambient = 0.32184f; - private const float Diffuse = 0.5f; - - private static readonly float3 LightDir = 1.0f; - private static readonly float3 LightColor = new(1.0f, 1.0f, 0.858824f); - private static readonly float3 LightDir2 = new(1.0f, -1.0f, 1.0f); - private static readonly float3 LightColor2 = new(0, 0.333333f, 1.0f); - private static readonly float3 Offset = new(0.92858f, 0.92858f, 0.32858f); - - /// - /// Rotates a given value by a specified amount. - /// - private static float2 Rotate(float2 v, float a) - { - return new((Hlsl.Cos(a) * v.X) + (Hlsl.Sin(a) * v.Y), (-Hlsl.Sin(a) * v.X) + (Hlsl.Cos(a) * v.Y)); - } - - /// - /// Calculates the light at a specified normal and starting color. - /// Uses two light sources and no specular lights. - /// - private static float3 GetLight(in float3 color, in float3 normal) - { - float3 lightDir = Hlsl.Normalize(LightDir); - float diffuse = Hlsl.Max(0.0f, Hlsl.Dot(-normal, lightDir)); - - float3 lightDir2 = Hlsl.Normalize(LightDir2); - float diffuse2 = Hlsl.Max(0.0f, Hlsl.Dot(-normal, lightDir2)); - - return - (diffuse * Diffuse * (LightColor * color)) + - (diffuse2 * Diffuse * (LightColor2 * color)); - } - - /// - /// DE: Infinitely tiled Menger IFS. - /// For more info on KIFS, see - /// - private float DE(float3 z) - { - // Performs the GLSL mod function. - static float3 Mod(float3 x, float y) - { - return x - (y * Hlsl.Floor(x / y)); - } - - z = Hlsl.Abs(1.0f - Mod(z, 2.0f)); - - float d = 1000.0f; - - for (int n = 0; n < Iterations; n++) - { - z.XY = Rotate(z.XY, 4.0f + (2.0f * Hlsl.Cos(time / 8.0f))); - z = Hlsl.Abs(z); - - if (z.X < z.Y) { z.XY = z.YX; } - - if (z.X < z.Z) { z.XZ = z.ZX; } - - if (z.Y < z.Z) { z.YZ = z.ZY; } - - z = (Scale * z) - (Offset * (Scale - 1.0f)); - - if (z.Z < -0.5f * Offset.Z * (Scale - 1.0f)) - { - z.Z += Offset.Z * (Scale - 1.0f); - } - - d = Hlsl.Min(d, Hlsl.Length(z) * Hlsl.Pow(Scale, -n - 1.0f)); - } - - return d - 0.001f; - } - - /// - /// Calculates the finite difference normal at a given position. - /// - private float3 GetNormal(in float3 pos) - { - float3 e = new(0.0f, NormalDistance, 0.0f); - - return Hlsl.Normalize(new float3( - DE(pos + e.YXX) - DE(pos - e.YXX), - DE(pos + e.XYX) - DE(pos - e.XYX), - DE(pos + e.XXY) - DE(pos - e.XXY))); - } - - /// - /// Performs a ray march operation on a specific position. - /// - private float4 RayMarch(in float3 from, float3 dir, in float2 fragCoord) - { - // Computes a pseudo-random number - static float Rand(float2 co) - { - return Hlsl.Frac(Hlsl.Cos(Hlsl.Dot(co, new float2(4.898f, 7.23f))) * 23421.631f); - } - - float totalDistance = Jitter * Rand(fragCoord.XY + time); - float3 dir2 = dir; - float distance = 0; - int steps = 0; - float3 pos = 0; - - for (int i = 0; i < MaxSteps; i++) - { - dir.ZY = Rotate(dir2.ZY, totalDistance * Hlsl.Cos(time / 4.0f) * NonLinearPerspective); - pos = from + (totalDistance * dir); - distance = DE(pos) * FudgeFactor; - totalDistance += distance; - - if (distance < MinimumDistance) - { - break; - } - - steps = i; - } - - float smoothStep = steps + (distance / MinimumDistance); - float ao = 1.1f - (smoothStep / MaxSteps); - float3 normal = GetNormal(pos - (dir * NormalDistance * 3.0f)); - float3 color = 1.0f; - float3 light = GetLight(color, normal); - - color = ((color * Ambient) + light) * ao; - - return new(color.X, color.Y, color.Z, 1.0f); - } - - /// - public float4 Execute() - { - int2 xy = (int2)D2D.GetScenePosition().XY; - float3 camPos = 0.5f * time * new float3(1.0f, 0.0f, 0.0f); - float3 target = camPos + new float3(1.0f, 0.0f * Hlsl.Cos(time), 0.0f * Hlsl.Sin(0.4f * time)); - float3 camDir = Hlsl.Normalize(target - camPos); - float3 camUp = new(0.0f, 1.0f, 0.0f); - - camUp = Hlsl.Normalize(camUp - (Hlsl.Dot(camDir, camUp) * camDir)); - - float3 camRight = Hlsl.Normalize(Hlsl.Cross(camDir, camUp)); - float2 coord = -1.0f + (2.0f * (float2)xy / (float2)dispatchSize); - - coord.X *= dispatchSize.X / (float)dispatchSize.Y; - - float3 rayDir = Hlsl.Normalize(camDir + (((coord.X * camRight) + (coord.Y * camUp)) * FieldOfView)); - - return RayMarch(camPos, rayDir, xy); - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.Shaders.D2D1/Octagrams.cs b/samples/ComputeSharp.SwapChain.Shaders.D2D1/Octagrams.cs deleted file mode 100644 index ddcbcd45..00000000 --- a/samples/ComputeSharp.SwapChain.Shaders.D2D1/Octagrams.cs +++ /dev/null @@ -1,126 +0,0 @@ -using ComputeSharp.D2D1; - -namespace ComputeSharp.SwapChain.Shaders.D2D1; - -/// -/// A shader creating an octagram animation, inspired by arabesque. -/// Ported from . -/// Created by whisky_shusuky. -/// -/// The current time since the start of the application. -/// The dispatch size for the current output. -[D2DInputCount(0)] -[D2DRequiresScenePosition] -[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)] -[D2DGeneratedPixelShaderDescriptor] -internal readonly partial struct Octagrams(float time, int2 dispatchSize) : ID2D1PixelShader -{ - private static float2x2 Rotate(float a) - { - float c = Hlsl.Cos(a); - float s = Hlsl.Sin(a); - - return new(c, s, -s, c); - } - - private static float Box(float3 pos, float scale) - { - static float SDBox(float3 p, float3 b) - { - float3 q = Hlsl.Abs(p) - b; - - return Hlsl.Length(Hlsl.Max(q, 0.0f)) + - Hlsl.Min(Hlsl.Max(q.X, Hlsl.Max(q.Y, q.Z)), 0.0f); - } - - pos *= scale; - - float b = SDBox(pos, new(0.4f, 0.4f, 0.1f)) / 1.5f; - - pos.XY *= 5.0f; - pos.Y -= 3.5f; - pos.XY = Hlsl.Mul(pos.XY, Rotate(0.75f)); - - return -b; - } - - private static float BoxSet(float3 pos, float gTime) - { - float3 pos_origin = pos; - - pos = pos_origin; - pos.Y += Hlsl.Sin(gTime * 0.4f) * 2.5f; - pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f)); - - float box1 = Box(pos, 2.0f - (Hlsl.Abs(Hlsl.Sin(gTime * 0.4f)) * 1.5f)); - - pos = pos_origin; - pos.Y -= Hlsl.Sin(gTime * 0.4f) * 2.5f; - pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f)); - - float box2 = Box(pos, 2.0f - (Hlsl.Abs(Hlsl.Sin(gTime * 0.4f)) * 1.5f)); - - pos = pos_origin; - pos.X += Hlsl.Sin(gTime * 0.4f) * 2.5f; - pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f)); - - float box3 = Box(pos, 2.0f - (Hlsl.Abs(Hlsl.Sin(gTime * 0.4f)) * 1.5f)); - - pos = pos_origin; - pos.X -= Hlsl.Sin(gTime * 0.4f) * 2.5f; - pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f)); - - float box4 = Box(pos, 2.0f - (Hlsl.Abs(Hlsl.Sin(gTime * 0.4f)) * 1.5f)); - - pos = pos_origin; - pos.XY = Hlsl.Mul(pos.XY, Rotate(0.8f)); - - float box5 = Box(pos, 0.5f) * 6.0f; - - pos = pos_origin; - - float box6 = Box(pos, 0.5f) * 6.0f; - float result = Hlsl.Max(Hlsl.Max(Hlsl.Max(Hlsl.Max(Hlsl.Max(box1, box2), box3), box4), box5), box6); - - return result; - } - - /// - public float4 Execute() - { - int2 xy = (int2)D2D.GetScenePosition().XY; - float2 p = (((float2)xy * 2.0f) - dispatchSize) / Hlsl.Min(dispatchSize.X, dispatchSize.Y); - float3 ro = new(0.0f, -0.2f, time * 4.0f); - float3 ray = Hlsl.Normalize(new float3(p, 1.5f)); - - ray.XY = Hlsl.Mul(ray.XY, Rotate(Hlsl.Sin(time * 0.03f) * 5.0f)); - ray.YZ = Hlsl.Mul(ray.YZ, Rotate(Hlsl.Sin(time * 0.05f) * 0.2f)); - - float t = 0.1f; - float ac = 0.0f; - - for (int i = 0; i < 99; i++) - { - static float3 Mod(float3 x, float y) - { - return x - (y * Hlsl.Floor(x / y)); - } - - float3 pos = ro + (ray * t); - - pos = Mod(pos - 2.0f, 4.0f) - 2.0f; - - float gTime = time - (i * 0.01f); - float d = BoxSet(pos, gTime); - - d = Hlsl.Max(Hlsl.Abs(d), 0.01f); - ac += Hlsl.Exp(-d * 23.0f); - t += d * 0.55f; - } - - float3 col = (ac * 0.02f) + new float3(0.0f, 0.2f * Hlsl.Abs(Hlsl.Sin(time)), 0.5f + (Hlsl.Sin(time) * 0.2f)); - float4 color = new(col, 1); - - return color; - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.Shaders.D2D1/ProteanClouds.cs b/samples/ComputeSharp.SwapChain.Shaders.D2D1/ProteanClouds.cs deleted file mode 100644 index b77f1b67..00000000 --- a/samples/ComputeSharp.SwapChain.Shaders.D2D1/ProteanClouds.cs +++ /dev/null @@ -1,174 +0,0 @@ -using ComputeSharp.D2D1; - -namespace ComputeSharp.SwapChain.Shaders.D2D1; - -/// -/// Fully procedural 3D animated volume with three evaluations per step (for shading). -/// Ported from . -/// Created by nimitz (twitter: @stormoid). -/// License Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License. -/// -/// The current time since the start of the application. -/// The dispatch size for the current output. -[D2DInputCount(0)] -[D2DRequiresScenePosition] -[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)] -[D2DGeneratedPixelShaderDescriptor] -internal readonly partial struct ProteanClouds(float time, int2 dispatchSize) : ID2D1PixelShader -{ - private static readonly float3x3 M3 = new float3x3(0.33338f, 0.56034f, -0.71817f, -0.87887f, 0.32651f, -0.15323f, 0.15162f, 0.69596f, 0.61339f) * 1.93f; - - private static float2x2 Rotate(in float a) - { - float c = Hlsl.Cos(a); - float s = Hlsl.Sin(a); - - return new(c, s, -s, c); - } - - private static float LinStep(in float mn, in float mx, in float x) - { - return Hlsl.Clamp((x - mn) / (mx - mn), 0.0f, 1.0f); - } - - private static float2 Disp(float t) - { - return new float2(Hlsl.Sin(t * 0.22f) * 1.0f, Hlsl.Cos(t * 0.175f) * 1.0f) * 2.0f; - } - - private float2 Map(float3 p, float prm1, float2 bsMo) - { - float3 p2 = p; - - p2.XY -= Disp(p.Z).XY; - p.XY = Hlsl.Mul(p.XY, Rotate((Hlsl.Sin(p.Z + time) * (0.1f + (prm1 * 0.05f))) + (time * 0.09f))); - - float cl = Hlsl.Dot(p2.XY, p2.XY); - float d = 0.0f; - - p *= 0.61f; - - float z = 1.0f; - float trk = 1.0f; - float dspAmp = 0.1f + (prm1 * 0.2f); - - for (int i = 0; i < 5; i++) - { - p += Hlsl.Sin((p.ZXY * 0.75f * trk) + (time * trk * 0.8f)) * dspAmp; - d -= Hlsl.Abs(Hlsl.Dot(Hlsl.Cos(p), Hlsl.Sin(p.YZX)) * z); - z *= 0.57f; - trk *= 1.4f; - - p = Hlsl.Mul(p, M3); - } - - d = Hlsl.Abs(d + (prm1 * 3.0f)) + (prm1 * 0.3f) - 2.5f + bsMo.Y; - - return new float2(d + (cl * 0.2f) + 0.25f, cl); - } - - private float4 Render(float3 ro, float3 rd, float prm1, float2 bsMo) - { - float4 rez = 0; - float t = 1.5f; - float fogT = 0; - - for (int i = 0; i < 130; i++) - { - if (rez.A > 0.99f) - { - break; - } - - float3 pos = ro + (t * rd); - float2 mpv = Map(pos, prm1, bsMo); - float den = Hlsl.Clamp(mpv.X - 0.3f, 0.0f, 1.0f) * 1.12f; - float dn = Hlsl.Clamp(mpv.X + 2.0f, 0.0f, 3.0f); - float4 col = 0f; - - if (mpv.X > 0.6f) - { - - col = new float4((Hlsl.Sin(new float3(5.0f, 0.4f, 0.2f) + (mpv.Y * 0.1f) + (Hlsl.Sin(pos.Z * 0.4f) * 0.5f) + 1.8f) * 0.5f) + 0.5f, 0.08f); - col *= den * den * den; - col.RGB *= LinStep(4.0f, -2.5f, mpv.X) * 2.3f; - - float dif = Hlsl.Clamp((den - Map(pos + 0.8f, prm1, bsMo).X) / 9.0f, 0.001f, 1.0f); - - dif += Hlsl.Clamp((den - Map(pos + 0.35f, prm1, bsMo).X) / 2.5f, 0.001f, 1.0f); - col.XYZ *= den * (new float3(0.005f, 0.045f, 0.075f) + (1.5f * new float3(0.033f, 0.07f, 0.03f) * dif)); - } - - float fogC = Hlsl.Exp((t * 0.2f) - 2.2f); - - col += new float4(0.06f, 0.11f, 0.11f, 0.1f) * Hlsl.Clamp(fogC - fogT, 0.0f, 1.0f); - fogT = fogC; - rez += col * (1.0f - rez.A); - t += Hlsl.Clamp(0.5f - (dn * dn * 0.05f), 0.09f, 0.3f); - } - - return Hlsl.Clamp(rez, 0.0f, 1.0f); - } - - private static float GetSaturation(float3 c) - { - float mi = Hlsl.Min(Hlsl.Min(c.X, c.Y), c.Z); - float ma = Hlsl.Max(Hlsl.Max(c.X, c.Y), c.Z); - - return (ma - mi) / (ma + (float)1e-7); - } - - private static float3 ILerp(in float3 a, in float3 b, in float x) - { - float3 ic = Hlsl.Lerp(a, b, x) + new float3((float)1e-6, 0.0f, 0.0f); - float sd = Hlsl.Abs(GetSaturation(ic) - Hlsl.Lerp(GetSaturation(a), GetSaturation(b), x)); - float3 dir = Hlsl.Normalize(new float3((2.0f * ic.X) - ic.Y - ic.Z, (2.0f * ic.Y) - ic.X - ic.Z, (2.0f * ic.Z) - ic.Y - ic.X)); - float lgt = Hlsl.Dot(1.0f, ic); - float ff = Hlsl.Dot(dir, Hlsl.Normalize(ic)); - - ic += 1.5f * dir * sd * ff * lgt; - - return Hlsl.Clamp(ic, 0.0f, 1.0f); - } - - /// - public float4 Execute() - { - int2 xy = (int2)D2D.GetScenePosition().XY; - float2 q = (float2)xy / dispatchSize; - float2 p = (xy - (0.5f * (float2)dispatchSize)) / dispatchSize.Y; - float2 bsMo = -0.5f * (float2)dispatchSize / dispatchSize.Y; - float scaledTime = time * 3.0f; - float3 ro = new(0, 0, scaledTime); - - ro += new float3(Hlsl.Sin(time) * 0.5f, Hlsl.Sin(time * 1.0f) * 0.0f, 0); - - float dspAmp = 0.85f; - - ro.XY += Disp(ro.Z) * dspAmp; - - float tgtDst = 3.5f; - float3 target = Hlsl.Normalize(ro - new float3(Disp(scaledTime + tgtDst) * dspAmp, scaledTime + tgtDst)); - - ro.X -= bsMo.X * 2.0f; - - float3 rightdir = Hlsl.Normalize(Hlsl.Cross(target, new float3(0, 1, 0))); - float3 updir = Hlsl.Normalize(Hlsl.Cross(rightdir, target)); - - rightdir = Hlsl.Normalize(Hlsl.Cross(updir, target)); - - float3 rd = Hlsl.Normalize((((p.X * rightdir) + (p.Y * updir)) * 1.0f) - target); - - rd.XY = Hlsl.Mul(rd.XY, Rotate((-Disp(scaledTime + 3.5f).X * 0.2f) + bsMo.X)); - - float prm1 = Hlsl.SmoothStep(-0.4f, 0.4f, Hlsl.Sin(time * 0.3f)); - float4 scn = Render(ro, rd, prm1, bsMo); - float3 col = scn.RGB; - - col = ILerp(col.BGR, col.RGB, Hlsl.Clamp(1.0f - prm1, 0.05f, 1.0f)); - col = Hlsl.Pow(col, new float3(0.55f, 0.65f, 0.6f)) * new float3(1.0f, 0.97f, 0.9f); - col *= (Hlsl.Pow(Hlsl.Abs(16.0f * q.X * q.Y * (1.0f - q.X) * (1.0f - q.Y)), 0.12f) * 0.7f) + 0.3f; - - return new(col, 1.0f); - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.Shaders.D2D1/PyramidPattern.cs b/samples/ComputeSharp.SwapChain.Shaders.D2D1/PyramidPattern.cs deleted file mode 100644 index c0d2bef3..00000000 --- a/samples/ComputeSharp.SwapChain.Shaders.D2D1/PyramidPattern.cs +++ /dev/null @@ -1,191 +0,0 @@ -using ComputeSharp.D2D1; - -namespace ComputeSharp.SwapChain.Shaders.D2D1; - -/// -/// An offset grid of square-based pyramids whose tips have been offset according to an underlying directional noise field. -/// The faux lighting is provided via bump mapping. No raymarching was harmed during the making of this example. -/// Ported from . -/// Created by Shane. -/// -/// The current time since the start of the application. -/// The dispatch size for the current output. -[D2DInputCount(0)] -[D2DRequiresScenePosition] -[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)] -[D2DGeneratedPixelShaderDescriptor] -internal readonly partial struct PyramidPattern(float time, int2 dispatchSize) : ID2D1PixelShader -{ - // Standard 2D rotation formula. - private static float2x2 Rotate2x2(in float a) - { - float c = Hlsl.Cos(a); - float s = Hlsl.Sin(a); - - return new(c, -s, s, c); - } - - // IQ's float2 to float hash. - private static float Hash21(float2 p) - { - return Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(p, new float2(27.619f, 57.583f))) * 43758.5453f); - } - - // float2 to float2 hash. - private static float2 Hash22B(float2 p) - { - float n = Hlsl.Sin(Hlsl.Dot(p, new float2(41, 289))); - - return (Hlsl.Frac(new float2(262144, 32768) * n) * 2.0f) - 1.0f; - } - - // Based on IQ's gradient noise formula. - private static float N2D3G(float2 p) - { - float2 i = Hlsl.Floor(p); - - p -= i; - - float4 v = default; - - v.X = Hlsl.Dot(Hash22B(i), p); - v.Y = Hlsl.Dot(Hash22B(i + float2.UnitX), p - float2.UnitX); - v.Z = Hlsl.Dot(Hash22B(i + float2.UnitY), p - float2.UnitY); - v.W = Hlsl.Dot(Hash22B(i + 1.0f), p - 1.0f); - - p = p * p * (3.0f - (2.0f * p)); - - return Hlsl.Lerp(Hlsl.Lerp(v.X, v.Y, p.X), Hlsl.Lerp(v.Z, v.W, p.X), p.Y); - } - - // Two layers of noise. - private static float FBM(float2 p) - { - return (N2D3G(p) * 0.66f) + (N2D3G(p * 2.0f) * 0.34f); - } - - // HLSL mod from GLSL - private static float Mod(float x, float y) - { - return x - (y * Hlsl.Floor(x / y)); - } - - private float BMap(float2 p) - { - p = Hlsl.Mul(p, Rotate2x2(-3.14159f / 5.0f)); - - if (Mod(Hlsl.Floor(p.Y), 2.0f) < 0.5f) - { - p.X += 0.5f; - } - - float2 ip = Hlsl.Floor(p); - - p -= ip + 0.5f; - - float ang = (-3.14159f * 3.0f / 5.0f) + (FBM((ip / 8.0f) + (time / 3.0f)) * 6.2831f * 2.0f); - - float2 offs = new float2(Hlsl.Cos(ang), Hlsl.Sin(ang)) * 0.35f; - - if (p.X < offs.X) - { - p.X = 1.0f - ((p.X + 0.5f) / Hlsl.Abs(offs.X + 0.5f)); - } - else - { - p.X = (p.X - offs.X) / (0.5f - offs.X); - } - - if (p.Y < offs.Y) - { - p.Y = 1.0f - ((p.Y + 0.5f) / Hlsl.Abs(offs.Y + 0.5f)); - } - else - { - p.Y = (p.Y - offs.Y) / (0.5f - offs.Y); - } - - return 1.0f - Hlsl.Max(p.X, p.Y); - } - - // Standard function-based bump mapping function, with an edge value included for good measure - private float3 DoBumpMap(in float2 p, in float3 n, float bumpfactor, ref float edge) - { - float2 e = new(0.025f, 0); - - float f = BMap(p); - float fx = BMap(p - e.XY); - float fy = BMap(p - e.YX); - float fx2 = BMap(p + e.XY); - float fy2 = BMap(p + e.YX); - - float3 grad = new float3(fx - fx2, fy - fx2, 0) / e.X / 2.0f; - - edge = Hlsl.Length(new float2(fx, fy) + new float2(fx2, fy2) - (f * 2.0f)); - edge = Hlsl.SmoothStep(0.0f, 1.0f, edge / e.X); - - grad -= n * Hlsl.Dot(n, grad); - - return Hlsl.Normalize(n + (grad * bumpfactor)); - } - - // A hatch-like algorithm, or a stipple... or some kind of textured pattern - private float DoHatch(float2 p, float res) - { - p *= res / 16.0f; - - float hatch = Hlsl.Clamp((Hlsl.Sin((p.X - p.Y) * 3.14159f * 200.0f) * 2.0f) + 0.5f, 0.0f, 1.0f); - - float hRnd = Hash21(Hlsl.Floor(p * 6.0f) + 0.73f); - if (hRnd > 0.66f) - { - hatch = hRnd; - } - - return hatch; - } - - /// - public float4 Execute() - { - int2 xy = (int2)D2D.GetScenePosition().XY; - int2 coordinate = new(xy.X, dispatchSize.Y - xy.Y); - float iRes = Hlsl.Min(dispatchSize.Y, 800.0f); - float2 uv = (coordinate - ((float2)dispatchSize * 0.5f)) / iRes; - float3 rd = Hlsl.Normalize(new float3(uv, 0.5f)); - const float gSc = 10.0f; - float2 p = (uv * gSc) + new float2(0, time / 2.0f); - float2 oP = p; - float m = BMap(p); - float3 n = new(0, 0, -1); - float edge = 0.0f; - float bumpFactor = 0.25f; - - n = DoBumpMap(p, n, bumpFactor, ref edge); - - float3 lp = new float3(-0.0f + (Hlsl.Sin(time) * 0.3f), 0.0f + (Hlsl.Cos(time * 1.3f) * 0.3f), -1) - new float3(uv, 0); - float lDist = Hlsl.Max(Hlsl.Length(lp), 0.001f); - float3 ld = lp / lDist; - float diff = Hlsl.Max(Hlsl.Dot(n, ld), 0.0f); - - diff = Hlsl.Pow(diff, 4.0f); - - float spec = Hlsl.Pow(Hlsl.Max(Hlsl.Dot(Hlsl.Reflect(-ld, n), -rd), 0.0f), 16.0f); - float fre = Hlsl.Min(Hlsl.Pow(Hlsl.Max(1.0f + Hlsl.Dot(n, rd), 0.0f), 4.0f), 3.0f); - float3 col = 0.15f * (diff + 0.251f + (spec * new float3(1, 0.7f, 0.3f) * 9.0f) + (fre * new float3(0.1f, 0.3f, 1) * 12.0f)); - float rf = Hlsl.SmoothStep(0.0f, 0.35f, (BMap(Hlsl.Reflect(rd, n).XY * 2.0f) * FBM(Hlsl.Reflect(rd, n).XY * 3.0f)) + 0.1f); - - col += col * col * rf * rf * new float3(1, 0.1f, 0.1f) * 15.0f; - - float shade = (m * 0.83f) + 0.17f; - - col *= shade; - col *= 1.0f - (edge * 0.8f); - - float hatch = DoHatch(oP / gSc, iRes); - - col *= (hatch * 0.5f) + 0.7f; - - return new(Hlsl.Sqrt(Hlsl.Max(col, 0.0f)), 1); - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.Shaders.D2D1/TerracedHills.cs b/samples/ComputeSharp.SwapChain.Shaders.D2D1/TerracedHills.cs deleted file mode 100644 index 79c62167..00000000 --- a/samples/ComputeSharp.SwapChain.Shaders.D2D1/TerracedHills.cs +++ /dev/null @@ -1,124 +0,0 @@ -using ComputeSharp.D2D1; - -namespace ComputeSharp.SwapChain.Shaders.D2D1; - -/// -/// An abstract representation of some terraced hills. In essence, just a very basic terrain layout with a small code footprint. -/// Ported from . -/// Created by Shane. -/// -/// The current time since the start of the application. -/// The dispatch size for the current output. -[D2DInputCount(0)] -[D2DRequiresScenePosition] -[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)] -[D2DGeneratedPixelShaderDescriptor] -internal readonly partial struct TerracedHills(float time, int2 dispatchSize) : ID2D1PixelShader -{ - // 2x2 matrix rotation. Angle vector, courtesy of Fabrice - private static float2x2 Rot2(float th) - { - float2 a = Hlsl.Sin(new float2(1.5707963f, 0) + th); - - return new(a.X, -a.Y, a.Y, a.X); - } - - // The triangle function that Shadertoy user Nimitz has used in various triangle noise demonstrations - private static float Tri(in float x) - { - return Hlsl.Abs(x - Hlsl.Floor(x) - 0.5f); - } - - // 2D variant of the triangle function - private static float2 Tri(in float2 x) - { - return Hlsl.Abs(x - Hlsl.Floor(x) - 0.5f); - } - - // A simple noisey layer made up of a sawtooth combination - private static float HLayer(float2 p) - { - return Hlsl.Dot(Tri((p / 1.5f) + Tri((p.YX / 3.0f) + 0.25f)), 1); - } - - // Combine layers to create surfaces to render - private static float HMap(float2 p) - { - float ret = 0, a = 1; - - for (int i = 0; i < 3; i++) - { - ret += Hlsl.Abs(a) * HLayer(p / a); - p = new float2x2(0.866025f, -0.57735f, 0.57735f, 0.866025f) * p; - a *= -0.3f; - } - - ret = Hlsl.SmoothStep(-0.2f, 1.0f, ret * ret / 1.39f / 1.39f); - - return (ret * 0.975f) + (Tri(ret * 12.0f) * 0.05f); - } - - // Distance function. A flat plane perturbed by a height function of some kind. - private static float Map(float3 p) - { - return (p.Y - (HMap(p.XZ) * 0.35f)) * 0.75f; - } - - // Tetrahedral normal - courtesy of IQ - private static float3 Normal(in float3 p, ref float edge, float dispatchHeight) - { - float2 e = new float2(-1.0f, 1.0f) * 0.5f / dispatchHeight; - float d1 = Map(p + e.YXX), d2 = Map(p + e.XXY); - float d3 = Map(p + e.XYX), d4 = Map(p + e.YYY); - float d = Map(p); - - edge = Hlsl.Abs(d1 + d2 + d3 + d4 - (d * 4.0f)); - edge = Hlsl.SmoothStep(0.0f, 1.0f, Hlsl.Sqrt(edge / e.Y * 2.0f)); - e = new float2(-1.0f, 1.0f) * 0.001f; - d1 = Map(p + e.YXX); - d2 = Map(p + e.XXY); - d3 = Map(p + e.XYX); - d4 = Map(p + e.YYY); - - return Hlsl.Normalize((e.YXX * d1) + (e.XXY * d2) + (e.XYX * d3) + (e.YYY * d4)); - } - - /// - public float4 Execute() - { - int2 xy = (int2)D2D.GetScenePosition().XY; - int2 coordinate = new(xy.X, dispatchSize.Y - xy.Y); - - float3 rd = Hlsl.Normalize(new float3((float2)coordinate - (dispatchSize.Y * 0.5f), dispatchSize.Y)); - - rd.YZ = Rot2(0.35f) * rd.YZ; - - float3 ro = new(time * 0.4f, 0.5f, time * 0.2f); - - float t = 0, d; - for (int i = 0; i < 96; i++) - { - d = Map(ro + (rd * t)); - - if (Hlsl.Abs(d) < 0.001f * ((t * 0.125f) + 1.0f) || t > 20.0f) - { - break; - } - - t += ((Hlsl.Step(1.0f, t) * 0.3f) + 0.7f) * d; - } - - float3 sp = ro + (rd * t); - float3 ld = new(-0.676f, 0.408f, 0.613f); - float edge = 0; - float3 n = Normal(sp, ref edge, dispatchSize.Y); - float dif = Hlsl.Max(Hlsl.Dot(ld, n), 0.0f); - float spe = Hlsl.Pow(Hlsl.Max(Hlsl.Dot(Hlsl.Reflect(rd, n), ld), 0.0f), 16.0f); - float sh = HMap(sp.XZ); - float rnd = (Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(Hlsl.Floor(sp.XZ * 512.0f), new float2(41.73f, 289.67f))) * 43758.5453f) * 0.5f) + 0.5f; - float3 fog = Hlsl.Lerp(new float3(0.75f, 0.77f, 0.78f), new float3(1.04f, 0.95f, 0.87f), Hlsl.Pow(1.0f + Hlsl.Dot(rd, ld), 3.0f) * 0.35f); - float3 c = Hlsl.Lerp(((new float3(1.1f, 1.05f, 1) * rnd * (dif + 0.1f) * sh) + (fog * spe)) * (1.0f - (edge * 0.7f)), fog * fog, Hlsl.Min(1.0f, t * 0.3f)); - - return new(c, 1); - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.Shaders.D2D1/TriangleGridContouring.cs b/samples/ComputeSharp.SwapChain.Shaders.D2D1/TriangleGridContouring.cs deleted file mode 100644 index ec84aa37..00000000 --- a/samples/ComputeSharp.SwapChain.Shaders.D2D1/TriangleGridContouring.cs +++ /dev/null @@ -1,302 +0,0 @@ -using ComputeSharp.D2D1; - -namespace ComputeSharp.SwapChain.Shaders.D2D1; - -/// -/// Utilizing a 2D simplex grid to construct the isolines of a noise function. -/// Ported from . -/// Created by Shane. -/// -/// The current time since the start of the application. -/// The dispatch size for the current output. -[D2DInputCount(0)] -[D2DRequiresScenePosition] -[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)] -[D2DGeneratedPixelShaderDescriptor] -internal readonly partial struct TriangleGridContouring(float time, int2 dispatchSize) : ID2D1PixelShader -{ - // Standard 2D rotation formula. - private static float2x2 Rotate2x2(in float a) - { - float c = Hlsl.Cos(a); - float s = Hlsl.Sin(a); - - return new(c, -s, s, c); - } - - // float2 to float2 hash. - private float2 Hash22(float2 p) - { - float n = Hlsl.Sin(Hlsl.Dot(p, new float2(41, 289))); - - p = Hlsl.Frac(new float2(262144, 32768) * n); - - return Hlsl.Sin((p * 6.2831853f) + time); - } - - // Based on IQ's gradient noise formula. - private float N2D3G(float2 p) - { - float2 i = Hlsl.Floor(p); - - p -= i; - - float4 v = default; - - v.X = Hlsl.Dot(Hash22(i), p); - v.Y = Hlsl.Dot(Hash22(i + float2.UnitX), p - float2.UnitX); - v.Z = Hlsl.Dot(Hash22(i + float2.UnitY), p - float2.UnitY); - v.W = Hlsl.Dot(Hash22(i + 1.0f), p - 1.0f); - - p = p * p * p * ((p * ((p * 6.0f) - 15.0f)) + 10.0f); - - return Hlsl.Lerp(Hlsl.Lerp(v.X, v.Y, p.X), Hlsl.Lerp(v.Z, v.W, p.X), p.Y); - } - - // The isofunction. Just a Hlsl.Single noise function, but it can be more elaborate. - private float IsoFunction(in float2 p) - { - return N2D3G((p / 4.0f) + 0.07f); - } - - // Unsigned distance to the segment joining "a" and "b". - private static float DistLine(float2 a, float2 b) - { - b = a - b; - - float h = Hlsl.Clamp(Hlsl.Dot(a, b) / Hlsl.Dot(b, b), 0.0f, 1.0f); - - return Hlsl.Length(a - (b * h)); - } - - // Based on IQ's signed distance to the segment joining "a" and "b". - private static float DistEdge(float2 a, float2 b) - { - return Hlsl.Dot((a + b) * 0.5f, Hlsl.Normalize((b - a).YX * new float2(-1, 1))); - } - - // Interpolating along the edge connecting vertices v1 and v2 with respect to the isovalue. - private static float2 Interpolate(in float2 p1, in float2 p2, float v1, float v2, float isovalue) - { - return Hlsl.Lerp(p1, p2, ((isovalue - v1) / (v2 - v1) * 0.75f) + (0.25f / 2.0f)); - } - - // Isoline function. - private static int IsoLine( - float3 n3, - float2 ip0, - float2 ip1, - float2 ip2, - float isovalue, - float i, - ref float2 p0, - ref float2 p1) - { - p0 = 1e5f; - p1 = 1e5f; - - int iTh = 0; - - if (n3.X > isovalue) - { - iTh += 4; - } - - if (n3.Y > isovalue) - { - iTh += 2; - } - - if (n3.Z > isovalue) - { - iTh += 1; - } - - if (iTh == 1 || iTh == 6) - { - p0 = Interpolate(ip1, ip2, n3.Y, n3.Z, isovalue); - p1 = Interpolate(ip2, ip0, n3.Z, n3.X, isovalue); - - } - else if (iTh == 2 || iTh == 5) - { - p0 = Interpolate(ip0, ip1, n3.X, n3.Y, isovalue); - p1 = Interpolate(ip1, ip2, n3.Y, n3.Z, isovalue); - - } - else if (iTh == 3 || iTh == 4) - { - p0 = Interpolate(ip0, ip1, n3.X, n3.Y, isovalue); - p1 = Interpolate(ip2, ip0, n3.Z, n3.X, isovalue); - } - - if (iTh >= 4 && iTh <= 6) - { - float2 tmp = p0; - - p0 = p1; - p1 = tmp; - } - - if (i == 0.0f) - { - float2 tmp = p0; - - p0 = p1; - p1 = tmp; - } - - return iTh; - } - - private float3 SimplexContour(float2 p) - { - const float gSc = 8.0f; - - p *= gSc; - - float2 oP = p; - - p += new float2(N2D3G(p * 3.5f), N2D3G((p * 3.5f) + 7.3f)) * 0.015f; - - float2 s = Hlsl.Floor(p + ((p.X + p.Y) * 0.36602540378f)); - - p -= s - ((s.X + s.Y) * 0.211324865f); - - float i = p.X < p.Y ? 1.0f : 0.0f; - float2 ioffs = new(1.0f - i, i); - float2 ip0 = 0; - float2 ip1 = ioffs - 0.2113248654f; - float2 ip2 = 0.577350269f; - float2 ctr = (ip0 + ip1 + ip2) / 3.0f; - - ip0 -= ctr; - ip1 -= ctr; - ip2 -= ctr; - p -= ctr; - - float3 n3 = default; - - n3.X = IsoFunction(s); - n3.Y = IsoFunction(s + ioffs); - n3.Z = IsoFunction(s + 1.0f); - - float d = 1e5f; - float d2 = 1e5f; - float d3 = 1e5f; - float d4 = 1e5f; - float d5 = 1e5f; - float isovalue = 0; - float2 p0 = default; - float2 p1 = default; - int iTh = IsoLine(n3, ip0, ip1, ip2, isovalue, i, ref p0, ref p1); - - d = Hlsl.Min(d, DistEdge(p - p0, p - p1)); - - if (iTh == 7) - { - d = 0; - } - - d3 = Hlsl.Min(d3, DistLine(p - p0, p - p1)); - d4 = Hlsl.Min(d4, Hlsl.Min(Hlsl.Length(p - p0), Hlsl.Length(p - p1))); - - float tri = Hlsl.Min(Hlsl.Min(DistLine(p - ip0, p - ip1), DistLine(p - ip1, p - ip2)), DistLine(p - ip2, p - ip0)); - - d5 = Hlsl.Min(d5, tri); - d5 = Hlsl.Min(d5, Hlsl.Length(p) - 0.02f); - isovalue = -0.15f; - - int iTh2 = IsoLine(n3, ip0, ip1, ip2, isovalue, i, ref p0, ref p1); - - d2 = Hlsl.Min(d2, DistEdge(p - p0, p - p1)); - - if (iTh2 == 7) - { - d2 = 0.0f; - } - - if (iTh == 7) - { - d2 = 1e5f; - } - - d2 = Hlsl.Max(d2, -d); - d3 = Hlsl.Min(d3, DistLine(p - p0, p - p1)); - d4 = Hlsl.Min(d4, Hlsl.Min(Hlsl.Length(p - p0), Hlsl.Length(p - p1))); - d4 -= 0.075f; - d3 -= 0.0125f; - d /= gSc; - d2 /= gSc; - d3 /= gSc; - d4 /= gSc; - d5 /= gSc; - - float3 col = new(1, 0.85f, 0.6f); - float sf = 0.004f; - - if (d > 0.0f && d2 > 0.0f) - { - col = new float3(1, 1.8f, 3) * 0.45f; - } - - if (d > 0.0f) - { - col = Hlsl.Lerp(col, new float3(1, 1.85f, 3) * 0.3f, 1.0f - Hlsl.SmoothStep(0.0f, sf, d2 - 0.012f)); - } - - col = Hlsl.Lerp(col, new float3(1.1f, 0.85f, 0.6f), 1.0f - Hlsl.SmoothStep(0.0f, sf, d2)); - col = Hlsl.Lerp(col, new float3(1.5f, 0.9f, 0.6f) * 0.6f, 1.0f - Hlsl.SmoothStep(0.0f, sf, d - 0.012f)); - col = Hlsl.Lerp(col, new float3(1, 0.8f, 0.6f) * new float3(0.7f, 1.0f, 0.75f) * 0.95f, 1.0f - Hlsl.SmoothStep(0.0f, sf, d)); - - if (d2 > 0.0f) - { - col *= ((Hlsl.Abs(Hlsl.Dot(n3, float3.One)) * 1.25f) + 1.25f) / 2.0f; - } - else - { - col *= Hlsl.Max(2.0f - ((Hlsl.Dot(n3, float3.One) + 1.45f) / 1.25f), 0.0f); - } - - float pat = Hlsl.Abs(Hlsl.Frac((tri * 12.5f) + 0.4f) - 0.5f) * 2.0f; - - col *= (pat * 0.425f) + 0.75f; - col = Hlsl.Lerp(col, float3.Zero, (1.0f - Hlsl.SmoothStep(0.0f, sf, d5)) * 0.95f); - col = Hlsl.Lerp(col, float3.Zero, 1.0f - Hlsl.SmoothStep(0.0f, sf, d3)); - col = Hlsl.Lerp(col, float3.Zero, 1.0f - Hlsl.SmoothStep(0.0f, sf, d4)); - col = Hlsl.Lerp(col, float3.One, 1.0f - Hlsl.SmoothStep(0.0f, sf, d4 + 0.005f)); - - float2 q = oP * 1.5f; - - col = Hlsl.Min(col, 1.0f); - - float gr = Hlsl.Sqrt(Hlsl.Dot(col, new float3(0.299f, 0.587f, 0.114f))) * 1.25f; - float ns = (((N2D3G(q * 4.0f * new float2(1.0f / 3.0f, 3)) * 0.64f) + (N2D3G(q * 8.0f * new float2(1.0f / 3.0f, 3)) * 0.34f)) * 0.5f) + 0.5f; - - ns = gr - ns; - q = Hlsl.Mul(q, Rotate2x2(3.14159f / 3.0f)); - - float ns2 = (((N2D3G(q * 4.0f * new float2(1.0f / 3.0f, 3)) * 0.64f) + (N2D3G(q * 8.0f * new float2(1.0f / 3.0f, 3)) * 0.34f)) * 0.5f) + 0.5f; - - ns2 = gr - ns2; - ns = Hlsl.SmoothStep(0.0f, 1.0f, Hlsl.Min(ns, ns2)); - col = Hlsl.Lerp(col, col * (ns + 0.35f), 0.4f); - - return col; - } - - /// - public float4 Execute() - { - int2 xy = (int2)D2D.GetScenePosition().XY; - int2 coordinate = new(xy.X, dispatchSize.Y - xy.Y); - float2 uv = (coordinate - ((float2)dispatchSize * 0.5f)) / Hlsl.Min(650.0f, dispatchSize.Y); - float2 p = Hlsl.Mul(Rotate2x2(3.14159f / 12.0f), uv) + (new float2(0.8660254f, 0.5f) * time / 16.0f); - float3 col = SimplexContour(p); - - uv = coordinate / (float2)dispatchSize; - col *= Hlsl.Pow(Hlsl.Abs(16.0f * uv.X * uv.Y * (1.0f - uv.X) * (1.0f - uv.Y)), 0.0625f) + 0.1f; - - return new(Hlsl.Sqrt(Hlsl.Max(col, 0.0f)), 1); - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.Shaders.D2D1/TwoTiledTruchet.cs b/samples/ComputeSharp.SwapChain.Shaders.D2D1/TwoTiledTruchet.cs deleted file mode 100644 index 441787b8..00000000 --- a/samples/ComputeSharp.SwapChain.Shaders.D2D1/TwoTiledTruchet.cs +++ /dev/null @@ -1,146 +0,0 @@ -using ComputeSharp.D2D1; - -namespace ComputeSharp.SwapChain.Shaders.D2D1; - -/// -/// A shader creating an animated two-tiles Truchet arrangement. -/// Ported from . -/// Created by Shane. -/// -/// The current time since the start of the application. -/// The dispatch size for the current output. -[D2DInputCount(0)] -[D2DRequiresScenePosition] -[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)] -[D2DGeneratedPixelShaderDescriptor] -internal readonly partial struct TwoTiledTruchet(float time, int2 dispatchSize) : ID2D1PixelShader -{ - /// - /// Calculates the Truchet distance field. - /// - /// The input value to compute the distance field for. - /// The resulting Truchet angle. - /// The distance field for the input value. - private float2 DistanceField(float2 p, out float2 ang) - { - // Fast hash for a pair of floats - static float Hash21(float2 p) - { - return Hlsl.Frac(Hlsl.Sin(Hlsl.Dot(p, new float2(27.619f, 57.583f))) * 43758.5453f); - } - - // HLSL's port of the GLSL mod intrinsic - static float Mod(float x, float y) - { - return x - (y * Hlsl.Floor(x / y)); - } - - float2 ip2 = Hlsl.Floor(p / 2.0f); - float2 ip = Hlsl.Floor(p); - float rnd = Hash21(ip); - float rnd3 = Hash21(ip + 0.57f); - float2 d = 1e5f; - - p -= ip + 0.5f; - - if (Mod(ip2.X + ip2.Y, 2.0f) < 0.5f) - { - d = Hlsl.Abs(p); - ang = p.YX; - - if (Mod(ip.X + 1.0f, 2.0f) < 0.5f) - { - ang.X *= -1.0f; - - } - - if (Mod(ip.Y + 1.0f, 2.0f) > 0.5f) - { - ang.Y *= -1.0f; - } - - if (rnd3 < 0.5f) - { - d = d.YX; - ang = ang.YX; - } - - ang += 0.5f; - ang *= 3.0f; - - } - else - { - if (rnd < 0.5f) - { - p = p.YX * new float2(1, -1); - } - - d.X = Hlsl.Length(p - 0.5f) - 0.5f; - d.Y = Hlsl.Length(p + 0.5f) - 0.5f; - - d = Hlsl.Abs(d); - - ang = 0; - ang.X = -Hlsl.Atan((p.Y - 0.5f) / (p.X - 0.5f)); - ang.Y = -Hlsl.Atan((p.Y + 0.5f) / (p.X + 0.5f)); - - if (Mod(ip.X + ip.Y, 2.0f) < 0.5f) - { - ang *= -1.0f; - } - - if (rnd < 0.5f) - { - ang *= -1.0f; - } - - if (rnd3 < 0.5f) - { - d = d.YX; - ang = ang.YX; - } - - ang *= 4.0f / 6.2831853f; - ang *= 2.0f; - } - - ang = Hlsl.Frac(ang + (time / 4.0f)); - - return d; - } - - /// - public float4 Execute() - { - int2 xy = (int2)D2D.GetScenePosition().XY; - float2 uv = (xy - ((float2)dispatchSize * 0.5f)) / dispatchSize.Y; - float gSc = 7.0f; - float2 p = (uv * gSc) - (new float2(-1, -0.5f) * time / 2.0f); - float sf = 2.0f / dispatchSize.Y * gSc; - float lSc = 6.0f; - float lw = 1.0f / lSc / gSc; - float2 d = DistanceField(p, out float2 ang) - (2.5f / lSc); - float3 col = new(1.0f, 0.9f, 0.8f); - - for (int i = 0; i < 2; i++) - { - float di = d[i] - (lw / 4.0f); - float tracks = Hlsl.Clamp(Hlsl.Sin((ang[i] * 6.2831f) + (time * 6.0f)) * 4.0f, 0.0f, 1.0f); - float gap = 1.0f + lw; - - col = Hlsl.Lerp(col, 0, (1.0f - Hlsl.SmoothStep(0.0f, sf * 6.0f, di)) * 0.35f); - col = Hlsl.Lerp(col, 0, 1.0f - Hlsl.SmoothStep(0.0f, sf, di)); - col = Hlsl.Lerp(col, new(1.0f, 0.9f, 0.8f), 1.0f - Hlsl.SmoothStep(0.0f, sf, di + (lw * 2.0f))); - col = Hlsl.Lerp(col, 0, 1.0f - Hlsl.SmoothStep(0.0f, sf, di + (gap / lSc))); - col = Hlsl.Lerp(col, 1, 1.0f - Hlsl.SmoothStep(0.0f, sf, di + (gap / lSc) + lw)); - col = Hlsl.Lerp(col, 0, 1.0f - Hlsl.SmoothStep(0.0f, sf, di + (2.0f * gap / lSc))); - col = Hlsl.Lerp(col, 1 * tracks, 1.0f - Hlsl.SmoothStep(0.0f, sf, di + (2.0f * gap / lSc) + lw)); - } - - float3 rgb = Hlsl.Sqrt(Hlsl.Max(col, 0.0f)); - float4 color = new(rgb.X, rgb.Y, rgb.Z, 1.0f); - - return color; - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/LargeTile.scale-100.png b/samples/ComputeSharp.SwapChain.UI/Assets/LargeTile.scale-100.png deleted file mode 100644 index d6c0045a18e1712e0796bb81a30f3ed11a917fbd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3731 zcmdT{`CAg$8pg44sZm?CajVHDOA{>&b=*s@N^YrXflF#uDyWHAid$n=GgeNyM?z&v z=0<{`CeqNTlc*?eETXyK8Y*fKZd{ss|AP5p?sI=Q&wHNpJ?Hzr_dD-*o^yWj_He!~BMV@DKHRu$o_%E@>l=^(MqmG)iB0_Gr7_B;csJcDRD(}YJd8wxA8Fu`!_Kt8E%dN>;I5LumEeV=E zy#DE?Evs{5YUS4Fl5X)*CuC&+L?kkSWg#+_M&CHg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pEgwYc}EJWM~LfcfJ?(9TN z>haOPj;~pRPUgWImz?E1F{-?n+;vX*5Ql7{rH=R!9)K|kHzx&JlJW`E5_xea668du z4#NZ9CX{r+)wmFL4frCkIV3n*Ck6`Cg}Smwy36DgnyK66bMeW>?kkOP*9=0@*0}&+q7kLH-Z}OO&|WU3fzbwO#5w+%C~O!Vd@6f{mbj(NSUpi%q Z30fl`XxP4b`7aaT=IrTIbNbTH{|4fyR5Jho diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/LargeTile.scale-125.png b/samples/ComputeSharp.SwapChain.UI/Assets/LargeTile.scale-125.png deleted file mode 100644 index 5122e6515f3915cdd52580936ce9cc6c2681c66b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4448 zcmds5`#Y3d8-DquA%|h_2!n}|ozqsDJwnMlwA~ciFGZ_m*Dnl zl^r)yEI-70b^XqNeictS^V5Yp>ZjmD<8dRX?`5rN!JiO;#y_9s_ptf15UsLlofiWbFg~6;XCS~C6aW|C1uUSz6(V3H&IkM#4*ci;1!~9Y4EtOlGi83$ z7yn#?xF^;e(iuDP{Yq9A97em}R%?!!-mq?YJpVgD`<@xP7aGhen;74SAuGS}w-miS z4{66n_N@AZMrj>P*2h2n(QQCJsZXF+5V4qZuwbeZx=KPlSk}T6Koc zTJX|6b@EI&?E6vi&mpLUa>0&S1rgH5g3s_QW60?ZOzu7FDiP2-Qu1~6GAAAsH-ZxlTkfbzKn>0@_nAPLu}=dJgj@f{@71pE!qo}^?N78Y2uWz zuRnI6OdMjla0uXg%VzGiSwc-Sv)S%X>}JIis(!e`+N&BkFkXa%rjXcHT#2Ua$b7n= zpuNyNUoHkKmKx?6ofN4i!21fDvFw~t{HT)5{fBs_fS6M#q z7Nl}>YaAn}6!y@7S*tZ3FjH|B1w_H|E6&oUX`2d>brQ#)_TklJNwI zhxwNDM;-lL%TFY!>kKSr;Ib;~C=40&B53|Kr|9gQ9)#D3$<%SST()d5S43T5;MbGp^q#r(Q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O>GL*#9u$RCA;7#k(3kFx zh$mLtE~jFmv^g)yIsbZN)C6gFI$uo+t7>{_XgoyXK}w;JK{FR5#z5L?C~)eN=VK+U zlVEi!0_{${>tg&z?civ&VZXkh)^b3g56qxaKMZRuR~j@RVrF~MmqsPkT27csx$9Oh$ZU05e=nlJ8}?VFrEM& zR7uw)m_|`)S3Oy{h6w*K^9^bIqFl-71jN|QRYWF03RThvN;fR1|Hm|5h5eNH>5XJH zDgFhFTM=q_EGr-Wp&Vw8aj`5s##dxjPf>g@%n4&2_0s`4K7PDMEHaM*s9r*qxJ)?U zhCphboP*4HHHcLe^B?tU%w(C(q|JoEybOeg_&l8ij9I;RXC}UVuFDw%HF@nCbf9C> zSCt$32>#=vYjTD$3^;(h$C PUnYQssg+5Eu_y6=>X(0g diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/LargeTile.scale-150.png b/samples/ComputeSharp.SwapChain.UI/Assets/LargeTile.scale-150.png deleted file mode 100644 index 53a9bc92124fad42ecffd739473dd252cdcea11b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5036 zcmeHLi&v6ayML+F#+fuGlhV?n8ZlF*883;URH%ueX{BkRUFJ*FQ7lmtH7vgpHFFHh z$@_p>j;WQ{1-#UlT{Kj@p_r03Du_q|l6b-IrE~s+v(|Uk`PNyBXR-FP_kQ-Xf6wpt zyf365^>SaQZ=w$Xz&ek^SYH5u@U*s87xdV*q!xf*-$Wk{hyeiOU0Q>9`0o4+02_im zum_G`DwGbBX#bcbyqFE07*TWR6_z`Fdf0de>z%v)@QAiNzS<*X&-`v{{RDsP0ouXf zxgyys81ALtsg7E=$F@TtK7K9E^_(MvHE)7I?m5d@e>_IPJBgSOlZ;I zF9lp=OlPw?>Fw~{0NsweP7Yr`x5$2YDOK~=ZROiUVUKbIm>j5bnZK~mD_e=h znZ}p19^dJfpEm1VGE7=|OTC9B`((gG$RM^0TJ8+h$*;33tROGDTV`pVZpx{FWpl?a z{INECRxN*MQaJ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Ou;mge1D2WCh|=;TDE`#N_B`v_K&D`PqZRYyVg z4aPJgFmKX{!*YbJ@HfrrU$*IYU4RSzxgUvQ3zWgYX9IAq?GRg$z*~Agiok?|Loe$r z`=5~dU1z{`Nqolb23tYR6$B{*{CosZ<8Bs7td23#t@vOE$#2iRoA4L2Y#dg(+un367rPb1RX5_o;Ny4vD{ zpq<0Ad=i4mC%Kt-B$*~TtH|lJCs)dO0LlYf5EmZIn*Xrb4Jg{qz_&+am?5+L%(^%F zq|~hE*}r9W?KiRJ!y+l6z_Vj;f$?~QNCG~N08%RL$pPoGQ#M(COQ`cb+N-UD3v|cl z7$88Y1duOVw=*Jh{A1pwk>5CchlQXHVu#=%!?(O`e$v+weFu%qV!|13JegZFEHQdC z;;Hu&p3LzLH!6nSbrS)p1tap7dkL5_bx3BLjjzZz3dnyf43Vp&=8?Zda{rj87Mt+Z7-(R7@isavHe z=ebR|LIQEvq20oI@PM1~pc1|gv)vSP47Wdk>RpU#yDC3&K!<|y6%=Q3QRn1f#&DneTR__^s#Jyp6~(nDk`gRqr!bvHnSm zb2Ym*k-)o{%&UmkO*w+)loi5~8^w*lX)i2?vA--L%r?ay%Bw+m+XPllxEjWB!EGtD zI1dob*GXS@0Z{3!q*%}Aw)t0Av98eK+I;N3x6X5O0u_EeotXDk;TD_l@wd*g0q*y_ z8c^U#hvTWI4na)r>|h7pj1pZ>y2uj{EY}6c?}L?Es&)7Eh{J0pSIWeHm$FsAdA)6J mXlN3RVh=;|AKP+NROznV(<>NT0{HhE;Nj|ptvPu5>c0S{yVn)~ diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/LargeTile.scale-200.png b/samples/ComputeSharp.SwapChain.UI/Assets/LargeTile.scale-200.png deleted file mode 100644 index cc8b55f3a0019ca435cc6536e8098a8cd23d018a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6906 zcmeHM_g9nI)_zf>Dpdgi1A+yWA|j!K&QN6l5eZ-b188W0ND0Nz#8D|i92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AWhShz#Kkmz(I%J zkrCJnLq(b@15Fz&0K}?zJWGNTED-c#&VyJ5b&AxoHd6JWz1QgPe4-%Rkn)(F+=7@9 z4M=C_C&S5yanF;m2D}jP;1~y3Lh_6ZKzQD`s44(8Pr~y{nh`OwbA5}az?_dZ=+z^~ z?(ROPeq9NArvfMDN6lqDJH5SB-{GUDb9 zk`MACz%CnJu{4qGH z7}RaSDvv_MW?(leW1%jMQ>4Qft7ny(BPz z=BlqpN6%)#@ZbiByQiW&i57?iwJebI$qjHg?JY?9G{i72AO#nur7Y1NrU<9j`vJ;M z2ZvkN*uw=(^_(~hI9shoQ3|QO@dS8` zqLD4hV@Blv;Wslesm0EoNEL=j9K%(oG(!9t%gz?NcC z%j7=e{3)MXJQKJ)OCZC~|Caj}6#ggC%xmz`i*`tcp0MH6j4wIqLOxRSN-b>yiRK?KIwfWF?kusQ4~Mkr+x6^F zy~CDX2QIMs&Gcs3RnRBoxBA!*(Mfw0KTCYuYk0WlEIV>qBmPl! zq4ukrvfADX@#p8fbLY(H47N+k`FZ(FZh?cDro7>{8mkBO3>^oaIx`3!Jl)Qq)HI!+ z(S=1{o~eT)&W^=Ea8C`-17(Jv5(nHFJ{dOjGdxLVkY_y6&S1whfuFI4MM0kF0f&cO zPDVpV%nz;Id$>+0Ga5e9625-JcI)oq=#Pa3p^>8BB}21BUw@eN!-6@w%X+^`+Vn?! zryu|3T>kVWNBYyBc=7Y6H#s1Ah!OI_nezW zXTqOdkv2Az6KKBV=$yHdF^R3Fqw(TZEoNSZX>reXJ#bwX42%f|Pgg&ebxsLQ010xn AssI20 diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Misc/noise_low.png b/samples/ComputeSharp.SwapChain.UI/Assets/Misc/noise_low.png deleted file mode 100644 index 0784c124212467f24b49eb49c5604b52c7e6a3da..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 213131 zcmWifd0Z3M`ncP=)gq#GNkxHry;tm2N&O-sgr&;0wATvussve*inm18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oeI@UR9MD7=1yJ6Fh>>NaR%1_mP#h6P#z?;RuG0Dym44tVrxk#%4BYcR|4J( z7QQ_St9!U7flt>eMm!g0co(;_kMWdqdtGCy9?DbBy*XF>`5waO1jfo-FcE{YF9-^F z>pxP^Prw)&!65lN`A--D=9e^

-/// A custom that can be used to render animated backgrounds via Win2D. -/// -[TemplatePart(Name = "PART_CanvasAnimatedControl", Type = typeof(CanvasAnimatedControl))] -public sealed partial class D2D1AnimatedPixelShaderPanel : Control -{ - /// - /// The backing . - /// - public static readonly DependencyProperty PixelShaderEffectProperty = DependencyProperty.Register( - nameof(PixelShaderEffect), - typeof(PixelShaderEffect), - typeof(D2D1AnimatedPixelShaderPanel), - new PropertyMetadata(null, OnPixelShaderEffectPropertyChanged)); - - /// - /// The backing . - /// - public static readonly DependencyProperty IsPausedProperty = DependencyProperty.Register( - nameof(IsPaused), - typeof(bool), - typeof(D2D1AnimatedPixelShaderPanel), - new PropertyMetadata(false, OnIsPausedPropertyChanged)); - - /// - /// The wrapped instance used to render frames. - /// - private CanvasAnimatedControl? canvasAnimatedControl; - - /// - /// The instance currently in use, if any. - /// - private volatile PixelShaderEffect? pixelShaderEffect; - - /// - /// Creates a new instance. - /// - public D2D1AnimatedPixelShaderPanel() - { - DefaultStyleKey = typeof(D2D1AnimatedPixelShaderPanel); - - Loaded += D2D1AnimatedPixelShaderPanel_Loaded; - Unloaded += D2D1AnimatedPixelShaderPanel_Unloaded; - } - - /// - /// Gets or sets the instance to use to render content. - /// - public PixelShaderEffect? PixelShaderEffect - { - get => (PixelShaderEffect?)GetValue(PixelShaderEffectProperty); - set => SetValue(PixelShaderEffectProperty, value); - } - - /// - /// Gets or sets whether or not the rendering is paused. - /// - public bool IsPaused - { - get => (bool)GetValue(IsPausedProperty); - set => SetValue(IsPausedProperty, value); - } - - /// - protected override void OnApplyTemplate() - { - base.OnApplyTemplate(); - - this.canvasAnimatedControl = (CanvasAnimatedControl)GetTemplateChild("PART_CanvasAnimatedControl")!; - this.canvasAnimatedControl.Draw += CanvasAnimatedControl_Draw; - } - - // Ensure the panel is not paused when the control is loaded - private void D2D1AnimatedPixelShaderPanel_Loaded(object sender, RoutedEventArgs e) - { - if (this.canvasAnimatedControl is { } canvasAnimatedControl && - PixelShaderEffect is not null && - !IsPaused) - { - canvasAnimatedControl.Paused = false; - } - } - - // Always pause rendering when the control is unloaded - private void D2D1AnimatedPixelShaderPanel_Unloaded(object sender, RoutedEventArgs e) - { - if (this.canvasAnimatedControl is { } canvasAnimatedControl) - { - canvasAnimatedControl.Paused = true; - } - } - - /// - /// Draws a new frame on the wrapped instance. - /// - /// The source instance. - /// The object to perform drawing with. - private void CanvasAnimatedControl_Draw(ICanvasAnimatedControl sender, CanvasAnimatedDrawEventArgs args) - { - // Set the effect properties - this.pixelShaderEffect!.ElapsedTime = args.Timing.TotalTime; - this.pixelShaderEffect.ScreenWidth = sender.ConvertDipsToPixels((float)sender.Size.Width, CanvasDpiRounding.Round); - this.pixelShaderEffect.ScreenHeight = sender.ConvertDipsToPixels((float)sender.Size.Height, CanvasDpiRounding.Round); - - // Draw the effect - args.DrawingSession.DrawImage(this.pixelShaderEffect); - } - - /// - private static void OnPixelShaderEffectPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - D2D1AnimatedPixelShaderPanel @this = (D2D1AnimatedPixelShaderPanel)d; - PixelShaderEffect? pixelShaderEffect = (PixelShaderEffect?)e.NewValue; - - // Save the new pixel shader effect for later (as the dependency property cannot be accessed by the render thread) - @this.pixelShaderEffect = pixelShaderEffect; - - // Pause or start the render thread if an effect is available - if (@this.canvasAnimatedControl is { } canvasAnimatedControl) - { - bool shouldRender = @this.IsLoaded && !@this.IsPaused && pixelShaderEffect is not null; - - canvasAnimatedControl.Paused = !shouldRender; - } - } - - /// - private static void OnIsPausedPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - D2D1AnimatedPixelShaderPanel @this = (D2D1AnimatedPixelShaderPanel)d; - bool isPaused = (bool)e.NewValue; - - if (@this.canvasAnimatedControl is { } canvasAnimatedControl) - { - bool shouldRender = @this.IsLoaded && !isPaused && @this.PixelShaderEffect is not null; - - canvasAnimatedControl.Paused = !shouldRender; - } - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.UI/Converters/RenderingPauseConverter.cs b/samples/ComputeSharp.SwapChain.UI/Converters/RenderingPauseConverter.cs deleted file mode 100644 index 0888d6e1..00000000 --- a/samples/ComputeSharp.SwapChain.UI/Converters/RenderingPauseConverter.cs +++ /dev/null @@ -1,23 +0,0 @@ -#if WINDOWS_UWP -using Windows.UI.Xaml.Controls; -#else -using Microsoft.UI.Xaml.Controls; -#endif - -namespace ComputeSharp.SwapChain.Core.Converters; - -/// -/// A class with some static converters for rendering state. -/// -public static class RenderingPauseConverter -{ - /// - /// Gets a symbol for an input rendering state. - /// - /// Whether or not the rendering is currently paused. - /// A symbol representing the next action for the rendering. - public static Symbol ConvertPausedToSymbol(bool value) - { - return value ? Symbol.Play : Symbol.Pause; - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.UI/Converters/ResolutionScaleConverter.cs b/samples/ComputeSharp.SwapChain.UI/Converters/ResolutionScaleConverter.cs deleted file mode 100644 index a7be9a73..00000000 --- a/samples/ComputeSharp.SwapChain.UI/Converters/ResolutionScaleConverter.cs +++ /dev/null @@ -1,27 +0,0 @@ -namespace ComputeSharp.SwapChain.Core.Converters; - -/// -/// A class with some static converters for resolution scale settings. -/// -public static class ResolutionScaleConverter -{ - /// - /// Converts a resolution scale to a formatted string. - /// - /// The input resolution scale (in percentage). - /// A formatted percentage string for . - public static string ConvertPercentageToFormattedString(int value) - { - return $"{value}%"; - } - - /// - /// Converts a percentage value to a scaled value in the [0, 1] range. - /// - /// The input percentage value to scale. - /// The input percentage scaled to the [0, 1] range. - public static double ConvertPercentageToScale(int value) - { - return value / 100.0; - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.UI/Enums/RenderingMode.cs b/samples/ComputeSharp.SwapChain.UI/Enums/RenderingMode.cs deleted file mode 100644 index 68f0ec13..00000000 --- a/samples/ComputeSharp.SwapChain.UI/Enums/RenderingMode.cs +++ /dev/null @@ -1,17 +0,0 @@ -namespace ComputeSharp.SwapChain.Core.Enums; - -/// -/// Indicates the rendering mode being used. -/// -public enum RenderingMode -{ - /// - /// Render using DirectX 12 APIs. - /// - DirectX12, - - /// - /// Render using Win2D (ie. Direct2D behind the scenes). - /// - Win2D -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.UI/Shaders/PixelShaderEffect.cs b/samples/ComputeSharp.SwapChain.UI/Shaders/PixelShaderEffect.cs deleted file mode 100644 index a2ac4a69..00000000 --- a/samples/ComputeSharp.SwapChain.UI/Shaders/PixelShaderEffect.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; -using ComputeSharp.D2D1; -using ComputeSharp.D2D1.Descriptors; -#if WINDOWS_UWP -using ComputeSharp.D2D1.Uwp; -#else -using ComputeSharp.D2D1.WinUI; -#endif - -namespace ComputeSharp.SwapChain.Core.Shaders; - -/// -/// An base effect for an animated pixel shader. -/// -public abstract partial class PixelShaderEffect : CanvasEffect -{ - /// - /// Gets or sets the total elapsed time. - /// - [GeneratedCanvasEffectProperty] - public partial TimeSpan ElapsedTime { get; set; } - - /// - /// Gets or sets the screen width in raw pixels. - /// - [GeneratedCanvasEffectProperty] - public partial int ScreenWidth { get; set; } - - /// - /// Gets or sets the screen height in raw pixels. - /// - [GeneratedCanvasEffectProperty] - public partial int ScreenHeight { get; set; } - - /// - /// An effect for an animated pixel shader. - /// - /// The type of pixel shader to render. - /// The input factory. - public sealed partial class For(For.Factory factory) : PixelShaderEffect - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - /// - /// The node in use. - /// - private static readonly CanvasEffectNode> Effect = new(); - - /// - protected override void BuildEffectGraph(CanvasEffectGraph effectGraph) - { - effectGraph.RegisterOutputNode(Effect, new PixelShaderEffect()); - } - - /// - protected override void ConfigureEffectGraph(CanvasEffectGraph effectGraph) - { - effectGraph.GetNode(Effect).ConstantBuffer = factory(ElapsedTime, ScreenWidth, ScreenHeight); - } - - /// - /// A factory of a given shader instance. - /// - /// The total elapsed time. - /// The screen width in raw pixels. - /// The screen height in raw pixels. - /// A shader instance to render. - public delegate T Factory(TimeSpan elapsedTime, int screenWidth, int screenHeight); - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.UI/Shaders/Runners/ContouredLayersRunner.cs b/samples/ComputeSharp.SwapChain.UI/Shaders/Runners/ContouredLayersRunner.cs deleted file mode 100644 index 4c6fd817..00000000 --- a/samples/ComputeSharp.SwapChain.UI/Shaders/Runners/ContouredLayersRunner.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.IO; -using ComputeSharp.SwapChain.Shaders; -#if WINDOWS_UWP -using ComputeSharp.Uwp; -#else -using ComputeSharp.WinUI; -#endif -using Windows.ApplicationModel; - -namespace ComputeSharp.SwapChain.Core.Shaders.Runners; - -/// -/// A specialized for . -/// -public sealed class ContouredLayersRunner : IShaderRunner -{ - /// - /// A texture for \Textures\RustyMetal.png. - /// - private ReadOnlyTexture2D? texture; - - /// - public bool TryExecute(IReadWriteNormalizedTexture2D texture, TimeSpan timespan, object? parameter) - { - if (this.texture is null || - this.texture.GraphicsDevice != texture.GraphicsDevice) - { - string filename = Path.Combine(Package.Current.InstalledLocation.Path, "Assets", "Textures", "RustyMetal.png"); - - this.texture?.Dispose(); - - this.texture = texture.GraphicsDevice.LoadReadOnlyTexture2D(filename); - } - - texture.GraphicsDevice.ForEach(texture, new ContouredLayers((float)timespan.TotalSeconds, this.texture)); - - return true; - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.UI/Shaders/Runners/D2D1ContouredLayersRunner.cs b/samples/ComputeSharp.SwapChain.UI/Shaders/Runners/D2D1ContouredLayersRunner.cs deleted file mode 100644 index 5a1d5db9..00000000 --- a/samples/ComputeSharp.SwapChain.UI/Shaders/Runners/D2D1ContouredLayersRunner.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System; -using System.IO; -using ComputeSharp.D2D1; -using ComputeSharp.D2D1.Interop; -#if WINDOWS_UWP -using ComputeSharp.D2D1.Uwp; -#else -using ComputeSharp.D2D1.WinUI; -#endif -using ComputeSharp.SwapChain.Shaders.D2D1; -using Windows.ApplicationModel; - -namespace ComputeSharp.SwapChain.Core.Shaders.Runners; - -/// -/// A specialized for . -/// -public sealed partial class D2D1ContouredLayersEffect : PixelShaderEffect -{ - /// - /// The reusable node to use to render frames. - /// - private static readonly CanvasEffectNode> PixelShaderEffect = new(); - - /// - protected override unsafe void BuildEffectGraph(CanvasEffectGraph effectGraph) - { - string filename = Path.Combine(Package.Current.InstalledLocation.Path, "Assets", "Textures", "RustyMetal.png"); - - // As a temporary workaround for the lack of image decoding helpers for D2D1ResourceTextureManager, and in order to - // keep the code here synchronous and simple, we can just leverage the DirectX 12 APIs to load textures. That is, we - // first load a texture (which will use WIC behind the scenes) to get the decoded image data in GPU memory, and then - // copy the data in a readback texture we can read from on the CPU. We can't just load an upload texture and read - // from it, as that type of texture can only be written to from the CPU. From there, we create a D2D resource texture. - using ReadOnlyTexture2D readOnlyTexture = GraphicsDevice.GetDefault().LoadReadOnlyTexture2D(filename); - using ReadBackTexture2D readBackTexture = GraphicsDevice.GetDefault().AllocateReadBackTexture2D(readOnlyTexture.Width, readOnlyTexture.Height); - - readOnlyTexture.CopyTo(readBackTexture); - - // Get the buffer pointer, the stride, and calculate the buffer size without the trailing padding. - // That is, the area between the end of the data in the last row and the stride is not included. - Rgba32* dataBuffer = readBackTexture.View.DangerousGetAddressAndByteStride(out int strideInBytes); - int bufferSize = ((readBackTexture.Height - 1) * strideInBytes) + (readBackTexture.View.Width * sizeof(Rgba32)); - - // Create the resource texture manager to use in the shader - D2D1ResourceTextureManager resourceTextureManager = new( - extents: [(uint)readBackTexture.Height, (uint)readBackTexture.Width], - bufferPrecision: D2D1BufferPrecision.UInt8Normalized, - channelDepth: D2D1ChannelDepth.Four, - filter: D2D1Filter.MinMagMipLinear, - extendModes: [D2D1ExtendMode.Mirror, D2D1ExtendMode.Mirror], - data: new ReadOnlySpan(dataBuffer, bufferSize), - strides: [(uint)strideInBytes]); - - // Create the new pixel shader effect - PixelShaderEffect pixelShaderEffect = new() { ResourceTextureManagers = { [0] = resourceTextureManager } }; - - // Register the pixel shader effect as the output node in the effect graph - effectGraph.RegisterOutputNode(PixelShaderEffect, pixelShaderEffect); - } - - /// - protected override void ConfigureEffectGraph(CanvasEffectGraph effectGraph) - { - effectGraph.GetNode(PixelShaderEffect).ConstantBuffer = new ContouredLayers((float)ElapsedTime.TotalSeconds, new int2(ScreenWidth, ScreenHeight)); - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.UI/ViewModels/MainViewModel.cs b/samples/ComputeSharp.SwapChain.UI/ViewModels/MainViewModel.cs deleted file mode 100644 index 93dd68cf..00000000 --- a/samples/ComputeSharp.SwapChain.UI/ViewModels/MainViewModel.cs +++ /dev/null @@ -1,163 +0,0 @@ -using System.Collections.ObjectModel; -using CommunityToolkit.Mvvm.ComponentModel; -using CommunityToolkit.Mvvm.Input; -using ComputeSharp.SwapChain.Core.Enums; -using ComputeSharp.SwapChain.Core.Shaders; -using ComputeSharp.SwapChain.Core.Shaders.Runners; -using ComputeSharp.SwapChain.Shaders; -#if WINDOWS_UWP -using ComputeSharp.Uwp; -#else -using ComputeSharp.WinUI; -#endif - -#pragma warning disable IDE0300 // CsWinRT does not support marshalling collection expression (https://github.com/microsoft/CsWinRT/issues/1661) - -namespace ComputeSharp.SwapChain.Core.ViewModels; - -/// -/// The viewmodel for for a view that allows users to select shaders and customize settings. -/// -public sealed partial class MainViewModel : ObservableObject -{ - /// - /// Creates a new instance. - /// - public MainViewModel() - { - SelectedComputeShader = ComputeShaderOptions[0]; - } - - /// - /// Gets or sets the selected rendering mode. - /// - [ObservableProperty] - [NotifyPropertyChangedFor(nameof(IsResolutionScaleOptionEnabled))] - public partial RenderingMode SelectedRenderingMode { get; set; } = RenderingMode.DirectX12; - - /// - /// Gets or sets whether the vertical sync is enabled. - /// - [ObservableProperty] - public partial bool IsVerticalSyncEnabled { get; set; } = true; - - /// - /// Gets or sets whether the dynamic resolution is enabled. - /// - [ObservableProperty] - [NotifyPropertyChangedFor(nameof(IsResolutionScaleOptionEnabled))] - public partial bool IsDynamicResolutionEnabled { get; set; } = true; - - /// - /// Gets the currently selected resolution scale setting (as percentage value). - /// - [ObservableProperty] - public partial int SelectedResolutionScale { get; set; } = 100; - - /// - /// Gets or sets the currently selected compute shader. - /// - [ObservableProperty] - public partial ShaderRunnerViewModel SelectedComputeShader { get; set; } - - /// - /// Gets or sets whether the rendering is currently paused. - /// - [ObservableProperty] - public partial bool IsRenderingPaused { get; set; } - - /// - /// Gets the available resolution scaling options (as percentage values). - /// - public ReadOnlyCollection ResolutionScaleOptions { get; } = new((int[])[25, 50, 75, 100]); - - /// - /// Gets the collection of available compute shader. - /// - public ReadOnlyCollection ComputeShaderOptions { get; } = new((ShaderRunnerViewModel[]) - [ - new( - nameof(ColorfulInfinity), - new ShaderRunner(static time => new((float)time.TotalSeconds)), - new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))), - new( - nameof(FractalTiling), - new ShaderRunner(static time => new((float)time.TotalSeconds)), - new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))), - new( - nameof(MengerJourney), - new ShaderRunner(static time => new((float)time.TotalSeconds)), - new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))), - new( - nameof(Octagrams), - new ShaderRunner(static time => new((float)time.TotalSeconds)), - new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))), - new( - nameof(ProteanClouds), - new ShaderRunner(static time => new((float)time.TotalSeconds)), - new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))), - new( - nameof(TwoTiledTruchet), - new ShaderRunner(static time => new((float)time.TotalSeconds)), - new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))), - new( - nameof(PyramidPattern), - new ShaderRunner(static time => new((float)time.TotalSeconds)), - new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))), - new( - nameof(TriangleGridContouring), - new ShaderRunner(static time => new((float)time.TotalSeconds)), - new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))), - new(nameof(ContouredLayers), new ContouredLayersRunner(), new D2D1ContouredLayersEffect()), - new( - nameof(TerracedHills), - new ShaderRunner(static time => new((float)time.TotalSeconds)), - new PixelShaderEffect.For(static (time, width, height) => new((float)time.TotalSeconds, new int2(width, height)))), - ]); - - /// - /// Checks whether the resolution scale can currently be expliclty set. - /// - public bool IsResolutionScaleOptionEnabled => SelectedRenderingMode == RenderingMode.DirectX12 && !IsDynamicResolutionEnabled; - - /// - /// Sets . - /// - [RelayCommand] - private void SetRenderingMode(RenderingMode renderingMode) - { - SelectedRenderingMode = renderingMode; - } - - /// - /// Sets . - /// - [RelayCommand] - private void SetResolutionScale(int resolutionScale) - { - SelectedResolutionScale = resolutionScale; - } - - /// - /// Toggles . - /// - [RelayCommand] - private void ToggleRenderingPaused() - { - IsRenderingPaused = !IsRenderingPaused; - } - - /// - partial void OnSelectedComputeShaderChanging(ShaderRunnerViewModel oldValue, ShaderRunnerViewModel newValue) - { - // Known issue with partial properties: while the property is marked as not nullable, assigning it in the - // constructor will suppress the warning but cause the setter to be invoked, with 'field' being 'null'. - // As such, as need to check for that scenario here to avoid an exception. Possibly fixed in C# 14. - if (oldValue is not null) - { - oldValue.IsSelected = false; - } - - newValue.IsSelected = true; - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.UI/ViewModels/ShaderRunnerViewModel.cs b/samples/ComputeSharp.SwapChain.UI/ViewModels/ShaderRunnerViewModel.cs deleted file mode 100644 index e3db3a2d..00000000 --- a/samples/ComputeSharp.SwapChain.UI/ViewModels/ShaderRunnerViewModel.cs +++ /dev/null @@ -1,42 +0,0 @@ -using CommunityToolkit.Mvvm.ComponentModel; -using ComputeSharp.SwapChain.Core.Shaders; -#if WINDOWS_UWP -using ComputeSharp.Uwp; -#else -using ComputeSharp.WinUI; -#endif - -namespace ComputeSharp.SwapChain.Core.ViewModels; - -/// -/// A viewmodel for a compute shader. -/// -/// The name of the shader type to execute. -/// The instance to execute. -/// The instance to execute. -public sealed partial class ShaderRunnerViewModel( - string shaderType, - IShaderRunner shaderRunner, - PixelShaderEffect pixelShaderEffect) : ObservableObject -{ - /// - /// Gets the name of the shader type to execute. - /// - public string ShaderType => shaderType; - - /// - /// Gets the instance to execute. - /// - public IShaderRunner ShaderRunner => shaderRunner; - - /// - /// Gets the instance to execute. - /// - public PixelShaderEffect PixelShaderEffect => pixelShaderEffect; - - /// - /// Gets or sets whether the current shader is selected. - /// - [ObservableProperty] - public partial bool IsSelected { get; set; } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.Uwp/App.xaml b/samples/ComputeSharp.SwapChain.Uwp/App.xaml deleted file mode 100644 index 9ee3a3dc..00000000 --- a/samples/ComputeSharp.SwapChain.Uwp/App.xaml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.Uwp/App.xaml.cs b/samples/ComputeSharp.SwapChain.Uwp/App.xaml.cs deleted file mode 100644 index d60363db..00000000 --- a/samples/ComputeSharp.SwapChain.Uwp/App.xaml.cs +++ /dev/null @@ -1,72 +0,0 @@ -using ComputeSharp.SwapChain.Uwp.Views; -using Windows.ApplicationModel.Activation; -using Windows.ApplicationModel.Core; -using Windows.UI; -using Windows.UI.ViewManagement; -using Windows.UI.Xaml; - -namespace ComputeSharp.SwapChain.Uwp; - -/// -/// Provides application-specific behavior to supplement the default Application class. -/// -sealed partial class App : Application -{ - /// - /// Initializes the singleton application object. This is the first line of authored code - /// executed, and as such is the logical equivalent of main() or WinMain(). - /// - public App() - { - InitializeComponent(); - } - - /// - protected override void OnLaunched(LaunchActivatedEventArgs e) - { - if (Window.Current.Content is not MainView) - { - StyleTitleBar(); - ExpandViewIntoTitleBar(); - - Window.Current.Content = new MainView(); - } - - if (!e.PrelaunchActivated) - { - Window.Current.Activate(); - } - } - - /// - /// Styles the title bar buttons according to the theme in use - /// - private static void StyleTitleBar() - { - ApplicationViewTitleBar titleBar = ApplicationView.GetForCurrentView().TitleBar; - - // Transparent colors - titleBar.ForegroundColor = Colors.Transparent; - titleBar.BackgroundColor = Colors.Transparent; - titleBar.ButtonBackgroundColor = Colors.Transparent; - titleBar.InactiveBackgroundColor = Colors.Transparent; - titleBar.ButtonInactiveBackgroundColor = Colors.Transparent; - - // Theme aware colors - titleBar.ButtonForegroundColor = titleBar.ButtonHoverForegroundColor = titleBar.ButtonPressedForegroundColor = Colors.White; - titleBar.ButtonHoverBackgroundColor = Color.FromArgb(0x20, 0xFF, 0xFF, 0xFF); - titleBar.ButtonPressedBackgroundColor = Color.FromArgb(0x40, 0xFF, 0xFF, 0xFF); - titleBar.ButtonInactiveForegroundColor = Color.FromArgb(0xC0, 0xFF, 0xFF, 0xFF); - titleBar.InactiveForegroundColor = Color.FromArgb(0xA0, 0xA0, 0xA0, 0xA0); - } - - /// - /// Sets up the app UI to be expanded into the title bar - /// - private static void ExpandViewIntoTitleBar() - { - CoreApplicationViewTitleBar coreTitleBar = CoreApplication.GetCurrentView().TitleBar; - - coreTitleBar.ExtendViewIntoTitleBar = true; - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.Uwp/ComputeSharp.SwapChain.Uwp.csproj b/samples/ComputeSharp.SwapChain.Uwp/ComputeSharp.SwapChain.Uwp.csproj deleted file mode 100644 index 3ade76b3..00000000 --- a/samples/ComputeSharp.SwapChain.Uwp/ComputeSharp.SwapChain.Uwp.csproj +++ /dev/null @@ -1,68 +0,0 @@ - - - WinExe - net8.0-windows10.0.26100.0 - 10.0.17763.0 - true - x64;ARM64 - win-x64;win-arm64 - $(DefineConstants);WINDOWS_UWP - en-US - true - win-$(Platform).pubxml - true - - - false - - - 1.3.20250314.1 - - - - - false - true - 2 - - - - - false - true - - - - - true - true - true - false - Speed - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.Uwp/Controls/D2D1AnimatedPixelShaderPanel.xaml b/samples/ComputeSharp.SwapChain.Uwp/Controls/D2D1AnimatedPixelShaderPanel.xaml deleted file mode 100644 index b7c172e8..00000000 --- a/samples/ComputeSharp.SwapChain.Uwp/Controls/D2D1AnimatedPixelShaderPanel.xaml +++ /dev/null @@ -1,16 +0,0 @@ - - - - diff --git a/samples/ComputeSharp.SwapChain.Uwp/Package.appxmanifest b/samples/ComputeSharp.SwapChain.Uwp/Package.appxmanifest deleted file mode 100644 index f12fcf8c..00000000 --- a/samples/ComputeSharp.SwapChain.Uwp/Package.appxmanifest +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - ComputeSharp Sample App - Sergio Pedri - Assets\StoreLogo.png - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.Uwp/Properties/PublishProfiles/win-arm64.pubxml b/samples/ComputeSharp.SwapChain.Uwp/Properties/PublishProfiles/win-arm64.pubxml deleted file mode 100644 index 5de0b991..00000000 --- a/samples/ComputeSharp.SwapChain.Uwp/Properties/PublishProfiles/win-arm64.pubxml +++ /dev/null @@ -1,11 +0,0 @@ - - - - FileSystem - ARM64 - win-arm64 - bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ - true - true - - \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.Uwp/Properties/PublishProfiles/win-x64.pubxml b/samples/ComputeSharp.SwapChain.Uwp/Properties/PublishProfiles/win-x64.pubxml deleted file mode 100644 index 89844a87..00000000 --- a/samples/ComputeSharp.SwapChain.Uwp/Properties/PublishProfiles/win-x64.pubxml +++ /dev/null @@ -1,11 +0,0 @@ - - - - FileSystem - x64 - win-x64 - bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ - true - true - - \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.Uwp/Properties/launchSettings.json b/samples/ComputeSharp.SwapChain.Uwp/Properties/launchSettings.json deleted file mode 100644 index 46264d2b..00000000 --- a/samples/ComputeSharp.SwapChain.Uwp/Properties/launchSettings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "profiles": { - "ComputeSharp.SwapChain.Uwp": { - "commandName": "MsixPackage" - } - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.Uwp/Views/MainView.xaml b/samples/ComputeSharp.SwapChain.Uwp/Views/MainView.xaml deleted file mode 100644 index ec299cb0..00000000 --- a/samples/ComputeSharp.SwapChain.Uwp/Views/MainView.xaml +++ /dev/null @@ -1,281 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.Uwp/Views/MainView.xaml.cs b/samples/ComputeSharp.SwapChain.Uwp/Views/MainView.xaml.cs deleted file mode 100644 index 756d5329..00000000 --- a/samples/ComputeSharp.SwapChain.Uwp/Views/MainView.xaml.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System; -using ComputeSharp.Uwp; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -using Windows.UI.Xaml.Input; - -namespace ComputeSharp.SwapChain.Uwp.Views; - -/// -/// A view for . -/// -public sealed partial class MainView : UserControl -{ - public MainView() - { - InitializeComponent(); - } - - // Opens the shader selection panel - private void OpenShaderSelectionPanelButton_Click(object sender, RoutedEventArgs e) - { - _ = this.Root.Resources.Remove(nameof(this.ShaderSelectionPanel)); - - this.Root.Children.Add(this.ShaderSelectionPanel); - } - - // Hides the shader selection panel - private void ShaderSelectionPanel_Tapped(object sender, TappedRoutedEventArgs e) - { - _ = this.Root.Children.Remove(this.ShaderSelectionPanel); - } - - // Updates the size of the shaders list panel - private void UserControl_SizeChanged(object sender, SizeChangedEventArgs e) - { - this.ShadersListContainerPanel.Height = Math.Round(e.NewSize.Height * 0.35); - } - - // Logs rendering failed in the main panel - private void MainShaderPanel_RenderingFailed(AnimatedComputeShaderPanel sender, RenderingFailedEventArgs args) - { - this.RenderingErrorInfoBar.IsOpen = true; - } - - // Logs rendering failed in a secondary panel - private void SelectionShaderPanel_RenderingFailed(AnimatedComputeShaderPanel sender, RenderingFailedEventArgs args) - { - this.RenderingErrorInfoBar.IsOpen = true; - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.WinUI/App.xaml b/samples/ComputeSharp.SwapChain.WinUI/App.xaml deleted file mode 100644 index 4e2888ba..00000000 --- a/samples/ComputeSharp.SwapChain.WinUI/App.xaml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - - - - - - diff --git a/samples/ComputeSharp.SwapChain.WinUI/App.xaml.cs b/samples/ComputeSharp.SwapChain.WinUI/App.xaml.cs deleted file mode 100644 index c4a547d4..00000000 --- a/samples/ComputeSharp.SwapChain.WinUI/App.xaml.cs +++ /dev/null @@ -1,54 +0,0 @@ -using System; -using System.Threading; -using ComputeSharp.SwapChain.WinUI.Views; -using Microsoft.UI.Xaml; - -#pragma warning disable CA1001, IDE0052 - -namespace ComputeSharp.SwapChain.WinUI; - -/// -/// Provides application-specific behavior to supplement the default Application class. -/// -public sealed partial class App : Application -{ - /// - /// The main application window - /// - private MainWindow? mainWindow; - - /// - /// A timer to force shutdown after a given amount of time. - /// - /// This field is needed to keep the timer alive. - private Timer? shutdownTimer; - - /// - /// Initializes the singleton application object. This is the first line of authored code - /// executed, and as such is the logical equivalent of main() or WinMain(). - /// - public App() - { - InitializeComponent(); - } - - /// - protected override void OnLaunched(LaunchActivatedEventArgs args) - { - this.mainWindow = new MainWindow(); - this.mainWindow.Closed += (_, _) => - { - // Due to an issue (https://discord.com/channels/372137812037730304/663434534087426129/979543152853663744), the WinUI 3 app - // will keep running after the window is closed if any render thread is still going. To work around this, each loaded shader - // panel is tracked in a conditional weak table, and then when the window is closed they're all manually stopped by setting - // their shader runners to null. After this, the app should just be able to close automatically when the panels are done. - this.mainWindow.OnShutdown(); - - // For good measure, also start a timer of one second. If the app is still alive by then (ie. if the timer callback is - // executed at all), then just force the whole process to terminate, and exit with the E_APPLICATION_EXITING error code. - this.shutdownTimer = new Timer(_ => Environment.Exit(unchecked((int)0x8000001A)), this, 1000, Timeout.Infinite); - }; - - this.mainWindow.Activate(); - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.WinUI/ComputeSharp.SwapChain.WinUI.csproj b/samples/ComputeSharp.SwapChain.WinUI/ComputeSharp.SwapChain.WinUI.csproj deleted file mode 100644 index cf222e6c..00000000 --- a/samples/ComputeSharp.SwapChain.WinUI/ComputeSharp.SwapChain.WinUI.csproj +++ /dev/null @@ -1,90 +0,0 @@ - - - WinExe - net8.0-windows10.0.22621.0 - 10.0.17763.0 - app.manifest - x64;ARM64 - win-x64;win-arm64 - win-$(Platform).pubxml - true - true - - - false - - - - - - - false - - - true - - - 2 - - - - - false - true - - - - - true - true - true - false - Speed - - - - - - - - - - - - - - - - - true - - - - - - - - - - - - - - - - - diff --git a/samples/ComputeSharp.SwapChain.WinUI/Controls/D2D1AnimatedPixelShaderPanel.xaml b/samples/ComputeSharp.SwapChain.WinUI/Controls/D2D1AnimatedPixelShaderPanel.xaml deleted file mode 100644 index 438d53d0..00000000 --- a/samples/ComputeSharp.SwapChain.WinUI/Controls/D2D1AnimatedPixelShaderPanel.xaml +++ /dev/null @@ -1,16 +0,0 @@ - - - - diff --git a/samples/ComputeSharp.SwapChain.WinUI/Package.appxmanifest b/samples/ComputeSharp.SwapChain.WinUI/Package.appxmanifest deleted file mode 100644 index a5b965f7..00000000 --- a/samples/ComputeSharp.SwapChain.WinUI/Package.appxmanifest +++ /dev/null @@ -1,42 +0,0 @@ - - - - - - - - ComputeSharp Sample App (WinUI 3) - Sergio Pedri - Assets\StoreLogo.png - - - - - - - - - - - - - - - - - - - diff --git a/samples/ComputeSharp.SwapChain.WinUI/Properties/PublishProfiles/win-arm64.pubxml b/samples/ComputeSharp.SwapChain.WinUI/Properties/PublishProfiles/win-arm64.pubxml deleted file mode 100644 index 5de0b991..00000000 --- a/samples/ComputeSharp.SwapChain.WinUI/Properties/PublishProfiles/win-arm64.pubxml +++ /dev/null @@ -1,11 +0,0 @@ - - - - FileSystem - ARM64 - win-arm64 - bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ - true - true - - \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.WinUI/Properties/PublishProfiles/win-x64.pubxml b/samples/ComputeSharp.SwapChain.WinUI/Properties/PublishProfiles/win-x64.pubxml deleted file mode 100644 index 89844a87..00000000 --- a/samples/ComputeSharp.SwapChain.WinUI/Properties/PublishProfiles/win-x64.pubxml +++ /dev/null @@ -1,11 +0,0 @@ - - - - FileSystem - x64 - win-x64 - bin\$(Configuration)\$(TargetFramework)\$(RuntimeIdentifier)\publish\ - true - true - - \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.WinUI/Properties/launchSettings.json b/samples/ComputeSharp.SwapChain.WinUI/Properties/launchSettings.json deleted file mode 100644 index dd70ba94..00000000 --- a/samples/ComputeSharp.SwapChain.WinUI/Properties/launchSettings.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "profiles": { - "ComputeSharp.SwapChain.WinUI": { - "commandName": "MsixPackage" - } - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.WinUI/Views/MainWindow.xaml b/samples/ComputeSharp.SwapChain.WinUI/Views/MainWindow.xaml deleted file mode 100644 index 9f0df1a0..00000000 --- a/samples/ComputeSharp.SwapChain.WinUI/Views/MainWindow.xaml +++ /dev/null @@ -1,292 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/samples/ComputeSharp.SwapChain.WinUI/Views/MainWindow.xaml.cs b/samples/ComputeSharp.SwapChain.WinUI/Views/MainWindow.xaml.cs deleted file mode 100644 index 72e2b5c0..00000000 --- a/samples/ComputeSharp.SwapChain.WinUI/Views/MainWindow.xaml.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using ComputeSharp.SwapChain.Core.ViewModels; -using ComputeSharp.WinUI; -using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Input; - -namespace ComputeSharp.SwapChain.WinUI.Views; - -/// -/// A view for . -/// -public sealed partial class MainWindow : Window -{ - /// - /// The mapping of currently alive shader panels. - /// - private readonly ConditionalWeakTable shaderPanels = []; - - public MainWindow() - { - InitializeComponent(); - - ExtendsContentIntoTitleBar = true; - - SetTitleBar(this.TitleBarRectangle); - } - - /// - /// Stops all rendering when the application is closing. - /// - public void OnShutdown() - { - this.ShaderPanel.ShaderRunner = null; - - foreach ((AnimatedComputeShaderPanel panel, object? _) in this.shaderPanels) - { - panel.ShaderRunner = null; - } - } - - // Opens the shader selection panel - private void OpenShaderSelectionPanelButton_Click(object sender, RoutedEventArgs e) - { - _ = this.Root.Resources.Remove("ShaderSelectionPanel"); - - this.Root.Children.Add(this.ShaderSelectionPanel); - } - - // Hides the shader selection panel - private void ShaderSelectionPanel_Tapped(object sender, TappedRoutedEventArgs e) - { - _ = this.Root.Children.Remove(this.ShaderSelectionPanel); - } - - // Updates the size of the shaders list panel - private void Window_SizeChanged(object sender, WindowSizeChangedEventArgs e) - { - this.ShadersListContainerPanel.Height = Math.Round(e.Size.Height * 0.35); - } - - // Tracks the current panel - private void AnimatedComputeShaderPanel_Loaded(object sender, RoutedEventArgs e) - { - this.shaderPanels.AddOrUpdate((AnimatedComputeShaderPanel)sender, null); - } - - // Logs rendering failed in the main panel - private void MainShaderPanel_RenderingFailed(AnimatedComputeShaderPanel sender, RenderingFailedEventArgs args) - { - this.RenderingErrorInfoBar.IsOpen = true; - } - - // Logs rendering failed in a secondary panel - private void SelectionShaderPanel_RenderingFailed(AnimatedComputeShaderPanel sender, RenderingFailedEventArgs args) - { - this.RenderingErrorInfoBar.IsOpen = true; - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.WinUI/app.manifest b/samples/ComputeSharp.SwapChain.WinUI/app.manifest deleted file mode 100644 index 2b945c52..00000000 --- a/samples/ComputeSharp.SwapChain.WinUI/app.manifest +++ /dev/null @@ -1,15 +0,0 @@ - - - - - - - - true/PM - PerMonitorV2, PerMonitor - - - diff --git a/samples/ComputeSharp.SwapChain/Backend/Win32Application.cs b/samples/ComputeSharp.SwapChain/Backend/Win32Application.cs deleted file mode 100644 index 080820a5..00000000 --- a/samples/ComputeSharp.SwapChain/Backend/Win32Application.cs +++ /dev/null @@ -1,300 +0,0 @@ -using System; -using ComputeSharp.Interop; -using TerraFX.Interop.DirectX; -using TerraFX.Interop.Windows; - -namespace ComputeSharp.SwapChain.Backend; - -/// -/// A class representing a simple Win32 application. -/// -/// The function pointer used to run a shader on a target texture. -internal sealed unsafe class Win32Application(delegate*, TimeSpan, void> shaderCallback) -{ - /// - /// The pointer for the device currently in use. - /// - private ComPtr d3D12Device; - - /// - /// The instance to use for graphics operations. - /// - private ComPtr d3D12CommandQueue; - - /// - /// The instance used for graphics operations. - /// - private ComPtr d3D12Fence; - - /// - /// The next fence value for graphics operations using . - /// - private ulong nextD3D12FenceValue = 1; - - /// - /// The object to create command lists. - /// - private ComPtr d3D12CommandAllocator; - - /// - /// The instance used to copy data to the back buffers. - /// - private ComPtr d3D12GraphicsCommandList; - - /// - /// The instance used to display content onto the target window. - /// - private ComPtr dxgiSwapChain1; - - /// - /// The first buffer within . - /// - private ComPtr d3D12Resource0; - - /// - /// The second buffer within . - /// - private ComPtr d3D12Resource1; - - /// - /// The index of the next buffer that can be used to present content. - /// - private uint currentBufferIndex; - - /// - /// The instance used to prepare frames to display. - /// - private ReadWriteTexture2D? texture; - - /// - /// Whether or not the window has been resized and requires the buffers to be updated. - /// - private volatile bool isResizePending; - - /// - /// Initializes the current application. - /// - /// The handle for the window. - public void OnInitialize(HWND hwnd) - { - // Get the underlying ID3D12Device in use - fixed (ID3D12Device** d3D12Device = this.d3D12Device) - { - _ = InteropServices.TryGetID3D12Device(GraphicsDevice.GetDefault(), Windows.__uuidof(), (void**)d3D12Device); - } - - // Create the direct command queue to use - fixed (ID3D12CommandQueue** d3D12CommandQueue = this.d3D12CommandQueue) - { - D3D12_COMMAND_QUEUE_DESC d3D12CommandQueueDesc; - d3D12CommandQueueDesc.Type = D3D12_COMMAND_LIST_TYPE.D3D12_COMMAND_LIST_TYPE_DIRECT; - d3D12CommandQueueDesc.Priority = (int)D3D12_COMMAND_QUEUE_PRIORITY.D3D12_COMMAND_QUEUE_PRIORITY_NORMAL; - d3D12CommandQueueDesc.Flags = D3D12_COMMAND_QUEUE_FLAGS.D3D12_COMMAND_QUEUE_FLAG_NONE; - d3D12CommandQueueDesc.NodeMask = 0; - - _ = this.d3D12Device.Get()->CreateCommandQueue( - &d3D12CommandQueueDesc, - Windows.__uuidof(), - (void**)d3D12CommandQueue); - } - - // Create the direct fence - fixed (ID3D12Fence** d3D12Fence = this.d3D12Fence) - { - _ = this.d3D12Device.Get()->CreateFence( - 0, - D3D12_FENCE_FLAGS.D3D12_FENCE_FLAG_NONE, - Windows.__uuidof(), - (void**)d3D12Fence); - } - - // Create the swap chain to display frames - fixed (IDXGISwapChain1** dxgiSwapChain1 = this.dxgiSwapChain1) - { - using ComPtr dxgiFactory2 = default; - - _ = DirectX.CreateDXGIFactory2(DXGI.DXGI_CREATE_FACTORY_DEBUG, Windows.__uuidof(), (void**)dxgiFactory2.GetAddressOf()); - - DXGI_SWAP_CHAIN_DESC1 dxgiSwapChainDesc1 = default; - dxgiSwapChainDesc1.AlphaMode = DXGI_ALPHA_MODE.DXGI_ALPHA_MODE_IGNORE; - dxgiSwapChainDesc1.BufferCount = 2; - dxgiSwapChainDesc1.Flags = 0; - dxgiSwapChainDesc1.Format = DXGI_FORMAT.DXGI_FORMAT_R8G8B8A8_UNORM; - dxgiSwapChainDesc1.Width = 0; - dxgiSwapChainDesc1.Height = 0; - dxgiSwapChainDesc1.SampleDesc = new DXGI_SAMPLE_DESC(count: 1, quality: 0); - dxgiSwapChainDesc1.Scaling = DXGI_SCALING.DXGI_SCALING_STRETCH; - dxgiSwapChainDesc1.Stereo = 0; - dxgiSwapChainDesc1.SwapEffect = DXGI_SWAP_EFFECT.DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; - - _ = dxgiFactory2.Get()->CreateSwapChainForHwnd( - (IUnknown*)this.d3D12CommandQueue.Get(), - hwnd, - &dxgiSwapChainDesc1, - null, - null, - dxgiSwapChain1); - } - - // Create the command allocator to use - fixed (ID3D12CommandAllocator** d3D12CommandAllocator = this.d3D12CommandAllocator) - { - _ = this.d3D12Device.Get()->CreateCommandAllocator( - D3D12_COMMAND_LIST_TYPE.D3D12_COMMAND_LIST_TYPE_DIRECT, - Windows.__uuidof(), - (void**)d3D12CommandAllocator); - } - - // Create the reusable command list to copy data to the back buffers - fixed (ID3D12GraphicsCommandList** d3D12GraphicsCommandList = this.d3D12GraphicsCommandList) - { - _ = this.d3D12Device.Get()->CreateCommandList( - 0, - D3D12_COMMAND_LIST_TYPE.D3D12_COMMAND_LIST_TYPE_DIRECT, - this.d3D12CommandAllocator, - null, - Windows.__uuidof(), - (void**)d3D12GraphicsCommandList); - } - - // Close the command list to prepare it for future use - _ = this.d3D12GraphicsCommandList.Get()->Close(); - } - - /// - /// Resizes the current application. - /// - public void OnResize() - { - this.isResizePending = true; - } - - /// - /// Applies the actual resize logic that was scheduled from . - /// - private void ApplyResize() - { - _ = this.d3D12CommandQueue.Get()->Signal(this.d3D12Fence.Get(), this.nextD3D12FenceValue); - - // Wait for the fence again to ensure there are no pending operations - _ = this.d3D12Fence.Get()->SetEventOnCompletion(this.nextD3D12FenceValue, default); - - this.nextD3D12FenceValue++; - - // Dispose the old buffers before resizing the buffer - this.d3D12Resource0.Dispose(); - this.d3D12Resource1.Dispose(); - - // Resize the swap chain buffers - _ = this.dxgiSwapChain1.Get()->ResizeBuffers(0, 0, 0, DXGI_FORMAT.DXGI_FORMAT_UNKNOWN, 0); - - // Get the index of the initial back buffer - using (ComPtr dxgiSwapChain3 = default) - { - _ = this.dxgiSwapChain1.CopyTo(dxgiSwapChain3.GetAddressOf()); - - this.currentBufferIndex = dxgiSwapChain3.Get()->GetCurrentBackBufferIndex(); - } - - // Retrieve the back buffers for the swap chain - fixed (ID3D12Resource** d3D12Resource0 = this.d3D12Resource0) - fixed (ID3D12Resource** d3D12Resource1 = this.d3D12Resource1) - { - _ = this.dxgiSwapChain1.Get()->GetBuffer(0, Windows.__uuidof(), (void**)d3D12Resource0); - _ = this.dxgiSwapChain1.Get()->GetBuffer(1, Windows.__uuidof(), (void**)d3D12Resource1); - } - - this.texture?.Dispose(); - - D3D12_RESOURCE_DESC d3D12Resource0Description = this.d3D12Resource0.Get()->GetDesc(); - - // Create the 2D texture to use to generate frames to display - this.texture = GraphicsDevice.GetDefault().AllocateReadWriteTexture2D( - (int)d3D12Resource0Description.Width, - (int)d3D12Resource0Description.Height); - } - - /// - /// Updates the current application. - /// - /// The current time since the start of the application. - public void OnUpdate(TimeSpan time) - { - if (this.isResizePending) - { - ApplyResize(); - - this.isResizePending = false; - } - - // Generate the new frame by invoking the callback - shaderCallback(this.texture!, time); - - using ComPtr d3D12Resource = default; - - // Get the underlying ID3D12Resource pointer for the texture - _ = InteropServices.TryGetID3D12Resource(this.texture!, Windows.__uuidof(), (void**)d3D12Resource.GetAddressOf()); - - // Get the target back buffer to update - ID3D12Resource* d3D12ResourceBackBuffer = this.currentBufferIndex switch - { - 0 => this.d3D12Resource0.Get(), - 1 => this.d3D12Resource1.Get(), - _ => null - }; - - this.currentBufferIndex ^= 1; - - // Reset the command list and command allocator - _ = this.d3D12CommandAllocator.Get()->Reset(); - _ = this.d3D12GraphicsCommandList.Get()->Reset(this.d3D12CommandAllocator.Get(), null); - - D3D12_RESOURCE_BARRIER* d3D12ResourceBarriers = stackalloc D3D12_RESOURCE_BARRIER[] - { - D3D12_RESOURCE_BARRIER.InitTransition( - d3D12Resource.Get(), - D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_UNORDERED_ACCESS, - D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COPY_SOURCE), - D3D12_RESOURCE_BARRIER.InitTransition( - d3D12ResourceBackBuffer, - D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COMMON, - D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COPY_DEST) - }; - - // Transition the resources to COPY_DEST and COPY_SOURCE respectively - this.d3D12GraphicsCommandList.Get()->ResourceBarrier(2, d3D12ResourceBarriers); - - // Copy the generated frame to the target back buffer - this.d3D12GraphicsCommandList.Get()->CopyResource(d3D12ResourceBackBuffer, d3D12Resource.Get()); - - d3D12ResourceBarriers[0] = D3D12_RESOURCE_BARRIER.InitTransition( - d3D12Resource.Get(), - D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COPY_SOURCE, - D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_UNORDERED_ACCESS); - - d3D12ResourceBarriers[1] = D3D12_RESOURCE_BARRIER.InitTransition( - d3D12ResourceBackBuffer, - D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COPY_DEST, - D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COMMON); - - // Transition the resources back to COMMON and UNORDERED_ACCESS respectively - this.d3D12GraphicsCommandList.Get()->ResourceBarrier(2, d3D12ResourceBarriers); - - _ = this.d3D12GraphicsCommandList.Get()->Close(); - - // Execute the command list to perform the copy - this.d3D12CommandQueue.Get()->ExecuteCommandLists(1, (ID3D12CommandList**)this.d3D12GraphicsCommandList.GetAddressOf()); - - _ = this.d3D12CommandQueue.Get()->Signal(this.d3D12Fence.Get(), this.nextD3D12FenceValue); - - // Present the new frame - _ = this.dxgiSwapChain1.Get()->Present(0, 0); - - if (this.nextD3D12FenceValue > this.d3D12Fence.Get()->GetCompletedValue()) - { - _ = this.d3D12Fence.Get()->SetEventOnCompletion(this.nextD3D12FenceValue, default); - } - - this.nextD3D12FenceValue++; - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationFactory{T}.cs b/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationFactory{T}.cs deleted file mode 100644 index 91592432..00000000 --- a/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationFactory{T}.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using ComputeSharp.Descriptors; -using TerraFX.Interop.Windows; - -namespace ComputeSharp.SwapChain.Backend; - -/// -/// A factory type that renders an animated shader on a swapchain on a target . -/// -/// The shader type to render. -/// -/// The main point of this type is to hide the complexity of from the non-NativeAOT sample. -/// -internal static class Win32ApplicationFactory - where T : struct, IComputeShader, IComputeShaderDescriptor -{ - /// - /// The instance used to create shaders to run. - /// - private static Func? shaderFactory; - - /// - /// Creates a new from the specified factory. - /// - /// The instance used to create shaders to run. - /// A instance to use. - public static unsafe Win32Application Create(Func shaderFactory) - { - Win32ApplicationFactory.shaderFactory = shaderFactory; - - return new(&ShaderCallback); - } - - /// - /// The callback function to draw a single frame. - /// - /// The input instance to draw on. - /// The time for the current frame. - private static void ShaderCallback(IReadWriteNormalizedTexture2D texture, TimeSpan time) - { - texture.GraphicsDevice.ForEach(texture, shaderFactory!(time)); - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationRunner.cs b/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationRunner.cs deleted file mode 100644 index fbcfea2e..00000000 --- a/samples/ComputeSharp.SwapChain/Backend/Win32ApplicationRunner.cs +++ /dev/null @@ -1,350 +0,0 @@ -using System; -using System.Diagnostics; -using System.Drawing; -using System.Runtime.InteropServices; -using System.Threading; -using TerraFX.Interop.Windows; - -namespace ComputeSharp.SwapChain.Backend; - -/// -/// A helper class to manage the creation and execution of Win32 applications. -/// -internal static unsafe class Win32ApplicationRunner -{ - /// - /// Whether or not a resize operation is in progress. - /// - private static bool isResizing = false; - - /// - /// Whether or not the application is currently paused. - /// - private static bool isPaused = false; - - /// - /// The for the application window. - /// - private static HWND hwnd; - - /// - /// The application being run. - /// - private static Win32Application application = null!; - - /// - /// The thread running the render loop. - /// - private static Thread renderThread = null!; - - /// - /// Runs a specified application and starts the main loop to update its state. This is the entry point for a given application, - /// and it should be called as soon as the process is launched, excluding any other additional initialization needed. - /// - /// The input application instance to run. - /// Name of the input application instance to run. - /// The title to use for the window being opened. - /// The exit code for the application. - public static int Run(Win32Application application, string applicationName, string windowTitle) - { - Win32ApplicationRunner.application = application; - - HMODULE hInstance = Windows.GetModuleHandleW(null); - - fixed (char* name = applicationName) - fixed (char* title = windowTitle) - { - // Initialize the window class - WNDCLASSEXW windowClassEx = new() - { - cbSize = (uint)sizeof(WNDCLASSEXW), - style = CS.CS_HREDRAW | CS.CS_VREDRAW, - lpfnWndProc = &WindowProc, - hInstance = hInstance, - hCursor = Windows.LoadCursorW(HINSTANCE.NULL, IDC.IDC_ARROW), - lpszClassName = name - }; - - // Register the window class - _ = Windows.RegisterClassExW(&windowClassEx); - - Rectangle windowRect = new(0, 0, 1280, 720); - - // Set the target window size - _ = Windows.AdjustWindowRect((RECT*)&windowRect, WS.WS_OVERLAPPEDWINDOW, Windows.FALSE); - - uint height = (uint)(windowRect.Bottom - windowRect.Top); - uint width = (uint)(windowRect.Right - windowRect.Left); - - // Create the window and store a handle to it - hwnd = Windows.CreateWindowExW( - 0, - windowClassEx.lpszClassName, - title, - WS.WS_OVERLAPPEDWINDOW, - Windows.CW_USEDEFAULT, - Windows.CW_USEDEFAULT, - (int)width, - (int)height, - HWND.NULL, - HMENU.NULL, - hInstance, - (void*)GCHandle.ToIntPtr(GCHandle.Alloc(application)) - ); - - MARGINS margins = default; - margins.cxLeftWidth = -1; - margins.cxRightWidth = -1; - margins.cyTopHeight = -1; - margins.cyBottomHeight = -1; - - _ = Windows.DwmExtendFrameIntoClientArea(hwnd, &margins); - } - - // Initialize the application - application.OnInitialize(hwnd); - - // Display the window - _ = Windows.ShowWindow(hwnd, SW.SW_SHOWDEFAULT); - - MSG msg = default; - - // Setup the render thread that enables smooth resizing of the window - renderThread = new Thread(static args => - { - (Win32Application application, CancellationToken token) = ((Win32Application, CancellationToken))args!; - - Stopwatch startStopwatch = Stopwatch.StartNew(); - Stopwatch frameStopwatch = Stopwatch.StartNew(); - - const long targetFrameTimeInTicksFor60fps = 166666; - - while (!token.IsCancellationRequested) - { - if (frameStopwatch.ElapsedTicks >= targetFrameTimeInTicksFor60fps) - { - frameStopwatch.Restart(); - - application.OnUpdate(startStopwatch.Elapsed); - } - } - }); - - CancellationTokenSource tokenSource = new(); - - renderThread.Start((application, tokenSource.Token)); - - // Process any messages in the queue - while (msg.message != WM.WM_QUIT) - { - if (Windows.PeekMessageW(&msg, HWND.NULL, 0, 0, PM.PM_REMOVE) != 0) - { - _ = Windows.TranslateMessage(&msg); - _ = Windows.DispatchMessageW(&msg); - } - else if (isPaused) - { - Thread.Sleep(100); - } - - // Also listen to Escape and 'Q' to quit - if (msg.message == WM.WM_KEYUP && (msg.wParam == (WPARAM)VK.VK_ESCAPE || msg.wParam == 'Q')) - { - _ = Windows.DestroyWindow(hwnd); - } - } - - tokenSource.Cancel(); - - renderThread.Join(); - - // Return this part of the WM_QUIT message to Windows - return (int)msg.wParam; - } - - /// - /// Processes incoming messages for a window. - /// - /// A handle to the window. - /// The message. - /// Additional message information (the contents depend on the value of ). - /// Additional message information (the contents depend on the value of ). - /// The result of the message processing for the input message. - [UnmanagedCallersOnly] - private static LRESULT WindowProc(HWND hwnd, uint uMsg, WPARAM wParam, LPARAM lParam) - { - switch (uMsg) - { - // Change the paused state on window activation - case WM.WM_ACTIVATE: - { - if (Windows.LOWORD(wParam) == Windows.WA_INACTIVE) - { - isPaused = true; - } - else - { - isPaused = false; - } - - return 0; - } - - // Change the paused state when ESC is pressed - case WM.WM_KEYDOWN: - { - if (wParam == (byte)ConsoleKey.Escape) - { - - if (isPaused) - { - _ = Windows.SetCapture(hwnd); - } - else - { - _ = Windows.ReleaseCapture(); - } - - isPaused = !isPaused; - } - - return 0; - } - - // Window resize started - case WM.WM_ENTERSIZEMOVE: - { - isResizing = true; - - return 0; - } - - // Window resize completed - case WM.WM_EXITSIZEMOVE: - { - isResizing = false; - application.OnResize(); - - return 0; - } - - // Size update - case WM.WM_SIZE: - { - if (!isResizing && wParam != Windows.SIZE_MINIMIZED) - { - application.OnResize(); - } - - return 0; - } - - // Size and position of the window (needed to enable the borderless mode) - case WM.WM_NCCALCSIZE: - { - return 0; - } - - // Enable dragging the window - case WM.WM_NCHITTEST: - { - POINT point; - RECT rect; - - _ = Windows.GetCursorPos(&point); - _ = Windows.GetWindowRect(hwnd, &rect); - - bool isAtTop = Math.Abs(point.y - rect.top) < 12; - bool isAtRight = Math.Abs(point.x - rect.right) < 12; - bool isAtBottom = Math.Abs(point.y - rect.bottom) < 12; - bool isAtLeft = Math.Abs(point.x - rect.left) < 12; - - if (isAtTop) - { - if (isAtRight) - { - return Windows.HTTOPRIGHT; - } - - if (isAtLeft) - { - return Windows.HTTOPLEFT; - } - - return Windows.HTTOP; - } - - if (isAtRight) - { - if (isAtTop) - { - return Windows.HTTOPRIGHT; - } - - if (isAtBottom) - { - return Windows.HTBOTTOMRIGHT; - } - - return Windows.HTRIGHT; - } - - if (isAtBottom) - { - if (isAtRight) - { - return Windows.HTBOTTOMRIGHT; - } - - if (isAtLeft) - { - return Windows.HTBOTTOMLEFT; - } - - return Windows.HTBOTTOM; - } - - if (isAtLeft) - { - if (isAtTop) - { - return Windows.HTTOPLEFT; - } - - if (isAtBottom) - { - return Windows.HTBOTTOMLEFT; - } - - return Windows.HTLEFT; - } - - return Windows.HTCAPTION; - } - - // Restore the drop shadow - case WM.WM_DWMCOMPOSITIONCHANGED: - { - MARGINS margins = default; - margins.cxLeftWidth = -1; - margins.cxRightWidth = -1; - margins.cyTopHeight = -1; - margins.cyBottomHeight = -1; - - _ = Windows.DwmExtendFrameIntoClientArea(hwnd, &margins); - - return 0; - } - - // Shutdown - case WM.WM_DESTROY: - { - Windows.PostQuitMessage(0); - - return 0; - } - } - - return Windows.DefWindowProcW(hwnd, uMsg, wParam, lParam); - } -} \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain/ComputeSharp.SwapChain.csproj b/samples/ComputeSharp.SwapChain/ComputeSharp.SwapChain.csproj deleted file mode 100644 index ac8219e0..00000000 --- a/samples/ComputeSharp.SwapChain/ComputeSharp.SwapChain.csproj +++ /dev/null @@ -1,26 +0,0 @@ - - - Exe - net8.0 - x64;ARM64 - - - - - - - - - - - - - - - - PreserveNewest - - - - - diff --git a/samples/ComputeSharp.SwapChain/Program.cs b/samples/ComputeSharp.SwapChain/Program.cs deleted file mode 100644 index 6362852d..00000000 --- a/samples/ComputeSharp.SwapChain/Program.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.IO; -using System.Runtime.CompilerServices; -using ComputeSharp.SwapChain.Backend; -using ComputeSharp.SwapChain.Shaders; - -namespace ComputeSharp.SwapChain; - -class Program -{ - /// - /// A texture for \Textures\RustyMetal.png. - /// - private static readonly Lazy> RustyMetal = new(static () => LoadTexture()); - - static void Main() - { - // Prepare the mapping of available samples to choose from - (string ShaderName, Win32Application Application)[] samples = - [ - (nameof(HelloWorld), Win32ApplicationFactory.Create(static time => new((float)time.TotalSeconds))), - (nameof(FourColorGradient), Win32ApplicationFactory.Create(static time => new((float)time.TotalSeconds))), - (nameof(ColorfulInfinity), Win32ApplicationFactory.Create(static time => new((float)time.TotalSeconds))), - (nameof(FractalTiling), Win32ApplicationFactory.Create(static time => new((float)time.TotalSeconds))), - (nameof(TwoTiledTruchet), Win32ApplicationFactory.Create(static time => new((float)time.TotalSeconds))), - (nameof(MengerJourney), Win32ApplicationFactory.Create(static time => new((float)time.TotalSeconds))), - (nameof(Octagrams), Win32ApplicationFactory.Create(static time => new((float)time.TotalSeconds))), - (nameof(ProteanClouds), Win32ApplicationFactory.Create(static time => new((float)time.TotalSeconds))), - (nameof(ExtrudedTruchetPattern), Win32ApplicationFactory.Create(static time => new((float)time.TotalSeconds))), - (nameof(PyramidPattern), Win32ApplicationFactory.Create(static time => new((float)time.TotalSeconds))), - (nameof(TriangleGridContouring), Win32ApplicationFactory.Create(static time => new((float)time.TotalSeconds))), - (nameof(ContouredLayers), Win32ApplicationFactory.Create(static time => new((float)time.TotalSeconds, RustyMetal.Value))), - (nameof(TerracedHills), Win32ApplicationFactory.Create(static time => new((float)time.TotalSeconds))), - ]; - - int index; - - do - { - Console.Clear(); - Console.WriteLine("Available samples:"); - Console.WriteLine(); - - for (int i = 0; i < samples.Length; i++) - { - Console.WriteLine($"{i}: {samples[i].ShaderName}"); - } - - Console.WriteLine($"{samples.Length}+: Exit (Use Escape, 'Q', or Alt + F4 to exit a sample once chosen)"); - Console.WriteLine(); - - do - { - Console.Write("Enter the index of the sample to run: "); - } - while (!int.TryParse(Console.ReadLine(), out index)); - - if (index >= 0 && index < samples.Length) - { - Console.WriteLine(); - Console.WriteLine($"Starting {samples[index].ShaderName}..."); - - _ = Win32ApplicationRunner.Run(samples[index].Application, "ComputeSharp.SwapChain", samples[index].ShaderName); - } - } - while (index >= 0 && index < samples.Length); - } - - /// - /// Allocates a new instance with the specified texture data. - /// - /// The name of the texture to load. - /// A texture with the data from the image at the specified name. - private static ReadOnlyTexture2D LoadTexture([CallerMemberName] string name = null!) - { - string filename = Path.Combine(AppContext.BaseDirectory, "Textures", $"{name}.png"); - - return GraphicsDevice.GetDefault().LoadReadOnlyTexture2D(filename); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.Core/ComputeSharp.Core.csproj b/src/ComputeSharp.Core/ComputeSharp.Core.csproj index 58c33e92..f410cbca 100644 --- a/src/ComputeSharp.Core/ComputeSharp.Core.csproj +++ b/src/ComputeSharp.Core/ComputeSharp.Core.csproj @@ -7,12 +7,6 @@ - - - - - - diff --git a/src/ComputeSharp.D2D1.CodeFixers/ComputeSharp.D2D1.CodeFixers.csproj b/src/ComputeSharp.D2D1.CodeFixers/ComputeSharp.D2D1.CodeFixers.csproj deleted file mode 100644 index dbfc9741..00000000 --- a/src/ComputeSharp.D2D1.CodeFixers/ComputeSharp.D2D1.CodeFixers.csproj +++ /dev/null @@ -1,15 +0,0 @@ - - - netstandard2.0 - - - - - - - - - - - - diff --git a/src/ComputeSharp.D2D1.CodeFixers/MissingPixelShaderDescriptorOnPixelShaderCodeFixer.cs b/src/ComputeSharp.D2D1.CodeFixers/MissingPixelShaderDescriptorOnPixelShaderCodeFixer.cs deleted file mode 100644 index 9cf759fd..00000000 --- a/src/ComputeSharp.D2D1.CodeFixers/MissingPixelShaderDescriptorOnPixelShaderCodeFixer.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.Composition; -using ComputeSharp.CodeFixing; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CodeFixes; -using static ComputeSharp.SourceGeneration.Diagnostics.DiagnosticDescriptors; - -namespace ComputeSharp.D2D1.CodeFixers; - -/// -/// A code fixer that adds the [D2DGeneratedPixelShaderDescriptor] to D2D1 shader types with no descriptor. -/// -[ExportCodeFixProvider(LanguageNames.CSharp)] -[Shared] -public sealed class MissingPixelShaderDescriptorOnPixelShaderCodeFixer : MissingAttributeCodeFixer -{ - /// - /// The set of type names for all D2D attributes that can be over shader types. - /// - private static readonly string[] D2DAttributeTypeNames = - [ - "ComputeSharp.D2D1.D2DCompileOptionsAttribute", - "ComputeSharp.D2D1.D2DEffectAuthorAttribute", - "ComputeSharp.D2D1.D2DEffectCategoryAttribute", - "ComputeSharp.D2D1.D2DEffectDescriptionAttribute", - "ComputeSharp.D2D1.D2DEffectDisplayNameAttribute", - "ComputeSharp.D2D1.D2DEffectIdAttribute", - "ComputeSharp.D2D1.D2DInputComplexAttribute", - "ComputeSharp.D2D1.D2DInputCountAttribute", - "ComputeSharp.D2D1.D2DInputDescriptionAttribute", - "ComputeSharp.D2D1.D2DInputSimpleAttribute", - "ComputeSharp.D2D1.D2DOutputBufferAttribute", - "ComputeSharp.D2D1.D2DPixelOptionsAttribute", - "ComputeSharp.D2D1.D2DRequiresScenePositionAttribute", - "ComputeSharp.D2D1.D2DShaderProfileAttribute" - ]; - - /// - /// Creates a new instance with the specified parameters. - /// - public MissingPixelShaderDescriptorOnPixelShaderCodeFixer() - : base( - diagnosticId: MissingPixelShaderDescriptorOnPixelShaderTypeId, - codeActionTitle: "Add [D2DGeneratedPixelShaderDescriptor] attribute", - attributeFullyQualifiedMetadataName: "ComputeSharp.D2D1.D2DGeneratedPixelShaderDescriptorAttribute", - leadingAttributeFullyQualifiedMetadataNames: D2DAttributeTypeNames) - { - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/AnalyzerReleases.Shipped.md b/src/ComputeSharp.D2D1.SourceGenerators/AnalyzerReleases.Shipped.md deleted file mode 100644 index e9637e0e..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/AnalyzerReleases.Shipped.md +++ /dev/null @@ -1,95 +0,0 @@ -; Shipped analyzer releases -; https://github.com/dotnet/roslyn-analyzers/blob/master/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md - -## Release 1.0 - -### New Rules - -Rule ID | Category | Severity | Notes ---------|----------|----------|------- -CMPSD2D0001 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0002 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0003 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0004 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0005 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0006 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0007 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0008 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0009 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0010 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0011 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0012 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0013 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0014 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0015 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0016 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0017 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0018 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0019 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0020 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0021 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0022 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0023 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0024 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0025 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0026 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0027 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0028 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0029 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0030 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0031 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0032 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0033 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0034 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0035 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0036 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0037 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0038 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0039 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0040 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0041 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0042 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0043 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0044 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0045 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0046 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0047 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0048 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0049 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0050 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0051 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0052 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0053 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0054 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0055 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0056 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0057 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0058 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0059 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0060 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0061 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0062 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0063 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0064 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0065 | ComputeSharp.D2D1.Shaders | Warning | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0066 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0067 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0068 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0069 | ComputeSharp.D2D1.Shaders | Warning | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0070 | ComputeSharp.D2D1.Shaders | Warning | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0071 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0072 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0073 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0074 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0075 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0076 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0077 | ComputeSharp.D2D1.Shaders | Info | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0078 | ComputeSharp.D2D1.Shaders | Warning | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0079 | ComputeSharp.D2D1.Shaders | Warning | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0080 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0081 | ComputeSharp.D2D1.Shaders | Warning | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0082 | ComputeSharp.D2D1.Shaders | Warning | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0083 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0084 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0085 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2D0086 | ComputeSharp.D2D1.Shaders | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) diff --git a/src/ComputeSharp.D2D1.SourceGenerators/AnalyzerReleases.Unshipped.md b/src/ComputeSharp.D2D1.SourceGenerators/AnalyzerReleases.Unshipped.md deleted file mode 100644 index 6a6dd08d..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/AnalyzerReleases.Unshipped.md +++ /dev/null @@ -1,2 +0,0 @@ -; Unshipped analyzer release -; https://github.com/dotnet/roslyn-analyzers/blob/master/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md diff --git a/src/ComputeSharp.D2D1.SourceGenerators/ComputeSharp.D2D1.SourceGenerators.csproj b/src/ComputeSharp.D2D1.SourceGenerators/ComputeSharp.D2D1.SourceGenerators.csproj deleted file mode 100644 index 11887f91..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/ComputeSharp.D2D1.SourceGenerators.csproj +++ /dev/null @@ -1,99 +0,0 @@ - - - netstandard2.0 - $(DefineConstants);D2D1_SOURCE_GENERATOR - - - - - - $(NoWarn);CS0419 - - - $(NoWarn);CS1574 - - - $(NoWarn);IDE0004 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.ConstantBuffer.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.ConstantBuffer.cs deleted file mode 100644 index 8fad2ba0..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.ConstantBuffer.cs +++ /dev/null @@ -1,117 +0,0 @@ -using System.Collections.Immutable; -using ComputeSharp.D2D1.SourceGenerators.Models; -using ComputeSharp.SourceGeneration.Extensions; -using ComputeSharp.SourceGeneration.Helpers; -using ComputeSharp.SourceGeneration.Models; -using ComputeSharp.SourceGeneration.SyntaxProcessors; -using Microsoft.CodeAnalysis; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -partial class D2DPixelShaderDescriptorGenerator -{ - /// - /// A helper with all logic to generate the constant buffer marshalling methods and additional types. - /// - private static class ConstantBuffer - { - /// - /// - /// - /// - /// - public static void GetInfo( - Compilation compilation, - ITypeSymbol structDeclarationSymbol, - out int constantBufferSizeInBytes, - out ImmutableArray fields) - { - constantBufferSizeInBytes = 0; - - ConstantBufferSyntaxProcessor.GetInfo( - compilation, - structDeclarationSymbol, - ref constantBufferSizeInBytes, - out fields); - } - - /// - /// Writes the LoadConstantBuffer method. - /// - /// The input instance with gathered shader info. - /// The instance to write into. - public static void WriteLoadConstantBufferSyntax(D2D1ShaderInfo info, IndentedTextWriter writer) - { - string typeName = info.Hierarchy.Hierarchy[0].QualifiedName; - - writer.WriteLine("/// "); - writer.WriteGeneratedAttributes(GeneratorName); - writer.WriteLine("[global::System.Runtime.CompilerServices.SkipLocalsInit]"); - - // Write the method declaration (we only need unsafe blocks if we have any values in the constant buffer) - writer.Write("static "); - writer.WriteIf(!info.Fields.IsEmpty, "unsafe "); - writer.WriteLine($"void global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<{typeName}>.LoadConstantBuffer(in {typeName} shader, ref TLoader loader)"); - - using (writer.WriteBlock()) - { - // If there are no fields, just load an empty buffer - if (info.Fields.IsEmpty) - { - writer.WriteLine("loader.LoadConstantBuffer(default);"); - } - else - { - // Because D2D (and possibly other consumers) will do a bitwise check on the constant buffer to check for changes, - // it is important that the padding space between aligned elements in the generated constant buffer type are also - // cleared, and not filled with random data (which might be the case if no special care is taken). We cannot just - // rely on the default zero-ing performed by the JIT, because there is no guarantee that the padding space in types - // representing unions will also be zero-ed. So instead we create an uninitialized instance and manually clear it - // with 'NativeMemory.Clear' (which can also be unrolled by the JIT). This still maintains good performance, and - // makes it possible for downstream consumers to further improve performance by implementing better caching strategies. - writer.WriteLine("global::System.Runtime.CompilerServices.Unsafe.SkipInit(out global::ComputeSharp.D2D1.Generated.ConstantBuffer buffer);"); - writer.WriteLine(); - writer.WriteLine("global::System.Runtime.InteropServices.NativeMemory.Clear(&buffer, (uint)sizeof(global::ComputeSharp.D2D1.Generated.ConstantBuffer));"); - writer.WriteLine(); - - // Otherwise, pass a span into the marshalled native layout buffer - writer.WriteLine("global::ComputeSharp.D2D1.Generated.ConstantBufferMarshaller.FromManaged(in shader, out buffer);"); - writer.WriteLine(); - writer.WriteLine("loader.LoadConstantBuffer(new global::System.ReadOnlySpan(&buffer, sizeof(global::ComputeSharp.D2D1.Generated.ConstantBuffer)));"); - } - } - } - - /// - /// Writes the CreateFromConstantBuffer method. - /// - /// The input instance with gathered shader info. - /// The instance to write into. - public static void WriteCreateFromConstantBufferSyntax(D2D1ShaderInfo info, IndentedTextWriter writer) - { - string typeName = info.Hierarchy.Hierarchy[0].QualifiedName; - - writer.WriteLine("/// "); - writer.WriteGeneratedAttributes(GeneratorName); - writer.WriteLine("[global::System.Runtime.CompilerServices.SkipLocalsInit]"); - writer.WriteLine($"static {typeName} global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<{typeName}>.CreateFromConstantBuffer(global::System.ReadOnlySpan data)"); - - using (writer.WriteBlock()) - { - // If there are no fields, just return an empty shader - if (info.Fields.IsEmpty) - { - writer.WriteLine("return default;"); - - return; - } - - // Get a reference to the data through the generated native layout type and define the shader - writer.WriteLine("ref readonly global::ComputeSharp.D2D1.Generated.ConstantBuffer buffer = ref global::System.Runtime.InteropServices.MemoryMarshal.AsRef(data);"); - writer.WriteLine(); - writer.WriteLine("return global::ComputeSharp.D2D1.Generated.ConstantBufferMarshaller.ToManaged(in buffer);"); - } - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectFactory.Syntax.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectFactory.Syntax.cs deleted file mode 100644 index c69a6f24..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectFactory.Syntax.cs +++ /dev/null @@ -1,46 +0,0 @@ -using ComputeSharp.D2D1.SourceGenerators.Models; -using ComputeSharp.SourceGeneration.Extensions; -using ComputeSharp.SourceGeneration.Helpers; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -partial class D2DPixelShaderDescriptorGenerator -{ - /// - /// A helper with all logic to generate the EffectFactory property. - /// - private static class EffectFactory - { - /// - /// Writes the EffectFactory property. - /// - /// The input instance with gathered shader info. - /// The instance to write into. - public static void WriteSyntax(D2D1ShaderInfo info, IndentedTextWriter writer) - { - writer.WriteLine("/// "); - writer.WriteGeneratedAttributes(GeneratorName); - writer.WriteLine($"static unsafe nint global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<{info.Hierarchy.Hierarchy[0].QualifiedName}>.EffectFactory"); - - using (writer.WriteBlock()) - { - writer.WriteLine("[global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]"); - writer.WriteLine("get"); - - using (writer.WriteBlock()) - { - writer.WriteLine($$""" - [global::System.Runtime.InteropServices.UnmanagedCallersOnly(CallConvs = [typeof(global::System.Runtime.CompilerServices.CallConvStdcall)])] - static int EffectFactory(void** effectImpl) - { - return global::ComputeSharp.D2D1.Interop.D2D1PixelShaderEffect.CreateEffectUnsafe<{{info.Hierarchy.Hierarchy[0].QualifiedName}}>(effectImpl); - } - - return (nint)(delegate* unmanaged[Stdcall])&EffectFactory; - """, isMultiline: true); - } - } - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectId.Syntax.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectId.Syntax.cs deleted file mode 100644 index 721c0ac6..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectId.Syntax.cs +++ /dev/null @@ -1,71 +0,0 @@ -using ComputeSharp.D2D1.SourceGenerators.Models; -using ComputeSharp.SourceGeneration.Extensions; -using ComputeSharp.SourceGeneration.Helpers; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -partial class D2DPixelShaderDescriptorGenerator -{ - /// - partial class EffectId - { - /// - /// Writes the EffectId property. - /// - /// The input instance with gathered shader info. - /// The instance to write into. - public static void WriteSyntax(D2D1ShaderInfo info, IndentedTextWriter writer) - { - writer.WriteLine("/// "); - writer.WriteGeneratedAttributes(GeneratorName); - writer.WriteLine($"static ref readonly global::System.Guid global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<{info.Hierarchy.Hierarchy[0].QualifiedName}>.EffectId"); - - using (writer.WriteBlock()) - { - writer.WriteLine("[global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)]"); - writer.WriteLine("get"); - - using (writer.WriteBlock()) - { - writer.WriteLine("global::System.ReadOnlySpan bytes ="); - writer.WriteLine("["); - writer.IncreaseIndent(); - - // Write the bytes like so: - // - // b[0], b[1], b[2], b[3], - // b[4], b[5], - // b[6], b[7], - // b[8], - // b[9], - // b[10], - // b[11], - // b[12], - // b[13], - // b[14], - // b[15] - SyntaxFormattingHelper.WriteByteArrayInitializationExpressions(info.EffectId.AsSpan()[..4], writer); - writer.WriteLine(","); - SyntaxFormattingHelper.WriteByteArrayInitializationExpressions(info.EffectId.AsSpan()[4..6], writer); - writer.WriteLine(","); - SyntaxFormattingHelper.WriteByteArrayInitializationExpressions(info.EffectId.AsSpan()[6..8], writer); - writer.WriteLine(","); - writer.WriteLine($"{SyntaxFormattingHelper.GetByteExpression(info.EffectId[8])},"); - writer.WriteLine($"{SyntaxFormattingHelper.GetByteExpression(info.EffectId[9])},"); - writer.WriteLine($"{SyntaxFormattingHelper.GetByteExpression(info.EffectId[10])},"); - writer.WriteLine($"{SyntaxFormattingHelper.GetByteExpression(info.EffectId[11])},"); - writer.WriteLine($"{SyntaxFormattingHelper.GetByteExpression(info.EffectId[12])},"); - writer.WriteLine($"{SyntaxFormattingHelper.GetByteExpression(info.EffectId[13])},"); - writer.WriteLine($"{SyntaxFormattingHelper.GetByteExpression(info.EffectId[14])},"); - writer.WriteLine(SyntaxFormattingHelper.GetByteExpression(info.EffectId[15])); - writer.DecreaseIndent(); - writer.WriteLine("];"); - - writer.WriteLine(); - writer.WriteLine("return ref global::System.Runtime.CompilerServices.Unsafe.As(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(bytes));"); - } - } - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectId.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectId.cs deleted file mode 100644 index 7c270681..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectId.cs +++ /dev/null @@ -1,132 +0,0 @@ -using System; -using System.Buffers; -using System.Collections.Immutable; -using System.Runtime.CompilerServices; -using System.Security.Cryptography; -using System.Text; -using ComputeSharp.SourceGeneration.Extensions; -using ComputeSharp.SourceGeneration.Helpers; -using Microsoft.CodeAnalysis; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -partial class D2DPixelShaderDescriptorGenerator -{ - /// - /// A helper with all logic to generate the EffectId property. - /// - private static partial class EffectId - { - /// - /// The instance currently in use for the running thread, if any. - /// - [ThreadStatic] - private static IncrementalHash? incrementalHash; - - /// - /// Extracts the effect id info for the current shader. - /// - /// The input object currently in use. - /// The for the shader type in use. - /// The resulting effect id. - public static ImmutableArray GetInfo(Compilation compilation, INamedTypeSymbol structDeclarationSymbol) - { - if (TryGetDefinedEffectId(compilation, structDeclarationSymbol, out ImmutableArray effectId)) - { - return effectId; - } - - return CreateDefaultEffectId(structDeclarationSymbol); - } - - /// - /// Tries to get the defined effect id for a given shader type. - /// - /// The input object currently in use. - /// The input instance. - /// The resulting defined effect id, if found. - /// Whether or not a defined effect id could be found. - private static bool TryGetDefinedEffectId(Compilation compilation, INamedTypeSymbol typeSymbol, out ImmutableArray effectId) - { - INamedTypeSymbol effectIdAttributeSymbol = compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2DEffectIdAttribute")!; - - foreach (AttributeData attributeData in typeSymbol.GetAttributes()) - { - // Check that the attribute is [D2DEffectId] and with a valid parameter - if (SymbolEqualityComparer.Default.Equals(attributeData.AttributeClass, effectIdAttributeSymbol) && - attributeData.ConstructorArguments is [{ Value: string value }] && - Guid.TryParse(value, out Guid guid)) - { - byte[] bytes = guid.ToByteArray(); - - effectId = Unsafe.As>(ref bytes); - - return true; - } - } - - effectId = default; - - return false; - } - - /// - /// Creates the default effect id for a given type symbol. - /// - /// The input instance. - /// The resulting effect id. - private static unsafe ImmutableArray CreateDefaultEffectId(INamedTypeSymbol typeSymbol) - { - try - { - // Initialize an instance using the MD5 algorithm. We use this for several reasons: - // - We don't really need security, this is just to uniquely identify types - // - The hash size is 128 bits, which is exactly the size of a GUID. - IncrementalHash incrementalHash = EffectId.incrementalHash ??= IncrementalHash.CreateHash(HashAlgorithmName.MD5); - - string assemblyName = typeSymbol.ContainingAssembly?.Name ?? string.Empty; - - using ImmutableArrayBuilder charBuffer = new(); - - // Format the fully qualified name into a pooled builder to avoid the string allocation - typeSymbol.AppendFullyQualifiedMetadataName(in charBuffer); - - int maxTypeNameByteCount = Encoding.UTF8.GetMaxByteCount(charBuffer.Count); - int maxAssemblyNameByteCount = Encoding.UTF8.GetMaxByteCount(assemblyName.Length); - int maxEncodedByteCount = Math.Max(maxTypeNameByteCount, maxAssemblyNameByteCount); - - byte[] bufferUtf8 = ArrayPool.Shared.Rent(maxEncodedByteCount); - - // UTF8 encode the fully qualified name first - int typeNameBytesWritten = Encoding.UTF8.GetBytes(charBuffer.WrittenSpan, bufferUtf8); - - // Append the UTF8 fully qualified name to the MD5 hash - incrementalHash.AppendData(bufferUtf8, 0, typeNameBytesWritten); - - // UTF8 encode the assembly name as well - int assemblyNameBytesWritten = Encoding.UTF8.GetBytes(assemblyName.AsSpan(), bufferUtf8); - - // Append the UTF8 assembly name to the MD5 hash - incrementalHash.AppendData(bufferUtf8, 0, assemblyNameBytesWritten); - - // The state is now fully in the incremental hash, we can return the array - ArrayPool.Shared.Return(bufferUtf8); - - // Get the resulting MD5 hash (128 bits) - byte[] hash = incrementalHash.GetHashAndReset(); - - // We own this buffer, so we can just reinterpret to an immutable array - return Unsafe.As>(ref hash); - } - catch - { - // Something went wrong, throw away the current incremental hash. - // Realistically speaking, this should just never happen. - incrementalHash = null; - - throw; - } - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectMetadata.Syntax.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectMetadata.Syntax.cs deleted file mode 100644 index 83caf155..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectMetadata.Syntax.cs +++ /dev/null @@ -1,77 +0,0 @@ -using ComputeSharp.D2D1.SourceGenerators.Models; -using ComputeSharp.SourceGeneration.Extensions; -using ComputeSharp.SourceGeneration.Helpers; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -partial class D2DPixelShaderDescriptorGenerator -{ - /// - partial class EffectMetadata - { - /// - /// Writes the EffectDisplayName property. - /// - /// The input instance with gathered shader info. - /// The instance to write into. - public static void WriteEffectDisplayNameSyntax(D2D1ShaderInfo info, IndentedTextWriter writer) - { - WriteEffectMetadataSyntax(info.Hierarchy.Hierarchy[0].QualifiedName, "EffectDisplayName", info.EffectDisplayName, writer); - } - - /// - /// Writes the EffectDescription property. - /// - /// The input instance with gathered shader info. - /// The instance to write into. - public static void WriteEffectDescriptionSyntax(D2D1ShaderInfo info, IndentedTextWriter writer) - { - WriteEffectMetadataSyntax(info.Hierarchy.Hierarchy[0].QualifiedName, "EffectDescription", info.EffectDescription, writer); - } - - /// - /// Writes the EffectCategory property. - /// - /// The input instance with gathered shader info. - /// The instance to write into. - public static void WriteEffectCategorySyntax(D2D1ShaderInfo info, IndentedTextWriter writer) - { - WriteEffectMetadataSyntax(info.Hierarchy.Hierarchy[0].QualifiedName, "EffectCategory", info.EffectCategory, writer); - } - - /// - /// Writes the EffectAuthor property. - /// - /// The input instance with gathered shader info. - /// The instance to write into. - public static void WriteEffectAuthorSyntax(D2D1ShaderInfo info, IndentedTextWriter writer) - { - WriteEffectMetadataSyntax(info.Hierarchy.Hierarchy[0].QualifiedName, "EffectAuthor", info.EffectAuthor, writer); - } - - /// - /// Writes a specified metadata property. - /// - /// The qualified name of the shader type. - /// The property name to generate. - /// The input effect metadata value, if available. - /// The instance to write into. - private static void WriteEffectMetadataSyntax(string qualifiedName, string propertyName, string? metadataValue, IndentedTextWriter writer) - { - writer.WriteLine("/// "); - writer.WriteGeneratedAttributes(GeneratorName); - writer.Write($"static string? global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<{qualifiedName}>.{propertyName} => "); - - // Append null or the metadata value as a string literal - if (metadataValue is null) - { - writer.WriteLine("null;"); - } - else - { - writer.WriteLine($"\"{metadataValue}\";"); - } - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectMetadata.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectMetadata.cs deleted file mode 100644 index 5ffcb502..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.EffectMetadata.cs +++ /dev/null @@ -1,98 +0,0 @@ -using ComputeSharp.D2D1.SourceGenerators.Helpers; -using Microsoft.CodeAnalysis; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -partial class D2DPixelShaderDescriptorGenerator -{ - /// - /// A helper with all logic to generate the effect metadata properties. - /// - private static partial class EffectMetadata - { - /// - /// Extracts the effect display name info for the current shader. - /// - /// The input object currently in use. - /// The for the shader type in use. - /// The resulting effect display name, if available. - public static string? GetEffectDisplayNameInfo(Compilation compilation, INamedTypeSymbol structDeclarationSymbol) - { - if (D2D1EffectMetadataParser.TryGetEffectMetadataName( - compilation, - structDeclarationSymbol, - "ComputeSharp.D2D1.D2DEffectDisplayNameAttribute", - isAssemblyLevelAttributeSupported: false, - out string? effectDisplayName)) - { - return effectDisplayName; - } - - return null; - } - - /// - /// Extracts the effect description info for the current shader. - /// - /// The input object currently in use. - /// The for the shader type in use. - /// The resulting effect description, if available. - public static string? GetEffectDescriptionInfo(Compilation compilation, INamedTypeSymbol structDeclarationSymbol) - { - if (D2D1EffectMetadataParser.TryGetEffectMetadataName( - compilation, - structDeclarationSymbol, - "ComputeSharp.D2D1.D2DEffectDescriptionAttribute", - isAssemblyLevelAttributeSupported: false, - out string? effectDescription)) - { - return effectDescription; - } - - return null; - } - - /// - /// Extracts the effect category info for the current shader. - /// - /// The input object currently in use. - /// The for the shader type in use. - /// The resulting effect category, if available. - public static string? GetEffectCategoryInfo(Compilation compilation, INamedTypeSymbol structDeclarationSymbol) - { - if (D2D1EffectMetadataParser.TryGetEffectMetadataName( - compilation, - structDeclarationSymbol, - "ComputeSharp.D2D1.D2DEffectCategoryAttribute", - isAssemblyLevelAttributeSupported: true, - out string? effectCategory)) - { - return effectCategory; - } - - return null; - } - - /// - /// Extracts the effect author info for the current shader. - /// - /// The input object currently in use. - /// The for the shader type in use. - /// The resulting effect author, if available. - public static string? GetEffectAuthorInfo(Compilation compilation, INamedTypeSymbol structDeclarationSymbol) - { - if (D2D1EffectMetadataParser.TryGetEffectMetadataName( - compilation, - structDeclarationSymbol, - "ComputeSharp.D2D1.D2DEffectAuthorAttribute", - isAssemblyLevelAttributeSupported: true, - out string? effectAuthor)) - { - return effectAuthor; - } - - return null; - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslBytecode.Syntax.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslBytecode.Syntax.cs deleted file mode 100644 index 5df2a00f..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslBytecode.Syntax.cs +++ /dev/null @@ -1,158 +0,0 @@ -using System.Linq; -using ComputeSharp.D2D1.SourceGenerators.Models; -using ComputeSharp.SourceGeneration.Extensions; -using ComputeSharp.SourceGeneration.Helpers; -using ComputeSharp.SourceGeneration.Models; -using Microsoft.CodeAnalysis; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -partial class D2DPixelShaderDescriptorGenerator -{ - /// - partial class HlslBytecode - { - /// - /// Writes the ShaderProfile property. - /// - /// The input instance with gathered shader info. - /// The instance to write into. - public static void WriteShaderProfileSyntax(D2D1ShaderInfo info, IndentedTextWriter writer) - { - writer.WriteLine("/// "); - writer.WriteGeneratedAttributes(GeneratorName); - writer.WriteLine($"static ComputeSharp.D2D1.D2D1ShaderProfile global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<{info.Hierarchy.Hierarchy[0].QualifiedName}>.ShaderProfile => global::ComputeSharp.D2D1.D2D1ShaderProfile.{info.HlslInfoKey.ShaderProfile};"); - } - - /// - /// Writes the CompileOptions property. - /// - /// The input instance with gathered shader info. - /// The instance to write into. - public static void WriteCompileOptionsSyntax(D2D1ShaderInfo info, IndentedTextWriter writer) - { - // Get a formatted representation of the compile options being used - string compileOptionsExpression = - info.HlslInfoKey.CompileOptions - .ToString() - .Split(',') - .Select(static name => $"global::ComputeSharp.D2D1.D2D1CompileOptions.{name.Trim()}") - .Aggregate("", static (left, right) => left.Length > 0 ? $"{left} | {right}" : right); - - writer.WriteLine("/// "); - writer.WriteGeneratedAttributes(GeneratorName); - writer.WriteLine($"static ComputeSharp.D2D1.D2D1CompileOptions global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<{info.Hierarchy.Hierarchy[0].QualifiedName}>.CompileOptions => {compileOptionsExpression};"); - } - - /// - /// Writes the HlslBytecode property. - /// - /// The input instance with gathered shader info. - /// The instance to write into. - public static void WriteHlslBytecodeSyntax(D2D1ShaderInfo info, IndentedTextWriter writer) - { - writer.WriteLine("/// "); - writer.WriteGeneratedAttributes(GeneratorName); - writer.Write($"static global::System.ReadOnlyMemory global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<{info.Hierarchy.Hierarchy[0].QualifiedName}>.HlslBytecode => "); - - // If there is no bytecode, just return a default expression. - // Otherwise, return the memory manager backed memory instance. - if (info.HlslInfo is not HlslBytecodeInfo.Success) - { - writer.WriteLine("default;"); - } - else - { - writer.WriteLine("global::ComputeSharp.D2D1.Generated.HlslBytecodeMemoryManager.Instance.Memory;"); - } - } - - /// - /// Registers a callback to generate additional types, if needed. - /// - /// The input instance with gathered shader info. - /// The registered callbacks to generate additional types. - /// The using directives needed by the generated code. - public static void RegisterAdditionalTypesSyntax( - D2D1ShaderInfo info, - ImmutableArrayBuilder> callbacks, - ImmutableHashSetBuilder usingDirectives) - { - // If there is no bytecode, no memory manager is needed - if (info.HlslInfo is not HlslBytecodeInfo.Success) - { - return; - } - - _ = usingDirectives.Add("global::System"); - _ = usingDirectives.Add("global::System.Buffers"); - _ = usingDirectives.Add("global::System.CodeDom.Compiler"); - _ = usingDirectives.Add("global::System.Diagnostics"); - _ = usingDirectives.Add("global::System.Diagnostics.CodeAnalysis"); - _ = usingDirectives.Add("global::System.Runtime.CompilerServices"); - _ = usingDirectives.Add("global::System.Runtime.InteropServices"); - - // Declare the HlslBytecodeMemoryManager custom memory manager type - static void Callback(D2D1ShaderInfo info, IndentedTextWriter writer) - { - writer.WriteLine($$"""/// """); - writer.WriteLine($$"""/// implementation to get the HLSL bytecode."""); - writer.WriteLine($$"""/// """); - writer.WriteGeneratedAttributes(GeneratorName, useFullyQualifiedTypeNames: false); - writer.WriteLine($$"""file sealed class HlslBytecodeMemoryManager : MemoryManager"""); - - using (writer.WriteBlock()) - { - // Static singleton instance (to avoid the static constructor, just like with the input types) - writer.WriteLine($$"""/// The singleton instance to use."""); - writer.WriteLine($$"""public static readonly HlslBytecodeMemoryManager Instance = new();"""); - - // RVA field (with the compiled HLSL bytecode, on a single line) - writer.WriteLine(); - writer.WriteLine("/// The RVA data with the HLSL bytecode."); - writer.Write("private static ReadOnlySpan Data => ["); - - SyntaxFormattingHelper.WriteByteArrayInitializationExpressions(((HlslBytecodeInfo.Success)info.HlslInfo).Bytecode.AsSpan(), writer); - - writer.WriteLine("];"); - writer.WriteLine(); - - // Add the remaining members for the memory manager - writer.WriteLine(""" - /// - public override unsafe Span GetSpan() - { - return new(Unsafe.AsPointer(ref MemoryMarshal.GetReference(Data)), Data.Length); - } - - /// - public override Memory Memory - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => CreateMemory(Data.Length); - } - - /// - public override unsafe MemoryHandle Pin(int elementIndex) - { - return new(Unsafe.AsPointer(ref Unsafe.AsRef(in Data[elementIndex])), pinnable: this); - } - - /// - public override void Unpin() - { - } - - /// - protected override void Dispose(bool disposing) - { - } - """, isMultiline: true); - } - } - - callbacks.Add(Callback); - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslBytecode.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslBytecode.cs deleted file mode 100644 index f0ea920a..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslBytecode.cs +++ /dev/null @@ -1,86 +0,0 @@ -using ComputeSharp.SourceGeneration.Extensions; -using Microsoft.CodeAnalysis; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -partial class D2DPixelShaderDescriptorGenerator -{ - /// - /// A helper with all logic to generate the HLSL bytecode properties. - /// - internal static partial class HlslBytecode - { - /// - /// Extracts the requested shader profile for the current shader. - /// - /// The input instance to process. - /// The requested shader profile to use to compile the shader, if present. - public static D2D1ShaderProfile? GetRequestedShaderProfile(INamedTypeSymbol structDeclarationSymbol) - { - if (structDeclarationSymbol.TryGetAttributeWithFullyQualifiedMetadataName("ComputeSharp.D2D1.D2DShaderProfileAttribute", out AttributeData? attributeData)) - { - return (D2D1ShaderProfile)attributeData.ConstructorArguments[0].Value!; - } - - if (structDeclarationSymbol.ContainingAssembly.TryGetAttributeWithFullyQualifiedMetadataName("ComputeSharp.D2D1.D2DShaderProfileAttribute", out attributeData)) - { - return (D2D1ShaderProfile)attributeData.ConstructorArguments[0].Value!; - } - - return null; - } - - /// - /// Extracts the requested compile options for the current shader. - /// - /// The input instance to process. - /// The requested compile options to use to compile the shader, if present. - public static D2D1CompileOptions? GetRequestedCompileOptions(INamedTypeSymbol structDeclarationSymbol) - { - if (structDeclarationSymbol.TryGetAttributeWithFullyQualifiedMetadataName("ComputeSharp.D2D1.D2DCompileOptionsAttribute", out AttributeData? attributeData)) - { - D2D1CompileOptions options = (D2D1CompileOptions)attributeData.ConstructorArguments[0].Value!; - - // PackMatrixRowMajor is always automatically enabled. If by any chance the attribute is requesting - // column major packing, the analyzer will emit a diagnostic (same as for the assembly-level case). - return options | D2D1CompileOptions.PackMatrixRowMajor; - } - - if (structDeclarationSymbol.ContainingAssembly.TryGetAttributeWithFullyQualifiedMetadataName("ComputeSharp.D2D1.D2DCompileOptionsAttribute", out attributeData)) - { - // No need to validate against PackMatrixColumnMajor as that's checked separately - return (D2D1CompileOptions)attributeData.ConstructorArguments[0].Value! | D2D1CompileOptions.PackMatrixRowMajor; - } - - return null; - } - - /// - /// Gets the effective shader profile to use. - /// - /// The requested shader profile. - /// Whether compilation should be performed with the input profile. - /// The effective shader profile. - public static D2D1ShaderProfile GetEffectiveShaderProfile(D2D1ShaderProfile? shaderProfile, out bool isCompilationEnabled) - { - // Compilation is only enabled if the user explicitly selected a shader profile - isCompilationEnabled = shaderProfile is not null; - - // The effective shader profile is either be the requested one, or the default value (which maps to PS5.0) - return shaderProfile ?? D2D1ShaderProfile.PixelShader50; - } - - /// - /// Gets the effective compile options to use. - /// - /// The requested compile options. - /// The effective compile options. - public static D2D1CompileOptions GetEffectiveCompileOptions(D2D1CompileOptions? compileOptions) - { - // If an explicit set of compile options is provided, use that directly. Otherwise, use the default - // options plus the option to enable linking only if the shader can potentially support it. - return compileOptions ?? D2D1CompileOptions.Default; - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslSource.Syntax.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslSource.Syntax.cs deleted file mode 100644 index 4016dd5e..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslSource.Syntax.cs +++ /dev/null @@ -1,31 +0,0 @@ -using ComputeSharp.D2D1.SourceGenerators.Models; -using ComputeSharp.SourceGeneration.Extensions; -using ComputeSharp.SourceGeneration.Helpers; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -partial class D2DPixelShaderDescriptorGenerator -{ - /// - partial class HlslSource - { - /// - /// Writes the HlslSource property. - /// - /// The input instance with gathered shader info. - /// The instance to write into. - public static void WriteSyntax(D2D1ShaderInfo info, IndentedTextWriter writer) - { - writer.WriteLine("/// "); - writer.WriteGeneratedAttributes(GeneratorName); - writer.WriteLine($"static string global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<{info.Hierarchy.Hierarchy[0].QualifiedName}>.HlslSource =>"); - writer.IncreaseIndent(); - writer.WriteLine("\"\"\""); - writer.Write(info.HlslInfoKey.HlslSource, isMultiline: true); - writer.WriteLine(skipIfPresent: true); - writer.WriteLine("\"\"\";"); - writer.DecreaseIndent(); - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslSource.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslSource.cs deleted file mode 100644 index 91ea3a83..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.HlslSource.cs +++ /dev/null @@ -1,539 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.Immutable; -using System.Threading; -using ComputeSharp.SourceGeneration.Extensions; -using ComputeSharp.SourceGeneration.Helpers; -using ComputeSharp.SourceGeneration.Mappings; -using ComputeSharp.SourceGeneration.Models; -using ComputeSharp.SourceGeneration.SyntaxProcessors; -using ComputeSharp.SourceGeneration.SyntaxRewriters; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp; -using Microsoft.CodeAnalysis.CSharp.Syntax; -using static ComputeSharp.SourceGeneration.Diagnostics.DiagnosticDescriptors; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -partial class D2DPixelShaderDescriptorGenerator -{ - /// - /// A helper with all logic to generate the HlslSource property. - /// - private static partial class HlslSource - { - /// - /// Gathers all necessary information on a transpiled HLSL source for a given shader type. - /// - /// The collection of produced instances. - /// The input object currently in use. - /// The for the shader type. - /// The shader interface type implemented by the shader type. - /// The number of inputs for the shader. - /// The indices of the simple shader inputs. - /// The indices of the complex shader inputs. - /// The used to cancel the operation, if needed. - /// The HLSL source for the shader. - public static string GetHlslSource( - ImmutableArrayBuilder diagnostics, - Compilation compilation, - INamedTypeSymbol structDeclarationSymbol, - INamedTypeSymbol shaderInterfaceType, - int inputCount, - ImmutableArray inputSimpleIndices, - ImmutableArray inputComplexIndices, - CancellationToken token) - { - // Detect any invalid properties - HlslDefinitionsSyntaxProcessor.DetectAndReportInvalidPropertyDeclarations(diagnostics, structDeclarationSymbol); - - token.ThrowIfCancellationRequested(); - - // We need to sets to track all discovered custom types and static methods - HashSet discoveredTypes = new(SymbolEqualityComparer.Default); - Dictionary staticMethods = new(SymbolEqualityComparer.Default); - Dictionary instanceMethods = new(SymbolEqualityComparer.Default); - Dictionary constructors = new(SymbolEqualityComparer.Default); - Dictionary constantDefinitions = new(SymbolEqualityComparer.Default); - Dictionary staticFieldDefinitions = new(SymbolEqualityComparer.Default); - - token.ThrowIfCancellationRequested(); - - // Extract information on all captured fields - GetInstanceFields( - diagnostics, - structDeclarationSymbol, - discoveredTypes, - out ImmutableArray valueFields, - out ImmutableArray resourceTextureFields); - - token.ThrowIfCancellationRequested(); - - SemanticModelProvider semanticModelProvider = new(compilation); - - // Explore the syntax tree and extract the processed info - (string entryPoint, ImmutableArray processedMethods) = GetProcessedMethods( - diagnostics, - structDeclarationSymbol, - shaderInterfaceType, - semanticModelProvider, - discoveredTypes, - staticMethods, - instanceMethods, - constructors, - constantDefinitions, - staticFieldDefinitions, - token, - out bool methodsNeedD2D1RequiresScenePosition); - - token.ThrowIfCancellationRequested(); - - ImmutableArray staticFields = GetStaticFields( - diagnostics, - semanticModelProvider, - structDeclarationSymbol, - discoveredTypes, - constantDefinitions, - staticFieldDefinitions, - token, - out bool fieldsNeedD2D1RequiresScenePosition); - - token.ThrowIfCancellationRequested(); - - // Process the discovered types and constants - HlslDefinitionsSyntaxProcessor.GetDeclaredTypes( - diagnostics, - structDeclarationSymbol, - discoveredTypes, - instanceMethods, - constructors, - out ImmutableArray typeDeclarations, - out ImmutableArray typeMethodDeclarations); - - token.ThrowIfCancellationRequested(); - - ImmutableArray definedConstants = HlslDefinitionsSyntaxProcessor.GetDefinedConstants(constantDefinitions); - - token.ThrowIfCancellationRequested(); - - // Check whether the scene position is required - bool requiresScenePosition = GetD2DRequiresScenePositionInfo(structDeclarationSymbol); - - // Emit diagnostics for incorrect scene position uses - ReportInvalidD2DRequiresScenePositionUse( - diagnostics, - structDeclarationSymbol, - requiresScenePosition, - methodsNeedD2D1RequiresScenePosition || fieldsNeedD2D1RequiresScenePosition); - - token.ThrowIfCancellationRequested(); - - // Get the HLSL source - return GetHlslSource( - definedConstants, - valueFields, - resourceTextureFields, - staticFields, - processedMethods, - typeDeclarations, - typeMethodDeclarations, - entryPoint, - inputCount, - inputSimpleIndices, - inputComplexIndices, - requiresScenePosition); - } - - /// - /// Gets a sequence of captured fields and their mapped names. - /// - /// The collection of produced instances. - /// The input instance to process. - /// The collection of currently discovered types. - /// The sequence of captured fields in . - /// The sequence of captured resource textures in . - private static void GetInstanceFields( - ImmutableArrayBuilder diagnostics, - INamedTypeSymbol structDeclarationSymbol, - ICollection types, - out ImmutableArray valueFields, - out ImmutableArray resourceTextureFields) - { - using ImmutableArrayBuilder values = new(); - using ImmutableArrayBuilder resourceTextures = new(); - - foreach (ISymbol memberSymbol in structDeclarationSymbol.GetMembers()) - { - // Skip constants and static fields, we only care about instance ones here - if (memberSymbol is not IFieldSymbol { IsConst: false, IsStatic: false } fieldSymbol) - { - continue; - } - - // Try to get the actual field name - if (!ConstantBufferSyntaxProcessor.TryGetFieldAccessorName(fieldSymbol, out string? fieldName, out _)) - { - continue; - } - - // Captured fields must be named type symbols - if (fieldSymbol.Type is not INamedTypeSymbol typeSymbol) - { - diagnostics.Add(InvalidShaderField, fieldSymbol, structDeclarationSymbol, fieldName, fieldSymbol.Type); - - continue; - } - - string metadataName = typeSymbol.GetFullyQualifiedMetadataName(); - string typeName = HlslKnownTypes.GetMappedName(typeSymbol); - - _ = HlslKnownKeywords.TryGetMappedName(fieldName, out string? mapping); - - // Handle resource textures as a special case - if (HlslKnownTypes.IsResourceTextureType(metadataName)) - { - ITypeSymbol resourceTextureTypeArgumentSymbol = typeSymbol.TypeArguments[0]; - - // Validate that the type argument is only either float or float4 - if (!resourceTextureTypeArgumentSymbol.HasFullyQualifiedMetadataName("System.Single") && - !resourceTextureTypeArgumentSymbol.HasFullyQualifiedMetadataName("ComputeSharp.Float4")) - { - diagnostics.Add( - InvalidResourceTextureElementType, - fieldSymbol, - fieldName, - structDeclarationSymbol, - fieldSymbol.Type); - } - - int index = 0; - - // If [D2DResourceTextureIndex] is present, get the resource texture index. - // This generator doesn't need to emit diagnostics, as that's handled separately - // by the logic handling the info gathering for LoadResourceTextureDescriptions. - if (fieldSymbol.TryGetAttributeWithFullyQualifiedMetadataName("ComputeSharp.D2D1.D2DResourceTextureIndexAttribute", out AttributeData? attributeData)) - { - _ = attributeData.TryGetConstructorArgument(0, out index); - } - - resourceTextures.Add((mapping ?? fieldName, typeName, index)); - } - else if (typeSymbol.IsUnmanagedType) - { - // Allowed fields must be unmanaged values. - // Also, track the type if it's a custom struct. - if (!HlslKnownTypes.IsKnownHlslType(metadataName)) - { - types.Add(typeSymbol); - } - - values.Add((mapping ?? fieldName, typeName)); - } - else - { - diagnostics.Add(InvalidShaderField, fieldSymbol, structDeclarationSymbol, fieldName, typeSymbol); - } - } - - valueFields = values.ToImmutable(); - resourceTextureFields = resourceTextures.ToImmutable(); - } - - /// - /// Gets a sequence of shader static fields and their mapped names. - /// - /// The collection of produced instances. - /// The instance for the type to process. - /// The type symbol for the shader type. - /// The collection of currently discovered types. - /// The collection of discovered constant definitions. - /// The collection of discovered static field definitions. - /// The used to cancel the operation, if needed. - /// Whether or not the shader needs the [D2DRequiresScenePosition] annotation. - /// A sequence of static constant fields in . - private static ImmutableArray GetStaticFields( - ImmutableArrayBuilder diagnostics, - SemanticModelProvider semanticModel, - INamedTypeSymbol structDeclarationSymbol, - ICollection discoveredTypes, - IDictionary constantDefinitions, - IDictionary staticFieldDefinitions, - CancellationToken token, - out bool needsD2D1RequiresScenePosition) - { - using ImmutableArrayBuilder builder = new(); - - needsD2D1RequiresScenePosition = false; - - foreach (ISymbol memberSymbol in structDeclarationSymbol.GetMembers()) - { - if (memberSymbol is not IFieldSymbol fieldSymbol) - { - continue; - } - - if (HlslDefinitionsSyntaxProcessor.TryGetStaticField( - structDeclarationSymbol, - fieldSymbol, - semanticModel, - discoveredTypes, - constantDefinitions, - staticFieldDefinitions, - diagnostics, - token, - out string? name, - out string? typeDeclaration, - out string? assignmentExpression, - out StaticFieldRewriter? staticFieldRewriter)) - { - needsD2D1RequiresScenePosition |= staticFieldRewriter.NeedsD2DRequiresScenePositionAttribute; - - builder.Add((name, typeDeclaration, assignmentExpression)); - } - } - - // Also gather the external static fields (same as in the DX12 generator) - foreach (HlslStaticField externalField in staticFieldDefinitions.Values) - { - builder.Add(externalField); - } - - return builder.ToImmutable(); - } - - /// - /// Gets a sequence of processed methods declared within a given type. - /// - /// The collection of produced instances. - /// The type symbol for the shader type. - /// The shader interface type implemented by the shader type. - /// The instance for the type to process. - /// The collection of currently discovered types. - /// The set of discovered and processed static methods. - /// The collection of discovered instance methods for custom struct types. - /// The collection of discovered constructors for custom struct types. - /// The collection of discovered constant definitions. - /// The collection of discovered static field definitions. - /// Whether or not the shader needs the [D2DRequiresScenePosition] annotation. - /// The used to cancel the operation, if needed. - /// A sequence of processed methods in , and the entry point. - private static (string EntryPoint, ImmutableArray Methods) GetProcessedMethods( - ImmutableArrayBuilder diagnostics, - INamedTypeSymbol structDeclarationSymbol, - INamedTypeSymbol shaderInterfaceType, - SemanticModelProvider semanticModel, - ICollection discoveredTypes, - IDictionary staticMethods, - IDictionary instanceMethods, - IDictionary constructors, - IDictionary constantDefinitions, - IDictionary staticFieldDefinitions, - CancellationToken token, - out bool needsD2D1RequiresScenePosition) - { - using ImmutableArrayBuilder methods = new(); - - IMethodSymbol entryPointInterfaceMethod = shaderInterfaceType.GetMethod("Execute")!; - string? entryPoint = null; - - // By default, the scene position is not required. We will set this while - // rewriting HLSL, if any method we traverse ends up requiring the position. - needsD2D1RequiresScenePosition = false; - - foreach (ISymbol memberSymbol in structDeclarationSymbol.GetMembers()) - { - // Find all declared methods in the type - if (memberSymbol is not IMethodSymbol { IsImplicitlyDeclared: false, } methodSymbol) - { - continue; - } - - // Ensure that we have accessible source information - if (!methodSymbol.TryGetSyntaxNode(token, out MethodDeclarationSyntax? methodDeclaration)) - { - continue; - } - - // Check whether the current method is the entry point (ie. it's implementing 'Execute'). - // This is the same logic as in the DX12 generator for compute shaders and pixel shaders. - bool isShaderEntryPoint = SymbolEqualityComparer.Default.Equals( - structDeclarationSymbol.FindImplementationForInterfaceMember(entryPointInterfaceMethod), - methodSymbol); - - // Except for the entry point, ignore explicit interface implementations - if (!isShaderEntryPoint && !methodSymbol.ExplicitInterfaceImplementations.IsDefaultOrEmpty) - { - continue; - } - - token.ThrowIfCancellationRequested(); - - // Create the source rewriter for the current method - ShaderSourceRewriter shaderSourceRewriter = new( - structDeclarationSymbol, - semanticModel, - discoveredTypes, - staticMethods, - instanceMethods, - constructors, - constantDefinitions, - staticFieldDefinitions, - diagnostics, - token, - isShaderEntryPoint); - - // Rewrite the method syntax tree - MethodDeclarationSyntax? processedMethod = shaderSourceRewriter.Visit(methodDeclaration)!.WithoutTrivia(); - - token.ThrowIfCancellationRequested(); - - // Update the position requirement - needsD2D1RequiresScenePosition |= shaderSourceRewriter.NeedsD2DRequiresScenePositionAttribute; - - // Emit the extracted local functions first - foreach (KeyValuePair localFunction in shaderSourceRewriter.LocalFunctions) - { - methods.Add(( - localFunction.Value.AsDefinition().NormalizeWhitespace(eol: "\n").ToFullString(), - localFunction.Value.NormalizeWhitespace(eol: "\n").ToFullString())); - } - - // If the method is the shader entry point, do additional processing - if (isShaderEntryPoint) - { - string entryPointDeclaration = processedMethod.NormalizeWhitespace(eol: "\n").ToFullString(); - string adjustedEntryPointDeclaration = entryPointDeclaration.Replace("float4 Execute()", "D2D_PS_ENTRY(Execute)"); - - entryPoint = adjustedEntryPointDeclaration; - } - else - { - methods.Add(( - processedMethod.AsDefinition().NormalizeWhitespace(eol: "\n").ToFullString(), - processedMethod.NormalizeWhitespace(eol: "\n").ToFullString())); - } - } - - token.ThrowIfCancellationRequested(); - - // Process static methods as well - foreach (MethodDeclarationSyntax staticMethod in staticMethods.Values) - { - methods.Add(( - staticMethod.AsDefinition().NormalizeWhitespace(eol: "\n").ToFullString(), - staticMethod.NormalizeWhitespace(eol: "\n").ToFullString())); - } - - return (entryPoint!, methods.ToImmutable()); - } - - /// - /// Reports diagnostics for invalid uses of [D2DRequiresScenePosition] in a shader. - /// - /// The collection of produced instances. - /// The input instance to process. - /// Whether the shader type is declaring the need for scene position. - /// Whether the shader is using APIs that rely on scene position. - private static void ReportInvalidD2DRequiresScenePositionUse( - ImmutableArrayBuilder diagnostics, - INamedTypeSymbol structDeclarationSymbol, - bool requiresScenePosition, - bool usesPositionDependentMethods) - { - if (!requiresScenePosition && usesPositionDependentMethods) - { - diagnostics.Add(MissingD2DRequiresScenePositionAttribute, structDeclarationSymbol, structDeclarationSymbol); - } - } - - /// - /// Gets whether or not a given shader requires the scene position. - /// - /// The input instance to process. - /// Whether requires the scene position. - private static bool GetD2DRequiresScenePositionInfo(INamedTypeSymbol structDeclarationSymbol) - { - return structDeclarationSymbol.TryGetAttributeWithFullyQualifiedMetadataName("ComputeSharp.D2D1.D2DRequiresScenePositionAttribute", out _); - } - - /// - /// Produces the series of statements to build the current HLSL source. - /// - /// - /// - /// The sequence of captured resource textures for the current shader. - /// - /// - /// - /// - /// The body of the entry point of the shader. - /// The number of shader inputs to declare. - /// The indices of the simple shader inputs. - /// The indices of the complex shader inputs. - /// Whether the shader requires the scene position. - /// The series of statements to build the HLSL source to compile to execute the current shader. - private static string GetHlslSource( - ImmutableArray definedConstants, - ImmutableArray valueFields, - ImmutableArray resourceTextureFields, - ImmutableArray staticFields, - ImmutableArray processedMethods, - ImmutableArray typeDeclarations, - ImmutableArray typeMethodDeclarations, - string executeMethod, - int inputCount, - ImmutableArray inputSimpleIndices, - ImmutableArray inputComplexIndices, - bool requiresScenePosition) - { - using IndentedTextWriter writer = new(); - - // Shader metadata - writer.WriteLine($"#define D2D_INPUT_COUNT {inputCount}"); - - foreach (int simpleInput in inputSimpleIndices) - { - writer.WriteLine($"#define D2D_INPUT{simpleInput}_SIMPLE"); - } - - foreach (int complexInput in inputComplexIndices) - { - writer.WriteLine($"#define D2D_INPUT{complexInput}_COMPLEX"); - } - - writer.WriteLineIf(requiresScenePosition, "#define D2D_REQUIRES_SCENE_POSITION"); - - // Add the "d2d1effecthelpers.hlsli" header - writer.WriteLine(); - writer.WriteLine("#include \"d2d1effecthelpers.hlsli\""); - writer.WriteLine(); - - // The FXC compiler does not support type forward declarations - HlslSourceSyntaxProcessor.WriteTopDeclarations( - writer, - definedConstants, - staticFields, - processedMethods, - typeDeclarations, - includeTypeForwardDeclarations: false); - - HlslSourceSyntaxProcessor.WriteCapturedFields(writer, valueFields); - - // Resource textures - foreach (HlslResourceTextureField field in resourceTextureFields) - { - writer.WriteLine(skipIfPresent: true); - writer.WriteLine($"{field.Type} {field.Name} : register(t{field.Index});"); - writer.WriteLine($"SamplerState __sampler__{field.Name} : register(s{field.Index});"); - } - - HlslSourceSyntaxProcessor.WriteMethodDeclarations(writer, processedMethods, typeMethodDeclarations); - - // Entry point - writer.WriteLine(executeMethod); - - return writer.ToString(); - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.InputDescriptions.Syntax.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.InputDescriptions.Syntax.cs deleted file mode 100644 index 4023760e..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.InputDescriptions.Syntax.cs +++ /dev/null @@ -1,145 +0,0 @@ -using ComputeSharp.D2D1.SourceGenerators.Models; -using ComputeSharp.SourceGeneration.Extensions; -using ComputeSharp.SourceGeneration.Helpers; - -#pragma warning disable IDE0053 - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -partial class D2DPixelShaderDescriptorGenerator -{ - /// - private static partial class InputDescriptions - { - /// - /// Writes the InputDescriptions property. - /// - /// The input instance with gathered shader info. - /// The instance to write into. - public static void WriteSyntax(D2D1ShaderInfo info, IndentedTextWriter writer) - { - writer.WriteLine("/// "); - writer.WriteGeneratedAttributes(GeneratorName); - writer.Write($"static global::System.ReadOnlyMemory global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<{info.Hierarchy.Hierarchy[0].QualifiedName}>.InputDescriptions => "); - - // If there are no input descriptions, just return a default expression. - // Otherwise, return the shared array with cached input descriptions. - if (info.InputDescriptions.IsEmpty) - { - writer.WriteLine("default;"); - } - else - { - writer.WriteLine("global::ComputeSharp.D2D1.Generated.Data.InputDescriptions;"); - } - } - - /// - /// Registers a callback to generate additional types, if needed. - /// - /// The input instance with gathered shader info. - /// The registered callbacks to generate additional types. - /// The using directives needed by the generated code. - public static void RegisterAdditionalTypesSyntax( - D2D1ShaderInfo info, - ImmutableArrayBuilder> callbacks, - ImmutableHashSetBuilder usingDirectives) - { - // If there are no necessary data members, stop here - if (info.InputDescriptions.IsEmpty && - info.ResourceTextureDescriptions.IsEmpty) - { - return; - } - - _ = usingDirectives.Add("global::System.CodeDom.Compiler"); - _ = usingDirectives.Add("global::System.Diagnostics"); - _ = usingDirectives.Add("global::System.Diagnostics.CodeAnalysis"); - - AddAdditionalDataMemberUsingDirectives(info, usingDirectives); - ResourceTextureDescriptions.AddAdditionalDataMemberUsingDirectives(info, usingDirectives); - - // Declare the additional data type - static void Callback(D2D1ShaderInfo info, IndentedTextWriter writer) - { - writer.WriteLine($$"""/// """); - writer.WriteLine($$"""/// A container type for additional data needed by the shader."""); - writer.WriteLine($$"""/// """); - writer.WriteGeneratedAttributes(GeneratorName, useFullyQualifiedTypeNames: false); - writer.WriteLine($$"""file static class Data"""); - - using (writer.WriteBlock()) - { - using ImmutableArrayBuilder> dataMembers = new(); - - RegisterAdditionalDataMemberSyntax(info, dataMembers); - ResourceTextureDescriptions.RegisterAdditionalDataMemberSyntax(info, dataMembers); - - for (int i = 0; i < dataMembers.WrittenSpan.Length; i++) - { - dataMembers.WrittenSpan[i](info, writer); - - if (i < dataMembers.WrittenSpan.Length - 1) - { - writer.WriteLine(); - } - } - } - } - - callbacks.Add(Callback); - } - - /// - /// Adds any using directives for the additional data member, if needed. - /// - /// The input instance with gathered shader info. - /// The using directives needed by the generated code. - private static void AddAdditionalDataMemberUsingDirectives(D2D1ShaderInfo info, ImmutableHashSetBuilder usingDirectives) - { - if (info.InputDescriptions.IsEmpty) - { - return; - } - - _ = usingDirectives.Add("global::ComputeSharp.D2D1"); - _ = usingDirectives.Add("global::ComputeSharp.D2D1.Interop"); - } - - /// - /// Registers a callback to generate an additional data member, if needed. - /// - /// The input instance with gathered shader info. - /// The registered callbacks to generate additional data members. - private static void RegisterAdditionalDataMemberSyntax(D2D1ShaderInfo info, ImmutableArrayBuilder> callbacks) - { - // If there are no input descriptions, there is nothing to di - if (info.InputDescriptions.IsEmpty) - { - return; - } - - // Declare the shared array with input descriptions - static void Callback(D2D1ShaderInfo info, IndentedTextWriter writer) - { - writer.WriteLine("""/// The singleton array instance."""); - writer.WriteLine("""public static readonly D2D1InputDescription[] InputDescriptions ="""); - writer.WriteLine("""["""); - writer.IncreaseIndent(); - - // Initialize all input descriptions - writer.WriteInitializationExpressions(info.InputDescriptions.AsSpan(), static (description, writer) => - { - writer.Write($$"""new D2D1InputDescription({{description.Index}}, D2D1Filter.{{description.Filter}}) { LevelOfDetailCount = {{description.LevelOfDetailCount}} }"""); - }); - - writer.DecreaseIndent(); - writer.WriteLine(); - writer.WriteLine("];"); - } - - callbacks.Add(Callback); - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.InputDescriptions.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.InputDescriptions.cs deleted file mode 100644 index 462591b2..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.InputDescriptions.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.Collections.Immutable; -using ComputeSharp.D2D1.SourceGenerators.Models; -using ComputeSharp.SourceGeneration.Extensions; -using ComputeSharp.SourceGeneration.Helpers; -using Microsoft.CodeAnalysis; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -partial class D2DPixelShaderDescriptorGenerator -{ - /// - /// A helper with all logic to generate the InputDescriptions property. - /// - private static partial class InputDescriptions - { - /// - /// Extracts the input descriptions for the current shader. - /// - /// The input instance to process. - /// The produced input descriptions for the shader. - public static void GetInfo( - INamedTypeSymbol structDeclarationSymbol, - out ImmutableArray inputDescriptions) - { - using ImmutableArrayBuilder builder = new(); - - foreach (AttributeData attributeData in structDeclarationSymbol.GetAttributes()) - { - if (attributeData.AttributeClass?.HasFullyQualifiedMetadataName("ComputeSharp.D2D1.D2DInputDescriptionAttribute") == true) - { - int index = (int)attributeData.ConstructorArguments[0].Value!; - D2D1Filter filter = (D2D1Filter)attributeData.ConstructorArguments[1].Value!; - - _ = attributeData.TryGetNamedArgument("LevelOfDetailCount", out int levelOfDetailCount); - - builder.Add(new InputDescription(index, filter, levelOfDetailCount)); - } - } - - inputDescriptions = builder.ToImmutable(); - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.InputTypes.Syntax.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.InputTypes.Syntax.cs deleted file mode 100644 index 8476cbea..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.InputTypes.Syntax.cs +++ /dev/null @@ -1,133 +0,0 @@ -using ComputeSharp.D2D1.SourceGenerators.Models; -using ComputeSharp.SourceGeneration.Extensions; -using ComputeSharp.SourceGeneration.Helpers; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -partial class D2DPixelShaderDescriptorGenerator -{ - /// - partial class InputTypes - { - /// - /// Writes the InputTypes property. - /// - /// The input instance with gathered shader info. - /// The instance to write into. - public static void WriteSyntax(D2D1ShaderInfo info, IndentedTextWriter writer) - { - writer.WriteLine("/// "); - writer.WriteGeneratedAttributes(GeneratorName); - writer.Write($"static global::System.ReadOnlyMemory global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<{info.Hierarchy.Hierarchy[0].QualifiedName}>.InputTypes => "); - - // If there are no inputs, simply return a default expression. Otherwise, create - // a ReadOnlyMemory instance from the memory manager. - if (info.InputTypes.IsEmpty) - { - writer.WriteLine("default;"); - } - else - { - writer.WriteLine("global::ComputeSharp.D2D1.Generated.InputTypesMemoryManager.Instance.Memory;"); - } - } - - /// - /// Registers a callback to generate additional types, if needed. - /// - /// The input instance with gathered shader info. - /// The registered callbacks to generate additional types. - /// The using directives needed by the generated code. - public static void RegisterAdditionalTypesSyntax( - D2D1ShaderInfo info, - ImmutableArrayBuilder> callbacks, - ImmutableHashSetBuilder usingDirectives) - { - // If there are no inputs, no memory manager is needed - if (info.InputTypes.IsEmpty) - { - return; - } - - _ = usingDirectives.Add("global::System"); - _ = usingDirectives.Add("global::System.Buffers"); - _ = usingDirectives.Add("global::System.CodeDom.Compiler"); - _ = usingDirectives.Add("global::System.Diagnostics"); - _ = usingDirectives.Add("global::System.Diagnostics.CodeAnalysis"); - _ = usingDirectives.Add("global::System.Runtime.CompilerServices"); - _ = usingDirectives.Add("global::System.Runtime.InteropServices"); - _ = usingDirectives.Add("global::ComputeSharp.D2D1.Interop"); - - // Declare the InputTypesMemoryManager custom memory manager type - static void Callback(D2D1ShaderInfo info, IndentedTextWriter writer) - { - writer.WriteLine($$"""/// """); - writer.WriteLine($$"""/// A implementation to get the input types."""); - writer.WriteLine($$"""/// """); - writer.WriteGeneratedAttributes(GeneratorName, useFullyQualifiedTypeNames: false); - writer.WriteLine($$"""file sealed class InputTypesMemoryManager : MemoryManager"""); - - using (writer.WriteBlock()) - { - // Static singleton instance (the object goes in the frozen heap, so there's no static constructor) - writer.WriteLine($$"""/// The singleton instance to use."""); - writer.WriteLine($$"""public static readonly InputTypesMemoryManager Instance = new();"""); - - // RVA field - writer.WriteLine(); - writer.WriteLine("/// The RVA data with the input type info."); - writer.WriteLine("private static ReadOnlySpan Data =>"); - writer.WriteLine("["); - writer.IncreaseIndent(); - - // Input types, one per line in the RVA field initializer - writer.WriteInitializationExpressions(info.InputTypes.AsSpan(), static (type, writer) => - { - writer.Write("D2D1PixelShaderInputType."); - writer.Write(type == 0 ? "Simple" : "Complex"); - }); - - writer.DecreaseIndent(); - writer.WriteLine(); - writer.WriteLine("];"); - writer.WriteLine(); - - // Add the remaining members for the memory manager - writer.WriteLine(""" - /// - public override unsafe Span GetSpan() - { - return new(Unsafe.AsPointer(ref MemoryMarshal.GetReference(Data)), Data.Length); - } - - /// - public override Memory Memory - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => CreateMemory(Data.Length); - } - - /// - public override unsafe MemoryHandle Pin(int elementIndex) - { - return new(Unsafe.AsPointer(ref Unsafe.AsRef(in Data[elementIndex])), pinnable: this); - } - - /// - public override void Unpin() - { - } - - /// - protected override void Dispose(bool disposing) - { - } - """, isMultiline: true); - } - } - - callbacks.Add(Callback); - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.InputTypes.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.InputTypes.cs deleted file mode 100644 index 4d134694..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.InputTypes.cs +++ /dev/null @@ -1,93 +0,0 @@ -using System; -using System.Collections.Immutable; -using System.Runtime.CompilerServices; -using ComputeSharp.SourceGeneration.Extensions; -using ComputeSharp.SourceGeneration.Helpers; -using Microsoft.CodeAnalysis; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -partial class D2DPixelShaderDescriptorGenerator -{ - /// - /// A helper with all logic to generate the InputTypes properties. - /// - internal static partial class InputTypes - { - /// - /// Extracts the input info for the current shader. - /// - /// The input instance to process. - /// The number of shader inputs to declare. - /// The indicess of the simple shader inputs. - /// The indices of the complex shader inputs. - /// The combined and serialized input types for each available input. - public static void GetInfo( - INamedTypeSymbol structDeclarationSymbol, - out int inputCount, - out ImmutableArray inputSimpleIndices, - out ImmutableArray inputComplexIndices, - out ImmutableArray combinedInputTypes) - { - // Note: this logic is shared with InvalidD2DResourceTextureIndexAttributeUseAnalyzer. - // If any changes are made here, they should be reflected in that analyzer as well. - inputCount = 0; - - using ImmutableArrayBuilder inputSimpleIndicesBuilder = new(); - using ImmutableArrayBuilder inputComplexIndicesBuilder = new(); - - foreach (AttributeData attributeData in structDeclarationSymbol.GetAttributes()) - { - using ImmutableArrayBuilder builder = new(); - - attributeData.AttributeClass?.AppendFullyQualifiedMetadataName(in builder); - - switch (builder.WrittenSpan) - { - case "ComputeSharp.D2D1.D2DInputCountAttribute": - - // We ignore negative values here to avoid the rest of the generator crashing due - // to out of bound exceptions or other issues. The analyzer will detect this and - // emit a diagnostic if that's the case, so it is safe to ignore that from here. - inputCount = Math.Max((int)attributeData.ConstructorArguments[0].Value!, 0); - break; - case "ComputeSharp.D2D1.D2DInputSimpleAttribute": - inputSimpleIndicesBuilder.Add((int)attributeData.ConstructorArguments[0].Value!); - break; - case "ComputeSharp.D2D1.D2DInputComplexAttribute": - inputComplexIndicesBuilder.Add((int)attributeData.ConstructorArguments[0].Value!); - break; - default: - break; - } - } - - inputSimpleIndices = inputSimpleIndicesBuilder.ToImmutable(); - inputComplexIndices = inputComplexIndicesBuilder.ToImmutable(); - - uint[] inputTypes = new uint[inputCount]; - - // The D2D_INPUT_SIMPLE define is optional, and if omitted, the corresponding input - // will automatically be of complex type. For the same reason, D2D_INPUT_COMPLEX is - // also essentially redundant. So we can do the following to compute the input types: - // - Create an array with as many inputs as the declared number of inputs - // - Fill it with 1 (ie. D2D1PixelShaderInputType.Complex), as that's the default - // - Traverse the declared simple inputs once, and update their corresponding values - inputTypes.AsSpan().Fill(1); - - foreach (int index in inputSimpleIndicesBuilder.WrittenSpan) - { - // Simply ignore any out of range indices here, to avoid throwing an exception. - // The analyzer will detect all of these cases and correctly issue a diagnostic. - if ((uint)index < inputCount) - { - inputTypes[index] = 0; - } - } - - // We own the array, so we can just reinterpret it here - combinedInputTypes = Unsafe.As>(ref inputTypes); - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.NumericProperties.Syntax.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.NumericProperties.Syntax.cs deleted file mode 100644 index 332705c4..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.NumericProperties.Syntax.cs +++ /dev/null @@ -1,51 +0,0 @@ -using ComputeSharp.D2D1.SourceGenerators.Models; -using ComputeSharp.SourceGeneration.Extensions; -using ComputeSharp.SourceGeneration.Helpers; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -partial class D2DPixelShaderDescriptorGenerator -{ - /// - /// A helper with all logic to generate the available numeric properties. - /// - private static class NumericProperties - { - /// - /// Writes the ConstantBufferSize property. - /// - /// The input instance with gathered shader info. - /// The instance to write into. - public static void WriteConstantBufferSizeSyntax(D2D1ShaderInfo info, IndentedTextWriter writer) - { - writer.WriteLine("/// "); - writer.WriteGeneratedAttributes(GeneratorName); - writer.WriteLine($"static int global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<{info.Hierarchy.Hierarchy[0].QualifiedName}>.ConstantBufferSize => {info.ConstantBufferSizeInBytes};"); - } - - /// - /// Writes the InputCount property. - /// - /// The input instance with gathered shader info. - /// The instance to write into. - public static void WriteInputCountSyntax(D2D1ShaderInfo info, IndentedTextWriter writer) - { - writer.WriteLine("/// "); - writer.WriteGeneratedAttributes(GeneratorName); - writer.WriteLine($"static int global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<{info.Hierarchy.Hierarchy[0].QualifiedName}>.InputCount => {info.InputTypes.Length};"); - } - - /// - /// Writes the ResourceTextureCount property. - /// - /// The input instance with gathered shader info. - /// The instance to write into. - public static void WriteResourceTextureCountSyntax(D2D1ShaderInfo info, IndentedTextWriter writer) - { - writer.WriteLine("/// "); - writer.WriteGeneratedAttributes(GeneratorName); - writer.WriteLine($"static int global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<{info.Hierarchy.Hierarchy[0].QualifiedName}>.ResourceTextureCount => {info.ResourceTextureDescriptions.Length};"); - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.OutputBuffer.Syntax.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.OutputBuffer.Syntax.cs deleted file mode 100644 index 5a860c53..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.OutputBuffer.Syntax.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System; -using ComputeSharp.D2D1.SourceGenerators.Models; -using ComputeSharp.SourceGeneration.Extensions; -using ComputeSharp.SourceGeneration.Helpers; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -partial class D2DPixelShaderDescriptorGenerator -{ - /// - partial class OutputBuffer - { - /// - /// Writes the BufferPrecision property. - /// - /// The input instance with gathered shader info. - /// The instance to write into. - public static void WriteBufferPrecisionSyntax(D2D1ShaderInfo info, IndentedTextWriter writer) - { - // Set the right expression if the buffer options are valid. - // If they are not, just return default (the analyzer will emit a diagnostic). - string bufferPrecisionExpression = Enum.IsDefined(typeof(D2D1BufferPrecision), info.BufferPrecision) switch - { - true => $"global::ComputeSharp.D2D1.D2D1BufferPrecision.{info.BufferPrecision}", - false => "default" - }; - - writer.WriteLine("/// "); - writer.WriteGeneratedAttributes(GeneratorName); - writer.WriteLine($"static ComputeSharp.D2D1.D2D1BufferPrecision global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<{info.Hierarchy.Hierarchy[0].QualifiedName}>.BufferPrecision => {bufferPrecisionExpression};"); - } - - /// - /// Writes the ChannelDepth property. - /// - /// The input instance with gathered shader info. - /// The instance to write into. - public static void WriteChannelDepthSyntax(D2D1ShaderInfo info, IndentedTextWriter writer) - { - // Set the right expression if the buffer options are valid - string channelDepthExpression = Enum.IsDefined(typeof(D2D1ChannelDepth), info.ChannelDepth) switch - { - true => $"global::ComputeSharp.D2D1.D2D1ChannelDepth.{info.ChannelDepth}", - false => "default" - }; - - writer.WriteLine("/// "); - writer.WriteGeneratedAttributes(GeneratorName); - writer.WriteLine($"static ComputeSharp.D2D1.D2D1ChannelDepth global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<{info.Hierarchy.Hierarchy[0].QualifiedName}>.ChannelDepth => {channelDepthExpression};"); - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.OutputBuffer.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.OutputBuffer.cs deleted file mode 100644 index aae4ada1..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.OutputBuffer.cs +++ /dev/null @@ -1,62 +0,0 @@ -using ComputeSharp.SourceGeneration.Extensions; -using Microsoft.CodeAnalysis; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -partial class D2DPixelShaderDescriptorGenerator -{ - /// - /// A helper with all logic to generate the output buffer properties. - /// - private static partial class OutputBuffer - { - /// - /// Extracts the output buffer info for the current shader. - /// - /// The input instance to process. - /// The output buffer precision for the shader. - /// The output buffer channel depth for the shader. - public static void GetInfo( - INamedTypeSymbol structDeclarationSymbol, - out D2D1BufferPrecision bufferPrecision, - out D2D1ChannelDepth channelDepth) - { - // Try to get the [D2DOutputBuffer] attribute - if (!structDeclarationSymbol.TryGetAttributeWithFullyQualifiedMetadataName("ComputeSharp.D2D1.D2DOutputBufferAttribute", out AttributeData? attributeData)) - { - bufferPrecision = D2D1BufferPrecision.Unknown; - channelDepth = D2D1ChannelDepth.Default; - - return; - } - - // Extract the buffer precision and channel depth, if available - if (attributeData.ConstructorArguments.Length == 1) - { - if (attributeData.AttributeConstructor is IMethodSymbol { Parameters.Length: 1 } constructorSymbol && - constructorSymbol.Parameters[0].Type.HasFullyQualifiedMetadataName("ComputeSharp.D2D1.D2D1BufferPrecision")) - { - bufferPrecision = (D2D1BufferPrecision)attributeData.ConstructorArguments[0].Value!; - channelDepth = D2D1ChannelDepth.Default; - } - else - { - bufferPrecision = D2D1BufferPrecision.Unknown; - channelDepth = (D2D1ChannelDepth)attributeData.ConstructorArguments[0].Value!; - } - } - else if (attributeData.ConstructorArguments.Length == 2) - { - bufferPrecision = (D2D1BufferPrecision)attributeData.ConstructorArguments[0].Value!; - channelDepth = (D2D1ChannelDepth)attributeData.ConstructorArguments[1].Value!; - } - else - { - // The syntax tree is likely invalid, so just ignore it for now - bufferPrecision = D2D1BufferPrecision.Unknown; - channelDepth = D2D1ChannelDepth.Default; - } - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.PixelOptions.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.PixelOptions.cs deleted file mode 100644 index 5a891287..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.PixelOptions.cs +++ /dev/null @@ -1,52 +0,0 @@ -using ComputeSharp.D2D1.SourceGenerators.Models; -using ComputeSharp.SourceGeneration.Extensions; -using ComputeSharp.SourceGeneration.Helpers; -using Microsoft.CodeAnalysis; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -partial class D2DPixelShaderDescriptorGenerator -{ - /// - /// A helper with all logic to generate the PixelOptions property. - /// - private static class PixelOptions - { - /// - /// Extracts the pixel options for the current shader. - /// - /// The input instance to process. - /// The pixel options for the shader. - public static void GetInfo(INamedTypeSymbol structDeclarationSymbol, out D2D1PixelOptions pixelOptions) - { - if (structDeclarationSymbol.TryGetAttributeWithFullyQualifiedMetadataName("ComputeSharp.D2D1.D2DPixelOptionsAttribute", out AttributeData? attributeData)) - { - pixelOptions = (D2D1PixelOptions)attributeData.ConstructorArguments[0].Value!; - } - else - { - pixelOptions = D2D1PixelOptions.None; - } - } - - /// - /// Writes the PixelOptions property. - /// - /// The input instance with gathered shader info. - /// The instance to write into. - public static void WriteSyntax(D2D1ShaderInfo info, IndentedTextWriter writer) - { - // Set the right expression if the pixel options are valid - string pixelOptionsExpression = (info.PixelOptions is D2D1PixelOptions.None or D2D1PixelOptions.TrivialSampling) switch - { - true => $"global::ComputeSharp.D2D1.D2D1PixelOptions.{info.PixelOptions}", - false => "default" - }; - - writer.WriteLine("/// "); - writer.WriteGeneratedAttributes(GeneratorName); - writer.WriteLine($"static ComputeSharp.D2D1.D2D1PixelOptions global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<{info.Hierarchy.Hierarchy[0].QualifiedName}>.PixelOptions => {pixelOptionsExpression};"); - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.ResourceTextureDescriptions.Syntax.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.ResourceTextureDescriptions.Syntax.cs deleted file mode 100644 index d346da4e..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.ResourceTextureDescriptions.Syntax.cs +++ /dev/null @@ -1,88 +0,0 @@ -using ComputeSharp.D2D1.SourceGenerators.Models; -using ComputeSharp.SourceGeneration.Extensions; -using ComputeSharp.SourceGeneration.Helpers; - -#pragma warning disable IDE0053 - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -partial class D2DPixelShaderDescriptorGenerator -{ - /// - private static partial class ResourceTextureDescriptions - { - /// - /// Writes the ResourceTextureDescriptions property. - /// - /// The input instance with gathered shader info. - /// The instance to write into. - public static void WriteSyntax(D2D1ShaderInfo info, IndentedTextWriter writer) - { - writer.WriteLine("/// "); - writer.WriteGeneratedAttributes(GeneratorName); - writer.Write($"static global::System.ReadOnlyMemory global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<{info.Hierarchy.Hierarchy[0].QualifiedName}>.ResourceTextureDescriptions => "); - - // If there are no resource texture descriptions, just return a default expression. - // Otherwise, return a memory instance from the generated static readonly array. - if (info.ResourceTextureDescriptions.IsEmpty) - { - writer.WriteLine("default;"); - } - else - { - writer.WriteLine("global::ComputeSharp.D2D1.Generated.Data.ResourceTextureDescriptions;"); - } - } - - /// - /// Adds any using directives for the additional data member, if needed. - /// - /// The input instance with gathered shader info. - /// The using directives needed by the generated code. - public static void AddAdditionalDataMemberUsingDirectives(D2D1ShaderInfo info, ImmutableHashSetBuilder usingDirectives) - { - if (info.ResourceTextureDescriptions.IsEmpty) - { - return; - } - - _ = usingDirectives.Add("global::ComputeSharp.D2D1.Interop"); - } - - /// - /// Registers a callback to generate an additional data member, if needed. - /// - /// The input instance with gathered shader info. - /// The registered callbacks to generate additional data members. - public static void RegisterAdditionalDataMemberSyntax(D2D1ShaderInfo info, ImmutableArrayBuilder> callbacks) - { - // If there are no resource texture descriptions, there is nothing to di - if (info.ResourceTextureDescriptions.IsEmpty) - { - return; - } - - // Declare the shared array with resource texture descriptions - static void Callback(D2D1ShaderInfo info, IndentedTextWriter writer) - { - writer.WriteLine("""/// The singleton array instance."""); - writer.WriteLine("""public static readonly D2D1ResourceTextureDescription[] ResourceTextureDescriptions ="""); - writer.WriteLine("""["""); - writer.IncreaseIndent(); - - // Initialize all resource texture descriptions - writer.WriteInitializationExpressions(info.ResourceTextureDescriptions.AsSpan(), static (description, writer) => - { - writer.Write($"new D2D1ResourceTextureDescription({description.Index}, {description.Rank})"); - }); - - writer.DecreaseIndent(); - writer.WriteLine(); - writer.WriteLine("];"); - } - - callbacks.Add(Callback); - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.ResourceTextureDescriptions.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.ResourceTextureDescriptions.cs deleted file mode 100644 index b5f5a68e..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.ResourceTextureDescriptions.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System.Collections.Immutable; -using ComputeSharp.D2D1.SourceGenerators.Models; -using ComputeSharp.SourceGeneration.Extensions; -using ComputeSharp.SourceGeneration.Helpers; -using ComputeSharp.SourceGeneration.Mappings; -using Microsoft.CodeAnalysis; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -partial class D2DPixelShaderDescriptorGenerator -{ - /// - /// A helper with all logic to generate the ResourceTextureDescriptions property. - /// - private static partial class ResourceTextureDescriptions - { - /// - /// Extracts the resource texture descriptions for the current shader. - /// - /// The input instance to process. - /// The produced resource texture descriptions for the shader. - public static void GetInfo( - INamedTypeSymbol structDeclarationSymbol, - out ImmutableArray resourceTextureDescriptions) - { - using ImmutableArrayBuilder builder = new(); - - foreach (ISymbol memberSymbol in structDeclarationSymbol.GetMembers().OfType()) - { - // Only look for fields of a named type symbol (diagnostics is emitted by the HLSL rewriter if it's not the case). - // We're only looking for instance fields of unmanaged types in this case (as resource textures are structs). - if (memberSymbol is not IFieldSymbol { IsStatic: false, Type: INamedTypeSymbol { IsUnmanagedType: true, IsGenericType: true } typeSymbol } fieldSymbol) - { - continue; - } - - string metadataName = typeSymbol.GetFullyQualifiedMetadataName(); - - // Check that the field is a resource texture type (if not, it will be processed by the HLSL rewriter too) - if (HlslKnownTypes.IsResourceTextureType(metadataName)) - { - // The type name will be ComputeSharp.D2D1.D2D1ResourceTexture1D`1 or the 2D/3D versions. - // To avoid the intermediate string and the parsing, we can rely on the fact the metadata - // has already been validated here, so we can get the rank by offsetting the characters. - int rank = metadataName[^4] - '0'; - int? index = null; - - // Get the index from the [D2DResourceTextureIndex] attribute over the field - if (fieldSymbol.TryGetAttributeWithFullyQualifiedMetadataName("ComputeSharp.D2D1.D2DResourceTextureIndexAttribute", out AttributeData? attributeData)) - { - // If the constructor argument isn't available, it means the code is invalid. Just do nothing then, as the - // user will have to fix that to get the code to compile anyway. This way the generator won't crash too. - if (attributeData.TryGetConstructorArgument(0, out int resourceIndex)) - { - index = resourceIndex; - } - } - - builder.Add(new ResourceTextureDescription(index ?? 0, rank)); - } - } - - resourceTextureDescriptions = builder.ToImmutable(); - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.cs deleted file mode 100644 index 1d145909..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderDescriptorGenerator.cs +++ /dev/null @@ -1,278 +0,0 @@ -using System.Collections.Immutable; -using System.ComponentModel; -using System.Linq; -using ComputeSharp.D2D1.SourceGenerators.Models; -using ComputeSharp.SourceGeneration.Constants; -using ComputeSharp.SourceGeneration.Extensions; -using ComputeSharp.SourceGeneration.Helpers; -using ComputeSharp.SourceGeneration.Models; -using ComputeSharp.SourceGeneration.SyntaxProcessors; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp.Syntax; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -/// A source generator creating pixel shader descriptors for annotated D2D1 pixel shader types. -/// -[Generator(LanguageNames.CSharp)] -public sealed partial class D2DPixelShaderDescriptorGenerator : IIncrementalGenerator -{ - /// - /// The name of generator to include in the generated code. - /// - private const string GeneratorName = "ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator"; - - /// - public void Initialize(IncrementalGeneratorInitializationContext context) - { - // Discover all shader types and extract all the necessary info from each of them - IncrementalValuesProvider shaderInfo = - context.SyntaxProvider - .ForAttributeWithMetadataName( - "ComputeSharp.D2D1.D2DGeneratedPixelShaderDescriptorAttribute", - static (node, _) => node.IsTypeDeclarationWithOrPotentiallyWithBaseTypes(), - static (context, token) => - { - // The source generator requires unsafe blocks to be enabled (eg. for pointers, [SkipLocalsInit], etc.) - if (!context.SemanticModel.Compilation.IsAllowUnsafeBlocksEnabled()) - { - return default; - } - - // If the type symbol doesn't have at least one interface, it can't possibly be a shader type. - // Also check for generic types, just like with DX12 shaders (including nesting inside generics). - if (context.TargetSymbol is not INamedTypeSymbol { AllInterfaces.Length: > 0, IsGenericType: false } typeSymbol) - { - return default; - } - - // Immediately bail if the target type doesn't have internal accessibility - if (!typeSymbol.IsAccessibleFromContainingAssembly(context.SemanticModel.Compilation)) - { - return default; - } - - INamedTypeSymbol shaderInterfaceType = context.SemanticModel.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.ID2D1PixelShader")!; - - // Check that the shader implements the ID2D1PixelShader interface - if (!typeSymbol.HasInterfaceWithType(shaderInterfaceType)) - { - return default; - } - - // EffectId info - ImmutableArray effectId = EffectId.GetInfo(context.SemanticModel.Compilation, typeSymbol); - - token.ThrowIfCancellationRequested(); - - // EffectDisplayName info - string? effectDisplayName = EffectMetadata.GetEffectDisplayNameInfo(context.SemanticModel.Compilation, typeSymbol); - - token.ThrowIfCancellationRequested(); - - // EffectDescription info - string? effectDescription = EffectMetadata.GetEffectDescriptionInfo(context.SemanticModel.Compilation, typeSymbol); - - token.ThrowIfCancellationRequested(); - - // EffectCategory info - string? effectCategory = EffectMetadata.GetEffectCategoryInfo(context.SemanticModel.Compilation, typeSymbol); - - token.ThrowIfCancellationRequested(); - - // EffectAuthor info - string? effectAuthor = EffectMetadata.GetEffectAuthorInfo(context.SemanticModel.Compilation, typeSymbol); - - token.ThrowIfCancellationRequested(); - - // Constant buffer info - ConstantBuffer.GetInfo( - context.SemanticModel.Compilation, - typeSymbol, - out int constantBufferSizeInBytes, - out ImmutableArray fieldInfos); - - token.ThrowIfCancellationRequested(); - - // Get the input info for InputTypes - InputTypes.GetInfo( - typeSymbol, - out int inputCount, - out ImmutableArray inputSimpleIndices, - out ImmutableArray inputComplexIndices, - out ImmutableArray inputTypes); - - token.ThrowIfCancellationRequested(); - - // Get the resource texture info for ResourceTextureDescriptions - ResourceTextureDescriptions.GetInfo( - typeSymbol, - out ImmutableArray resourceTextureDescriptions); - - token.ThrowIfCancellationRequested(); - - // Get the info for the output buffer properties - OutputBuffer.GetInfo(typeSymbol, out D2D1BufferPrecision bufferPrecision, out D2D1ChannelDepth channelDepth); - - token.ThrowIfCancellationRequested(); - - // Get the info for InputDescriptions - InputDescriptions.GetInfo( - typeSymbol, - out ImmutableArray inputDescriptions); - - token.ThrowIfCancellationRequested(); - - // Get the info for PixelOptions - PixelOptions.GetInfo(typeSymbol, out D2D1PixelOptions pixelOptions); - - token.ThrowIfCancellationRequested(); - - // Get the shader profile and linking info for the HLSL bytecode properties - D2D1ShaderProfile? requestedShaderProfile = HlslBytecode.GetRequestedShaderProfile(typeSymbol); - D2D1CompileOptions? requestedCompileOptions = HlslBytecode.GetRequestedCompileOptions(typeSymbol); - D2D1ShaderProfile effectiveShaderProfile = HlslBytecode.GetEffectiveShaderProfile(requestedShaderProfile, out bool isCompilationEnabled); - D2D1CompileOptions effectiveCompileOptions = HlslBytecode.GetEffectiveCompileOptions(requestedCompileOptions); - - token.ThrowIfCancellationRequested(); - - using ImmutableArrayBuilder diagnostics = new(); - - // Get HLSL source for HlslSource - string hlslSource = HlslSource.GetHlslSource( - diagnostics, - context.SemanticModel.Compilation, - typeSymbol, - shaderInterfaceType, - inputCount, - inputSimpleIndices, - inputComplexIndices, - token); - - token.ThrowIfCancellationRequested(); - - // As the last steps in the pipeline, try to compile the shader if needed. - // This is done last so that it can be skipped if any errors happened before. - HlslBytecodeInfoKey hlslInfoKey = new( - hlslSource, - effectiveShaderProfile, - effectiveCompileOptions, - isCompilationEnabled); - - // Get the existing compiled shader, or compile the processed HLSL code - HlslBytecodeInfo hlslInfo = HlslBytecodeSyntaxProcessor.GetInfo(ref hlslInfoKey, token); - - token.ThrowIfCancellationRequested(); - - // Append any diagnostic for the shader compilation - HlslBytecodeSyntaxProcessor.GetInfoDiagnostics(typeSymbol, hlslInfo, diagnostics); - HlslBytecodeSyntaxProcessor.GetDoublePrecisionSupportDiagnostics(typeSymbol, hlslInfo, diagnostics); - - token.ThrowIfCancellationRequested(); - - // Finally, get the hierarchy too - HierarchyInfo hierarchyInfo = HierarchyInfo.From(typeSymbol); - - token.ThrowIfCancellationRequested(); - - return new D2D1ShaderInfo( - Hierarchy: hierarchyInfo, - EffectId: effectId, - EffectDisplayName: effectDisplayName, - EffectDescription: effectDescription, - EffectCategory: effectCategory, - EffectAuthor: effectAuthor, - ConstantBufferSizeInBytes: constantBufferSizeInBytes, - InputTypes: inputTypes, - InputDescriptions: inputDescriptions, - ResourceTextureDescriptions: resourceTextureDescriptions, - Fields: fieldInfos, - BufferPrecision: bufferPrecision, - ChannelDepth: channelDepth, - PixelOptions: pixelOptions, - HlslInfoKey: hlslInfoKey, - HlslInfo: hlslInfo, - Diagnostcs: diagnostics.ToImmutable()); - }) - .WithTrackingName(WellKnownTrackingNames.Execute) - .Where(static item => item is not null)!; - - // We need to create two more incremental steps to ensure we correctly emit diagnostics and re-generate sources. - // First, select an incremental provider with just the diagnostics, which will trigger every time any of them changes. - IncrementalValuesProvider> diagnosticInfo = - shaderInfo - .Select(static (item, _) => item.Diagnostcs) - .WithTrackingName(WellKnownTrackingNames.Diagnostics) - .Where(static item => !item.IsEmpty); - - // Next, select one with just the shader info (and no diagnostics), so that changes there don't trigger generation unnecessarily - IncrementalValuesProvider outputInfo = - shaderInfo - .Select(static (item, _) => item with { Diagnostcs = default }) - .WithTrackingName(WellKnownTrackingNames.Output); - - // Output the diagnostics, if any - context.ReportDiagnostics(diagnosticInfo); - - // Generate the source files, if any - context.RegisterSourceOutput(outputInfo, static (context, item) => - { - using ImmutableArrayBuilder> declaredMembers = new(); - - declaredMembers.Add(EffectId.WriteSyntax); - declaredMembers.Add(EffectMetadata.WriteEffectDisplayNameSyntax); - declaredMembers.Add(EffectMetadata.WriteEffectDescriptionSyntax); - declaredMembers.Add(EffectMetadata.WriteEffectCategorySyntax); - declaredMembers.Add(EffectMetadata.WriteEffectAuthorSyntax); - declaredMembers.Add(EffectFactory.WriteSyntax); - declaredMembers.Add(NumericProperties.WriteConstantBufferSizeSyntax); - declaredMembers.Add(NumericProperties.WriteInputCountSyntax); - declaredMembers.Add(NumericProperties.WriteResourceTextureCountSyntax); - declaredMembers.Add(InputTypes.WriteSyntax); - declaredMembers.Add(InputDescriptions.WriteSyntax); - declaredMembers.Add(ResourceTextureDescriptions.WriteSyntax); - declaredMembers.Add(PixelOptions.WriteSyntax); - declaredMembers.Add(OutputBuffer.WriteBufferPrecisionSyntax); - declaredMembers.Add(OutputBuffer.WriteChannelDepthSyntax); - declaredMembers.Add(HlslBytecode.WriteShaderProfileSyntax); - declaredMembers.Add(HlslBytecode.WriteCompileOptionsSyntax); - declaredMembers.Add(HlslSource.WriteSyntax); - declaredMembers.Add(HlslBytecode.WriteHlslBytecodeSyntax); - declaredMembers.Add(ConstantBuffer.WriteCreateFromConstantBufferSyntax); - declaredMembers.Add(ConstantBuffer.WriteLoadConstantBufferSyntax); - - using ImmutableArrayBuilder> additionalTypes = new(); - using ImmutableHashSetBuilder usingDirectives = new(); - - ConstantBufferSyntaxProcessor.RegisterAdditionalTypesSyntax(GeneratorName, BindingDirection.TwoWay, item, additionalTypes, usingDirectives); - InputDescriptions.RegisterAdditionalTypesSyntax(item, additionalTypes, usingDirectives); - InputTypes.RegisterAdditionalTypesSyntax(item, additionalTypes, usingDirectives); - HlslBytecode.RegisterAdditionalTypesSyntax(item, additionalTypes, usingDirectives); - - using IndentedTextWriter writer = new(); - - item.Hierarchy.WriteSyntax( - state: item, - writer: writer, - baseTypes: [$"global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor<{item.Hierarchy.Hierarchy[0].QualifiedName}>"], - memberCallbacks: declaredMembers.WrittenSpan); - - // If any generated types are needed, they go into a separate namespace - // This allows the code to use using directives without any conflicts. - if (additionalTypes.Count > 0) - { - writer.WriteLine(); - writer.WriteLine("namespace ComputeSharp.D2D1.Generated"); - - using (writer.WriteBlock()) - { - writer.WriteSortedUsingDirectives(usingDirectives.AsEnumerable()); - writer.WriteLineSeparatedMembers(additionalTypes.WrittenSpan, (callback, writer) => callback(item, writer)); - } - } - - context.AddSource($"{item.Hierarchy.FullyQualifiedMetadataName}.g.cs", writer.ToString()); - }); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderSourceGenerator.Execute.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderSourceGenerator.Execute.cs deleted file mode 100644 index d728efce..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderSourceGenerator.Execute.cs +++ /dev/null @@ -1,180 +0,0 @@ -using System.Collections.Immutable; -using ComputeSharp.D2D1.SourceGenerators.Models; -using ComputeSharp.SourceGeneration.Extensions; -using ComputeSharp.SourceGeneration.Helpers; -using ComputeSharp.SourceGeneration.Models; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp; -using static ComputeSharp.SourceGeneration.Diagnostics.DiagnosticDescriptors; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -partial class D2DPixelShaderSourceGenerator -{ - /// - /// A container for all the logic for . - /// - private static partial class Execute - { - /// - /// Validates that the return type of the annotated method is valid and returns the type name. - /// - /// The input instance to process. - /// The fully qualified type name, if invalid. - public static string? GetInvalidReturnType(IMethodSymbol methodSymbol) - { - if (methodSymbol.ReturnType is not INamedTypeSymbol - { - Name: "ReadOnlySpan", - ContainingNamespace.Name: "System", - IsGenericType: true, - TypeArguments: [{ SpecialType: SpecialType.System_Byte }] - }) - { - return methodSymbol.ReturnType.ToDisplayString(SymbolDisplayFormat.FullyQualifiedFormat); - } - - return null; - } - - /// - /// Extracts the HLSL source from an annotated method. - /// - /// The input instance to process. - /// The HLSL source to compile, if present. - public static string? GetHlslSource(IMethodSymbol methodSymbol) - { - if (methodSymbol.TryGetAttributeWithFullyQualifiedMetadataName("ComputeSharp.D2D1.D2DPixelShaderSourceAttribute", out AttributeData? attributeData) && - attributeData!.TryGetConstructorArgument(0, out string? hlslSource)) - { - return hlslSource; - } - - return null; - } - - /// - /// Extracts the shader profile for a target method, if present. - /// - /// The input instance to process. - /// The shader profile to use to compile the shader, if present. - public static D2D1ShaderProfile? GetShaderProfile(IMethodSymbol methodSymbol) - { - if (methodSymbol.TryGetAttributeWithFullyQualifiedMetadataName("ComputeSharp.D2D1.D2DShaderProfileAttribute", out AttributeData? attributeData)) - { - return (D2D1ShaderProfile)attributeData.ConstructorArguments[0].Value!; - } - - if (methodSymbol.ContainingAssembly.TryGetAttributeWithFullyQualifiedMetadataName("ComputeSharp.D2D1.D2DShaderProfileAttribute", out attributeData)) - { - return (D2D1ShaderProfile)attributeData.ConstructorArguments[0].Value!; - } - - return null; - } - - /// - /// Extracts the compile options for the current shader. - /// - /// The input instance to process. - /// The compile options to use to compile the shader, if present. - public static D2D1CompileOptions GetCompileOptions(IMethodSymbol methodSymbol) - { - if (methodSymbol.TryGetAttributeWithFullyQualifiedMetadataName("ComputeSharp.D2D1.D2DCompileOptionsAttribute", out AttributeData? attributeData)) - { - return (D2D1CompileOptions)attributeData.ConstructorArguments[0].Value!; - } - - if (methodSymbol.ContainingAssembly.TryGetAttributeWithFullyQualifiedMetadataName("ComputeSharp.D2D1.D2DCompileOptionsAttribute", out attributeData)) - { - return (D2D1CompileOptions)attributeData.ConstructorArguments[0].Value!; - } - - return D2D1CompileOptions.Default; - } - - /// - /// Gets any diagnostics from a processed instance. - /// - /// The input instance to process. - /// The source instance. - /// The collection of produced instances. - public static ImmutableArray GetInfoDiagnostics(IMethodSymbol methodSymbol, HlslBytecodeInfo info) - { - if (info is HlslBytecodeInfo.Win32Error win32Error) - { - DiagnosticInfo diagnostic = DiagnosticInfo.Create( - D2DPixelShaderSourceCompilationFailedWithWin32Exception, - methodSymbol, - methodSymbol, - methodSymbol.ContainingType, - win32Error.HResult, - win32Error.Message); - - return [diagnostic]; - } - else if (info is HlslBytecodeInfo.CompilerError fxcError) - { - DiagnosticInfo diagnostic = DiagnosticInfo.Create( - D2DPixelShaderSourceCompilationFailedWithFxcCompilationException, - methodSymbol, - methodSymbol, - methodSymbol.ContainingType, - fxcError.Message); - - return [diagnostic]; - } - - return []; - } - - /// - /// Writes the generated method for the compiled HLSL bytecode. - /// - /// The input instance with gathered shader info. - /// The instance to write into. - public static void WriteSyntax(D2D1PixelShaderSourceInfo info, IndentedTextWriter writer) - { - writer.WriteLine("/// "); - writer.WriteGeneratedAttributes(GeneratorName); - - // Write the modifiers, if any - foreach (uint modifier in info.Modifiers) - { - writer.Write(SyntaxFacts.GetText((SyntaxKind)modifier)); - writer.Write(" "); - } - - // Write the return type - if (info.InvalidReturnType is string invalidReturnType) - { - writer.Write(invalidReturnType); - writer.Write(" "); - } - else - { - writer.Write("global::System.ReadOnlySpan "); - } - - writer.WriteLine($"{info.MethodName}()"); - - // Write the bytecode expression - using (writer.WriteBlock()) - { - if (info.HlslInfo is HlslBytecodeInfo.Success success) - { - writer.Write("return ["); - - SyntaxFormattingHelper.WriteByteArrayInitializationExpressions(success.Bytecode.AsSpan(), writer); - - writer.WriteLine("];"); - } - else - { - writer.Write("return default;"); - } - } - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderSourceGenerator.cs b/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderSourceGenerator.cs deleted file mode 100644 index 0573a8fd..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/D2DPixelShaderSourceGenerator.cs +++ /dev/null @@ -1,117 +0,0 @@ -using System.Collections.Immutable; -using System.Linq; -using ComputeSharp.D2D1.SourceGenerators.Models; -using ComputeSharp.SourceGeneration.Constants; -using ComputeSharp.SourceGeneration.Extensions; -using ComputeSharp.SourceGeneration.Helpers; -using ComputeSharp.SourceGeneration.Models; -using ComputeSharp.SourceGeneration.SyntaxProcessors; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp; -using Microsoft.CodeAnalysis.CSharp.Syntax; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -/// A source generator compiling methods annotated with . -/// -[Generator(LanguageNames.CSharp)] -public sealed partial class D2DPixelShaderSourceGenerator : IIncrementalGenerator -{ - /// - private const string GeneratorName = "ComputeSharp.D2D1.D2DPixelShaderSourceGenerator"; - - /// - public void Initialize(IncrementalGeneratorInitializationContext context) - { - // Get all method declarations with the [D2DPixelShaderSource] attribute and gather all necessary info - IncrementalValuesProvider methodInfo = - context.SyntaxProvider - .ForAttributeWithMetadataName( - "ComputeSharp.D2D1.D2DPixelShaderSourceAttribute", - static (node, _) => node is MethodDeclarationSyntax, - static (context, token) => - { - MethodDeclarationSyntax methodDeclaration = (MethodDeclarationSyntax)context.TargetNode; - IMethodSymbol methodSymbol = (IMethodSymbol)context.TargetSymbol; - - // Get the remaining info for the current shader - ImmutableArray modifiers = methodDeclaration.Modifiers.Select(token => (ushort)token.Kind()).ToImmutableArray(); - string methodName = methodSymbol.Name; - string? invalidReturnType = Execute.GetInvalidReturnType(methodSymbol); - string? requestedHlslSource = Execute.GetHlslSource(methodSymbol); - string effectiveHlslSource = requestedHlslSource ?? ""; - D2D1CompileOptions compileOptions = Execute.GetCompileOptions(methodSymbol); - - // For the shader profile, reuse the same logic as in D2D1PixelShaderDescriptorGenerator. - // The only difference is that in this case, we also skip if the source is null. - D2D1ShaderProfile? requestedShaderProfile = Execute.GetShaderProfile(methodSymbol); - D2D1ShaderProfile effectiveShaderProfile = requestedShaderProfile ?? D2D1ShaderProfile.PixelShader50; - bool isCompilationEnabled = requestedHlslSource is not null && requestedShaderProfile is not null; - - token.ThrowIfCancellationRequested(); - - // Prepare the key to cache the bytecode (just like the main D2D1 generator) - HlslBytecodeInfoKey hlslInfoKey = new( - effectiveHlslSource, - effectiveShaderProfile, - compileOptions, - isCompilationEnabled); - - // Get the existing compiled shader, or compile the processed HLSL code - HlslBytecodeInfo hlslInfo = HlslBytecodeSyntaxProcessor.GetInfo(ref hlslInfoKey, token); - - token.ThrowIfCancellationRequested(); - - // Get any diagnostics for the shader compilation - ImmutableArray diagnostics = Execute.GetInfoDiagnostics(methodSymbol, hlslInfo); - - token.ThrowIfCancellationRequested(); - - // Finally, get the hierarchy too - HierarchyInfo hierarchyInfo = HierarchyInfo.From(methodSymbol.ContainingType!); - - token.ThrowIfCancellationRequested(); - - return new D2D1PixelShaderSourceInfo( - Hierarchy: hierarchyInfo, - Modifiers: modifiers, - MethodName: methodName, - InvalidReturnType: invalidReturnType, - HlslInfoKey: hlslInfoKey, - HlslInfo: hlslInfo, - Diagnostcs: diagnostics); - }) - .WithTrackingName(WellKnownTrackingNames.Execute); - - // Get the diagnostic incremental collection with filtering (same as in the D2D1 generator) - IncrementalValuesProvider> diagnosticInfo = - methodInfo - .Select(static (item, _) => item.Diagnostcs) - .WithTrackingName(WellKnownTrackingNames.Diagnostics) - .Where(static item => !item.IsEmpty); - - // Also get the comparison-friendly incremental collection for the output (same as above) - IncrementalValuesProvider outputInfo = - methodInfo - .Select(static (item, _) => item with { Diagnostcs = default }) - .WithTrackingName(WellKnownTrackingNames.Output); - - // Output the diagnostics, if any - context.ReportDiagnostics(diagnosticInfo); - - // Generate the shader bytecode methods - context.RegisterSourceOutput(outputInfo, static (context, item) => - { - using IndentedTextWriter writer = new(); - - item.Hierarchy.WriteSyntax( - state: item, - writer: writer, - baseTypes: [], - memberCallbacks: [Execute.WriteSyntax]); - - context.AddSource($"{item.Hierarchy.FullyQualifiedMetadataName}.{item.MethodName}.g.cs", writer.ToString()); - }); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/D2DEnableRuntimeCompilationOnAssemblyAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/D2DEnableRuntimeCompilationOnAssemblyAnalyzer.cs deleted file mode 100644 index 559f2263..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/D2DEnableRuntimeCompilationOnAssemblyAnalyzer.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.Collections.Immutable; -using ComputeSharp.SourceGeneration.Extensions; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; -using static ComputeSharp.SourceGeneration.Diagnostics.DiagnosticDescriptors; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -/// A diagnostic analyzer that generates diagnostics for the [D2DEnableRuntimeCompilation] attribute, when used on an assembly. -/// -[DiagnosticAnalyzer(LanguageNames.CSharp)] -public sealed class D2DEnableRuntimeCompilationOnAssemblyAnalyzer : DiagnosticAnalyzer -{ - /// - public override ImmutableArray SupportedDiagnostics { get; } = [D2DRuntimeCompilationOnAssemblyNotNecessary]; - - /// - public override void Initialize(AnalysisContext context) - { - context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); - context.EnableConcurrentExecution(); - - context.RegisterCompilationAction(static context => - { - IAssemblySymbol assemblySymbol = context.Compilation.Assembly; - - // Emit a diagnostic if an assembly has both [D2DShaderProfile] and [D2DEnableRuntimeCompilation] (the latter is useless) - if (assemblySymbol.TryGetAttributeWithFullyQualifiedMetadataName("ComputeSharp.D2D1.D2DShaderProfileAttribute", out _) && - assemblySymbol.TryGetAttributeWithFullyQualifiedMetadataName("ComputeSharp.D2D1.D2DEnableRuntimeCompilationAttribute", out AttributeData? attributeData)) - { - context.ReportDiagnostic(Diagnostic.Create( - D2DRuntimeCompilationOnAssemblyNotNecessary, - attributeData.GetLocation(), - assemblySymbol)); - } - }); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/D2DEnableRuntimeCompilationOnTypeAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/D2DEnableRuntimeCompilationOnTypeAnalyzer.cs deleted file mode 100644 index e5e70edd..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/D2DEnableRuntimeCompilationOnTypeAnalyzer.cs +++ /dev/null @@ -1,94 +0,0 @@ -using System.Collections.Immutable; -using System.Linq; -using ComputeSharp.SourceGeneration.Extensions; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; -using static ComputeSharp.SourceGeneration.Diagnostics.DiagnosticDescriptors; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -/// A diagnostic analyzer that generates diagnostics for the [D2DEnableRuntimeCompilation] attribute, when used on a type. -/// -[DiagnosticAnalyzer(LanguageNames.CSharp)] -public sealed class D2DEnableRuntimeCompilationOnTypeAnalyzer : DiagnosticAnalyzer -{ - /// - public override ImmutableArray SupportedDiagnostics { get; } = [D2DRuntimeCompilationDisabled, D2DRuntimeCompilationAlreadyEnabled, D2DRuntimeCompilationOnTypeNotNecessary]; - - /// - public override void Initialize(AnalysisContext context) - { - context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); - context.EnableConcurrentExecution(); - - context.RegisterCompilationStartAction(static context => - { - // Get the [D2DShaderProfile], [D2DEnableRuntimeCompilation] and [D2DGeneratedPixelShaderDescriptor] symbols - if (context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2DShaderProfileAttribute") is not { } d2DShaderProfileAttributeSymbol || - context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2DEnableRuntimeCompilationAttribute") is not { } d2DEnableRuntimeCompilationAttributeSymbol || - context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2DGeneratedPixelShaderDescriptorAttribute") is not { } d2DGeneratedPixelShaderDescriptorAttributeSymbol) - { - return; - } - - context.RegisterSymbolAction(context => - { - // Only struct types are possible targets - if (context.Symbol is not INamedTypeSymbol { TypeKind: TypeKind.Struct } typeSymbol) - { - return; - } - - // Skip the type if it's not a generated shader descriptor target - if (!typeSymbol.HasAttributeWithType(d2DGeneratedPixelShaderDescriptorAttributeSymbol)) - { - return; - } - - // This analyzer will detect the following cases: - // 1) Shader not precompiled, and missing [D2DEnableRuntimeCompilation] (D2DRuntimeCompilationDisabled) - // 2) Shader with [D2DEnableRuntimeCompilation] on the assembly and also on the shader type (D2DRuntimeCompilationAlreadyEnabled) - // 3) Shader being precompiled, but also with [D2DEnableRuntimeCompilation] (D2DRuntimeCompilationNotNecessary) - bool hasD2DShaderProfileAttributeOnAssembly = typeSymbol.ContainingAssembly.HasAttributeWithType(d2DShaderProfileAttributeSymbol); - bool hasD2DShaderProfileAttributeOnType = typeSymbol.HasAttributeWithType(d2DShaderProfileAttributeSymbol); - bool hasD2DEnableRuntimeCompilationAttributeOnAssembly = typeSymbol.ContainingAssembly.HasAttributeWithType(d2DEnableRuntimeCompilationAttributeSymbol); - bool hasD2DEnableRuntimeCompilationAttributeOnType = typeSymbol.TryGetAttributeWithType( - d2DEnableRuntimeCompilationAttributeSymbol, - out AttributeData? d2DEnableRuntimeCompilationAttributeData); - - // If [D2DEnableRuntimeCompilation] is present on the type and also on the assembly, emit a diagnostic (2) - if (hasD2DEnableRuntimeCompilationAttributeOnAssembly && hasD2DEnableRuntimeCompilationAttributeOnType) - { - context.ReportDiagnostic(Diagnostic.Create( - D2DRuntimeCompilationAlreadyEnabled, - d2DEnableRuntimeCompilationAttributeData!.GetLocation(), - typeSymbol)); - } - - // Check if the shader is precompiled: - // - If it is, we should check that it's not annotated with [D2DEnableRuntimeCompilation] - // - If it is not, we should check that it is annotated with [D2DEnableRuntimeCompilation] - if (hasD2DShaderProfileAttributeOnType || hasD2DShaderProfileAttributeOnAssembly) - { - // Emit a diagnostic if [D2DEnableRuntimeCompilation] is present on the type (3) - if (hasD2DEnableRuntimeCompilationAttributeOnType) - { - context.ReportDiagnostic(Diagnostic.Create( - D2DRuntimeCompilationOnTypeNotNecessary, - d2DEnableRuntimeCompilationAttributeData!.GetLocation(), - typeSymbol)); - } - } - else if (!hasD2DEnableRuntimeCompilationAttributeOnType && !hasD2DEnableRuntimeCompilationAttributeOnAssembly) - { - // Emit a diagnostic if there is no [D2DEnableRuntimeCompilation] set anywhere (1) - context.ReportDiagnostic(Diagnostic.Create( - D2DRuntimeCompilationDisabled, - typeSymbol.Locations.FirstOrDefault(), - typeSymbol)); - } - }, SymbolKind.NamedType); - }); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/ExcedeedPixelShaderDispatchDataSizeAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/ExcedeedPixelShaderDispatchDataSizeAnalyzer.cs deleted file mode 100644 index 69a850bb..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/ExcedeedPixelShaderDispatchDataSizeAnalyzer.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System.Collections.Immutable; -using System.Linq; -using ComputeSharp.SourceGeneration.Extensions; -using ComputeSharp.SourceGeneration.SyntaxProcessors; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; -using static ComputeSharp.SourceGeneration.Diagnostics.DiagnosticDescriptors; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -/// A diagnostic analyzer that generates errors when a D2D pixel shader exceeds the maximum dispatch data size. -/// -[DiagnosticAnalyzer(LanguageNames.CSharp)] -public sealed class ExceededPixelShaderDispatchDataSizeAnalyzer : DiagnosticAnalyzer -{ - /// - public override ImmutableArray SupportedDiagnostics { get; } = [ExceededDispatchDataSize]; - - /// - public override void Initialize(AnalysisContext context) - { - context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); - context.EnableConcurrentExecution(); - - context.RegisterCompilationStartAction(static context => - { - // Get the ID2D1PixelShader symbol - if (context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.ID2D1PixelShader") is not { } d2D1PixelShaderSymbol) - { - return; - } - - context.RegisterSymbolAction(context => - { - // We're validating all struct types (since they're the possible shader types) - if (context.Symbol is not INamedTypeSymbol { TypeKind: TypeKind.Struct } typeSymbol) - { - return; - } - - // Only validate fields for shader types (even without a generated descriptor) - if (!typeSymbol.HasInterfaceWithType(d2D1PixelShaderSymbol)) - { - return; - } - - int constantBufferSizeInBytes = 0; - - // Run the fast-path constant buffer processor logic. - // This only extracts the constant buffer size. - ConstantBufferSyntaxProcessor.GetInfo( - context.Compilation, - typeSymbol, - ref constantBufferSizeInBytes); - - // The maximum size for a constant buffer is 64KB - const int D3D11_REQ_CONSTANT_BUFFER_ELEMENT_COUNT = 4096; - const int MaximumConstantBufferSize = D3D11_REQ_CONSTANT_BUFFER_ELEMENT_COUNT * 4 * sizeof(float); - - // Emit a diagnostic if the shader constant buffer is too large - if (constantBufferSizeInBytes > MaximumConstantBufferSize) - { - context.ReportDiagnostic(Diagnostic.Create( - ExceededDispatchDataSize, - typeSymbol.Locations.First(), - typeSymbol, - constantBufferSizeInBytes)); - } - }, SymbolKind.NamedType); - }); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidAssemblyLevelCompileOptionsAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidAssemblyLevelCompileOptionsAnalyzer.cs deleted file mode 100644 index 5b3ad418..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidAssemblyLevelCompileOptionsAnalyzer.cs +++ /dev/null @@ -1,48 +0,0 @@ -using System.Collections.Immutable; -using ComputeSharp.SourceGeneration.Extensions; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; -using static ComputeSharp.SourceGeneration.Diagnostics.DiagnosticDescriptors; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -/// A diagnostic analyzer that generates an error whenever invalid options are used in an assembly-level [D2D1CompileOptions] attribute. -/// -[DiagnosticAnalyzer(LanguageNames.CSharp)] -public sealed class InvalidAssemblyLevelCompileOptionsAnalyzer : DiagnosticAnalyzer -{ - /// - public override ImmutableArray SupportedDiagnostics { get; } = [InvalidPackMatrixColumnMajorOption]; - - /// - public override void Initialize(AnalysisContext context) - { - context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); - context.EnableConcurrentExecution(); - - context.RegisterCompilationAction(static context => - { - IAssemblySymbol assemblySymbol = context.Compilation.Assembly; - - // In order to emit diagnostics for [D2D1CompileOptions] attributes at the assembly level, the following is needed: - // - The type symbol for the assembly, to get the AttributeData object for the [D2D1CompileOptions] attribute, if used. - // - The syntax node representing the attribute targeting the assembly, to get a location (this is retrieved from the AttributeData). - // - The input D2D1CompileOptions value, which can be retrieved from the constructor arguments of the AttributeData object. - if (assemblySymbol.TryGetAttributeWithFullyQualifiedMetadataName("ComputeSharp.D2D1.D2DCompileOptionsAttribute", out AttributeData? attributeData)) - { - D2D1CompileOptions options = (D2D1CompileOptions)attributeData.ConstructorArguments[0].Value!; - - if ((options & D2D1CompileOptions.PackMatrixColumnMajor) != 0) - { - Diagnostic diagnostic = Diagnostic.Create( - InvalidPackMatrixColumnMajorOption, - attributeData.ApplicationSyntaxReference?.GetSyntax(context.CancellationToken).GetLocation(), - assemblySymbol); - - context.ReportDiagnostic(diagnostic); - } - } - }); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2D1PixelOptionsTrivialSamplingOnShaderTypeAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2D1PixelOptionsTrivialSamplingOnShaderTypeAnalyzer.cs deleted file mode 100644 index d95237b6..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2D1PixelOptionsTrivialSamplingOnShaderTypeAnalyzer.cs +++ /dev/null @@ -1,120 +0,0 @@ -using System; -using System.Collections.Immutable; -using ComputeSharp.SourceGeneration.Extensions; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; -using static ComputeSharp.SourceGeneration.Diagnostics.DiagnosticDescriptors; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -/// A diagnostic analyzer that generates an error whenever [D2DPixelOptions] is used on a shader type to incorrectly request trivial sampling. -/// -[DiagnosticAnalyzer(LanguageNames.CSharp)] -public sealed class InvalidD2D1PixelOptionsTrivialSamplingOnShaderTypeAnalyzer : DiagnosticAnalyzer -{ - /// - public override ImmutableArray SupportedDiagnostics { get; } = [InvalidD2D1PixelOptionsTrivialSamplingOnShaderType]; - - /// - public override void Initialize(AnalysisContext context) - { - context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); - context.EnableConcurrentExecution(); - - context.RegisterCompilationStartAction(static context => - { - // Get the [D2DPixelOptions], [D2DInputCount] and [D2DInputSimple] symbols - if (context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2DPixelOptionsAttribute") is not { } d2DPixelOptionsAttributeSymbol || - context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2DInputCountAttribute") is not { } d2DInputCountAttributeSymbol || - context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2DInputSimpleAttribute") is not { } d2DInputSimpleAttributeSymbol) - { - return; - } - - context.RegisterSymbolAction(context => - { - // Only struct types are possible targets - if (context.Symbol is not INamedTypeSymbol { TypeKind: TypeKind.Struct } typeSymbol) - { - return; - } - - // If the type is not using [D2DPixelOptions] with D2D1PixelOptions.TrivialSampling, there's nothing to do - if (!typeSymbol.TryGetAttributeWithType(d2DPixelOptionsAttributeSymbol, out AttributeData? pixelOptionsAttribute) || - !((D2D1PixelOptions)pixelOptionsAttribute.ConstructorArguments[0].Value!).HasFlag(D2D1PixelOptions.TrivialSampling)) - { - return; - } - - // Make sure we have the [D2DInputCount] (if not present, the shader is invalid anyway) and with a valid value - if (!typeSymbol.TryGetAttributeWithType(d2DInputCountAttributeSymbol, out AttributeData? inputCountAttribute) || - inputCountAttribute.ConstructorArguments is not [{ Value: >= 0 and < 8 and int inputCount }]) - { - return; - } - - // Emit a diagnostic if the compile options are not valid for the shader type - if (!IsSimpleInputShader(typeSymbol, d2DInputSimpleAttributeSymbol, inputCount)) - { - context.ReportDiagnostic(Diagnostic.Create( - InvalidD2D1PixelOptionsTrivialSamplingOnShaderType, - pixelOptionsAttribute.GetLocation(), - typeSymbol)); - } - }, SymbolKind.NamedType); - }); - } - - /// - /// Checks whether a given shader only has simple inputs. - /// - /// The input instance to process. - /// The symbol for the [D2DInputSimple] attribute. - /// The number of inputs for the shader. - /// Whether the shader only has simple inputs. - private static unsafe bool IsSimpleInputShader( - INamedTypeSymbol structDeclarationSymbol, - INamedTypeSymbol d2DInputSimpleSymbolAttributeSymbol, - int inputCount) - { - // We cannot trust the input count to be valid at this point (it may be invalid and - // with diagnostic already emitted for it). So first, just clamp it in the right range. - inputCount = Math.Max(0, Math.Min(8, inputCount)); - - // If there are no inputs, the shader is as if only had simple inputs - if (inputCount == 0) - { - return true; - } - - // Build a map of all simple inputs (unmarked inputs default to being complex). - // We can never have more than 8 inputs, and if there are it means the shader is - // not valid. Just ignore them, and the generator will emit a separate diagnostic. - Span simpleInputsMap = stackalloc bool[8]; - - // We first start with all inputs marked as complex (ie. not simple) - simpleInputsMap.Clear(); - - foreach (AttributeData attributeData in structDeclarationSymbol.GetAttributes()) - { - // Only retrieve indices of simple inputs that are in range. If an input is out of - // range, the diagnostic for it will already be emitted by a previous generator step. - if (SymbolEqualityComparer.Default.Equals(attributeData.AttributeClass, d2DInputSimpleSymbolAttributeSymbol) && - attributeData.ConstructorArguments is [{ Value: >= 0 and < 8 and int index }]) - { - simpleInputsMap[index] = true; - } - } - - bool isSimpleInputShader = true; - - // Validate all inputs in our range (filtered by the allowed one) - foreach (bool isSimpleInput in simpleInputsMap[..inputCount]) - { - isSimpleInputShader &= isSimpleInput; - } - - return isSimpleInputShader; - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DGeneratedPixelShaderDescriptorAttributeTargetAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DGeneratedPixelShaderDescriptorAttributeTargetAnalyzer.cs deleted file mode 100644 index e0575e7d..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DGeneratedPixelShaderDescriptorAttributeTargetAnalyzer.cs +++ /dev/null @@ -1,58 +0,0 @@ -using System.Collections.Immutable; -using ComputeSharp.SourceGeneration.Extensions; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; -using static ComputeSharp.SourceGeneration.Diagnostics.DiagnosticDescriptors; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -/// A diagnostic analyzer that generates an error whenever the [D2DGeneratedPixelShaderDescriptor] attribute is used on an invalid target type. -/// -[DiagnosticAnalyzer(LanguageNames.CSharp)] -public sealed class InvalidD2DGeneratedPixelShaderDescriptorAttributeTargetAnalyzer : DiagnosticAnalyzer -{ - /// - public override ImmutableArray SupportedDiagnostics { get; } = [InvalidD2DGeneratedPixelShaderDescriptorAttributeTarget]; - - /// - public override void Initialize(AnalysisContext context) - { - context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); - context.EnableConcurrentExecution(); - - context.RegisterCompilationStartAction(static context => - { - // Get the ID2D1PixelShader and [D2DGeneratedPixelShaderDescriptor] symbols - if (context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.ID2D1PixelShader") is not { } d2D1PixelShaderSymbol || - context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2DGeneratedPixelShaderDescriptorAttribute") is not { } d2DGeneratedPixelShaderDescriptorAttributeSymbol) - { - return; - } - - context.RegisterSymbolAction(context => - { - // Only struct types are possible targets - if (context.Symbol is not INamedTypeSymbol { TypeKind: TypeKind.Struct } typeSymbol) - { - return; - } - - // If the type does not have [D2DGeneratedPixelShaderDescriptor], we can stop here - if (!typeSymbol.TryGetAttributeWithType(d2DGeneratedPixelShaderDescriptorAttributeSymbol, out AttributeData? attribute)) - { - return; - } - - // Emit a diagnostic if the target type is generic or does not implement ID2D1PixelShader - if (typeSymbol.IsGenericType || !typeSymbol.HasInterfaceWithType(d2D1PixelShaderSymbol)) - { - context.ReportDiagnostic(Diagnostic.Create( - InvalidD2DGeneratedPixelShaderDescriptorAttributeTarget, - attribute.GetLocation(), - typeSymbol)); - } - }, SymbolKind.NamedType); - }); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DInputArgumentAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DInputArgumentAnalyzer.cs deleted file mode 100644 index 24631108..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DInputArgumentAnalyzer.cs +++ /dev/null @@ -1,202 +0,0 @@ -using System.Collections.Immutable; -using System.Diagnostics.CodeAnalysis; -using System.Reflection; -using ComputeSharp.D2D1.Interop; -using ComputeSharp.D2D1.Intrinsics; -using ComputeSharp.SourceGeneration.Extensions; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp; -using Microsoft.CodeAnalysis.Diagnostics; -using Microsoft.CodeAnalysis.Operations; -using static ComputeSharp.SourceGeneration.Diagnostics.DiagnosticDescriptors; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -/// A diagnostic analyzer that generates an error whenever an invocation to a D2D intrinsic references an out of range or invalid shader input. -/// -[DiagnosticAnalyzer(LanguageNames.CSharp)] -public sealed class InvalidD2DInputArgumentAnalyzer : DiagnosticAnalyzer -{ - /// - public override ImmutableArray SupportedDiagnostics { get; } = - [ - IndexOutOfRangeForD2DIntrinsic, - InvalidInputTypeForD2DIntrinsic, - InvalidIndexSyntaxForD2DIntrinsic - ]; - - /// - public override void Initialize(AnalysisContext context) - { - context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.None); - context.EnableConcurrentExecution(); - - context.RegisterCompilationStartAction(static context => - { - // If we can't get the D2D methods map, we have to stop right away - if (!TryBuildMethodSymbolMap(context.Compilation, out ImmutableDictionary? methodSymbols)) - { - return; - } - - context.CancellationToken.ThrowIfCancellationRequested(); - - // Get the '[D2DInputCount]' symbol, which we need to validate the source input arguments - if (context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2DInputCountAttribute") is not { } d2DInputCountAttributeSymbol) - { - return; - } - - // We want to register a callback for each method invocation, as all 'D2D' intrinsics would map to one - context.RegisterOperationAction(context => - { - IInvocationOperation operation = (IInvocationOperation)context.Operation; - - // Cheap initial filter: we only care about static methods from the 'D2D' type - if (operation.TargetMethod is not { IsStatic: true, ContainingType.Name: "D2D" } targetMethodSymbol) - { - return; - } - - // Second cheap inital filter: we only care about invocations with a constant 'int' argument in first position. - // While we're validating this, let's also get the 'index' parameter, since we need to validate it anyway. - if (operation.Arguments is not [{ Value.ConstantValue: { HasValue: true, Value: int index } } firstArgument, ..]) - { - return; - } - - // We only want to kick in when the target parameter is an 'int' (same as in 'NonConstantD2DInputArgumentAnalyzer') - if (firstArgument.Parameter is not { Type.SpecialType: SpecialType.System_Int32 } parameterSymbol) - { - return; - } - - // Validate that the target method is one of the ones we care about, and get the target input type - if (!methodSymbols.TryGetValue(targetMethodSymbol, out D2D1PixelShaderInputType? targetInputType)) - { - return; - } - - // Also check that the actual syntax for the index argument is valid (only literals and direct constant field references - // are valid). For parenthesized expressions, we need to check the parent syntax node (the operation just ignores it). - if (firstArgument.Value is not (ILiteralOperation or IFieldReferenceOperation)) - { - context.ReportDiagnostic(Diagnostic.Create( - InvalidIndexSyntaxForD2DIntrinsic, - firstArgument.Syntax.GetLocation(), - parameterSymbol.Name, - targetMethodSymbol.Name)); - } - else if (firstArgument.Syntax.Parent.IsKind(SyntaxKind.ParenthesizedExpression)) - { - // In this case, we pass the parent syntax node for the location, so that we can - // include the parentheses as well. Otherwise we'd just underline the inner value. - context.ReportDiagnostic(Diagnostic.Create( - InvalidIndexSyntaxForD2DIntrinsic, - firstArgument.Syntax.Parent.GetLocation(), - parameterSymbol.Name, - targetMethodSymbol.Name)); - } - - // We have matched a target symbol, so let's try to get the parent shader - if (context.ContainingSymbol.FirstAncestorOrSelf() is not { TypeKind: TypeKind.Struct } typeSymbol) - { - return; - } - - // We found a containing type, make sure it has '[D2DInputCount]' - if (!typeSymbol.HasAttributeWithType(d2DInputCountAttributeSymbol)) - { - return; - } - - // At this point we can assume the shader type is mostly valid: let's get the actual input counts and types - D2DPixelShaderDescriptorGenerator.InputTypes.GetInfo( - typeSymbol, - out int inputCount, - out _, - out _, - out ImmutableArray inputTypes); - - // First validation: the index must be in range - if ((uint)index >= (uint)inputCount) - { - context.ReportDiagnostic(Diagnostic.Create( - IndexOutOfRangeForD2DIntrinsic, - firstArgument.Syntax.GetLocation(), - targetMethodSymbol.Name, - index, - typeSymbol, - inputCount)); - } - else if (targetInputType is not null && (D2D1PixelShaderInputType)inputTypes[index] != targetInputType) - { - // Second validation: the input type must match - context.ReportDiagnostic(Diagnostic.Create( - InvalidInputTypeForD2DIntrinsic, - firstArgument.Syntax.GetLocation(), - targetMethodSymbol.Name, - index)); - } - }, OperationKind.Invocation); - }); - } - - /// - /// Tries to build a map of instances for all D2D intrinsics and their associated D2D input type. - /// - /// The to consider for analysis. - /// The resulting mapping of resolved instances. - /// Whether all requested instances could be resolved. - private static bool TryBuildMethodSymbolMap(Compilation compilation, [NotNullWhen(true)] out ImmutableDictionary? methodSymbols) - { - // Get the 'D2D' symbol, to get methods from it - if (compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2D") is not { } d2DSymbol) - { - methodSymbols = null; - - return false; - } - - // These are all the 'D2D' intrinsic methods that take a target shader input index - string[] d2DMethodNames = - [ - nameof(D2D.GetInput), - nameof(D2D.GetInputCoordinate), - nameof(D2D.SampleInput), - nameof(D2D.SampleInputAtOffset), - nameof(D2D.SampleInputAtPosition) - ]; - - ImmutableDictionary.Builder inputTypeMethodMap = ImmutableDictionary.CreateBuilder(SymbolEqualityComparer.Default); - - // Validate all methods and build the map - foreach (string d2DMethodName in d2DMethodNames) - { - // If we can't resolve a symbol (shouldn't really ever happen), just stop here - if (d2DSymbol.GetMethod(d2DMethodName) is not { } d2DMethodSymbol) - { - methodSymbols = null; - - return false; - } - - // Lookup the attribute to get the D2D input type (the attribute only exists on the 'D2D' type loaded in the analyzer) - if (typeof(D2D).GetMethod(d2DMethodSymbol.Name).GetCustomAttribute() is { } hlslD2DIntrinsicInputTypeAttribute) - { - inputTypeMethodMap.Add(d2DMethodSymbol, hlslD2DIntrinsicInputTypeAttribute.InputType); - } - else - { - // If the method is not annotated, we stil track it, but we will not indicate any exclusive input type. - // This means that the input index validation logic will still work, but we'll skip the input type checks. - inputTypeMethodMap.Add(d2DMethodSymbol, null); - } - } - - methodSymbols = inputTypeMethodMap.ToImmutable(); - - return true; - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DInputDescriptionAttributeUseAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DInputDescriptionAttributeUseAnalyzer.cs deleted file mode 100644 index c674bf7f..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DInputDescriptionAttributeUseAnalyzer.cs +++ /dev/null @@ -1,122 +0,0 @@ -using System; -using System.Collections.Immutable; -using System.Linq; -using ComputeSharp.SourceGeneration.Extensions; -using ComputeSharp.SourceGeneration.Helpers; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; -using static ComputeSharp.SourceGeneration.Diagnostics.DiagnosticDescriptors; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -/// A diagnostic analyzer that generates errors for all invalid uses of the [D2DInputDescription] attribute. -/// -[DiagnosticAnalyzer(LanguageNames.CSharp)] -public sealed class InvalidD2DInputDescriptionAttributeUseAnalyzer : DiagnosticAnalyzer -{ - /// - public override ImmutableArray SupportedDiagnostics { get; } = [OutOfRangeInputDescriptionIndex, RepeatedD2DInputDescriptionIndices]; - - /// - public override unsafe void Initialize(AnalysisContext context) - { - context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); - context.EnableConcurrentExecution(); - - context.RegisterCompilationStartAction(static context => - { - // Get the [D2DInputDescription], [D2DInputCount] and ID2D1PixelShader symbols - if (context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2DInputDescriptionAttribute") is not { } d2DInputDescriptionAttributeSymbol || - context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2DInputCountAttribute") is not { } d2DInputCountAttributeSymbol || - context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.ID2D1PixelShader") is not { } d2D1PixelShaderSymbol) - { - return; - } - - context.RegisterSymbolAction(context => - { - // We're validating all struct types (since they're the possible shader types) - if (context.Symbol is not INamedTypeSymbol { TypeKind: TypeKind.Struct } typeSymbol) - { - return; - } - - // Only validate fields for shader types (same as for resource textures) - if (!typeSymbol.HasInterfaceWithType(d2D1PixelShaderSymbol)) - { - return; - } - - // Immediately bail if [D2DInputCount] is not present. If that's the case, there's no way to properly - // validate the indices of the input descriptions anyway. Another analyzer will catch these cases. - if (!typeSymbol.TryGetAttributeWithType(d2DInputCountAttributeSymbol, out AttributeData? inputCountData)) - { - return; - } - - int inputCount = (int)inputCountData.ConstructorArguments[0].Value!; - - // Just like in the resource texture analyzer, also bail if the input count is invalid (for the same reason) - if (inputCount is not (>= 0 and <= 8)) - { - return; - } - - using ImmutableArrayBuilder inputDescriptionIndices = new(); - - // Collect all indices of available input descriptions (there's no validation for the other properties) - foreach (AttributeData attributeData in typeSymbol.GetAttributes()) - { - if (SymbolEqualityComparer.Default.Equals(attributeData.AttributeClass, d2DInputDescriptionAttributeSymbol)) - { - inputDescriptionIndices.Add((int)attributeData.ConstructorArguments[0].Value!); - } - } - - // All simple indices must be in range - foreach (int index in inputDescriptionIndices.WrittenSpan) - { - if (index >= inputCount) - { - context.ReportDiagnostic(Diagnostic.Create( - OutOfRangeInputDescriptionIndex, - typeSymbol.Locations.First(), - typeSymbol)); - - break; - } - } - - Span selectedInputDescriptionIndices = stackalloc bool[8]; - - selectedInputDescriptionIndices.Clear(); - - // All input description indices must be unique - foreach (int index in inputDescriptionIndices.WrittenSpan) - { - // Skip this path for invalid indices (just like with resource textures again). - // This would just throw when accessing the span anyway (also it's unlikely). - if (index >= 8) - { - continue; - } - - ref bool isInputDescriptionIndexUsed = ref selectedInputDescriptionIndices[index]; - - if (isInputDescriptionIndexUsed) - { - context.ReportDiagnostic(Diagnostic.Create( - RepeatedD2DInputDescriptionIndices, - typeSymbol.Locations.First(), - typeSymbol)); - - break; - } - - isInputDescriptionIndexUsed = true; - } - }, SymbolKind.NamedType); - }); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DPixelShaderSourceAttributeUseAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DPixelShaderSourceAttributeUseAnalyzer.cs deleted file mode 100644 index 81aa7621..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DPixelShaderSourceAttributeUseAnalyzer.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System.Collections.Immutable; -using System.Linq; -using ComputeSharp.SourceGeneration.Extensions; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; -using static ComputeSharp.SourceGeneration.Diagnostics.DiagnosticDescriptors; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -/// A diagnostic analyzer that generates diagnostics when a method is using [D2DPixelShaderSource] with an invalid argument. -/// -[DiagnosticAnalyzer(LanguageNames.CSharp)] -public sealed class InvalidD2DPixelShaderSourceAttributeUseAnalyzer : DiagnosticAnalyzer -{ - /// - public override ImmutableArray SupportedDiagnostics { get; } = [InvalidD2DPixelShaderSource]; - - /// - public override void Initialize(AnalysisContext context) - { - context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); - context.EnableConcurrentExecution(); - - context.RegisterCompilationStartAction(static context => - { - // Get the [D2DPixelShaderSource] symbol - if (context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2DPixelShaderSourceAttribute") is not { } d2DPixelShaderSourceAttributeSymbol) - { - return; - } - - context.RegisterSymbolAction(context => - { - // Only partial definition methods are possible targets - if (context.Symbol is not IMethodSymbol { IsPartialDefinition: true } methodSymbol) - { - return; - } - - // Ignore methods without [D2DPixelShaderSource] - if (!methodSymbol.TryGetAttributeWithType(d2DPixelShaderSourceAttributeSymbol, out AttributeData? attributeData)) - { - return; - } - - // Emit a diagnostic if there is no valid HLSL source argument - if (!attributeData.TryGetConstructorArgument(0, out string? hlslSource)) - { - context.ReportDiagnostic(Diagnostic.Create( - InvalidD2DPixelShaderSource, - methodSymbol.Locations.First(), - methodSymbol.Name, - methodSymbol.ContainingType)); - } - }, SymbolKind.Method); - }); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DPixelShaderSourceMethodReturnTypeAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DPixelShaderSourceMethodReturnTypeAnalyzer.cs deleted file mode 100644 index cd1053bb..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DPixelShaderSourceMethodReturnTypeAnalyzer.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System.Collections.Immutable; -using System.Linq; -using ComputeSharp.SourceGeneration.Extensions; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; -using static ComputeSharp.SourceGeneration.Diagnostics.DiagnosticDescriptors; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -/// A diagnostic analyzer that generates diagnostics when [D2DPixelShaderSource] is used on a method with an incorrect return type. -/// -[DiagnosticAnalyzer(LanguageNames.CSharp)] -public sealed class InvalidD2DPixelShaderSourceMethodReturnTypeAnalyzer : DiagnosticAnalyzer -{ - /// - public override ImmutableArray SupportedDiagnostics { get; } = [InvalidD2DPixelShaderSourceMethodReturnType]; - - /// - public override void Initialize(AnalysisContext context) - { - context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); - context.EnableConcurrentExecution(); - - context.RegisterCompilationStartAction(static context => - { - // Get the [D2DPixelShaderSource] symbol - if (context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2DPixelShaderSourceAttribute") is not { } d2DPixelShaderSourceAttributeSymbol) - { - return; - } - - // Also get the constructed ReadOnlySpan type - INamedTypeSymbol readOnlySpanSymbol = context.Compilation.GetTypeByMetadataName("System.ReadOnlySpan`1")!; - INamedTypeSymbol byteSymbol = context.Compilation.GetSpecialType(SpecialType.System_Byte); - INamedTypeSymbol readOnlySpanOfByteSymbol = readOnlySpanSymbol.Construct(byteSymbol); - - context.RegisterSymbolAction(context => - { - // Only partial definition methods are possible targets - if (context.Symbol is not IMethodSymbol { IsPartialDefinition: true } methodSymbol) - { - return; - } - - // Ignore methods without [D2DPixelShaderSource] - if (!methodSymbol.HasAttributeWithType(d2DPixelShaderSourceAttributeSymbol)) - { - return; - } - - // Emit a diagnostic if the return type is not ReadOnlySpan - if (!SymbolEqualityComparer.Default.Equals(methodSymbol.ReturnType, readOnlySpanOfByteSymbol)) - { - context.ReportDiagnostic(Diagnostic.Create( - InvalidD2DPixelShaderSourceMethodReturnType, - methodSymbol.Locations.First(), - methodSymbol.Name, - methodSymbol.ContainingType, - methodSymbol.ReturnType)); - } - }, SymbolKind.Method); - }); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DRequiresDoublePrecisionSupportAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DRequiresDoublePrecisionSupportAnalyzer.cs deleted file mode 100644 index 4d2b48d6..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DRequiresDoublePrecisionSupportAnalyzer.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System.Collections.Immutable; -using ComputeSharp.SourceGeneration.Extensions; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; -using static ComputeSharp.SourceGeneration.Diagnostics.DiagnosticDescriptors; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -/// A diagnostic analyzer that generates diagnostics when [D2DRequiresDoublePrecisionSupport] is used incorrectly. -/// -[DiagnosticAnalyzer(LanguageNames.CSharp)] -public sealed class InvalidD2DRequiresDoublePrecisionSupportAnalyzer : DiagnosticAnalyzer -{ - /// - public override ImmutableArray SupportedDiagnostics { get; } = [InvalidD2DRequiresDoublePrecisionSupportAttribute]; - - /// - public override void Initialize(AnalysisContext context) - { - context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); - context.EnableConcurrentExecution(); - - context.RegisterCompilationStartAction(static context => - { - // Get the [D2DRequiresDoublePrecisionSupport], [D2DShaderProfile] and [D2DGeneratedPixelShaderDescriptor] symbols - if (context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2DRequiresDoublePrecisionSupportAttribute") is not { } d2DRequiresDoublePrecisionSupportAttributeSymbol || - context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2DShaderProfileAttribute") is not { } d2DShaderProfileAttributeSymbol || - context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2DGeneratedPixelShaderDescriptorAttribute") is not { } d2DGeneratedPixelShaderDescriptorAttributeSymbol) - { - return; - } - - context.RegisterSymbolAction(context => - { - // Only struct types are possible targets - if (context.Symbol is not INamedTypeSymbol { TypeKind: TypeKind.Struct } typeSymbol) - { - return; - } - - // Skip the type if it's not a generated shader descriptor target - if (!typeSymbol.HasAttributeWithType(d2DGeneratedPixelShaderDescriptorAttributeSymbol)) - { - return; - } - - // If the shader is precompiled, there is nothing left to do - if (typeSymbol.HasAttributeWithType(d2DShaderProfileAttributeSymbol) || - typeSymbol.ContainingAssembly.HasAttributeWithType(d2DShaderProfileAttributeSymbol)) - { - return; - } - - // Emit a diagnostic if the type is not precompiled and has [D2DRequiresDoublePrecisionSupport] - if (typeSymbol.TryGetAttributeWithType(d2DRequiresDoublePrecisionSupportAttributeSymbol, out AttributeData? attributeData)) - { - context.ReportDiagnostic(Diagnostic.Create( - InvalidD2DRequiresDoublePrecisionSupportAttribute, - attributeData.GetLocation(), - typeSymbol)); - } - }, SymbolKind.NamedType); - }); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DResourceTextureIndexAttributeLocationAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DResourceTextureIndexAttributeLocationAnalyzer.cs deleted file mode 100644 index e65386a8..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DResourceTextureIndexAttributeLocationAnalyzer.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System.Collections.Immutable; -using System.Linq; -using ComputeSharp.SourceGeneration.Extensions; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; -using static ComputeSharp.SourceGeneration.Diagnostics.DiagnosticDescriptors; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -/// A diagnostic analyzer that generates an error whenever [D2DResourceTextureIndex] is used incorrectly to annotate a field. -/// -[DiagnosticAnalyzer(LanguageNames.CSharp)] -public sealed class InvalidD2DResourceTextureIndexAttributeLocationAnalyzer : DiagnosticAnalyzer -{ - /// - public override ImmutableArray SupportedDiagnostics { get; } = [InvalidD2DResourceTextureIndexAttributeLocation]; - - /// - public override void Initialize(AnalysisContext context) - { - context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); - context.EnableConcurrentExecution(); - - context.RegisterCompilationStartAction(static context => - { - // Get the [D2DResourceTextureIndex] symbol, and the ones for the D2D resource texture types - if (context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2DResourceTextureIndexAttribute") is not { } d2DResourceTextureIndexAttributeSymbol || - context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2D1ResourceTexture1D`1") is not { } d2D1ResourceTexture1DSymbol || - context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2D1ResourceTexture2D`1") is not { } d2D1ResourceTexture2DSymbol || - context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2D1ResourceTexture3D`1") is not { } d2D1ResourceTexture3DSymbol) - { - return; - } - - // Inspect all fields to make sure they're not using the attribute incorrectly - context.RegisterSymbolAction(context => - { - IFieldSymbol fieldSymbol = (IFieldSymbol)context.Symbol; - - if (fieldSymbol.HasAttributeWithType(d2DResourceTextureIndexAttributeSymbol)) - { - // If the field is using [D2DResourceTextureIndex], it must be a D2D resource texture. We can first - // just check that the field type is a generic named type (since that's the case if it's indeed of - // a D2D resource texture type). Past that, we just check that it's one of the three possible types. - if (fieldSymbol.Type is not INamedTypeSymbol { IsGenericType: true } typeSymbol || - !(SymbolEqualityComparer.Default.Equals(typeSymbol.ConstructedFrom, d2D1ResourceTexture1DSymbol) || - SymbolEqualityComparer.Default.Equals(typeSymbol.ConstructedFrom, d2D1ResourceTexture2DSymbol) || - SymbolEqualityComparer.Default.Equals(typeSymbol.ConstructedFrom, d2D1ResourceTexture3DSymbol))) - { - Diagnostic diagnostic = Diagnostic.Create( - InvalidD2DResourceTextureIndexAttributeLocation, - fieldSymbol.Locations.First(), - fieldSymbol.Name, - fieldSymbol.ContainingType, - fieldSymbol.Type); - - context.ReportDiagnostic(diagnostic); - } - } - }, SymbolKind.Field); - }); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DResourceTextureIndexAttributeUseAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DResourceTextureIndexAttributeUseAnalyzer.cs deleted file mode 100644 index 223ae4c4..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidD2DResourceTextureIndexAttributeUseAnalyzer.cs +++ /dev/null @@ -1,193 +0,0 @@ -using System; -using System.Collections.Immutable; -using System.Linq; -using ComputeSharp.SourceGeneration.Extensions; -using ComputeSharp.SourceGeneration.Helpers; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; -using static ComputeSharp.SourceGeneration.Diagnostics.DiagnosticDescriptors; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -/// A diagnostic analyzer that generates errors for all invalid uses of the [D2DResourceTextureIndex] attribute. -/// -[DiagnosticAnalyzer(LanguageNames.CSharp)] -public sealed class InvalidD2DResourceTextureIndexAttributeUseAnalyzer : DiagnosticAnalyzer -{ - /// - public override ImmutableArray SupportedDiagnostics { get; } = - [ - MissingD2DResourceTextureIndexAttribute, - ResourceTextureIndexOverlappingWithInputIndex, - OutOfRangeResourceTextureIndex, - RepeatedD2DResourceTextureIndices, - ]; - - /// - public override unsafe void Initialize(AnalysisContext context) - { - context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); - context.EnableConcurrentExecution(); - - context.RegisterCompilationStartAction(static context => - { - // Get all necessary symbols (we need a whole bunch of them here) - if (context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2DResourceTextureIndexAttribute") is not { } d2DResourceTextureIndexAttributeSymbol || - context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2D1ResourceTexture1D`1") is not { } d2D1ResourceTexture1DSymbol || - context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2D1ResourceTexture2D`1") is not { } d2D1ResourceTexture2DSymbol || - context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2D1ResourceTexture3D`1") is not { } d2D1ResourceTexture3DSymbol || - context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2DInputCountAttribute") is not { } d2DInputCountAttributeSymbol || - context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.ID2D1PixelShader") is not { } d2D1PixelShaderSymbol) - { - return; - } - - context.RegisterSymbolAction(context => - { - // We're validating all struct types (since they're the possible shader types) - if (context.Symbol is not INamedTypeSymbol { TypeKind: TypeKind.Struct } typeSymbol) - { - return; - } - - // Only validate fields for shader types (even without a generated descriptor) - if (!typeSymbol.HasInterfaceWithType(d2D1PixelShaderSymbol)) - { - return; - } - - using ImmutableArrayBuilder<(int? Index, int Rank)> resourceTextureInfos = new(); - - foreach (ISymbol memberSymbol in typeSymbol.GetMembers()) - { - // Only look for valid candidate fields (same logic as in D2DPixelShaderDescriptorGenerator.InputTypes) - if (memberSymbol is not IFieldSymbol { IsStatic: false, Type: INamedTypeSymbol { IsUnmanagedType: true } } fieldSymbol) - { - continue; - } - - // Specifically check that the type is generic and grab the source one - if (fieldSymbol.Type is not INamedTypeSymbol { ConstructedFrom: { } nonGenericFieldTypeSymbol }) - { - continue; - } - - // Check that the field is a D2D resource texture and get the rank - int rank = nonGenericFieldTypeSymbol switch - { - _ when SymbolEqualityComparer.Default.Equals(d2D1ResourceTexture1DSymbol, nonGenericFieldTypeSymbol) => 1, - _ when SymbolEqualityComparer.Default.Equals(d2D1ResourceTexture2DSymbol, nonGenericFieldTypeSymbol) => 2, - _ when SymbolEqualityComparer.Default.Equals(d2D1ResourceTexture3DSymbol, nonGenericFieldTypeSymbol) => 3, - _ => 0 - }; - - // The field is not a D2D resource texture, just skip it - if (rank == 0) - { - continue; - } - - int? index = null; - - // Try to get the annotated index for the D2D texture, and track it. This - // logic is also in sync with D2DPixelShaderDescriptorGenerator.InputTypes. - if (fieldSymbol.TryGetAttributeWithType(d2DResourceTextureIndexAttributeSymbol, out AttributeData? textureIndexData)) - { - if (textureIndexData.TryGetConstructorArgument(0, out int resourceIndex)) - { - index = resourceIndex; - } - } - else - { - // If the attribute is missing, emit a diagnostic - context.ReportDiagnostic(Diagnostic.Create( - MissingD2DResourceTextureIndexAttribute, - fieldSymbol.Locations.First(), - fieldSymbol.Name, - typeSymbol)); - } - - resourceTextureInfos.Add((index, rank)); - } - - int inputCount = 0; - - // Same logic as in D2DPixelShaderDescriptorGenerator.InputTypes (see there for reference). - // Keeping this in sync to ensure a consistent behavior (this should be updated if that changes). - if (typeSymbol.TryGetAttributeWithType(d2DInputCountAttributeSymbol, out AttributeData? inputCountData)) - { - inputCount = Math.Max((int)inputCountData.ConstructorArguments[0].Value!, 0); - } - - // If the input count is invalid, do nothing and avoid emitting potentially incorrect diagnostics - // based on the resource texture indices with respect to the input count. The generator for the - // InputType property has already emitted diagnostic for this error, so this analyzer can just - // wait for users to go back and fix that issue before proceeding. - if (inputCount is not (>= 0 and <= 8)) - { - return; - } - - // Validate that the resource texture indices don't overlap with the shader inputs - foreach ((int? index, _) in resourceTextureInfos.WrittenSpan) - { - if (index < inputCount) - { - context.ReportDiagnostic(Diagnostic.Create( - ResourceTextureIndexOverlappingWithInputIndex, - typeSymbol.Locations.First(), - typeSymbol)); - - break; - } - } - - // Validate that no resource texture has an index greater than or equal to 16 - foreach ((int? index, _) in resourceTextureInfos.WrittenSpan) - { - if (index >= 16) - { - context.ReportDiagnostic(Diagnostic.Create( - OutOfRangeResourceTextureIndex, - typeSymbol.Locations.First(), - typeSymbol)); - - break; - } - } - - Span selectedResourceTextureIndices = stackalloc bool[16]; - - selectedResourceTextureIndices.Clear(); - - // All input description indices must be unique - foreach ((int? index, _) in resourceTextureInfos.WrittenSpan) - { - // Skip this path for invalid indices, as those will receive other diagnostics. - // We have to do this to avoid generating false positives for the default value. - // Because indices could be out of range, we also have to skip any of those. - if (index is null or >= 16) - { - continue; - } - - ref bool isResourceTextureIndexUsed = ref selectedResourceTextureIndices[index ?? 0]; - - if (isResourceTextureIndexUsed) - { - context.ReportDiagnostic(Diagnostic.Create( - RepeatedD2DResourceTextureIndices, - typeSymbol.Locations.First(), - typeSymbol)); - - break; - } - - isResourceTextureIndexUsed = true; - } - }, SymbolKind.NamedType); - }); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidEffectIdValueAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidEffectIdValueAnalyzer.cs deleted file mode 100644 index 2f552484..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidEffectIdValueAnalyzer.cs +++ /dev/null @@ -1,63 +0,0 @@ -using System; -using System.Collections.Immutable; -using ComputeSharp.SourceGeneration.Extensions; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; -using static ComputeSharp.SourceGeneration.Diagnostics.DiagnosticDescriptors; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -/// A diagnostic analyzer that generates an error whenever [D2DEffectId] is used with an invalid value. -/// -[DiagnosticAnalyzer(LanguageNames.CSharp)] -public sealed class InvalidEffectIdValueAnalyzer : DiagnosticAnalyzer -{ - /// - public override ImmutableArray SupportedDiagnostics { get; } = [InvalidD2DEffectIdAttributeValue]; - - /// - public override void Initialize(AnalysisContext context) - { - context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); - context.EnableConcurrentExecution(); - - context.RegisterCompilationStartAction(static context => - { - // Get the [D2DEffectId] symbol - if (context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2DEffectIdAttribute") is not { } d2DEffectIdAttributeSymbol) - { - return; - } - - context.RegisterSymbolAction(context => - { - // Only struct types are possible targets - if (context.Symbol is not INamedTypeSymbol { TypeKind: TypeKind.Struct } typeSymbol) - { - return; - } - - foreach (AttributeData attributeData in typeSymbol.GetAttributes()) - { - // Look for the [D2DEffectId] use - if (!SymbolEqualityComparer.Default.Equals(attributeData.AttributeClass, d2DEffectIdAttributeSymbol)) - { - continue; - } - - // Validate the GUID text and emit a diagnostic if needed - if (attributeData.ConstructorArguments is not [{ Value: string value }] || - !Guid.TryParse(value, out _)) - { - context.ReportDiagnostic(Diagnostic.Create( - InvalidD2DEffectIdAttributeValue, - attributeData.GetLocation())); - } - - return; - } - }, SymbolKind.NamedType); - }); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidEffectMetadataValueAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidEffectMetadataValueAnalyzer.cs deleted file mode 100644 index 0c4f30ca..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidEffectMetadataValueAnalyzer.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System.Collections.Generic; -using System.Collections.Immutable; -using ComputeSharp.D2D1.SourceGenerators.Helpers; -using ComputeSharp.SourceGeneration.Extensions; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; -using static ComputeSharp.SourceGeneration.Diagnostics.DiagnosticDescriptors; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -/// A diagnostic analyzer that generates an error whenever any shader metadata value attributes are used with an invalid value. -/// -[DiagnosticAnalyzer(LanguageNames.CSharp)] -public sealed class InvalidEffectMetadataValueAnalyzer : DiagnosticAnalyzer -{ - /// - /// The set of type names for all metadata attributes. - /// - private static readonly ImmutableArray MetadataAttributeTypeNames = - [ - "ComputeSharp.D2D1.D2DEffectDisplayNameAttribute", - "ComputeSharp.D2D1.D2DEffectDescriptionAttribute", - "ComputeSharp.D2D1.D2DEffectCategoryAttribute", - "ComputeSharp.D2D1.D2DEffectAuthorAttribute", - ]; - - /// - /// The mapping of diagnostics to their attribute type names. - /// - private static readonly ImmutableDictionary AttributeTypeNameToDiagnosticMapping = ImmutableDictionary.CreateRange( - [ - new KeyValuePair("D2DEffectDisplayNameAttribute", InvalidD2DEffectDisplayNameAttributeValue), - new KeyValuePair("D2DEffectDescriptionAttribute", InvalidD2DEffectDescriptionAttributeValue), - new KeyValuePair("D2DEffectCategoryAttribute", InvalidD2DEffectCategoryAttributeValue), - new KeyValuePair("D2DEffectAuthorAttribute", InvalidD2DEffectAuthorAttributeValue) - ]); - - /// - public override ImmutableArray SupportedDiagnostics { get; } = - [ - InvalidD2DEffectDisplayNameAttributeValue, - InvalidD2DEffectDescriptionAttributeValue, - InvalidD2DEffectCategoryAttributeValue, - InvalidD2DEffectAuthorAttributeValue, - ]; - - /// - public override void Initialize(AnalysisContext context) - { - context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); - context.EnableConcurrentExecution(); - - context.RegisterCompilationStartAction(static context => - { - // Get the metadata attribute symbols - if (!context.Compilation.TryBuildNamedTypeSymbolSet(MetadataAttributeTypeNames, out ImmutableHashSet? typeSymbols)) - { - return; - } - - context.RegisterSymbolAction(context => - { - // Only struct types and assemblies are possible targets - if (context.Symbol is not (INamedTypeSymbol { TypeKind: TypeKind.Struct } or IAssemblySymbol)) - { - return; - } - - foreach (AttributeData attributeData in context.Symbol.GetAttributes()) - { - // Only check attributes we care about - if (attributeData.AttributeClass is not INamedTypeSymbol attributeSymbol || - !typeSymbols.Contains(attributeSymbol)) - { - continue; - } - - // Validate the effect display name - if (!D2D1EffectMetadataParser.IsValidEffectMetadataName(attributeData)) - { - context.ReportDiagnostic(Diagnostic.Create( - AttributeTypeNameToDiagnosticMapping[attributeSymbol.MetadataName], - attributeData.GetLocation())); - } - - return; - } - }, SymbolKind.NamedType | SymbolKind.Assembly); - }); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidShaderTypeCompileOptionsAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidShaderTypeCompileOptionsAnalyzer.cs deleted file mode 100644 index 636cd0b0..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidShaderTypeCompileOptionsAnalyzer.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System.Collections.Immutable; -using ComputeSharp.SourceGeneration.Extensions; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; -using static ComputeSharp.SourceGeneration.Diagnostics.DiagnosticDescriptors; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -/// A diagnostic analyzer that generates an error whenever invalid options are used in a [D2D1CompileOptions] attribute over a shader type. -/// -[DiagnosticAnalyzer(LanguageNames.CSharp)] -public sealed class InvalidShaderTypeCompileOptionsAnalyzer : DiagnosticAnalyzer -{ - /// - public override ImmutableArray SupportedDiagnostics { get; } = [InvalidPackMatrixColumnMajorOption]; - - /// - public override void Initialize(AnalysisContext context) - { - context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); - context.EnableConcurrentExecution(); - - context.RegisterCompilationStartAction(static context => - { - // Get the [D2DCompileOptions] attribute type - if (context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2DCompileOptionsAttribute") is not { } d2DCompileOptionsAttributeSymbol) - { - return; - } - - context.RegisterSymbolAction(context => - { - // We're validating all struct types (since they're the possible shader types) - if (context.Symbol is not INamedTypeSymbol { TypeKind: TypeKind.Struct } typeSymbol) - { - return; - } - - // Check that the type is using [D2DCompileOptions] - if (!typeSymbol.TryGetAttributeWithFullyQualifiedMetadataName("ComputeSharp.D2D1.D2DCompileOptionsAttribute", out AttributeData? attributeData)) - { - return; - } - - D2D1CompileOptions options = (D2D1CompileOptions)attributeData.ConstructorArguments[0].Value!; - - // Same validation and diagnostic as in the assembly-level analyzer - if ((options & D2D1CompileOptions.PackMatrixColumnMajor) != 0) - { - context.ReportDiagnostic(Diagnostic.Create( - InvalidPackMatrixColumnMajorOption, - attributeData.ApplicationSyntaxReference?.GetSyntax(context.CancellationToken).GetLocation(), - typeSymbol)); - } - }, SymbolKind.NamedType); - }); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidShaderTypeInputsAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidShaderTypeInputsAnalyzer.cs deleted file mode 100644 index 6b36923e..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/InvalidShaderTypeInputsAnalyzer.cs +++ /dev/null @@ -1,212 +0,0 @@ -using System; -using System.Collections.Immutable; -using System.Linq; -using ComputeSharp.SourceGeneration.Extensions; -using ComputeSharp.SourceGeneration.Helpers; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; -using static ComputeSharp.SourceGeneration.Diagnostics.DiagnosticDescriptors; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -/// A diagnostic analyzer that generates errors whenever a shader type is declaring invalid inputs. -/// -[DiagnosticAnalyzer(LanguageNames.CSharp)] -public sealed class InvalidShaderTypeInputsAnalyzer : DiagnosticAnalyzer -{ - /// - public override ImmutableArray SupportedDiagnostics { get; } = - [ - MissingD2DInputCountAttribute, - InvalidD2DInputCount, - OutOfRangeInputIndex, - RepeatedD2DInputSimpleIndices, - RepeatedD2DInputComplexIndices, - InvalidSimpleAndComplexIndicesCombination, - ]; - - /// - public override unsafe void Initialize(AnalysisContext context) - { - context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); - context.EnableConcurrentExecution(); - - context.RegisterCompilationStartAction(static context => - { - // Get the [D2DInputCount], [D2DInputSimple], [D2DInputComplex] and ID2D1PixelShader symbols - if (context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2DInputCountAttribute") is not { } d2DInputCountAttributeSymbol || - context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2DInputSimpleAttribute") is not { } d2DInputSimpleAttributeSymbol || - context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2DInputComplexAttribute") is not { } d2DInputComplexAttributeSymbol || - context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.ID2D1PixelShader") is not { } d2D1PixelShaderSymbol) - { - return; - } - - context.RegisterSymbolAction(context => - { - // We're validating all struct types (since they're the possible shader types) - if (context.Symbol is not INamedTypeSymbol { TypeKind: TypeKind.Struct } typeSymbol) - { - return; - } - - // Only validate fields for shader types (same as for resource textures) - if (!typeSymbol.HasInterfaceWithType(d2D1PixelShaderSymbol)) - { - return; - } - - // If there is no [D2DInputCount], we must stop here, but also emit a diagnostic (as it's mandatory) - if (!typeSymbol.TryGetAttributeWithType(d2DInputCountAttributeSymbol, out AttributeData? inputCountData)) - { - context.ReportDiagnostic(Diagnostic.Create( - MissingD2DInputCountAttribute, - typeSymbol.Locations.First(), - typeSymbol)); - - return; - } - - int inputCount = (int)inputCountData.ConstructorArguments[0].Value!; - - // Validate the input count - if (inputCount is not (>= 0 and <= 8)) - { - context.ReportDiagnostic(Diagnostic.Create( - InvalidD2DInputCount, - typeSymbol.Locations.First(), - typeSymbol, - inputCount)); - } - - // If we input is not valid, we can just clamp it to ensure it's nor negative, and - // continue to validate the rest normally. This will avoid some false positives. - inputCount = Math.Max(inputCount, 0); - - using ImmutableArrayBuilder inputSimpleIndices = new(); - using ImmutableArrayBuilder inputComplexIndices = new(); - - // Gather the indices of all explicitly declared simple and complex inputs - foreach (AttributeData attributeData in typeSymbol.GetAttributes()) - { - if (SymbolEqualityComparer.Default.Equals(attributeData.AttributeClass, d2DInputSimpleAttributeSymbol)) - { - inputSimpleIndices.Add((int)attributeData.ConstructorArguments[0].Value!); - } - else if (SymbolEqualityComparer.Default.Equals(attributeData.AttributeClass, d2DInputComplexAttributeSymbol)) - { - inputComplexIndices.Add((int)attributeData.ConstructorArguments[0].Value!); - } - } - - // All simple indices must be in range - foreach (int index in inputSimpleIndices.WrittenSpan) - { - if ((uint)index >= inputCount) - { - context.ReportDiagnostic(Diagnostic.Create( - OutOfRangeInputIndex, - typeSymbol.Locations.First(), - typeSymbol)); - - goto AfterOutOfRangeInputValidation; - } - } - - // All complex indices must also be in range (of course) - foreach (int index in inputComplexIndices.WrittenSpan) - { - if ((uint)index >= inputCount) - { - context.ReportDiagnostic(Diagnostic.Create( - OutOfRangeInputIndex, - typeSymbol.Locations.First(), - typeSymbol)); - - goto AfterOutOfRangeInputValidation; - } - } - - AfterOutOfRangeInputValidation: - - Span selectedSimpleInputIndices = stackalloc bool[8]; - Span selectedComplexInputIndices = stackalloc bool[8]; - - selectedSimpleInputIndices.Clear(); - selectedComplexInputIndices.Clear(); - - bool hasReportedRepeatedD2DinputSimpleIndex = false; - bool hasReportedRepeatedD2DinputComplexIndex = false; - - // All simple indices must be unique - foreach (int index in inputSimpleIndices.WrittenSpan) - { - // Skip this path for invalid indices (just like with resource textures again). - // This same exact pattern is also used when validating input descriptions. - if ((uint)index >= 8) - { - continue; - } - - ref bool isInputIndexUsed = ref selectedSimpleInputIndices[index]; - - // If we detect a repeated index, we emit the diagnostic (only at most once), but - // then we also continue processing all remaining items. This is done to make sure - // that all used indices are correctly marked, so that the detection of invalid - // combinations at the end of the analyzer doesn't risk having false negatives. - if (isInputIndexUsed && !hasReportedRepeatedD2DinputSimpleIndex) - { - context.ReportDiagnostic(Diagnostic.Create( - RepeatedD2DInputSimpleIndices, - typeSymbol.Locations.First(), - typeSymbol)); - - hasReportedRepeatedD2DinputSimpleIndex = true; - } - - isInputIndexUsed = true; - } - - // All complex indices must be unique as well (again, of course) - foreach (int index in inputComplexIndices.WrittenSpan) - { - if ((uint)index >= 8) - { - continue; - } - - ref bool isInputIndexUsed = ref selectedComplexInputIndices[index]; - - if (isInputIndexUsed && !hasReportedRepeatedD2DinputComplexIndex) - { - context.ReportDiagnostic(Diagnostic.Create( - RepeatedD2DInputComplexIndices, - typeSymbol.Locations.First(), - typeSymbol)); - - hasReportedRepeatedD2DinputComplexIndex = true; - } - - isInputIndexUsed = true; - } - - // Simple and complex indices can't have indices in common. We just validate - // the entire temporary spans, so that even if some values are out of range, - // we still also detect that some are conflicting. - for (int i = 0; i < 8; i++) - { - if (selectedSimpleInputIndices[i] && selectedComplexInputIndices[i]) - { - context.ReportDiagnostic(Diagnostic.Create( - InvalidSimpleAndComplexIndicesCombination, - typeSymbol.Locations.First(), - typeSymbol)); - - break; - } - } - }, SymbolKind.NamedType); - }); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/MissingAllowUnsafeBlocksCompilationOptionAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/MissingAllowUnsafeBlocksCompilationOptionAnalyzer.cs deleted file mode 100644 index 82cea957..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/MissingAllowUnsafeBlocksCompilationOptionAnalyzer.cs +++ /dev/null @@ -1,19 +0,0 @@ -using ComputeSharp.SourceGeneration.Diagnostics; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; -using static ComputeSharp.SourceGeneration.Diagnostics.DiagnosticDescriptors; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -[DiagnosticAnalyzer(LanguageNames.CSharp)] -public sealed class MissingAllowUnsafeBlocksCompilationOptionAnalyzer : MissingAllowUnsafeBlocksCompilationOptionAnalyzerBase -{ - /// - /// Creates a new instance. - /// - public MissingAllowUnsafeBlocksCompilationOptionAnalyzer() - : base(MissingAllowUnsafeBlocksOption, "ComputeSharp.D2D1.D2DGeneratedPixelShaderDescriptorAttribute") - { - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/MissingD2DCompileOptionsOnD2DPixelShaderSourceMethodAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/MissingD2DCompileOptionsOnD2DPixelShaderSourceMethodAnalyzer.cs deleted file mode 100644 index 053c5c1b..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/MissingD2DCompileOptionsOnD2DPixelShaderSourceMethodAnalyzer.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System.Collections.Immutable; -using System.Linq; -using ComputeSharp.SourceGeneration.Extensions; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; -using static ComputeSharp.SourceGeneration.Diagnostics.DiagnosticDescriptors; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -/// A diagnostic analyzer that generates diagnostics when a method with [D2DPixelShaderSource] isn't using [D2DCompileOptions]. -/// -[DiagnosticAnalyzer(LanguageNames.CSharp)] -public sealed class MissingD2DCompileOptionsOnD2DPixelShaderSourceMethodAnalyzer : DiagnosticAnalyzer -{ - /// - public override ImmutableArray SupportedDiagnostics { get; } = [MissingCompileOptionsForD2DPixelShaderSource]; - - /// - public override void Initialize(AnalysisContext context) - { - context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); - context.EnableConcurrentExecution(); - - context.RegisterCompilationStartAction(static context => - { - // Get the [D2DPixelShaderSource] and [D2DShaderProfile] symbols - if (context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2DPixelShaderSourceAttribute") is not { } d2DPixelShaderSourceAttributeSymbol || - context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2DCompileOptionsAttribute") is not { } d2DCompileOptionsAttributeSymbol) - { - return; - } - - context.RegisterSymbolAction(context => - { - // Only partial definition methods are possible targets - if (context.Symbol is not IMethodSymbol { IsPartialDefinition: true } methodSymbol) - { - return; - } - - // Ignore methods without [D2DPixelShaderSource] - if (!methodSymbol.HasAttributeWithType(d2DPixelShaderSourceAttributeSymbol)) - { - return; - } - - // Emit a diagnostic if there is no compile options available at any level - if (!methodSymbol.HasAttributeWithType(d2DCompileOptionsAttributeSymbol) && - !methodSymbol.ContainingAssembly.HasAttributeWithType(d2DCompileOptionsAttributeSymbol)) - { - context.ReportDiagnostic(Diagnostic.Create( - MissingCompileOptionsForD2DPixelShaderSource, - methodSymbol.Locations.First(), - methodSymbol.Name, - methodSymbol.ContainingType)); - } - }, SymbolKind.Method); - }); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/MissingD2DShaderProfileOnD2DPixelShaderSourceMethodAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/MissingD2DShaderProfileOnD2DPixelShaderSourceMethodAnalyzer.cs deleted file mode 100644 index 7b506a9e..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/MissingD2DShaderProfileOnD2DPixelShaderSourceMethodAnalyzer.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System.Collections.Immutable; -using System.Linq; -using ComputeSharp.SourceGeneration.Extensions; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; -using static ComputeSharp.SourceGeneration.Diagnostics.DiagnosticDescriptors; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -/// A diagnostic analyzer that generates diagnostics when a method with [D2DPixelShaderSource] isn't using [D2DShaderProfile]. -/// -[DiagnosticAnalyzer(LanguageNames.CSharp)] -public sealed class MissingD2DShaderProfileOnD2DPixelShaderSourceMethodAnalyzer : DiagnosticAnalyzer -{ - /// - public override ImmutableArray SupportedDiagnostics { get; } = [MissingShaderProfileForD2DPixelShaderSource]; - - /// - public override void Initialize(AnalysisContext context) - { - context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); - context.EnableConcurrentExecution(); - - context.RegisterCompilationStartAction(static context => - { - // Get the [D2DPixelShaderSource] and [D2DShaderProfile] symbols - if (context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2DPixelShaderSourceAttribute") is not { } d2DPixelShaderSourceAttributeSymbol || - context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2DShaderProfileAttribute") is not { } d2DShaderProfileAttributeSymbol) - { - return; - } - - context.RegisterSymbolAction(context => - { - // Only partial definition methods are possible targets - if (context.Symbol is not IMethodSymbol { IsPartialDefinition: true } methodSymbol) - { - return; - } - - // Ignore methods without [D2DPixelShaderSource] - if (!methodSymbol.HasAttributeWithType(d2DPixelShaderSourceAttributeSymbol)) - { - return; - } - - // Emit a diagnostic if there is no shader profile available at any level - if (!methodSymbol.HasAttributeWithType(d2DShaderProfileAttributeSymbol) && - !methodSymbol.ContainingAssembly.HasAttributeWithType(d2DShaderProfileAttributeSymbol)) - { - context.ReportDiagnostic(Diagnostic.Create( - MissingShaderProfileForD2DPixelShaderSource, - methodSymbol.Locations.First(), - methodSymbol.Name, - methodSymbol.ContainingType)); - } - }, SymbolKind.Method); - }); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/MissingPixelShaderDescriptorOnPixelShaderAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/MissingPixelShaderDescriptorOnPixelShaderAnalyzer.cs deleted file mode 100644 index 72db3997..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/MissingPixelShaderDescriptorOnPixelShaderAnalyzer.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System.Collections.Immutable; -using System.Linq; -using ComputeSharp.SourceGeneration.Extensions; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; -using static ComputeSharp.SourceGeneration.Diagnostics.DiagnosticDescriptors; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -/// A diagnostic analyzer that generates a warning whenever a D2D1 shader type does not have an associated descriptor. -/// -[DiagnosticAnalyzer(LanguageNames.CSharp)] -public sealed class MissingPixelShaderDescriptorOnPixelShaderAnalyzer : DiagnosticAnalyzer -{ - /// - public override ImmutableArray SupportedDiagnostics { get; } = [MissingPixelShaderDescriptorOnPixelShaderType]; - - /// - public override void Initialize(AnalysisContext context) - { - context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); - context.EnableConcurrentExecution(); - - context.RegisterCompilationStartAction(static context => - { - // Get the ID2D1PixelShader, ID2D1PixelShaderDescriptor and [D2DGeneratedPixelShaderDescriptor] symbols - if (context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.ID2D1PixelShader") is not { } d2D1PixelShaderSymbol || - context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor`1") is not { } d2D1PixelShaderDescriptorSymbol || - context.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2DGeneratedPixelShaderDescriptorAttribute") is not { } d2DGeneratedPixelShaderDescriptorAttributeSymbol) - { - return; - } - - context.RegisterSymbolAction(context => - { - // Only struct types are possible targets - if (context.Symbol is not INamedTypeSymbol { TypeKind: TypeKind.Struct } typeSymbol) - { - return; - } - - // If the type is not a pixel shader type, immediately bail out - if (!typeSymbol.HasInterfaceWithType(d2D1PixelShaderSymbol)) - { - return; - } - - // Emit a diagnostic if the descriptor is missing for the shader type - if (!HasD2D1PixelShaderDescriptorInterface(typeSymbol, d2D1PixelShaderDescriptorSymbol) && - !typeSymbol.HasAttributeWithType(d2DGeneratedPixelShaderDescriptorAttributeSymbol)) - { - context.ReportDiagnostic(Diagnostic.Create( - MissingPixelShaderDescriptorOnPixelShaderType, - typeSymbol.Locations.FirstOrDefault(), - typeSymbol)); - } - }, SymbolKind.NamedType); - }); - } - - /// - /// Checks whether a given type implements the shader descriptor interface. - /// - /// The type to check. - /// The type symbol for ID2D1PixelShaderDescriptor<T>. - /// - private static bool HasD2D1PixelShaderDescriptorInterface(INamedTypeSymbol typeSymbol, INamedTypeSymbol d2D1PixelShaderDescriptorSymbol) - { - foreach (INamedTypeSymbol interfaceSymbol in typeSymbol.AllInterfaces) - { - if (SymbolEqualityComparer.Default.Equals(interfaceSymbol.ConstructedFrom, d2D1PixelShaderDescriptorSymbol)) - { - return true; - } - } - - return false; - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/NonConstantD2DInputArgumentAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/NonConstantD2DInputArgumentAnalyzer.cs deleted file mode 100644 index 6e16e46e..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/NonConstantD2DInputArgumentAnalyzer.cs +++ /dev/null @@ -1,133 +0,0 @@ -using System.Collections.Immutable; -using System.Diagnostics.CodeAnalysis; -using ComputeSharp.SourceGeneration.Extensions; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; -using Microsoft.CodeAnalysis.Operations; -using static ComputeSharp.SourceGeneration.Diagnostics.DiagnosticDescriptors; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -/// A diagnostic analyzer that generates an error whenever an invocation to a D2D intrinsic is using an argument that is not constant for the source shader input. -/// -[DiagnosticAnalyzer(LanguageNames.CSharp)] -public sealed class NonConstantD2DInputArgumentAnalyzer : DiagnosticAnalyzer -{ - /// - public override ImmutableArray SupportedDiagnostics { get; } = [NonConstantSourceInputIndexForD2DIntrinsic]; - - /// - public override void Initialize(AnalysisContext context) - { - context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.None); - context.EnableConcurrentExecution(); - - context.RegisterCompilationStartAction(static context => - { - // Ensure we can get all methods, or stop immediately - if (!TryBuildMethodSymbolSet(context.Compilation, out ImmutableHashSet? methodSymbols)) - { - return; - } - - context.CancellationToken.ThrowIfCancellationRequested(); - - // Register a callback for each argument we want to validate - context.RegisterOperationAction(context => - { - IArgumentOperation operation = (IArgumentOperation)context.Operation; - - // Ensure the argument is for an invocation, and get its first argument - if (operation.Parent is not IInvocationOperation { Arguments: [{ } firstArgument, ..] } invocationOperation) - { - return; - } - - // We also want to verify that the argument is the first one (that's the only one that should be constant) - if (operation != firstArgument) - { - return; - } - - // Ensure the argument is for a 'D2D' method (ignore all other arguments, ie. almost all of them) - if (invocationOperation is not { TargetMethod: { IsStatic: true, ContainingType.Name: "D2D" } targetMethodSymbol }) - { - return; - } - - // We only want to kick in when the target parameter is an 'int' - if (operation is not { Parameter: { Type.SpecialType: SpecialType.System_Int32 } parameterSymbol }) - { - return; - } - - // This analyzer should also only kick in when the argument is not constant - if (operation.Value.ConstantValue.HasValue) - { - return; - } - - // Now we can actually verify that the target method is indeed one we care about (this should always match) - if (!methodSymbols.Contains(targetMethodSymbol)) - { - return; - } - - // Finally, we can emit the diagnostic - context.ReportDiagnostic(Diagnostic.Create( - NonConstantSourceInputIndexForD2DIntrinsic, - operation.Syntax.GetLocation(), - parameterSymbol.Name, - targetMethodSymbol.Name)); - }, OperationKind.Argument); - }); - } - - /// - /// Tries to build a set of instances for all D2D intrinsics targeting a specific shader input. - /// - /// The to consider for analysis. - /// The resulting set of resolved instances. - /// Whether all requested instances could be resolved. - private static bool TryBuildMethodSymbolSet(Compilation compilation, [NotNullWhen(true)] out ImmutableHashSet? methodSymbols) - { - // Get the 'D2D' symbol, to get methods from it - if (compilation.GetTypeByMetadataName("ComputeSharp.D2D1.D2D") is not { } d2DSymbol) - { - methodSymbols = null; - - return false; - } - - // All 'D2D' intrinsics targeting an input (see 'InvalidD2DInputArgumentAnalyzer') - string[] d2DMethodNames = - [ - nameof(D2D.GetInput), - nameof(D2D.GetInputCoordinate), - nameof(D2D.SampleInput), - nameof(D2D.SampleInputAtOffset), - nameof(D2D.SampleInputAtPosition) - ]; - - ImmutableHashSet.Builder inputTypeMethodSet = ImmutableHashSet.CreateBuilder(SymbolEqualityComparer.Default); - - // Validate all methods and build the map - foreach (string d2DMethodName in d2DMethodNames) - { - // Ensure we can find the target method symbol (again just like in 'InvalidD2DInputArgumentAnalyzer') - if (d2DSymbol.GetMethod(d2DMethodName) is not { } d2DMethodSymbol) - { - methodSymbols = null; - - return false; - } - - _ = inputTypeMethodSet.Add(d2DMethodSymbol); - } - - methodSymbols = inputTypeMethodSet.ToImmutable(); - - return true; - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/NotAccessibleD2DGeneratedPixelShaderDescriptorAttributeTargetAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/NotAccessibleD2DGeneratedPixelShaderDescriptorAttributeTargetAnalyzer.cs deleted file mode 100644 index 00dfe59a..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/NotAccessibleD2DGeneratedPixelShaderDescriptorAttributeTargetAnalyzer.cs +++ /dev/null @@ -1,19 +0,0 @@ -using ComputeSharp.SourceGeneration.Diagnostics; -using Microsoft.CodeAnalysis.Diagnostics; -using Microsoft.CodeAnalysis; -using static ComputeSharp.SourceGeneration.Diagnostics.DiagnosticDescriptors; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -[DiagnosticAnalyzer(LanguageNames.CSharp)] -public sealed class NotAccessibleD2DGeneratedPixelShaderDescriptorAttributeTargetAnalyzer : NotAccessibleGeneratedShaderDescriptorAttributeTargetAnalyzerBase -{ - /// - /// Creates a new instance. - /// - public NotAccessibleD2DGeneratedPixelShaderDescriptorAttributeTargetAnalyzer() - : base(NotAccessibleTargetTypeForD2DGeneratedPixelShaderDescriptorAttribute, "ComputeSharp.D2D1.D2DGeneratedPixelShaderDescriptorAttribute") - { - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/NotAccessibleFieldTypeInD2DGeneratedShaderDescriptorAttributeTargetAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/NotAccessibleFieldTypeInD2DGeneratedShaderDescriptorAttributeTargetAnalyzer.cs deleted file mode 100644 index d01b4a97..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/NotAccessibleFieldTypeInD2DGeneratedShaderDescriptorAttributeTargetAnalyzer.cs +++ /dev/null @@ -1,19 +0,0 @@ -using ComputeSharp.SourceGeneration.Diagnostics; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; -using static ComputeSharp.SourceGeneration.Diagnostics.DiagnosticDescriptors; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -[DiagnosticAnalyzer(LanguageNames.CSharp)] -public sealed class NotAccessibleFieldTypeInD2DGeneratedShaderDescriptorAttributeTargetAnalyzer : NotAccessibleFieldTypeInGeneratedShaderDescriptorAttributeTargetAnalyzerBase -{ - /// - /// Creates a new instance. - /// - public NotAccessibleFieldTypeInD2DGeneratedShaderDescriptorAttributeTargetAnalyzer() - : base(NotAccessibleFieldTypeInTargetTypeForD2DGeneratedPixelShaderDescriptorAttribute, "ComputeSharp.D2D1.D2DGeneratedPixelShaderDescriptorAttribute") - { - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/NotReadOnlyPixelShaderTypeWithFieldsAnalyzer.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/NotReadOnlyPixelShaderTypeWithFieldsAnalyzer.cs deleted file mode 100644 index 7690a51e..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Analyzers/NotReadOnlyPixelShaderTypeWithFieldsAnalyzer.cs +++ /dev/null @@ -1,19 +0,0 @@ -using ComputeSharp.SourceGeneration.Diagnostics; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; -using static ComputeSharp.SourceGeneration.Diagnostics.DiagnosticDescriptors; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -[DiagnosticAnalyzer(LanguageNames.CSharp)] -public sealed class NotReadOnlyPixelShaderTypeWithFieldsAnalyzer : NotReadOnlyShaderTypeWithFieldsAnalyzerBase -{ - /// - /// Creates a new instance. - /// - public NotReadOnlyPixelShaderTypeWithFieldsAnalyzer() - : base(NotReadOnlyShaderType, ["ComputeSharp.D2D1.ID2D1PixelShader"]) - { - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs deleted file mode 100644 index 80df85c4..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs +++ /dev/null @@ -1,1304 +0,0 @@ -using Microsoft.CodeAnalysis; - -namespace ComputeSharp.SourceGeneration.Diagnostics; - -/// -partial class DiagnosticDescriptors -{ - /// - /// The diagnostic id for . - /// - public const string MissingPixelShaderDescriptorOnPixelShaderTypeId = "CMPSD2D0065"; - - /// - /// Gets a for an invalid shader field. - /// - /// Format: "The pixel shader of type {0} contains a field "{1}" of an invalid type {2}". - /// - /// - public static readonly DiagnosticDescriptor InvalidShaderField = new( - id: "CMPSD2D0001", - title: "Invalid shader field", - messageFormat: """The pixel shader of type {0} contains a field "{1}" of an invalid type {2}""", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A type representing a pixel shader contains a field of a type that is not supported in HLSL.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for an invalid object creation expression. - /// - /// Format: "The type {0} cannot be created in a pixel shader". - /// - /// - public static readonly DiagnosticDescriptor InvalidObjectCreationExpression = new( - id: "CMPSD2D0002", - title: "Invalid object creation expression", - messageFormat: "The type {0} cannot be created in a pixel shader (only unmanaged types are supported)", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "Only unmanaged value type objects can be created in a pixel shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for an anonymous object creation expression. - /// - public static readonly DiagnosticDescriptor AnonymousObjectCreationExpression = new( - id: "CMPSD2D0003", - title: "Anonymous object creation expression", - messageFormat: "An anonymous object cannot be created in a pixel shader", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "An anonymous object cannot be created in a pixel shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for an async modifier on a method or function. - /// - public static readonly DiagnosticDescriptor AsyncModifierOnMethodOrFunction = new( - id: "CMPSD2D0004", - title: "Async modifier on method or function", - messageFormat: "The async modifier cannot be used in methods or functions used in a pixel shader", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "The async modifier cannot be used in methods or functions used in a pixel shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for an await expression. - /// - public static readonly DiagnosticDescriptor AwaitExpression = new( - id: "CMPSD2D0005", - title: "Await expression", - messageFormat: "The await expression cannot be used in a pixel shader", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "The await expression cannot be used in a pixel shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a checked expression. - /// - public static readonly DiagnosticDescriptor CheckedExpression = new( - id: "CMPSD2D0006", - title: "Checked expression", - messageFormat: "A checked expression cannot be used in a pixel shader", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A checked expression cannot be used in a pixel shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a checked statement. - /// - public static readonly DiagnosticDescriptor CheckedStatement = new( - id: "CMPSD2D0007", - title: "Checked statement", - messageFormat: "A checked statement cannot be used in a pixel shader", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A checked statement cannot be used in a pixel shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a fixed statement. - /// - public static readonly DiagnosticDescriptor FixedStatement = new( - id: "CMPSD2D0008", - title: "Fixed statement", - messageFormat: "A fixed statement cannot be used in a pixel shader", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A fixed statement cannot be used in a pixel shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a foreach statement. - /// - public static readonly DiagnosticDescriptor ForEachStatement = new( - id: "CMPSD2D0009", - title: "Foreach statement", - messageFormat: "A foreach statement cannot be used in a pixel shader", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A foreach statement cannot be used in a pixel shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a lock statement. - /// - public static readonly DiagnosticDescriptor LockStatement = new( - id: "CMPSD2D0010", - title: "Foreach statement", - messageFormat: "A lock statement cannot be used in a pixel shader", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A lock statement cannot be used in a pixel shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a query statement. - /// - public static readonly DiagnosticDescriptor QueryExpression = new( - id: "CMPSD2D0011", - title: "Foreach statement", - messageFormat: "A LINQ query expression cannot be used in a pixel shader", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A LINQ query expression cannot be used in a pixel shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a range expression. - /// - public static readonly DiagnosticDescriptor RangeExpression = new( - id: "CMPSD2D0012", - title: "Range expression", - messageFormat: "A range expression cannot be used in a pixel shader", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A range expression cannot be used in a pixel shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a recursive pattern. - /// - public static readonly DiagnosticDescriptor RecursivePattern = new( - id: "CMPSD2D0013", - title: "Recursive pattern", - messageFormat: "A recursive pattern cannot be used in a pixel shader", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A recursive pattern cannot be used in a pixel shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a ref type. - /// - public static readonly DiagnosticDescriptor RefType = new( - id: "CMPSD2D0014", - title: "Ref type", - messageFormat: "A pixel shader cannot have a ref type declaration", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A pixel shader cannot have a ref type declaration.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a relational pattern. - /// - public static readonly DiagnosticDescriptor RelationalPattern = new( - id: "CMPSD2D0015", - title: "Relational pattern", - messageFormat: "A relational pattern cannot be used in a pixel shader", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A relational pattern cannot be used in a pixel shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a sizeof expression. - /// - public static readonly DiagnosticDescriptor SizeOfExpression = new( - id: "CMPSD2D0016", - title: "Sizeof expression", - messageFormat: "A sizeof expression cannot be used in a pixel shader", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A sizeof expression cannot be used in a pixel shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a stackalloc expression. - /// - public static readonly DiagnosticDescriptor StackAllocArrayCreationExpression = new( - id: "CMPSD2D0017", - title: "Stackalloc expression", - messageFormat: "A stackalloc expression cannot be used in a pixel shader", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A stackalloc expression cannot be used in a pixel shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a throw expression or statement. - /// - public static readonly DiagnosticDescriptor ThrowExpressionOrStatement = new( - id: "CMPSD2D0018", - title: "Throw expression or statement", - messageFormat: "Throw expressions and statements cannot be used in a pixel shader", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "Throw expressions and statements cannot be used in a pixel shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a try statement. - /// - public static readonly DiagnosticDescriptor TryStatement = new( - id: "CMPSD2D0019", - title: "Try statement", - messageFormat: "A try statement cannot be used in a pixel shader", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A try statement cannot be used in a pixel shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a tuple type. - /// - public static readonly DiagnosticDescriptor TupleType = new( - id: "CMPSD2D0020", - title: "Tuple type", - messageFormat: "A pixel shader cannot have a tuple type declaration", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A pixel shader cannot have a tuple type declaration.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a using statement or declaration. - /// - public static readonly DiagnosticDescriptor UsingStatementOrDeclaration = new( - id: "CMPSD2D0021", - title: "Using statement or declaration", - messageFormat: "Using statements and declarations cannot be used in a pixel shader", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "Using statements and declarations cannot be used in a pixel shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a yield statement. - /// - public static readonly DiagnosticDescriptor YieldStatement = new( - id: "CMPSD2D0022", - title: "Yield statement", - messageFormat: "A yield statement cannot be used in a pixel shader", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A yield statement cannot be used in a pixel shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for an invalid object declaration. - /// - /// Format: "A variable of type {0} cannot be declared in a pixel shader". - /// - /// - public static readonly DiagnosticDescriptor InvalidObjectDeclaration = new( - id: "CMPSD2D0023", - title: "Invalid object declaration", - messageFormat: "A variable of type {0} cannot be declared in a pixel shader (only unmanaged types are supported)", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "Only unmanaged value type objects can be declared in a pixel shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a pointer type. - /// - public static readonly DiagnosticDescriptor PointerType = new( - id: "CMPSD2D0024", - title: "Pointer type", - messageFormat: "A pixel shader cannot have a pointer type declaration", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A pixel shader cannot have a pointer type declaration.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a function pointer type. - /// - public static readonly DiagnosticDescriptor FunctionPointer = new( - id: "CMPSD2D0025", - title: "Function pointer type", - messageFormat: "A pixel shader cannot have a function pointer type declaration", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A pixel shader cannot have a function pointer type declaration.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for an unsafe statement. - /// - public static readonly DiagnosticDescriptor UnsafeStatement = new( - id: "CMPSD2D0026", - title: "Unsafe statement", - messageFormat: "A pixel shader cannot have an unsafe statement", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A pixel shader cannot have an unsafe statement.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for an unsafe modifier on a method or function. - /// - public static readonly DiagnosticDescriptor UnsafeModifierOnMethodOrFunction = new( - id: "CMPSD2D0027", - title: "Unsafe modifier on method or function", - messageFormat: "The unsafe modifier cannot be used in methods or functions used in a pixel shader", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "The unsafe modifier cannot be used in methods or functions used in a pixel shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a string literal. - /// - public static readonly DiagnosticDescriptor StringLiteralExpression = new( - id: "CMPSD2D0028", - title: "String literal expression", - messageFormat: "String literal expressions cannot be used in a pixel shader", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "String literal expressions cannot be used in a pixel shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for an incorrect matrix swizzling property argument. - /// - public static readonly DiagnosticDescriptor NonConstantMatrixSwizzledIndex = new( - id: "CMPSD2D0029", - title: "Non constant matrix swizzled property argument", - messageFormat: "The arguments in a swizzled indexer for a matrix type must be compile-time constants", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "The arguments in a swizzled indexer for a matrix type must be compile-time constants.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for an invalid static field type. - /// - /// Format: "The pixel shader of type {0} contains or references a static field "{1}" of an invalid type {2} (only primitive, vector and matrix types are supported)". - /// - /// - public static readonly DiagnosticDescriptor InvalidShaderStaticFieldType = new( - id: "CMPSD2D0030", - title: "Invalid shader static field type", - messageFormat: """The pixel shader of type {0} contains or references a static field "{1}" of an invalid type {2} (only primitive, vector and matrix types are supported)""", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A type representing a pixel shader contains or references a static field of a type that is not supported.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a property declaration. - /// - /// Format: "The D2D1 shader of type {0} contains an invalid property "{1}" declaration (only stateless properties explicitly implementing an interface property can be used)". - /// - /// - public static readonly DiagnosticDescriptor InvalidPropertyDeclaration = new( - id: "CMPSD2D0031", - title: "Invalid property declaration", - messageFormat: """The D2D1 shader of type {0} contains an invalid property "{1}" declaration (only stateless properties explicitly implementing an interface property can be used)""", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "Property declarations (except for stateless properties explicitly implementing an interface property) cannot be used in a D2D1 shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a shader with a root signature that is too large. - /// - /// Format: "The D2D1 shader of type {0} has exceeded the maximum allowed size for captured values (the maximum size is 64KB, and the actual constant buffer size was {1} bytes)". - /// - /// - public static readonly DiagnosticDescriptor ExceededDispatchDataSize = new( - id: "CMPSD2D0032", - title: "Shader dispatch data size exceeded", - messageFormat: "The D2D1 shader of type {0} has exceeded the maximum allowed size for captured values (the maximum size is 64KB, and the actual constant buffer size was {1} bytes)", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "The D2D1 shader of type {0} has exceeded the maximum allowed size for captured values (the maximum size for constant buffers is 64KB).", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for HLSL bytecode shader failed due to a Win32 exception. - /// - /// Format: "The shader of type {0} failed to compile due to a Win32 exception (HRESULT: {1:X8}, Message: "{2}")". - /// - /// - public static readonly DiagnosticDescriptor HlslBytecodeFailedWithWin32Exception = new( - id: "CMPSD2D0033", - title: "HLSL bytecode compilation failed due to Win32 exception", - messageFormat: """The shader of type {0} failed to compile due to a Win32 exception (HRESULT: {1:X8}, Message: "{2}")""", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "The embedded bytecode for a shader failed to be compiled due to a Win32 exception.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for HLSL bytecode shader failed due to an HLSL compilation exception. - /// - /// Format: "The shader of type {0} failed to compile due to an HLSL compiler error (Message: "{1}")". - /// - /// - public static readonly DiagnosticDescriptor HlslBytecodeFailedWithCompilationException = new( - id: "CMPSD2D0034", - title: "HLSL bytecode compilation failed due to an HLSL compiler error", - messageFormat: """The shader of type {0} failed to compile due to an HLSL compiler error (Message: "{1}")""", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "The embedded bytecode for a shader failed to be compiled due to an HLSL compiler error.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a invalid D2D input count value. - /// - /// Format: "The D2D1 shader of type {0} is using an incorrect value for [D2DInputCount] (the number of inputs must be in the [0, 8] range, but it was {1})". - /// - /// - public static readonly DiagnosticDescriptor InvalidD2DInputCount = new( - id: "CMPSD2D0035", - title: "Invalid D2D1 shader input count", - messageFormat: "The D2D1 shader of type {0} is using an incorrect value for [D2DInputCount] (the number of inputs must be in the [0, 8] range, but it was {1})", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A D2D1 shader must have a number of inputs in the [0, 8] range.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for repeated indices for D2D simple indices. - /// - /// Format: "The D2D1 shader of type {0} is using repeated indices for some of its [D2DInputSimple] attributes". - /// - /// - public static readonly DiagnosticDescriptor RepeatedD2DInputSimpleIndices = new( - id: "CMPSD2D0036", - title: "Repeated D2D1 shader simple input indices", - messageFormat: "The D2D1 shader of type {0} is using repeated indices for some of its [D2DInputSimple] attributes", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A D2D1 shader must only have unique indices for all of its [D2DInputSimple] attributes.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for repeated indices for D2D complex indices. - /// - /// Format: "The D2D1 shader of type {0} is using repeated indices for some of its [D2DInputComplex] attributes". - /// - /// - public static readonly DiagnosticDescriptor RepeatedD2DInputComplexIndices = new( - id: "CMPSD2D0037", - title: "Repeated D2D1 shader complex input indices", - messageFormat: "The D2D1 shader of type {0} is using repeated indices for some of its [D2DInputComplex] attributes", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A D2D1 shader must only have unique indices for all of its [D2DInputComplex] attributes.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for invalid combination of simple and complex indices. - /// - /// Format: "The D2D1 shader of type {0} is using some indices in common for simple and complex input indices". - /// - /// - public static readonly DiagnosticDescriptor InvalidSimpleAndComplexIndicesCombination = new( - id: "CMPSD2D0038", - title: "Invalid D2D1 shader simple and complex indices combination", - messageFormat: "The D2D1 shader of type {0} is using some indices in common for simple and complex input indices", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A D2D1 shader cannot use the same indices to indicate both simple and complex inputs.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a shader with an out of range input index (or more). - /// - /// Format: "The D2D1 shader of type {0} is using some out of range input indices". - /// - /// - public static readonly DiagnosticDescriptor OutOfRangeInputIndex = new( - id: "CMPSD2D0039", - title: "Out of range D2D1 shader input indices", - messageFormat: "The D2D1 shader of type {0} is using some out of range input indices", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A D2D1 shader must have all the indices of its simple and complex inputs in the valid range (between 0 and the number of declared inputs).", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a method or constructor invocation that is not valid from a shader. - /// - /// Format: "The method or constructor {0} cannot be used in a D2D1 shader (methods or constructors need to either be HLSL intrinsics or with source available for analysis)". - /// - /// - public static readonly DiagnosticDescriptor InvalidMethodOrConstructorCall = new( - id: "CMPSD2D0040", - title: "Invalid method or constructor invocation from a D2D1 shader", - messageFormat: "The method or constructor {0} cannot be used in a D2D1 shader (methods or constructors need to either be HLSL intrinsics or with source available for analysis)", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A D2D1 shader can only invoke methods or constructors that are either HLSL intrinsics or with source available for analysis.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for an invalid discovered type. - /// - /// Format: "The D2D1 shader of type {0} uses the invalid type {1}". - /// - /// - public static readonly DiagnosticDescriptor InvalidDiscoveredType = new( - id: "CMPSD2D0041", - title: "Invalid discovered type", - messageFormat: "The D2D1 shader of type {0} uses the invalid type {1} (only some .NET primitive types, HLSL primitive, vector and matrix types, and custom types containing these types can be used, and custom types containing these types can be used, and bool fields in custom struct types have to be replaced with the ComputeSharp.Bool type for alignment reasons)", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "D2D1 shaders can only use supported types (some .NET primitive types, HLSL primitive, vector and matrix types, and custom types containing these types can be used, and custom types containing these types can be used, and bool fields in custom struct types have to be replaced with the ComputeSharp.Bool type for alignment reasons).", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a shader with an out of range input description index (or more). - /// - /// Format: "The D2D1 shader of type {0} is using some out of range input description indices". - /// - /// - public static readonly DiagnosticDescriptor OutOfRangeInputDescriptionIndex = new( - id: "CMPSD2D0042", - title: "Out of range D2D1 shader input description indices", - messageFormat: "The D2D1 shader of type {0} is using some out of range input description indices", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A D2D1 shader must have all the indices of its input descriptions in the valid range (between 0 and the number of declared inputs).", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for repeated indices for D2D input descriptions. - /// - /// Format: "The D2D1 shader of type {0} is using repeated indices for some of its [D2DInputDescription] attributes". - /// - /// - public static readonly DiagnosticDescriptor RepeatedD2DInputDescriptionIndices = new( - id: "CMPSD2D0043", - title: "Repeated D2D1 shader input description indices", - messageFormat: "The D2D1 shader of type {0} is using repeated indices for some of its [D2DInputDescription] attributes", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A D2D1 shader must only have unique indices for all of its [D2DInputDescription] attributes.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for the PackMatrixColumnMajor option being used. - /// - /// Format: "The D2D1 shader of type (or assembly) {0} is using the PackMatrixColumnMajor option in its [D2DCompileOptions] attribute". - /// - /// - public static readonly DiagnosticDescriptor InvalidPackMatrixColumnMajorOption = new( - id: "CMPSD2D0044", - title: "Invalid PackMatrixColumnMajor compile option", - messageFormat: "The D2D1 shader of type (or assembly) {0} is using the PackMatrixColumnMajor option in its [D2DCompileOptions] attribute", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A D2D1 shader generated with ComputeSharp.D2D1 (or an assembly) cannot use the PackMatrixColumnMajor option, as that is not compatible with the generated code used to load shader constant buffers.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp", - customTags: WellKnownDiagnosticTags.CompilationEnd); - - /// - /// Gets a for when the [D2DRequiresScenePosition] attribute is missing. - /// - /// Format: "The D2D1 shader of type {0} is using D2D1 APIs that require the [D2DRequiresScenePosition] attribute to be used (that is, D2D1.GetScenePosition() and D2D1.SampleInputAtPosition(int, float2)), but the shader type is not annotated accordingly". - /// - /// - public static readonly DiagnosticDescriptor MissingD2DRequiresScenePositionAttribute = new( - id: "CMPSD2D0045", - title: "Missing [D2DRequiresScenePosition] attribute", - messageFormat: "The D2D1 shader of type {0} is using D2D1 APIs that require the [D2DRequiresScenePosition] attribute to be used (that is, D2D.GetScenePosition() and D2D.SampleInputAtPosition(int, float2)), but the shader type is not annotated accordingly", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A D2D1 shader using functionality that needs position info (ie. when [D2DRequiresScenePosition] is used, which is mandatory when calling either D2D.GetScenePosition() or D2D.SampleInputAtPosition(int, float2)) needs to be annotated accordingly.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a shader with an overlapping resource texture index (or more). - /// - /// Format: "The D2D1 shader of type {0} is using some resource texture indices that overlap with the shader input indices". - /// - /// - public static readonly DiagnosticDescriptor ResourceTextureIndexOverlappingWithInputIndex = new( - id: "CMPSD2D0046", - title: "D2D1 shader resource texture indices overlapping input indices", - messageFormat: "The D2D1 shader of type {0} is using some resource texture indices that overlap with the shader input indices", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A D2D1 shader must have all the indices of its resource textures in the valid range (between the input count and 16, exclusive).", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a shader with an out of range resource texture index (or more). - /// - /// Format: "The D2D1 shader of type {0} is using some out of range resource texture indices". - /// - /// - public static readonly DiagnosticDescriptor OutOfRangeResourceTextureIndex = new( - id: "CMPSD2D0047", - title: "Out of range D2D1 shader resource texture indices", - messageFormat: "The D2D1 shader of type {0} is using some out of range resource texture indices", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A D2D1 shader must have all the indices of its resource textures in the valid range (between the input count and 16, exclusive).", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for repeated indices for D2D resource texture indices. - /// - /// Format: "The D2D1 shader of type {0} is using repeated indices for some of its [D2DResourceTextureIndex] attributes". - /// - /// - public static readonly DiagnosticDescriptor RepeatedD2DResourceTextureIndices = new( - id: "CMPSD2D0048", - title: "Repeated D2D1 shader resource texture indices", - messageFormat: "The D2D1 shader of type {0} is using repeated indices for some of its [D2DResourceTextureIndex] attributes", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A D2D1 shader must only have unique indices for all of its [D2DResourceTextureIndex] attributes.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for an invalid location of [D2DResourceTextureIndex]. - /// - /// Format: "The field "{0}" (in type {1}) is using [D2DResourceTextureIndex] on an invalid location (the attribute can only be used on D2D1 resource texture types, but the field is of type {2})". - /// - /// - public static readonly DiagnosticDescriptor InvalidD2DResourceTextureIndexAttributeLocation = new( - id: "CMPSD2D0049", - title: "Invalid [D2DResourceTextureIndex] location", - messageFormat: """The field "{0}" (in type {1}) is using [D2DResourceTextureIndex] incorrectly (the attribute can only be used on D2D1 resource texture types, but the field is of type {2})""", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A field is using [D2DResourceTextureIndex] incorrectly (the attribute can only be used on D2D1 resource texture types).", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a missing [D2DResourceTextureIndex]. - /// - /// Format: "The field "{0}" (in type {1}) is of a D2D1 resource texture type but is missing the [D2DResourceTextureIndex] attribute". - /// - /// - public static readonly DiagnosticDescriptor MissingD2DResourceTextureIndexAttribute = new( - id: "CMPSD2D0050", - title: "Missing [D2DResourceTextureIndex] attribute", - messageFormat: """The field "{0}" (in type {1}) is of a D2D1 resource texture type but is missing the [D2DResourceTextureIndex] attribute""", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "All fields of a D2D1 resource texture type must be annotated using the [D2DResourceTextureIndex] attribute.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a resource texture using an invalid element type. - /// - /// Format: "The field "{0}" (in type {1}) using a D2D1 resource texture of type {2} has an invalid element type (only float and float4 type arguments are supported)". - /// - /// - public static readonly DiagnosticDescriptor InvalidResourceTextureElementType = new( - id: "CMPSD2D0051", - title: "Invalid D2D1 resource texture element type", - messageFormat: """The field "{0}" (in type {1}) using a D2D1 resource texture of type {2} has an invalid element type (only float and float4 type arguments are supported)""", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "The element type of D2D1 resource texture fields in a D2D1 shader must be either float or float4.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for an invalid HLSL source in [D2DPixelShaderSource]. - /// - /// Format: "The method "{0}" (in type {1}) is using [D2DPixelShaderSource] with an invalid HLSL source argument". - /// - /// - public static readonly DiagnosticDescriptor InvalidD2DPixelShaderSource = new( - id: "CMPSD2D0052", - title: "Invalid [D2DPixelShaderSource] HLSL source argument", - messageFormat: """The method "{0}" (in type {1}) is using [D2DPixelShaderSource] with an invalid HLSL source argument""", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "Methods using [D2DPixelShaderSource] must pass a valid string as the HLSL source argument.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for an embedded bytecode D2D shader failed due to a Win32 exception. - /// - /// Format: "Compiling the HLSL source for method "{1}" (in type {0}) failed due to a Win32 exception (HRESULT: {2:X8}, Message: "{3}")". - /// - /// - public static readonly DiagnosticDescriptor D2DPixelShaderSourceCompilationFailedWithWin32Exception = new( - id: "CMPSD2D0053", - title: "D2D shader compilation failed due to Win32 exception", - messageFormat: """Compiling the HLSL source for method "{1}" (in type {0}) failed due to a Win32 exception (HRESULT: {2:X8}, Message: "{3}")""", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "The embedded bytecode for an input HLSl source failed to be compiled due to a Win32 exception.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for an embedded bytecode D2D shader failed due to an HLSL compilation exception. - /// - /// Format: "Compiling the HLSL source for method "{1}" (in type {0}) failed due to an HLSL compiler error (Message: "{2}")". - /// - /// - public static readonly DiagnosticDescriptor D2DPixelShaderSourceCompilationFailedWithFxcCompilationException = new( - id: "CMPSD2D0054", - title: "D2D shader compilation failed due to an HLSL compiler error", - messageFormat: """Compiling the HLSL source for method "{1}" (in type {0}) failed due to an HLSL compiler error (Message: "{2}")""", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "The embedded bytecode for an input HLSl source failed to be compiled due to an HLSL compiler error.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for an embedded bytecode D2D shader with no shader profile set. - /// - /// Format: "The method "{0}" (in type {1}) is using [D2DPixelShaderSource] but has not specified the shader profile to use". - /// - /// - public static readonly DiagnosticDescriptor MissingShaderProfileForD2DPixelShaderSource = new( - id: "CMPSD2D0055", - title: "Missing shader profile for D2D pixel shader source", - messageFormat: """The method "{0}" (in type {1}) is using [D2DPixelShaderSource] but has not specified the shader profile to use""", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "Precompiled shaders using [D2DPixelShaderSource] must explicitly indicate the shader profile to use.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for an embedded bytecode D2D shader with no compile options set. - /// - /// Format: "The method "{0}" (in type {1}) is using [D2DPixelShaderSource] but has not specified the compile options to use". - /// - /// - public static readonly DiagnosticDescriptor MissingCompileOptionsForD2DPixelShaderSource = new( - id: "CMPSD2D0056", - title: "Missing compile options for D2D pixel shader source", - messageFormat: """The method "{0}" (in type {1}) is using [D2DPixelShaderSource] but has not specified the compile options to use""", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "Precompiled shaders using [D2DPixelShaderSource] must explicitly indicate the compile options.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for when a method with [D2DPixelShaderSource] has an invalid return type. - /// - /// Format: "The method "{0}" (in type {1}) is using [D2DPixelShaderSource] but has an invalid return type {2} (it must return a ReadOnlySpan<byte>)". - /// - /// - public static readonly DiagnosticDescriptor InvalidD2DPixelShaderSourceMethodReturnType = new( - id: "CMPSD2D0057", - title: "Missing compile options for D2D pixel shader source", - messageFormat: """The method "{0}" (in type {1}) is using [D2DPixelShaderSource] but has an invalid return type {2} (it must return a ReadOnlySpan)""", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "Methods using using [D2DPixelShaderSource] must use ReadOnlySpan as the return type.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for when the [D2DInputCount] attribute is missing. - /// - /// Format: "The D2D1 shader of type {0} is not annotated with the [D2DInputCount] attribute (it is mandatory for all D2D1 shader types)". - /// - /// - public static readonly DiagnosticDescriptor MissingD2DInputCountAttribute = new( - id: "CMPSD2D0058", - title: "Missing [D2DResourceTextureIndex] attribute", - messageFormat: "The D2D1 shader of type {0} is not annotated with the [D2DInputCount] attribute (it is mandatory for all D2D1 shader types)", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A D2D1 shader must be annotated with the [D2DInputCount] attribute.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for when the [D2DEffectId] attribute is being used with an invalid value. - /// - /// Format: "The [D2DEffectId] attribute is being used with an invalid value (the input text must be a valid GUID)". - /// - /// - public static readonly DiagnosticDescriptor InvalidD2DEffectIdAttributeValue = new( - id: "CMPSD2D0059", - title: "Invalid [D2DEffectId] attribute value", - messageFormat: "The [D2DEffectId] attribute is being used with an invalid value (the input text must be a valid GUID)", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "The [D2DEffectId] attribute must use a valid GUID expression as value.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for when the [D2DEffectDisplayName] attribute is being used with an invalid value. - /// - /// Format: "The [D2DEffectDisplayName] attribute is being used with an invalid value". - /// - /// - public static readonly DiagnosticDescriptor InvalidD2DEffectDisplayNameAttributeValue = new( - id: "CMPSD2D0060", - title: "Invalid [D2DEffectDisplayName] attribute value", - messageFormat: "The [D2DEffectDisplayName] attribute is being used with an invalid value", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "The [D2DEffectDisplayName] attribute must contain valid text.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for when the [D2DEffectDescription] attribute is being used with an invalid value. - /// - /// Format: "The [D2DEffectDescription] attribute is being used with an invalid value". - /// - /// - public static readonly DiagnosticDescriptor InvalidD2DEffectDescriptionAttributeValue = new( - id: "CMPSD2D0061", - title: "Invalid [D2DEffectDescription] attribute value", - messageFormat: "The [D2DEffectDescription] attribute is being used with an invalid value", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "The [D2DEffectDescription] attribute must contain valid text.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for when the [D2DEffectCategory] attribute is being used with an invalid value. - /// - /// Format: "The [D2DEffectDescription] attribute is being used with an invalid value". - /// - /// - public static readonly DiagnosticDescriptor InvalidD2DEffectCategoryAttributeValue = new( - id: "CMPSD2D0062", - title: "Invalid [D2DEffectCategory] attribute value", - messageFormat: "The [D2DEffectCategory] attribute is being used with an invalid value", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "The [D2DEffectCategory] attribute must contain valid text.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for when the [D2DEffectAuthor] attribute is being used with an invalid value. - /// - /// Format: "The [D2DEffectAuthor] attribute is being used with an invalid value". - /// - /// - public static readonly DiagnosticDescriptor InvalidD2DEffectAuthorAttributeValue = new( - id: "CMPSD2D0063", - title: "Invalid [D2DEffectAuthor] attribute value", - messageFormat: "The [D2DEffectAuthor] attribute is being used with an invalid value", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "The [D2DEffectAuthor] attribute must contain valid text.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for when the AllowUnsafeBlocks option is not set. - /// - /// Format: "Using [D2DGeneratedPixelShaderDescriptor] requires unsafe blocks being enabled, as they are needed by the source generators to emit valid code (add <AllowUnsafeBlocks>true</AllowUnsafeBlocks> to your .csproj/.props file)". - /// - /// - public static readonly DiagnosticDescriptor MissingAllowUnsafeBlocksOption = new( - id: "CMPSD2D0064", - title: "Missing 'AllowUnsafeBlocks' compilation option", - messageFormat: "Using [D2DGeneratedPixelShaderDescriptor] requires unsafe blocks being enabled, as they are needed by the source generators to emit valid code (add true to your .csproj/.props file)", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "Unsafe blocks must be enabled when using [D2DGeneratedPixelShaderDescriptor] for the source generators to emit valid code (the true option must be set in the .csproj/.props file).", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for when a pixel shader type doesn't have an associated descriptor. - /// - /// Format: "The D2D1 shader of type {0} does not have an associated descriptor (it can be autogenerated via the [D2DGeneratedPixelShaderDescriptor] attribute)". - /// - /// - public static readonly DiagnosticDescriptor MissingPixelShaderDescriptorOnPixelShaderType = new( - id: MissingPixelShaderDescriptorOnPixelShaderTypeId, - title: "Missing descriptor for D2D1 pixel shader type", - messageFormat: "The D2D1 shader of type {0} does not have an associated descriptor (it can be autogenerated via the [D2DGeneratedPixelShaderDescriptor] attribute)", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Warning, - isEnabledByDefault: true, - description: "All D2D1 shader types must have an associated descriptor (it can be autogenerated via the [D2DGeneratedPixelShaderDescriptor] attribute).", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp", - customTags: WellKnownDiagnosticTags.CompilationEnd); - - /// - /// Gets a for when the [D2DGeneratedPixelShaderDescriptor] attribute is being used on an invalid target type. - /// - /// Format: "The type {0} is not a valid target for the [D2DGeneratedPixelShaderDescriptor] attribute (only non generic types implementing the ID2D1PixelShader interface are valid)". - /// - /// - public static readonly DiagnosticDescriptor InvalidD2DGeneratedPixelShaderDescriptorAttributeTarget = new( - id: "CMPSD2D0066", - title: "Invalid [D2DGeneratedPixelShaderDescriptor] attribute target", - messageFormat: "The type {0} is not a valid target for the [D2DGeneratedPixelShaderDescriptor] attribute (only non generic types implementing ID2D1PixelShader interface are valid)", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "The [D2DGeneratedPixelShaderDescriptor] attribute must be used on non generic types that implement the ID2D1PixelShader interface.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for when the [D2DGeneratedPixelShaderDescriptor] attribute is being used on a type that is not accessible from its containing assembly. - /// - /// Format: "The [D2DGeneratedPixelShaderDescriptor] attribute requires target types to be accessible from their containing assembly (type {0} has less effective accessibility than internal)". - /// - /// - public static readonly DiagnosticDescriptor NotAccessibleTargetTypeForD2DGeneratedPixelShaderDescriptorAttribute = new( - id: "CMPSD2D0067", - title: "Not accessible type using the [D2DGeneratedPixelShaderDescriptor] attribute", - messageFormat: "The [D2DGeneratedPixelShaderDescriptor] attribute requires target types to be accessible from their containing assembly (type {0} has less effective accessibility than internal)", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "The [D2DGeneratedPixelShaderDescriptor] attribute requires target types to be accessible from their containing assembly.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for when a field in a type using the [D2DGeneratedPixelShaderDescriptor] attribute has a type that is not accessible from its containing assembly. - /// - /// Format: "The [D2DGeneratedPixelShaderDescriptor] attribute requires the type of all fields of target types to be accessible from their containing assembly (type {0} has a field "{1}" of type {2} that has less effective accessibility than internal)". - /// - /// - public static readonly DiagnosticDescriptor NotAccessibleFieldTypeInTargetTypeForD2DGeneratedPixelShaderDescriptorAttribute = new( - id: "CMPSD2D0068", - title: "Not accessible field type in type using the [D2DGeneratedPixelShaderDescriptor] attribute", - messageFormat: """The [D2DGeneratedPixelShaderDescriptor] attribute requires the type of all fields of target types to be accessible from their containing assembly (type {0} has a field "{1}" of type {2} that has less effective accessibility than internal)""", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "The [D2DGeneratedPixelShaderDescriptor] attribute requires the type of all fields of target types to be accessible from their containing assembly.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for an invalid use of [D2DPixelOptions] indicating trivial sampling. - /// - /// Format: "The D2D1 shader of type {0} shouldn't use D2D1PixelOptions.TrivialSampling in its [D2DPixelOptions] attribute, as it has one or more complex inputs (either mark the inputs as simple, or remove the trivial sampling option)". - /// - /// - public static readonly DiagnosticDescriptor InvalidD2D1PixelOptionsTrivialSamplingOnShaderType = new( - id: "CMPSD2D0069", - title: "Invalid [D2DPixelOptions] use", - messageFormat: """The D2D1 shader of type {0} shouldn't use D2D1PixelOptions.TrivialSampling in its [D2DPixelOptions] attribute, as it has one or more complex inputs (either mark the inputs as simple, or remove the trivial sampling option)""", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Warning, - isEnabledByDefault: true, - description: "A D2D1 shader shouldn't use D2D1PixelOptions.TrivialSampling in its [D2DPixelOptions] attribute if it has one or more complex inputs (because trivial sampling shaders can only sample pixels at the same scene coordinate as the output pixel, a shader using this option should only have simple inputs).", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for when a shader type with any fields is not readonly. - /// - /// Format: "The shader of type {0} is not readonly (shaders cannot mutate their instance state while running, so shader types not being readonly makes them error prone)". - /// - /// - public static readonly DiagnosticDescriptor NotReadOnlyShaderType = new( - id: "CMPSD2D0070", - title: "Not readonly shader type (using ID2D1PixelShader)", - messageFormat: "The shader of type {0} is not readonly (shaders cannot mutate their instance state while running, so shader types not being readonly makes them error prone)", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Warning, - isEnabledByDefault: true, - description: "Shader types should be readonly (shaders cannot mutate their instance state while running, so shader types not being readonly makes them error prone).", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for an initializer expression. - /// - public static readonly DiagnosticDescriptor InitializerExpression = new( - id: "CMPSD2D0071", - title: "Initializer expression", - messageFormat: "An initializer expression cannot be used in a pixel shader", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "An initializer expression cannot be used in a pixel shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a collection expression. - /// - public static readonly DiagnosticDescriptor CollectionExpression = new( - id: "CMPSD2D0072", - title: "Collection expression", - messageFormat: "A collection expression cannot be used in a pixel shader", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A collection expression cannot be used in a pixel shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a constructor with a base constructor declaration. - /// - /// Format: "The constructor {0} has a base constructor declaration, which cannot be used in a D2D1 shader (only standalone constructors are allowed)". - /// - /// - public static readonly DiagnosticDescriptor InvalidBaseConstructorDeclaration = new( - id: "CMPSD2D0073", - title: "Invalid base constructor declaration", - messageFormat: "The constructor {0} has a base constructor declaration, which cannot be used in a D2D1 shader (only standalone constructors are allowed)", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "Only standalone constructors (with no base constructor declaration) can be used in a D2D1 shader.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a expression. - /// - public static readonly DiagnosticDescriptor ThisExpression = new( - id: "CMPSD2D0074", - title: "Invalid 'this' expression", - messageFormat: "A pixel shader cannot use a 'this' expression outside of member accesses (such as 'this.field')", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A pixel shader cannot use a 'this' expression outside of member accesses (such as 'this.field').", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for an invocation of a Math or MathF API. - /// - /// Format: "The method {0} cannot be used in a shader, use equivalent APIs from the Hlsl type instead". - /// - /// - public static readonly DiagnosticDescriptor InvalidMathOrMathFCall = new( - id: "CMPSD2D0075", - title: "Invalid Math or MathF invocation from a shader", - messageFormat: "The method {0} cannot be used in a shader, use equivalent APIs from the Hlsl type instead", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "Methods from the Math and MathF types cannot be used in a shader, and equivalent APIs from the Hlsl type should be used instead.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a shader not precompiled but with runtime compilation disabled. - /// - /// Format: "The shader {0} is not precompiled, but runtime compilation is not enabled (either precompile the shader by using [D2DShaderProfile], which is recommended, or enable runtime compilation using [D2DEnableRuntimeCompilation])". - /// - /// - public static readonly DiagnosticDescriptor D2DRuntimeCompilationDisabled = new( - id: "CMPSD2D0076", - title: "D2D runtime compilation disabled", - messageFormat: "The shader {0} is not precompiled, but runtime compilation is not enabled (either precompile the shader by using [D2DShaderProfile], which is recommended, or enable runtime compilation using [D2DEnableRuntimeCompilation])", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "Shaders must either be precompiled using [D2DShaderProfile], which is recommended, or runtime compilation for shaders must be enabled using [D2DEnableRuntimeCompilation].", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for an unnecessary [D2DEnableRuntimeCompilation] use. - /// - /// Format: "The shader {0} is annotated with [D2DEnableRuntimeCompilation], but its containing assembly is already annotated with this attribute (so using it again on the shader type is unnecessary)". - /// - /// - public static readonly DiagnosticDescriptor D2DRuntimeCompilationAlreadyEnabled = new( - id: "CMPSD2D0077", - title: "D2D runtime compilation already enabled", - messageFormat: "The shader {0} is annotated with [D2DEnableRuntimeCompilation], but its containing assembly is already annotated with this attribute (so using it again on the shader type is unnecessary)", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Info, - isEnabledByDefault: true, - description: "If an assembly is annotated with [D2DEnableRuntimeCompilation], that applies to all shader types within it. That means that using [D2DEnableRuntimeCompilation] on shader types too is unnecessary.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for an unnecessary [D2DEnableRuntimeCompilation] use on . - /// - /// Format: "The shader {0} is annotated with [D2DEnableRuntimeCompilation], but it is also being precompiled, as it has [D2DShaderProfile] on the type or containing assembly (so using [D2DEnableRuntimeCompilation] is unnecessary)". - /// - /// - public static readonly DiagnosticDescriptor D2DRuntimeCompilationOnTypeNotNecessary = new( - id: "CMPSD2D0078", - title: "D2D runtime compilation on type is not necessary", - messageFormat: "The shader {0} is annotated with [D2DEnableRuntimeCompilation], but it is also being precompiled, as it has [D2DShaderProfile] on the type or containing assembly (so using [D2DEnableRuntimeCompilation] is unnecessary)", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Warning, - isEnabledByDefault: true, - description: "If a shader is precompiled (ie. it has [D2DShaderProfile] on the type declaration or on its containing assembly), also using [D2DEnableRuntimeCompilation] is unnecessary.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for an unnecessary [D2DEnableRuntimeCompilation] use on an assembly. - /// - /// Format: "The assembly {0} is annotated with [D2DEnableRuntimeCompilation], but it is also has an assembly-level [D2DShaderProfile] attribute, which will cause all shaders to be precompiled (so using [D2DEnableRuntimeCompilation] is unnecessary)". - /// - /// - public static readonly DiagnosticDescriptor D2DRuntimeCompilationOnAssemblyNotNecessary = new( - id: "CMPSD2D0079", - title: "D2D runtime compilation on assembly is not necessary", - messageFormat: "The assembly {0} is annotated with [D2DEnableRuntimeCompilation], but it is also has an assembly-level [D2DShaderProfile] attribute, which will cause all shaders to be precompiled (so using [D2DEnableRuntimeCompilation] is unnecessary)", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Warning, - isEnabledByDefault: true, - description: "If an assembly is using [D2DShaderProfile] (meaning that all shaders declared within it will be precompiled), also using [D2DEnableRuntimeCompilation] is unnecessary.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp", - customTags: WellKnownDiagnosticTags.CompilationEnd); - - /// - /// Gets a for a shader missing [D2DRequiresDoublePrecisionSupport]. - /// - /// Format: "The shader {0} requires double precision support, but it does not have the [D2DRequiresDoublePrecisionSupport] attribute on it (adding the attribute is necessary to explicitly opt-in to that functionality)". - /// - /// - public static readonly DiagnosticDescriptor MissingRequiresDoublePrecisionSupportAttribute = new( - id: "CMPSD2D0080", - title: "Missing [D2DRequiresDoublePrecisionSupport] attribute", - messageFormat: "The shader {0} requires double precision support, but it does not have the [D2DRequiresDoublePrecisionSupport] attribute on it (adding the attribute is necessary to explicitly opt-in to that functionality)", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "Shaders performing double precision operations must be annotated with [D2DRequiresDoublePrecisionSupport] to explicitly opt-in to that functionality.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a shader is unnecessarily using [D2DRequiresDoublePrecisionSupport]. - /// - /// Format: "The shader {0} does not require double precision support, but it has the [D2DRequiresDoublePrecisionSupport] attribute on it (using the attribute is not needed if the shader is not performing any double precision operations)". - /// - /// - public static readonly DiagnosticDescriptor UnnecessaryRequiresDoublePrecisionSupportAttribute = new( - id: "CMPSD2D0081", - title: "Unnecessary [D2DRequiresDoublePrecisionSupport] attribute", - messageFormat: "The shader {0} does not require double precision support, but it has the [D2DRequiresDoublePrecisionSupport] attribute on it (using the attribute is not needed if the shader is not performing any double precision operations)", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Warning, - isEnabledByDefault: true, - description: "Shaders not performing any double precision operations should not be annotated with [D2DRequiresDoublePrecisionSupport], as the attribute is not needed in that case.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a shader is using [D2DRequiresDoublePrecisionSupport] incorrectly. - /// - /// Format: "The shader {0} has the [D2DRequiresDoublePrecisionSupport] attribute on it, but it is not precompiled, so validation for use of double precision operations cannot be performed". - /// - /// - public static readonly DiagnosticDescriptor InvalidD2DRequiresDoublePrecisionSupportAttribute = new( - id: "CMPSD2D0082", - title: "Invalid [D2DRequiresDoublePrecisionSupport] attribute", - messageFormat: "The shader {0} has the [D2DRequiresDoublePrecisionSupport] attribute on it, but it is not precompiled, so validation for use of double precision operations cannot be performed", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Warning, - isEnabledByDefault: true, - description: "Shaders can only be annotated with [D2DRequiresDoublePrecisionSupport] to perform validation for use of double precision operations if they are precompiled.", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a D2D intrinsic call with an out of range input. - /// - /// Format: "The D2D intrinsic '{0}' cannot be used for input {1}, as the containing shader {2} only declares {3} input(s) (use a valid argument for the D2D intrinsic, or adjust the number of inputs for the shader using [D2DInputCount])". - /// - /// - public static readonly DiagnosticDescriptor IndexOutOfRangeForD2DIntrinsic = new( - id: "CMPSD2D0083", - title: "Index out of range for D2D intrinsic", - messageFormat: "The D2D intrinsic '{0}' cannot be used for input {1}, as the containing shader {2} only declares {3} input(s) (use a valid argument for the D2D intrinsic, or adjust the number of inputs for the shader using [D2DInputCount])", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "D2D intrinsics must be used with valid input indices (the number of inputs for a shader can be configured using [D2DInputCount]).", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a D2D intrinsic call with an invalid input type. - /// - /// Format: "The D2D intrinsic '{0}' cannot be used for input {1}, as it does not have the right input type (you can configure the input type of each input using [D2DInputSimple] and [D2DInputComplex] on the shader type)". - /// - /// - public static readonly DiagnosticDescriptor InvalidInputTypeForD2DIntrinsic = new( - id: "CMPSD2D0084", - title: "Invalid input type for D2D intrinsic", - messageFormat: "The D2D intrinsic '{0}' cannot be used for input {1}, as it does not have the right input type (you can configure the input type of each input using [D2DInputSimple] and [D2DInputComplex] on the shader type)", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "D2D intrinsics must be used with compatible input types (the input type of each shader input can be configured using [D2DInputSimple] and [D2DInputComplex] on the shader type).", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a D2D intrinsic call with a source input index that is not a constant. - /// - /// Format: "The argument for parameter '{0}' in the call to the D2D intrinsic '{1}' must be a constant value (for instance, 'D2D.GetInput(0)' is valid, whereas 'D2D.GetInput(x)' is not)". - /// - /// - public static readonly DiagnosticDescriptor NonConstantSourceInputIndexForD2DIntrinsic = new( - id: "CMPSD2D0085", - title: "Non constant input index for D2D intrinsic", - messageFormat: "The argument for parameter '{0}' in the call to the D2D intrinsic '{1}' must be a constant value (for instance, 'D2D.GetInput(0)' is valid, whereas 'D2D.GetInput(x)' is not)", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "Arguments for parameters indicating the source shader input index in calls to D2D intrinsics must be constant values (for instance, 'D2D.GetInput(0)' is valid, whereas 'D2D.GetInput(x)' is not).", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a D2D intrinsic call with a source input index using invalid syntax. - /// - /// Format: "The argument for parameter '{0}' in the call to the D2D intrinsic '{1}' must be a literal or a constant field reference (for instance, 'D2D.GetInput(0)' and 'D2D.GetInput(TextureIndex)' are valid, whereas 'D2D.GetInput(BaseIndex + 1)' and 'D2D.GetInput(1 + 2)' are not)". - /// - /// - public static readonly DiagnosticDescriptor InvalidIndexSyntaxForD2DIntrinsic = new( - id: "CMPSD2D0086", - title: "Invalid input index syntax for D2D intrinsic", - messageFormat: "The argument for parameter '{0}' in the call to the D2D intrinsic '{1}' must be a literal or a constant field reference (for instance, 'D2D.GetInput(0)' and 'D2D.GetInput(TextureIndex)' are valid, whereas 'D2D.GetInput(BaseIndex + 1)' and 'D2D.GetInput(1 + 2)' are not)", - category: "ComputeSharp.D2D1.Shaders", - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "Arguments for parameters indicating the source shader input index in calls to D2D intrinsics must be a literal or constant field references (for instance, 'D2D.GetInput(0)' and 'D2D.GetInput(TextureIndex)' are valid, whereas 'D2D.GetInput(BaseIndex + 1)' and 'D2D.GetInput(1 + 2)' are not).", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/SuppressionDescriptors.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/SuppressionDescriptors.cs deleted file mode 100644 index 1b4fe29e..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/SuppressionDescriptors.cs +++ /dev/null @@ -1,17 +0,0 @@ -using Microsoft.CodeAnalysis; - -namespace ComputeSharp.D2D1.SourceGenerators.Diagnostics; - -/// -/// A container for all instances for suppressed diagnostics by analyzers in this project. -/// -internal static class SuppressionDescriptors -{ - /// - /// Gets a for an uninitialized D2D1 resource texture field. - /// - public static readonly SuppressionDescriptor UninitializedD2D1ResourceTextureField = new( - id: "CMPSD2DSPR0001", - suppressedDiagnosticId: "CS0649", - justification: "Fields of type D2D1ResourceTexture1D, D2D1ResourceTexture2D and D2D1ResourceTexture3D are implicitly mapped to resource texture objects into the resulting D2D1 pixel shader for their containing type, and don't need to be initialized"); -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Suppressors/D2D1ResourceTextureUninitializedFieldDiagnosticSuppressor.cs b/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Suppressors/D2D1ResourceTextureUninitializedFieldDiagnosticSuppressor.cs deleted file mode 100644 index c80cf927..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Diagnostics/Suppressors/D2D1ResourceTextureUninitializedFieldDiagnosticSuppressor.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System.Collections.Immutable; -using ComputeSharp.SourceGeneration.Extensions; -using ComputeSharp.SourceGeneration.Mappings; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; -using static ComputeSharp.D2D1.SourceGenerators.Diagnostics.SuppressionDescriptors; - -namespace ComputeSharp.D2D1.SourceGenerators; - -/// -/// -/// A diagnostic suppressor to suppress CS0649 warnings for uninitialized D2D1 resource texture fields. -/// -/// -/// That is, this diagnostic suppressor will suppress the following diagnostic: -/// -/// public struct MyShader : ID2D1PixelShader -/// { -/// [D2DResourceTextureIndex(0)] -/// private D2D1ResourceTexture1D<float4> texture; -/// -/// public float4 Execute() -/// { -/// return texture[0]; -/// } -/// } -/// -/// -/// -[DiagnosticAnalyzer(LanguageNames.CSharp)] -public sealed class D2D1ResourceTextureUninitializedFieldDiagnosticSuppressor : DiagnosticSuppressor -{ - /// - public override ImmutableArray SupportedSuppressions => [UninitializedD2D1ResourceTextureField]; - - /// - public override void ReportSuppressions(SuppressionAnalysisContext context) - { - foreach (Diagnostic diagnostic in context.ReportedDiagnostics) - { - SyntaxNode? syntaxNode = diagnostic.Location.SourceTree?.GetRoot(context.CancellationToken).FindNode(diagnostic.Location.SourceSpan); - - if (syntaxNode is not null) - { - SemanticModel semanticModel = context.GetSemanticModel(syntaxNode.SyntaxTree); - - // Get the field symbol - ISymbol? declaredSymbol = semanticModel.GetDeclaredSymbol(syntaxNode, context.CancellationToken); - - // Check if the field is in a struct and it's of a D2D1 resource texture type - if (declaredSymbol is IFieldSymbol { ContainingType: { TypeKind: TypeKind.Struct } structSymbol } fieldSymbol && - HlslKnownTypes.IsResourceTextureType(fieldSymbol.Type.GetFullyQualifiedMetadataName())) - { - // Get the ID2D1PixelShader interface symbol to the check the containing type of the field - if (semanticModel.Compilation.GetTypeByMetadataName("ComputeSharp.D2D1.ID2D1PixelShader") is not { } d2D1PixelShaderSymbol) - { - continue; - } - - // Also check if the containing type is in fact a D2D1 pixel shader type - if (structSymbol.HasInterfaceWithType(d2D1PixelShaderSymbol)) - { - context.ReportSuppression(Suppression.Create(UninitializedD2D1ResourceTextureField, diagnostic)); - } - } - } - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Fxc/D3DCompiler.cs b/src/ComputeSharp.D2D1.SourceGenerators/Fxc/D3DCompiler.cs deleted file mode 100644 index 0709fd22..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Fxc/D3DCompiler.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using Windows.Win32; -using Windows.Win32.Graphics.Direct3D; -using Windows.Win32.Graphics.Direct3D11; -using DirectX = Windows.Win32.PInvoke; - -namespace ComputeSharp.D2D1.Shaders.Translation; - -/// -partial class D3DCompiler -{ - /// - /// Checks whether double precision support is required. - /// - /// The input HLSL bytecode to inspect. - /// Whether double precision support is required for . - public static unsafe bool IsDoublePrecisionSupportRequired(ID3DBlob* d3DBlob) - { - using ComPtr d3D11ShaderReflection = default; - - Guid iidOfID3D11ShaderReflection = ID3D11ShaderReflection.IID_Guid; - - DirectX.D3DReflect( - pSrcData: d3DBlob->GetBufferPointer(), - SrcDataSize: d3DBlob->GetBufferSize(), - pInterface: &iidOfID3D11ShaderReflection, - ppReflector: (void**)d3D11ShaderReflection.GetAddressOf()).Assert(); - - const ulong doublePrecisionFlags = DirectX.D3D_SHADER_REQUIRES_DOUBLES | DirectX.D3D_SHADER_REQUIRES_11_1_DOUBLE_EXTENSIONS; - - return (d3D11ShaderReflection.Get()->GetRequiresFlags() & doublePrecisionFlags) != 0; - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Helpers/D2D1EffectMetadataParser.cs b/src/ComputeSharp.D2D1.SourceGenerators/Helpers/D2D1EffectMetadataParser.cs deleted file mode 100644 index 1b53addf..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Helpers/D2D1EffectMetadataParser.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System; -using System.Diagnostics.CodeAnalysis; -using System.Security; -using System.Text.RegularExpressions; -using ComputeSharp.SourceGeneration.Extensions; -using Microsoft.CodeAnalysis; - -namespace ComputeSharp.D2D1.SourceGenerators.Helpers; - -/// -/// A helper class to parse D2D metadata values. -/// -internal static class D2D1EffectMetadataParser -{ - /// - /// A instance to find all newlines. - /// - private static readonly Regex NewLinesRegex = new("[\r\n\v]", RegexOptions.Compiled); - - /// - /// Checks whether a given value contains a valid effect metadata name. - /// - /// The input object to inspect. - /// Whether contains a valid effect metadata name. - public static bool IsValidEffectMetadataName(AttributeData attributeData) - { - if (attributeData.ConstructorArguments is [{ Value: string { Length: > 0 } value }]) - { - // Remove new lines (the values cannot span multiple lines in XML) - string singleLineValue = NewLinesRegex.Replace(value, string.Empty); - - // Trim directly and check that (no need to escape, as that wouldn't change things) - return singleLineValue.AsSpan().Trim().Length > 0; - } - - return false; - } - - /// - /// Tries to get the defined effect metadata name for a given shader type. - /// - /// The input object currently in use. - /// The input instance. - /// The fully qualified metadata name of the target attribute. - /// Whether the attribute can also be on the assembly. - /// The resulting defined effect metadata name, if found. - /// Whether or not a defined effect metadata name could be found. - public static bool TryGetEffectMetadataName( - Compilation compilation, - INamedTypeSymbol typeSymbol, - string attributeFullyQualifiedMetadataName, - bool isAssemblyLevelAttributeSupported, - [NotNullWhen(true)] out string? effectMetadataName) - { - INamedTypeSymbol metadataAttributeSymbol = compilation.GetTypeByMetadataName(attributeFullyQualifiedMetadataName)!; - - // Always check the attributes on the type first - if (typeSymbol.TryGetAttributeWithType(metadataAttributeSymbol, out AttributeData? attributeData)) - { - return TryGetEffectMetadataName(attributeData, out effectMetadataName); - } - - // Check assembly-level attributes next, if needed - if (isAssemblyLevelAttributeSupported && - typeSymbol.ContainingAssembly!.TryGetAttributeWithType(metadataAttributeSymbol, out attributeData)) - { - return TryGetEffectMetadataName(attributeData, out effectMetadataName); - } - - effectMetadataName = default; - - return false; - } - - /// - /// Tries to get the defined effect metadata name for a given attribute. - /// - /// The input object to inspect. - /// The resulting defined effect metadata name, if found. - /// Whether or not a defined effect metadata name could be found. - public static bool TryGetEffectMetadataName(AttributeData attributeData, [NotNullWhen(true)] out string? effectMetadataName) - { - // Check that the attribute has a valid parameter - if (attributeData.ConstructorArguments is [{ Value: string { Length: > 0 } value }]) - { - // Remove new lines (the values cannot span multiple lines in XML) - string singleLineValue = NewLinesRegex.Replace(value, string.Empty); - - // Make sure to escape any invalid XML characters - string escapedValue = SecurityElement.Escape(singleLineValue); - - // Trim the display name as well - if (escapedValue.AsSpan().Trim() is { Length: > 0 } trimmedValue) - { - effectMetadataName = trimmedValue.ToString(); - - return true; - } - } - - effectMetadataName = default; - - return false; - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Mappings/HlslKnownKeywords.cs b/src/ComputeSharp.D2D1.SourceGenerators/Mappings/HlslKnownKeywords.cs deleted file mode 100644 index 8ea470fe..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Mappings/HlslKnownKeywords.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Collections.Generic; -using System.Reflection; -using ComputeSharp.Core.Intrinsics; -using ComputeSharp.D2D1; - -namespace ComputeSharp.SourceGeneration.Mappings; - -/// -partial class HlslKnownKeywords -{ - /// - static partial void AddKnownKeywords(ICollection knownKeywords) - { - // D2D1 intrinsics method names - foreach (MethodInfo? method in typeof(D2D).GetMethods(BindingFlags.Public | BindingFlags.Static)) - { - string name = method.GetCustomAttribute()?.Name ?? method.Name; - - knownKeywords.Add(name); - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Mappings/HlslKnownMethods.cs b/src/ComputeSharp.D2D1.SourceGenerators/Mappings/HlslKnownMethods.cs deleted file mode 100644 index 3d8228e7..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Mappings/HlslKnownMethods.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Reflection; -using ComputeSharp.Core.Intrinsics; -using ComputeSharp.D2D1; - -namespace ComputeSharp.SourceGeneration.Mappings; - -/// -partial class HlslKnownMethods -{ - /// - /// Checks whether or not a method name (previous matched with - /// needs the [D2DRequiresScenePosition] annotation on its containing shader in order to be used. - /// - /// The fully qualified metadata name. - /// Whether the method needs the [D2DRequiresScenePosition] annotation. - public static bool NeedsD2DRequiresScenePositionAttribute(string name) - { - return name is "ComputeSharp.D2D1.D2D.GetScenePosition" or "ComputeSharp.D2D1.D2D.SampleInputAtPosition"; - } - - /// - private static partial Dictionary BuildKnownResourceSamplers() - { - return new() - { - [$"ComputeSharp.D2D1.D2D1ResourceTexture1D`1.Sample({typeof(float).FullName})"] = null, - [$"ComputeSharp.D2D1.D2D1ResourceTexture2D`1.Sample({typeof(float).FullName}, {typeof(float).FullName})"] = "float2", - [$"ComputeSharp.D2D1.D2D1ResourceTexture2D`1.Sample({typeof(Float2).FullName})"] = null, - [$"ComputeSharp.D2D1.D2D1ResourceTexture3D`1.Sample({typeof(float).FullName}, {typeof(float).FullName}, {typeof(float).FullName})"] = "float3", - [$"ComputeSharp.D2D1.D2D1ResourceTexture3D`1.Sample({typeof(Float3).FullName})"] = null - }; - } - - /// - - static partial void AddKnownMethods(IDictionary knownMethods) - { - // Programmatically load mappings from the D2D1 class as well - foreach (MethodInfo? method in - from method in typeof(D2D).GetMethods(BindingFlags.Public | BindingFlags.Static) - group method by method.Name - into groups - select groups.First()) - { - string hlslName = method.GetCustomAttribute()?.Name ?? method.Name; - - knownMethods.Add($"{typeof(D2D).FullName}{Type.Delimiter}{method.Name}", hlslName); - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Mappings/HlslKnownProperties.cs b/src/ComputeSharp.D2D1.SourceGenerators/Mappings/HlslKnownProperties.cs deleted file mode 100644 index 2c750be2..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Mappings/HlslKnownProperties.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System.Collections.Generic; - -namespace ComputeSharp.SourceGeneration.Mappings; - -/// -partial class HlslKnownProperties -{ - /// - private static partial Dictionary BuildKnownResourceIndexers() - { - return new() - { - [$"ComputeSharp.D2D1.D2D1ResourceTexture2D`1.this[{typeof(int).FullName}, {typeof(int).FullName}]"] = "int2", - [$"ComputeSharp.D2D1.D2D1ResourceTexture3D`1.this[{typeof(int).FullName}, {typeof(int).FullName}, {typeof(int).FullName}]"] = "int3" - }; - } - - /// - private static partial Dictionary BuildKnownSizeAccessors() - { - return new() - { - ["ComputeSharp.D2D1.D2D1ResourceTexture1D`1.Width"] = (1, 0), - ["ComputeSharp.D2D1.D2D1ResourceTexture2D`1.Width"] = (2, 0), - ["ComputeSharp.D2D1.D2D1ResourceTexture2D`1.Height"] = (2, 1), - ["ComputeSharp.D2D1.D2D1ResourceTexture3D`1.Width"] = (3, 0), - ["ComputeSharp.D2D1.D2D1ResourceTexture3D`1.Height"] = (3, 1), - ["ComputeSharp.D2D1.D2D1ResourceTexture3D`1.Depth"] = (3, 2) - }; - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Mappings/HlslKnownTypes.cs b/src/ComputeSharp.D2D1.SourceGenerators/Mappings/HlslKnownTypes.cs deleted file mode 100644 index a5ef6e11..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Mappings/HlslKnownTypes.cs +++ /dev/null @@ -1,57 +0,0 @@ -using System; -using ComputeSharp.SourceGeneration.Extensions; -using Microsoft.CodeAnalysis; - -namespace ComputeSharp.SourceGeneration.Mappings; - -/// -partial class HlslKnownTypes -{ - /// - /// Checks whether or not a given type name matches a resource texture type. - /// - /// The input type name to check. - /// Whether or not represents a readonly typed resource type. - public static bool IsResourceTextureType(string typeName) - { - return typeName switch - { - "ComputeSharp.D2D1.D2D1ResourceTexture1D`1" or - "ComputeSharp.D2D1.D2D1ResourceTexture2D`1" or - "ComputeSharp.D2D1.D2D1ResourceTexture3D`1" => true, - _ => false - }; - } - - /// - public static partial string GetMappedName(INamedTypeSymbol typeSymbol) - { - string typeName = typeSymbol.GetFullyQualifiedMetadataName(); - - // Special case for resource texture types - if (IsResourceTextureType(typeName)) - { - string genericArgumentName = ((INamedTypeSymbol)typeSymbol.TypeArguments[0]).GetFullyQualifiedMetadataName(); - - // Get the HLSL name for the type argument (it can only be either float or float4) - _ = KnownHlslTypeMetadataNames.TryGetValue(genericArgumentName, out string? mappedElementType); - - return typeName switch - { - "ComputeSharp.D2D1.D2D1ResourceTexture1D`1" => $"Texture1D<{mappedElementType}>", - "ComputeSharp.D2D1.D2D1ResourceTexture2D`1" => $"Texture2D<{mappedElementType}>", - "ComputeSharp.D2D1.D2D1ResourceTexture3D`1" => $"Texture3D<{mappedElementType}>", - _ => throw new ArgumentException() - }; - } - - // The captured field is of an HLSL primitive type - if (KnownHlslTypeMetadataNames.TryGetValue(typeName, out string? mappedType)) - { - return mappedType; - } - - // The captured field is of a custom struct type - return typeName.ToHlslIdentifierName(); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Models/D2D1PixelShaderSourceInfo.cs b/src/ComputeSharp.D2D1.SourceGenerators/Models/D2D1PixelShaderSourceInfo.cs deleted file mode 100644 index 058c383f..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Models/D2D1PixelShaderSourceInfo.cs +++ /dev/null @@ -1,23 +0,0 @@ -using ComputeSharp.SourceGeneration.Helpers; -using ComputeSharp.SourceGeneration.Models; - -namespace ComputeSharp.D2D1.SourceGenerators.Models; - -/// -/// A model representing all necessary info for a full generation pass for a [D2D1PixelShaderSource] attribute. -/// -/// The hierarchy info for the shader type. -/// The modifiers for the annotated method (these are values, which can't be equated directly). -/// The name of the annotated method. -/// The fully qualified name of the return type, if invalid. -/// The key with processed info on the shader. -/// The value with processed info on the shader. -/// The discovered diagnostics, if any. -internal sealed record D2D1PixelShaderSourceInfo( - HierarchyInfo Hierarchy, - EquatableArray Modifiers, - string MethodName, - string? InvalidReturnType, - HlslBytecodeInfoKey HlslInfoKey, - HlslBytecodeInfo HlslInfo, - EquatableArray Diagnostcs); \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Models/D2D1ShaderInfo.cs b/src/ComputeSharp.D2D1.SourceGenerators/Models/D2D1ShaderInfo.cs deleted file mode 100644 index 31d5d1be..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Models/D2D1ShaderInfo.cs +++ /dev/null @@ -1,43 +0,0 @@ -using ComputeSharp.SourceGeneration.Helpers; -using ComputeSharp.SourceGeneration.Models; - -namespace ComputeSharp.D2D1.SourceGenerators.Models; - -/// -/// A model representing all necessary info for a full generation pass for a D2D1 shader. -/// -/// The hierarchy info for the shader type. -/// The GUID bytes for the effect id. -/// The effect display name for the shader type, if available. -/// The effect description for the shader type, if available. -/// The effect category for the shader type, if available. -/// The effect author for the shader type, if available. -/// The size of the shader constant buffer. -/// The gathered input types for the shader. -/// The gathered input descriptions for the shader. -/// The gathered resource texture descriptions for the shader. -/// The description on shader instance fields. -/// The buffer precision for the resulting output buffer. -/// The channel depth for the resulting output buffer. -/// The pixel options used by the shader. -/// The key with processed info on the shader. -/// The value with processed info on the shader. -/// The discovered diagnostics, if any. -internal sealed record D2D1ShaderInfo( - HierarchyInfo Hierarchy, - EquatableArray EffectId, - string? EffectDisplayName, - string? EffectDescription, - string? EffectCategory, - string? EffectAuthor, - int ConstantBufferSizeInBytes, - EquatableArray InputTypes, - EquatableArray InputDescriptions, - EquatableArray ResourceTextureDescriptions, - EquatableArray Fields, - D2D1BufferPrecision BufferPrecision, - D2D1ChannelDepth ChannelDepth, - D2D1PixelOptions PixelOptions, - HlslBytecodeInfoKey HlslInfoKey, - HlslBytecodeInfo HlslInfo, - EquatableArray Diagnostcs) : IConstantBufferInfo; \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Models/HlslBytecodeInfoKey.cs b/src/ComputeSharp.D2D1.SourceGenerators/Models/HlslBytecodeInfoKey.cs deleted file mode 100644 index 035f7144..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Models/HlslBytecodeInfoKey.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace ComputeSharp.D2D1.SourceGenerators.Models; - -/// -/// A model with info to be a unique key for instances. -/// -/// The input HLSL source code. -/// The shader profile. -/// The compile options. -/// Whether compilation should be attempted for the current info. -internal sealed record HlslBytecodeInfoKey( - string HlslSource, - D2D1ShaderProfile ShaderProfile, - D2D1CompileOptions CompileOptions, - bool IsCompilationEnabled); \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Models/InputDescription.cs b/src/ComputeSharp.D2D1.SourceGenerators/Models/InputDescription.cs deleted file mode 100644 index 405bdc5e..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Models/InputDescription.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace ComputeSharp.D2D1.SourceGenerators.Models; - -/// -/// A model representing an input description for a shader. -/// -/// The index of the input resource the description is for. -/// The input filter to use. -/// The level of detail to use. -internal sealed record InputDescription(int Index, D2D1Filter Filter, int LevelOfDetailCount); \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Models/ResourceTextureDescription.cs b/src/ComputeSharp.D2D1.SourceGenerators/Models/ResourceTextureDescription.cs deleted file mode 100644 index c14ed920..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Models/ResourceTextureDescription.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace ComputeSharp.D2D1.SourceGenerators.Models; - -/// -/// A model representing a resource texture description for a shader. -/// -/// The index of the resource texture resource the description is for. -/// The rank of the resource texture. -internal sealed record ResourceTextureDescription(int Index, int Rank); \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/NativeMethods.txt b/src/ComputeSharp.D2D1.SourceGenerators/NativeMethods.txt deleted file mode 100644 index eb4271bf..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/NativeMethods.txt +++ /dev/null @@ -1,30 +0,0 @@ -D3DCompile -D3DReflect -D3DSetBlobPart -D3DStripShader -D2D1_BUFFER_PRECISION -D2D1_CHANNEL_DEPTH -D2D1_FILTER -D2D1_PIXEL_OPTIONS -D3DCOMPILE_DEBUG -D3DCOMPILE_SKIP_VALIDATION -D3DCOMPILE_SKIP_OPTIMIZATION -D3DCOMPILE_PACK_MATRIX_ROW_MAJOR -D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR -D3DCOMPILE_PARTIAL_PRECISION -D3DCOMPILE_AVOID_FLOW_CONTROL -D3DCOMPILE_ENABLE_STRICTNESS -D3DCOMPILE_IEEE_STRICTNESS -D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY -D3DCOMPILE_OPTIMIZATION_LEVEL0 -D3DCOMPILE_OPTIMIZATION_LEVEL1 -D3DCOMPILE_OPTIMIZATION_LEVEL2 -D3DCOMPILE_OPTIMIZATION_LEVEL3 -D3DCOMPILE_WARNINGS_ARE_ERRORS -D3DCOMPILER_STRIP_FLAGS -D3D_SHADER_REQUIRES_DOUBLES -D3D_SHADER_REQUIRES_11_1_DOUBLE_EXTENSIONS -ID3D11ShaderReflection -IUnknown -S_OK -S_FALSE \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/Polyfills/EncodingExtensions.cs b/src/ComputeSharp.D2D1.SourceGenerators/Polyfills/EncodingExtensions.cs deleted file mode 100644 index 825e8d36..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/Polyfills/EncodingExtensions.cs +++ /dev/null @@ -1,23 +0,0 @@ -namespace System.Text; - -/// -/// Extensions for the type. -/// -internal static class EncodingExtensions -{ - /// - /// Encodes into a span of bytes a set of characters from the specified read-only span. - /// - /// The input instance to use. - /// The span containing the set of characters to encode. - /// The byte span to hold the encoded bytes. - /// The number of encoded bytes. - public static unsafe int GetBytes(this Encoding encoding, ReadOnlySpan chars, Span bytes) - { - fixed (char* charsPtr = chars) - fixed (byte* bytesPtr = bytes) - { - return encoding.GetBytes(charsPtr, chars.Length, bytesPtr, bytes.Length); - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/SyntaxProcessors/ConstantBufferSyntaxProcessor.ArtificialFields.cs b/src/ComputeSharp.D2D1.SourceGenerators/SyntaxProcessors/ConstantBufferSyntaxProcessor.ArtificialFields.cs deleted file mode 100644 index 51678124..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/SyntaxProcessors/ConstantBufferSyntaxProcessor.ArtificialFields.cs +++ /dev/null @@ -1,11 +0,0 @@ -namespace ComputeSharp.SourceGeneration.SyntaxProcessors; - -/// -partial class ConstantBufferSyntaxProcessor -{ - /// - private static partial bool HasArtificialFields() - { - return false; - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/SyntaxProcessors/HlslBytecodeSyntaxProcessor.D2D1.cs b/src/ComputeSharp.D2D1.SourceGenerators/SyntaxProcessors/HlslBytecodeSyntaxProcessor.D2D1.cs deleted file mode 100644 index d87ed2a7..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/SyntaxProcessors/HlslBytecodeSyntaxProcessor.D2D1.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Threading; -using ComputeSharp.D2D1.Shaders.Translation; -using ComputeSharp.D2D1.SourceGenerators.Models; -using Windows.Win32; -using Windows.Win32.Graphics.Direct3D; - -namespace ComputeSharp.SourceGeneration.SyntaxProcessors; - -/// -partial class HlslBytecodeSyntaxProcessor -{ - /// - private static partial string GetRequiresDoublePrecisionSupportAttributeName() - { - return "ComputeSharp.D2D1.D2DRequiresDoublePrecisionSupportAttribute"; - } - - /// - private static partial ComPtr Compile(HlslBytecodeInfoKey key, CancellationToken token) - { - return D3DCompiler.Compile( - key.HlslSource.AsSpan(), - key.ShaderProfile, - key.CompileOptions, - token); - } - - /// - private static unsafe partial bool IsDoublePrecisionSupportRequired(ID3DBlob* d3DBlob) - { - return D3DCompiler.IsDoublePrecisionSupportRequired(d3DBlob); - } - - /// - private static partial string FixupErrorMessage(string message) - { - return D3DCompiler.PrettifyFxcErrorMessage(message); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs b/src/ComputeSharp.D2D1.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs deleted file mode 100644 index 9b505839..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/SyntaxRewriters/ShaderSourceRewriter.cs +++ /dev/null @@ -1,42 +0,0 @@ -using ComputeSharp.SourceGeneration.Mappings; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp.Syntax; -using Microsoft.CodeAnalysis.Operations; -using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; - -namespace ComputeSharp.SourceGeneration.SyntaxRewriters; - -/// -partial class ShaderSourceRewriter -{ - /// - /// Gets whether or not the shader needs the [D2DRequiresScenePosition] attribute. - /// - public bool NeedsD2DRequiresScenePositionAttribute { get; private set; } - - /// - private partial SyntaxNode RewriteSampledTextureAccess(IInvocationOperation operation, ExpressionSyntax expression, ArgumentSyntax arguments) - { - string fieldName = (operation.Instance as IFieldReferenceOperation)?.Member.Name ?? ""; - - _ = HlslKnownKeywords.TryGetMappedName(fieldName, out string? mapped); - - // Transform an indexer syntax into a sampling call with the implicit static linear sampler. - // For instance: texture.Sample(uv) will be rewritten as texture.Sample(__sampler__texture, uv). - return - InvocationExpression(expression) - .AddArgumentListArguments(Argument(IdentifierName($"__sampler__{mapped ?? fieldName}")), arguments); - } - - /// - partial void TrackKnownMethodInvocation(string metadataName) - { - NeedsD2DRequiresScenePositionAttribute |= HlslKnownMethods.NeedsD2DRequiresScenePositionAttribute(metadataName); - } - - /// - partial void TrackExternalStaticField(StaticFieldRewriter staticFieldRewriter) - { - NeedsD2DRequiresScenePositionAttribute |= staticFieldRewriter.NeedsD2DRequiresScenePositionAttribute; - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.SourceGenerators/SyntaxRewriters/StaticFieldRewriter.cs b/src/ComputeSharp.D2D1.SourceGenerators/SyntaxRewriters/StaticFieldRewriter.cs deleted file mode 100644 index 242d527b..00000000 --- a/src/ComputeSharp.D2D1.SourceGenerators/SyntaxRewriters/StaticFieldRewriter.cs +++ /dev/null @@ -1,28 +0,0 @@ -using ComputeSharp.SourceGeneration.Mappings; -using Microsoft.CodeAnalysis.CSharp.Syntax; -using Microsoft.CodeAnalysis.Operations; - -namespace ComputeSharp.SourceGeneration.SyntaxRewriters; - -/// -partial class StaticFieldRewriter -{ - /// - public bool NeedsD2DRequiresScenePositionAttribute { get; private set; } - - /// - private partial void TrackKnownPropertyAccess(IMemberReferenceOperation operation, MemberAccessExpressionSyntax node) - { - // No special tracking is needed for D2D1 shaders - } - - /// - private partial void TrackKnownMethodInvocation(string metadataName) - { - // Track whether the method needs [D2DRequiresScenePosition] - if (HlslKnownMethods.NeedsD2DRequiresScenePositionAttribute(metadataName)) - { - NeedsD2DRequiresScenePositionAttribute = true; - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI.CodeFixers/ComputeSharp.D2D1.UI.CodeFixers.projitems b/src/ComputeSharp.D2D1.UI.CodeFixers/ComputeSharp.D2D1.UI.CodeFixers.projitems deleted file mode 100644 index 7f9be695..00000000 --- a/src/ComputeSharp.D2D1.UI.CodeFixers/ComputeSharp.D2D1.UI.CodeFixers.projitems +++ /dev/null @@ -1,14 +0,0 @@ - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - true - ce85dc5a-e455-42fe-9b64-0d5f0d7ee366 - - - ComputeSharp.D2D1.UI.CodeFixers - - - - - \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI.CodeFixers/ComputeSharp.D2D1.UI.CodeFixers.shproj b/src/ComputeSharp.D2D1.UI.CodeFixers/ComputeSharp.D2D1.UI.CodeFixers.shproj deleted file mode 100644 index 51be84cc..00000000 --- a/src/ComputeSharp.D2D1.UI.CodeFixers/ComputeSharp.D2D1.UI.CodeFixers.shproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - ce85dc5a-e455-42fe-9b64-0d5f0d7ee366 - 14.0 - - - - - - - - diff --git a/src/ComputeSharp.D2D1.UI.CodeFixers/UseGeneratedCanvasEffectPropertyOnSemiAutoPropertyCodeFixer.cs b/src/ComputeSharp.D2D1.UI.CodeFixers/UseGeneratedCanvasEffectPropertyOnSemiAutoPropertyCodeFixer.cs deleted file mode 100644 index da15eade..00000000 --- a/src/ComputeSharp.D2D1.UI.CodeFixers/UseGeneratedCanvasEffectPropertyOnSemiAutoPropertyCodeFixer.cs +++ /dev/null @@ -1,350 +0,0 @@ -using System.Collections.Immutable; -using System.Composition; -using System.Diagnostics.CodeAnalysis; -using System.Threading.Tasks; -#if WINDOWS_UWP -using ComputeSharp.D2D1.Uwp.SourceGenerators.Constants; -#else -using ComputeSharp.D2D1.WinUI.SourceGenerators.Constants; -#endif -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CodeActions; -using Microsoft.CodeAnalysis.CodeFixes; -using Microsoft.CodeAnalysis.CSharp; -using Microsoft.CodeAnalysis.CSharp.Syntax; -using Microsoft.CodeAnalysis.Editing; -using Microsoft.CodeAnalysis.Formatting; -using Microsoft.CodeAnalysis.Simplification; -using Microsoft.CodeAnalysis.Text; -#if WINDOWS_UWP -using static ComputeSharp.D2D1.Uwp.SourceGenerators.DiagnosticDescriptors; -#else -using static ComputeSharp.D2D1.WinUI.SourceGenerators.DiagnosticDescriptors; -#endif -using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory; - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp.SourceGenerators; -#else -namespace ComputeSharp.D2D1.WinUI.SourceGenerators; -#endif - -/// -/// A code fixer that converts manual properties into partial properties using [GeneratedCanvasEffectProperty]. -/// -[ExportCodeFixProvider(LanguageNames.CSharp)] -[Shared] -public sealed class UseGeneratedCanvasEffectPropertyOnSemiAutoPropertyCodeFixer : CodeFixProvider -{ - /// - public override ImmutableArray FixableDiagnosticIds { get; } = [UseGeneratedCanvasEffectPropertyOnSemiAutoPropertyId]; - - /// - public override Microsoft.CodeAnalysis.CodeFixes.FixAllProvider? GetFixAllProvider() - { - return new FixAllProvider(); - } - - /// - public override async Task RegisterCodeFixesAsync(CodeFixContext context) - { - Diagnostic diagnostic = context.Diagnostics[0]; - TextSpan diagnosticSpan = context.Span; - - // This code fixer needs the semantic model, so check that first - if (!context.Document.SupportsSemanticModel) - { - return; - } - - // Retrieve the properties passed by the analyzer - if (!int.TryParse(diagnostic.Properties[UseGeneratedCanvasEffectPropertyOnSemiAutoPropertyAnalyzer.InvalidationTypePropertyName], out int invalidationType)) - { - return; - } - - SyntaxNode? root = await context.Document.GetSyntaxRootAsync(context.CancellationToken).ConfigureAwait(false); - - // Get the property declaration from the target diagnostic - if (root!.FindNode(diagnosticSpan) is PropertyDeclarationSyntax propertyDeclaration) - { - // Get the semantic model, as we need to resolve symbols - SemanticModel semanticModel = (await context.Document.GetSemanticModelAsync(context.CancellationToken).ConfigureAwait(false))!; - - // Register the code fix to update the semi-auto property to a partial property with [GeneratedCanvasEffectProperty] - context.RegisterCodeFix( - CodeAction.Create( - title: "Use [GeneratedCanvasEffectProperty]", - createChangedDocument: token => ConvertToPartialProperty( - context.Document, - semanticModel, - root, - propertyDeclaration, - invalidationType), - equivalenceKey: "Use [GeneratedCanvasEffectProperty]"), - diagnostic); - } - } - - /// - /// Tries to get an for the [GeneratedCanvasEffectProperty] attribute. - /// - /// The original document being fixed. - /// The instance for the current compilation. - /// The resulting attribute list, if successfully retrieved. - /// Whether could be retrieved successfully. - private static bool TryGetGeneratedCanvasEffectPropertyAttributeList( - Document document, - SemanticModel semanticModel, - [NotNullWhen(true)] out AttributeListSyntax? generatedCanvasEffectPropertyAttributeList) - { - // Make sure we can resolve the '[GeneratedCanvasEffectProperty]' attribute - if (semanticModel.Compilation.GetTypeByMetadataName(WellKnownTypeNames.GeneratedCanvasEffectPropertyAttribute) is not INamedTypeSymbol attributeSymbol) - { - generatedCanvasEffectPropertyAttributeList = null; - - return false; - } - - SyntaxGenerator syntaxGenerator = SyntaxGenerator.GetGenerator(document); - - // Create the attribute syntax for the new '[GeneratedCanvasEffectProperty]' attribute here too - SyntaxNode attributeTypeSyntax = syntaxGenerator.TypeExpression(attributeSymbol).WithAdditionalAnnotations(Simplifier.AddImportsAnnotation); - - generatedCanvasEffectPropertyAttributeList = (AttributeListSyntax)syntaxGenerator.Attribute(attributeTypeSyntax); - - return true; - } - - /// - /// Updates an for the [GeneratedCanvasEffectProperty] attribute with the right default value. - /// - /// The original document being fixed. - /// The instance for the current compilation. - /// The with the attribute to add. - /// The invalidation type to use. - /// The updated attribute syntax. - private static AttributeListSyntax UpdateGeneratedCanvasEffectPropertyAttributeList( - Document document, - SemanticModel semanticModel, - AttributeListSyntax generatedCanvasEffectPropertyAttributeList, - int invalidationType) - { - // If the invalidation type is not the default, set it in the attribute. - // We extract the generated attribute so we can add the new argument. - // It's important to reuse it, as it has the "add usings" annotation. - if (invalidationType == 1) - { - // Try to resolve the attribute type, if present (this should always be the case) - if (semanticModel.Compilation.GetTypeByMetadataName(WellKnownTypeNames.CanvasEffectInvalidationType) is INamedTypeSymbol enumTypeSymbol) - { - SyntaxGenerator syntaxGenerator = SyntaxGenerator.GetGenerator(document); - - // Create the identifier syntax for the enum type, with the right annotations - SyntaxNode enumTypeSyntax = syntaxGenerator.TypeExpression(enumTypeSymbol).WithAdditionalAnnotations(Simplifier.AddImportsAnnotation); - - // Create the member access expression for the target enum type. - // We only ever take this path for the 'Creation' invalidation type. - SyntaxNode enumMemberAccessExpressionSyntax = syntaxGenerator.MemberAccessExpression(enumTypeSyntax, "Creation"); - - // Create the attribute argument to insert - SyntaxNode attributeArgumentSyntax = syntaxGenerator.AttributeArgument(enumMemberAccessExpressionSyntax); - - // Actually add the argument to the existing attribute syntax - return (AttributeListSyntax)syntaxGenerator.AddAttributeArguments(generatedCanvasEffectPropertyAttributeList, [attributeArgumentSyntax]); - } - - // This failed... For some reason. Use the fully qualified type name as a last resort. - return - AttributeList(SingletonSeparatedList( - generatedCanvasEffectPropertyAttributeList.Attributes[0] - .AddArgumentListArguments( - AttributeArgument(ParseExpression( - $"global::{WellKnownTypeNames.CanvasEffectInvalidationType}.Creation"))))); - } - - // If we have no custom invalidation type, we can just reuse the attribute with no changes - return generatedCanvasEffectPropertyAttributeList; - } - - /// - /// Applies the code fix to a target identifier and returns an updated document. - /// - /// The original document being fixed. - /// The instance for the current compilation. - /// The original tree root belonging to the current document. - /// The for the property being updated. - /// The invalidation type to use. - /// An updated document with the applied code fix, and being replaced with a partial property. - private static async Task ConvertToPartialProperty( - Document document, - SemanticModel semanticModel, - SyntaxNode root, - PropertyDeclarationSyntax propertyDeclaration, - int invalidationType) - { - await Task.CompletedTask; - - // If we can't generate the new attribute list, bail (this should never happen) - if (!TryGetGeneratedCanvasEffectPropertyAttributeList(document, semanticModel, out AttributeListSyntax? generatedCanvasEffectPropertyAttributeList)) - { - return document; - } - - // Create an editor to perform all mutations - SyntaxEditor syntaxEditor = new(root, document.Project.Solution.Workspace.Services); - - ConvertToPartialProperty( - document, - semanticModel, - propertyDeclaration, - generatedCanvasEffectPropertyAttributeList, - syntaxEditor, - invalidationType); - - // Create the new document with the single change - return document.WithSyntaxRoot(syntaxEditor.GetChangedRoot()); - } - - /// - /// Applies the code fix to a target identifier and returns an updated document. - /// - /// The original document being fixed. - /// The instance for the current compilation. - /// The for the property being updated. - /// The with the attribute to add. - /// The instance to use. - /// The invalidation type to use. - /// An updated document with the applied code fix, and being replaced with a partial property. - private static void ConvertToPartialProperty( - Document document, - SemanticModel semanticModel, - PropertyDeclarationSyntax propertyDeclaration, - AttributeListSyntax generatedCanvasEffectPropertyAttributeList, - SyntaxEditor syntaxEditor, - int invalidationType) - { - // Update the attribute to insert with the invalidation type, if needed - generatedCanvasEffectPropertyAttributeList = UpdateGeneratedCanvasEffectPropertyAttributeList( - document, - semanticModel, - generatedCanvasEffectPropertyAttributeList, - invalidationType); - - // Start setting up the updated attribute lists - SyntaxList attributeLists = propertyDeclaration.AttributeLists; - - if (attributeLists is [AttributeListSyntax firstAttributeListSyntax, ..]) - { - // Remove the trivia from the original first attribute - attributeLists = attributeLists.Replace( - nodeInList: firstAttributeListSyntax, - newNode: firstAttributeListSyntax.WithoutTrivia()); - - // If the property has at least an attribute list, move the trivia from it to the new attribute - generatedCanvasEffectPropertyAttributeList = generatedCanvasEffectPropertyAttributeList.WithTriviaFrom(firstAttributeListSyntax); - - // Insert the new attribute - attributeLists = attributeLists.Insert(0, generatedCanvasEffectPropertyAttributeList); - } - else - { - // Otherwise (there are no attribute lists), transfer the trivia to the new (only) attribute list - generatedCanvasEffectPropertyAttributeList = generatedCanvasEffectPropertyAttributeList.WithTriviaFrom(propertyDeclaration); - - // Save the new attribute list - attributeLists = attributeLists.Add(generatedCanvasEffectPropertyAttributeList); - } - - // Get a new property that is partial and with semicolon token accessors - PropertyDeclarationSyntax updatedPropertyDeclaration = - propertyDeclaration - .AddModifiers(Token(SyntaxKind.PartialKeyword)) - .WithoutLeadingTrivia() - .WithAttributeLists(attributeLists) - .WithAdditionalAnnotations(Formatter.Annotation) - .WithAccessorList(AccessorList(List( - [ - // Keep the accessors (so we can easily keep all trivia, modifiers, attributes, etc.) but make them semicolon only - propertyDeclaration.AccessorList!.Accessors[0] - .WithBody(null) - .WithExpressionBody(null) - .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)) - .WithAdditionalAnnotations(Formatter.Annotation), - propertyDeclaration.AccessorList!.Accessors[1] - .WithBody(null) - .WithExpressionBody(null) - .WithSemicolonToken(Token(SyntaxKind.SemicolonToken)) - .WithTrailingTrivia(propertyDeclaration.AccessorList.Accessors[1].GetTrailingTrivia()) - .WithAdditionalAnnotations(Formatter.Annotation) - ])).WithTrailingTrivia(propertyDeclaration.AccessorList.GetTrailingTrivia())); - - syntaxEditor.ReplaceNode(propertyDeclaration, updatedPropertyDeclaration); - - // Find the parent type for the property - TypeDeclarationSyntax typeDeclaration = propertyDeclaration.FirstAncestorOrSelf()!; - - // Make sure it's partial (we create the updated node in the function to preserve the updated property declaration). - // If we created it separately and replaced it, the whole tree would also be replaced, and we'd lose the new property. - if (!typeDeclaration.Modifiers.Any(SyntaxKind.PartialKeyword)) - { - syntaxEditor.ReplaceNode(typeDeclaration, static (node, generator) => generator.WithModifiers(node, generator.GetModifiers(node).WithPartial(true))); - } - } - - /// - /// A custom with the logic from . - /// - private sealed class FixAllProvider : DocumentBasedFixAllProvider - { - /// - protected override async Task FixAllAsync(FixAllContext fixAllContext, Document document, ImmutableArray diagnostics) - { - // Get the semantic model, as we need to resolve symbols - if (await document.GetSemanticModelAsync(fixAllContext.CancellationToken).ConfigureAwait(false) is not SemanticModel semanticModel) - { - return document; - } - - // Get the document root (this should always succeed) - if (await document.GetSyntaxRootAsync(fixAllContext.CancellationToken).ConfigureAwait(false) is not SyntaxNode root) - { - return document; - } - - // If we can't generate the new attribute list, bail (this should never happen) - if (!TryGetGeneratedCanvasEffectPropertyAttributeList(document, semanticModel, out AttributeListSyntax? generatedCanvasEffectPropertyAttributeList)) - { - return document; - } - - // Create an editor to perform all mutations (across all edits in the file) - SyntaxEditor syntaxEditor = new(root, fixAllContext.Solution.Services); - - foreach (Diagnostic diagnostic in diagnostics) - { - // Get the current property declaration for the diagnostic - if (root.FindNode(diagnostic.Location.SourceSpan) is not PropertyDeclarationSyntax propertyDeclaration) - { - continue; - } - - // Retrieve the properties passed by the analyzer - if (!int.TryParse(diagnostic.Properties[UseGeneratedCanvasEffectPropertyOnSemiAutoPropertyAnalyzer.InvalidationTypePropertyName], out int invalidationType)) - { - continue; - } - - ConvertToPartialProperty( - document, - semanticModel, - propertyDeclaration, - generatedCanvasEffectPropertyAttributeList, - syntaxEditor, - invalidationType); - } - - return document.WithSyntaxRoot(syntaxEditor.GetChangedRoot()); - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI.SourceGenerators/CanvasEffectPropertyGenerator.Execute.cs b/src/ComputeSharp.D2D1.UI.SourceGenerators/CanvasEffectPropertyGenerator.Execute.cs deleted file mode 100644 index 703023e8..00000000 --- a/src/ComputeSharp.D2D1.UI.SourceGenerators/CanvasEffectPropertyGenerator.Execute.cs +++ /dev/null @@ -1,258 +0,0 @@ -using System.Threading; -#if WINDOWS_UWP -using ComputeSharp.D2D1.Uwp.SourceGenerators.Constants; -using ComputeSharp.D2D1.Uwp.SourceGenerators.Models; -#else -using ComputeSharp.D2D1.WinUI.SourceGenerators.Constants; -using ComputeSharp.D2D1.WinUI.SourceGenerators.Models; -#endif -using ComputeSharp.SourceGeneration.Extensions; -using ComputeSharp.SourceGeneration.Helpers; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp; -using Microsoft.CodeAnalysis.CSharp.Syntax; - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp.SourceGenerators; -#else -namespace ComputeSharp.D2D1.WinUI.SourceGenerators; -#endif - -/// -partial class CanvasEffectPropertyGenerator -{ - /// - /// A container for all the logic for . - /// - private static partial class Execute - { - /// - /// Checks whether an input syntax node is a candidate property declaration for the generator. - /// - /// The input syntax node to check. - /// The used to cancel the operation, if needed. - /// Whether is a candidate property declaration. - public static bool IsCandidatePropertyDeclaration(SyntaxNode node, CancellationToken token) - { - // The node must be a property declaration with two accessors - if (node is not PropertyDeclarationSyntax { AccessorList.Accessors: { Count: 2 } accessors } property) - { - return false; - } - - // The property must be partial (we'll check that it's a declaration from its symbol) - if (!property.Modifiers.Any(SyntaxKind.PartialKeyword)) - { - return false; - } - - // Static properties are not supported - if (property.Modifiers.Any(SyntaxKind.StaticKeyword)) - { - return false; - } - - // The accessors must be a get and a set (with any accessibility) - if (accessors[0].Kind() is not (SyntaxKind.GetAccessorDeclaration or SyntaxKind.SetAccessorDeclaration) || - accessors[1].Kind() is not (SyntaxKind.GetAccessorDeclaration or SyntaxKind.SetAccessorDeclaration)) - { - return false; - } - - token.ThrowIfCancellationRequested(); - - // The property must be in a type with a base type (as it must derive from CanvasEffect) - return node.Parent?.IsTypeDeclarationWithOrPotentiallyWithBaseTypes() == true; - } - - /// - /// Tries to get the accessibility of the property and accessors, if possible. - /// - /// The input node. - /// The input instance. - /// The accessibility of the property, if available. - /// The accessibility of the accessor, if available. - /// The accessibility of the accessor, if available. - /// Whether the property was valid and the accessibilities could be retrieved. - public static bool TryGetAccessibilityModifiers( - PropertyDeclarationSyntax node, - IPropertySymbol symbol, - out Accessibility declaredAccessibility, - out Accessibility getterAccessibility, - out Accessibility setterAccessibility) - { - declaredAccessibility = Accessibility.NotApplicable; - getterAccessibility = Accessibility.NotApplicable; - setterAccessibility = Accessibility.NotApplicable; - - // Ensure that we have a getter and a setter, and that the setter is not init-only - if (symbol is not { GetMethod: { } getMethod, SetMethod: { IsInitOnly: false } setMethod }) - { - return false; - } - - // Track the property accessibility if explicitly set - if (node.Modifiers.Count > 0) - { - declaredAccessibility = symbol.DeclaredAccessibility; - } - - // Track the accessors accessibility, if explicitly set - foreach (AccessorDeclarationSyntax accessor in node.AccessorList?.Accessors ?? []) - { - if (accessor.Modifiers.Count == 0) - { - continue; - } - - switch (accessor.Kind()) - { - case SyntaxKind.GetAccessorDeclaration: - getterAccessibility = getMethod.DeclaredAccessibility; - break; - case SyntaxKind.SetAccessorDeclaration: - setterAccessibility = setMethod.DeclaredAccessibility; - break; - } - } - - return true; - } - - /// - /// Gets the invalidation type to use for the generated effect property. - /// - /// The instance for the processed attribute. - /// The resulting to use for the generated property. - public static CanvasEffectInvalidationType GetCanvasEffectInvalidationType(AttributeData attributeData) - { - if (attributeData.ConstructorArguments is [{ Kind: TypedConstantKind.Enum, Value: byte enumValue }]) - { - return (CanvasEffectInvalidationType)enumValue; - } - - // No constructor parameter, or an invalid one. In this case we either just use the default - // invalidation mode, or let the analyzer emit a diagnostic to let the user know. - return CanvasEffectInvalidationType.Update; - } - - /// - /// Writes all implementations of partial effect property declarations. - /// - /// The input set of declared effect properties. - /// The instance to write into. - public static void WritePropertyDeclarations(EquatableArray properties, IndentedTextWriter writer) - { - // Helper to get the nullable type name for the initial property value - static string GetOldValueTypeNameAsNullable(CanvasEffectPropertyInfo propertyInfo) - { - // Prepare the nullable type for the previous property value. This is needed because if the type is a reference - // type, the previous value might be null even if the property type is not nullable, as the first invocation would - // happen when the property is first set to some value that is not null (but the backing field would still be so). - // As a cheap way to check whether we need to add nullable, we can simply check whether the type name with nullability - // annotations ends with a '?'. If it doesn't and the type is a reference type, we add it. Otherwise, we keep it. - return propertyInfo.IsReferenceTypeOrUnconstraindTypeParameter switch - { - true when !propertyInfo.TypeNameWithNullabilityAnnotations.EndsWith("?") - => $"{propertyInfo.TypeNameWithNullabilityAnnotations}?", - _ => propertyInfo.TypeNameWithNullabilityAnnotations - }; - } - - // Helper to get the accessibility with a trailing space - static string GetExpressionWithTrailingSpace(Accessibility accessibility) - { - return accessibility.GetExpression() switch - { - { Length: > 0 } expression => expression + " ", - _ => "" - }; - } - - // First, generate all partial property implementations at the top of the partial type declaration - foreach (CanvasEffectPropertyInfo propertyInfo in properties) - { - string oldValueTypeNameAsNullable = GetOldValueTypeNameAsNullable(propertyInfo); - - writer.WriteLine("/// "); - writer.WriteGeneratedAttributes(GeneratorName); - writer.Write(GetExpressionWithTrailingSpace(propertyInfo.DeclaredAccessibility)); - writer.WriteIf(propertyInfo.IsRequired, "required "); - writer.WriteLine($"partial {propertyInfo.TypeNameWithNullabilityAnnotations} {propertyInfo.PropertyName}"); - writer.WriteLine($$""" - { - {{GetExpressionWithTrailingSpace(propertyInfo.GetterAccessibility)}}get => field; - {{GetExpressionWithTrailingSpace(propertyInfo.SetterAccessibility)}}set - { - if (global::System.Collections.Generic.EqualityComparer<{{oldValueTypeNameAsNullable}}>.Default.Equals(field, value)) - { - return; - } - - {{oldValueTypeNameAsNullable}} oldValue = field; - - On{{propertyInfo.PropertyName}}Changing(value); - On{{propertyInfo.PropertyName}}Changing(oldValue, value); - - field = value; - - On{{propertyInfo.PropertyName}}Changed(value); - On{{propertyInfo.PropertyName}}Changed(oldValue, value); - - InvalidateEffectGraph(global::{{WellKnownTypeNames.CanvasEffectInvalidationType}}.{{propertyInfo.InvalidationType}}); - } - } - """, isMultiline: true); - writer.WriteLine(); - } - - // Next, emit all partial method declarations at the bottom of the file - foreach (CanvasEffectPropertyInfo propertyInfo in properties) - { - // OnChanging, only with new value - writer.WriteLine(skipIfPresent: true); - writer.WriteLine($""" - /// Executes the logic for when is changing. - /// The new property value being set. - /// This method is invoked right before the value of is changed. - """, isMultiline: true); - writer.WriteGeneratedAttributes(GeneratorName, includeNonUserCodeAttributes: false); - writer.WriteLine($"partial void On{propertyInfo.PropertyName}Changing({propertyInfo.TypeNameWithNullabilityAnnotations} newValue);"); - - string oldValueTypeNameAsNullable = GetOldValueTypeNameAsNullable(propertyInfo); - - // OnChanging, with both values - writer.WriteLine(); - writer.WriteLine($""" - /// Executes the logic for when is changing. - /// The previous property value that is being replaced. - /// The new property value being set. - /// This method is invoked right before the value of is changed. - """, isMultiline: true); - writer.WriteGeneratedAttributes(GeneratorName, includeNonUserCodeAttributes: false); - writer.WriteLine($"partial void On{propertyInfo.PropertyName}Changing({oldValueTypeNameAsNullable} oldValue, {propertyInfo.TypeNameWithNullabilityAnnotations} newValue);"); - - // OnChanged, only with new value - writer.WriteLine(); - writer.WriteLine($""" - /// Executes the logic for when has just changed. - /// The new property value that has been set. - /// This method is invoked right after the value of is changed. - """, isMultiline: true); - writer.WriteGeneratedAttributes(GeneratorName, includeNonUserCodeAttributes: false); - writer.WriteLine($"partial void On{propertyInfo.PropertyName}Changed({propertyInfo.TypeNameWithNullabilityAnnotations} newValue);"); - - // OnChanged, with both values - writer.WriteLine(); - writer.WriteLine($""" - /// Executes the logic for when has just changed. - /// The previous property value that has been replaced. - /// The new property value that has been set. - /// This method is invoked right after the value of is changed. - """, isMultiline: true); - writer.WriteGeneratedAttributes(GeneratorName, includeNonUserCodeAttributes: false); - writer.WriteLine($"partial void On{propertyInfo.PropertyName}Changed({oldValueTypeNameAsNullable} oldValue, {propertyInfo.TypeNameWithNullabilityAnnotations} newValue);"); - } - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI.SourceGenerators/CanvasEffectPropertyGenerator.cs b/src/ComputeSharp.D2D1.UI.SourceGenerators/CanvasEffectPropertyGenerator.cs deleted file mode 100644 index 3bf7d069..00000000 --- a/src/ComputeSharp.D2D1.UI.SourceGenerators/CanvasEffectPropertyGenerator.cs +++ /dev/null @@ -1,145 +0,0 @@ -#if WINDOWS_UWP -using ComputeSharp.D2D1.Uwp.SourceGenerators.Constants; -using ComputeSharp.D2D1.Uwp.SourceGenerators.Models; -#else -using ComputeSharp.D2D1.WinUI.SourceGenerators.Constants; -using ComputeSharp.D2D1.WinUI.SourceGenerators.Models; -#endif -using ComputeSharp.SourceGeneration.Constants; -using ComputeSharp.SourceGeneration.Extensions; -using ComputeSharp.SourceGeneration.Helpers; -using ComputeSharp.SourceGeneration.Models; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp.Syntax; - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp.SourceGenerators; -#else -namespace ComputeSharp.D2D1.WinUI.SourceGenerators; -#endif - -/// -/// A source generator creating implementations of effect properties. -/// -[Generator(LanguageNames.CSharp)] -public sealed partial class CanvasEffectPropertyGenerator : IIncrementalGenerator -{ - /// - /// The name of generator to include in the generated code. - /// - internal const string GeneratorName = -#if WINDOWS_UWP - "ComputeSharp.D2D1.Uwp.CanvasEffectPropertyGenerator"; -#else - "ComputeSharp.D2D1.WinUI.CanvasEffectPropertyGenerator"; -#endif - - /// - public void Initialize(IncrementalGeneratorInitializationContext context) - { - IncrementalValuesProvider propertyInfo = - context.SyntaxProvider - .ForAttributeWithMetadataName( - WellKnownTypeNames.GeneratedCanvasEffectPropertyAttribute, - Execute.IsCandidatePropertyDeclaration, - static (context, token) => - { - // This generator requires C# preview to be used (due to the use of the 'field' keyword) - if (!context.SemanticModel.Compilation.IsLanguageVersionPreview()) - { - return default; - } - - // Ensure we do have a property with a valid containing type - if (context.TargetSymbol is not IPropertySymbol { ContainingType: INamedTypeSymbol typeSymbol } propertySymbol) - { - return default; - } - - // Ensure that the property declaration is a partial definition with no implementation - if (propertySymbol is not { IsPartialDefinition: true, PartialImplementationPart: null }) - { - return default; - } - - // Also ignore all properties that have an invalid declaration - if (propertySymbol.ReturnsByRef || propertySymbol.ReturnsByRefReadonly || propertySymbol.Type.IsRefLikeType) - { - return default; - } - - // Ensure that the containing type derives from CanvasEffect - if (!typeSymbol.InheritsFromFullyQualifiedMetadataName(WellKnownTypeNames.CanvasEffect)) - { - return default; - } - - token.ThrowIfCancellationRequested(); - - // Get the accessibility values, if the property is valid - if (!Execute.TryGetAccessibilityModifiers( - node: (PropertyDeclarationSyntax)context.TargetNode, - symbol: propertySymbol, - out Accessibility declaredAccessibility, - out Accessibility getterAccessibility, - out Accessibility setterAccessibility)) - { - return default; - } - - token.ThrowIfCancellationRequested(); - - string typeNameWithNullabilityAnnotations = propertySymbol.Type.GetFullyQualifiedNameWithNullabilityAnnotations(); - - token.ThrowIfCancellationRequested(); - - CanvasEffectInvalidationType invalidationType = Execute.GetCanvasEffectInvalidationType(context.Attributes[0]); - - token.ThrowIfCancellationRequested(); - - // We're using IsValueType here and not IsReferenceType to also cover unconstrained type parameter cases. - // This will cover both reference types as well T when the constraints are not struct or unmanaged. - // If this is true, it means the field storage can potentially be in a null state (even if not annotated). - bool isReferenceTypeOrUnconstraindTypeParameter = !propertySymbol.Type.IsValueType; - bool isRequired = propertySymbol.IsRequired; - - // Finally, get the hierarchy too - HierarchyInfo hierarchyInfo = HierarchyInfo.From(typeSymbol); - - token.ThrowIfCancellationRequested(); - - return new CanvasEffectPropertyInfo( - Hierarchy: hierarchyInfo, - PropertyName: propertySymbol.Name, - DeclaredAccessibility: declaredAccessibility, - GetterAccessibility: getterAccessibility, - SetterAccessibility: setterAccessibility, - TypeNameWithNullabilityAnnotations: typeNameWithNullabilityAnnotations, - IsReferenceTypeOrUnconstraindTypeParameter: isReferenceTypeOrUnconstraindTypeParameter, - IsRequired: isRequired, - InvalidationType: invalidationType); - }) - .WithTrackingName(WellKnownTrackingNames.Execute) - .Where(static item => item is not null)!; - - // Split and group by containing type - IncrementalValuesProvider<(HierarchyInfo Hierarchy, EquatableArray Properties)> groupedPropertyInfo = - propertyInfo - .GroupBy(keySelector: static item => item.Hierarchy, elementSelector: static item => item) - .WithTrackingName(WellKnownTrackingNames.Output); - - // Generate the source files, if any - context.RegisterSourceOutput(groupedPropertyInfo, static (context, item) => - { - using IndentedTextWriter writer = new(); - - item.Hierarchy.WriteSyntax( - state: item.Properties, - writer: writer, - baseTypes: [], - memberCallbacks: [Execute.WritePropertyDeclarations]); - - context.AddSource($"{item.Hierarchy.FullyQualifiedMetadataName}.g.cs", writer.ToString()); - }); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI.SourceGenerators/ComputeSharp.D2D1.UI.SourceGenerators.projitems b/src/ComputeSharp.D2D1.UI.SourceGenerators/ComputeSharp.D2D1.UI.SourceGenerators.projitems deleted file mode 100644 index 02d5da44..00000000 --- a/src/ComputeSharp.D2D1.UI.SourceGenerators/ComputeSharp.D2D1.UI.SourceGenerators.projitems +++ /dev/null @@ -1,24 +0,0 @@ - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - true - d20e610f-eb37-46e7-b028-04784d7400d5 - - - ComputeSharp.D2D1.UI.SourceGenerators - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI.SourceGenerators/ComputeSharp.D2D1.UI.SourceGenerators.shproj b/src/ComputeSharp.D2D1.UI.SourceGenerators/ComputeSharp.D2D1.UI.SourceGenerators.shproj deleted file mode 100644 index 0e319581..00000000 --- a/src/ComputeSharp.D2D1.UI.SourceGenerators/ComputeSharp.D2D1.UI.SourceGenerators.shproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - d20e610f-eb37-46e7-b028-04784d7400d5 - 14.0 - - - - - - - - diff --git a/src/ComputeSharp.D2D1.UI.SourceGenerators/Constants/WellKnownTypeNames.cs b/src/ComputeSharp.D2D1.UI.SourceGenerators/Constants/WellKnownTypeNames.cs deleted file mode 100644 index d79fbb56..00000000 --- a/src/ComputeSharp.D2D1.UI.SourceGenerators/Constants/WellKnownTypeNames.cs +++ /dev/null @@ -1,41 +0,0 @@ -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp.SourceGenerators.Constants; -#else -namespace ComputeSharp.D2D1.WinUI.SourceGenerators.Constants; -#endif - -/// -/// The well known names for types used by source generators and analyzers. -/// -internal static class WellKnownTypeNames -{ - /// - /// The fully qualified type name for the [GeneratedCanvasEffectProperty] type. - /// - public const string GeneratedCanvasEffectPropertyAttribute = -#if WINDOWS_UWP - "ComputeSharp.D2D1.Uwp.GeneratedCanvasEffectPropertyAttribute"; -#else - "ComputeSharp.D2D1.WinUI.GeneratedCanvasEffectPropertyAttribute"; -#endif - - /// - /// The fully qualified type name for the CanvasEffect type. - /// - public const string CanvasEffect = -#if WINDOWS_UWP - "ComputeSharp.D2D1.Uwp.CanvasEffect"; -#else - "ComputeSharp.D2D1.WinUI.CanvasEffect"; -#endif - - /// - /// The fully qualified type name for the CanvasEffect type. - /// - public const string CanvasEffectInvalidationType = -#if WINDOWS_UWP - "ComputeSharp.D2D1.Uwp.CanvasEffectInvalidationType"; -#else - "ComputeSharp.D2D1.WinUI.CanvasEffectInvalidationType"; -#endif -} diff --git a/src/ComputeSharp.D2D1.UI.SourceGenerators/Diagnostics/Analyzers/InvalidGeneratedCanvasEffectPropertyAccessorsAnalyzer.cs b/src/ComputeSharp.D2D1.UI.SourceGenerators/Diagnostics/Analyzers/InvalidGeneratedCanvasEffectPropertyAccessorsAnalyzer.cs deleted file mode 100644 index 41489bab..00000000 --- a/src/ComputeSharp.D2D1.UI.SourceGenerators/Diagnostics/Analyzers/InvalidGeneratedCanvasEffectPropertyAccessorsAnalyzer.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System.Collections.Immutable; -#if WINDOWS_UWP -using ComputeSharp.D2D1.Uwp.SourceGenerators.Constants; -#else -using ComputeSharp.D2D1.WinUI.SourceGenerators.Constants; -#endif -using ComputeSharp.SourceGeneration.Extensions; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; -#if WINDOWS_UWP -using static ComputeSharp.D2D1.Uwp.SourceGenerators.DiagnosticDescriptors; -#else -using static ComputeSharp.D2D1.WinUI.SourceGenerators.DiagnosticDescriptors; -#endif - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp.SourceGenerators; -#else -namespace ComputeSharp.D2D1.WinUI.SourceGenerators; -#endif - -/// -/// A diagnostic analyzer that generates errors when a property using [GeneratedCanvasEffectProperty] has invalid accessors. -/// -[DiagnosticAnalyzer(LanguageNames.CSharp)] -public sealed class InvalidGeneratedCanvasEffectPropertyAccessorsAnalyzer : DiagnosticAnalyzer -{ - /// - public override ImmutableArray SupportedDiagnostics { get; } = [InvalidGeneratedCanvasEffectPropertyAccessors]; - - /// - public override void Initialize(AnalysisContext context) - { - context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); - context.EnableConcurrentExecution(); - - context.RegisterCompilationStartAction(static context => - { - // Get the [GeneratedCanvasEffectProperty] symbols - if (context.Compilation.GetTypeByMetadataName(WellKnownTypeNames.GeneratedCanvasEffectPropertyAttribute) is not { } generatedCanvasEffectPropertyAttributeSymbol) - { - return; - } - - context.RegisterSymbolAction(context => - { - // Check that the property doesn't have 'get' and 'set' accessors - if (context.Symbol is IPropertySymbol { GetMethod: { }, SetMethod.IsInitOnly: false }) - { - return; - } - - // Skip implementation parts to avoid duplicate errors - if (context.Symbol is IPropertySymbol { PartialDefinitionPart: not null }) - { - return; - } - - // If the property is using [GeneratedCanvasEffectProperty], emit the diagnostic - if (context.Symbol.TryGetAttributeWithType(generatedCanvasEffectPropertyAttributeSymbol, out AttributeData? generatedCanvasEffectPropertyAttribute)) - { - context.ReportDiagnostic(Diagnostic.Create( - InvalidGeneratedCanvasEffectPropertyAccessors, - generatedCanvasEffectPropertyAttribute.GetLocation(), - context.Symbol)); - } - }, SymbolKind.Property); - }); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI.SourceGenerators/Diagnostics/Analyzers/InvalidGeneratedCanvasEffectPropertyContainingTypeAnalyzer.cs b/src/ComputeSharp.D2D1.UI.SourceGenerators/Diagnostics/Analyzers/InvalidGeneratedCanvasEffectPropertyContainingTypeAnalyzer.cs deleted file mode 100644 index bedd55d5..00000000 --- a/src/ComputeSharp.D2D1.UI.SourceGenerators/Diagnostics/Analyzers/InvalidGeneratedCanvasEffectPropertyContainingTypeAnalyzer.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System.Collections.Immutable; -#if WINDOWS_UWP -using ComputeSharp.D2D1.Uwp.SourceGenerators.Constants; -#else -using ComputeSharp.D2D1.WinUI.SourceGenerators.Constants; -#endif -using ComputeSharp.SourceGeneration.Extensions; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; -#if WINDOWS_UWP -using static ComputeSharp.D2D1.Uwp.SourceGenerators.DiagnosticDescriptors; -#else -using static ComputeSharp.D2D1.WinUI.SourceGenerators.DiagnosticDescriptors; -#endif - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp.SourceGenerators; -#else -namespace ComputeSharp.D2D1.WinUI.SourceGenerators; -#endif - -/// -/// A diagnostic analyzer that generates errors when a property using [GeneratedCanvasEffectProperty] is in an invalid type. -/// -[DiagnosticAnalyzer(LanguageNames.CSharp)] -public sealed class InvalidGeneratedCanvasEffectPropertyContainingTypeAnalyzer : DiagnosticAnalyzer -{ - /// - public override ImmutableArray SupportedDiagnostics { get; } = [InvalidGeneratedCanvasEffectPropertyContainingType]; - - /// - public override void Initialize(AnalysisContext context) - { - context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); - context.EnableConcurrentExecution(); - - context.RegisterCompilationStartAction(static context => - { - // Get the [GeneratedCanvasEffectProperty] and CanvasEffect symbols - if (context.Compilation.GetTypeByMetadataName(WellKnownTypeNames.GeneratedCanvasEffectPropertyAttribute) is not { } generatedCanvasEffectPropertyAttributeSymbol || - context.Compilation.GetTypeByMetadataName(WellKnownTypeNames.CanvasEffect) is not { } canvasEffectSymbol) - { - return; - } - - context.RegisterSymbolAction(context => - { - // Validate that we have a valid containing type (also skip implementation parts) - if (context.Symbol is not IPropertySymbol { ContainingType: { } containingTypeSymbol, PartialDefinitionPart: null }) - { - return; - } - - // If the property is not using [GeneratedCanvasEffectProperty], there's nothing to do - if (!context.Symbol.TryGetAttributeWithType(generatedCanvasEffectPropertyAttributeSymbol, out AttributeData? generatedCanvasEffectPropertyAttribute)) - { - return; - } - - // Issue a diagnostic if the type doesn't derive from CanvasEffect - if (!containingTypeSymbol.InheritsFromType(canvasEffectSymbol)) - { - context.ReportDiagnostic(Diagnostic.Create( - InvalidGeneratedCanvasEffectPropertyContainingType, - generatedCanvasEffectPropertyAttribute.GetLocation(), - context.Symbol)); - } - }, SymbolKind.Property); - }); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI.SourceGenerators/Diagnostics/Analyzers/InvalidGeneratedCanvasEffectPropertyDeclarationAnalyzer.cs b/src/ComputeSharp.D2D1.UI.SourceGenerators/Diagnostics/Analyzers/InvalidGeneratedCanvasEffectPropertyDeclarationAnalyzer.cs deleted file mode 100644 index 3875dcae..00000000 --- a/src/ComputeSharp.D2D1.UI.SourceGenerators/Diagnostics/Analyzers/InvalidGeneratedCanvasEffectPropertyDeclarationAnalyzer.cs +++ /dev/null @@ -1,115 +0,0 @@ -using System.Collections.Immutable; -#if WINDOWS_UWP -using ComputeSharp.D2D1.Uwp.SourceGenerators.Constants; -#else -using ComputeSharp.D2D1.WinUI.SourceGenerators.Constants; -#endif -using ComputeSharp.SourceGeneration.Extensions; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; -#if WINDOWS_UWP -using static ComputeSharp.D2D1.Uwp.SourceGenerators.DiagnosticDescriptors; -#else -using static ComputeSharp.D2D1.WinUI.SourceGenerators.DiagnosticDescriptors; -#endif - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp.SourceGenerators; -#else -namespace ComputeSharp.D2D1.WinUI.SourceGenerators; -#endif - -/// -/// A diagnostic analyzer that generates errors when a property using [GeneratedCanvasEffectProperty] has invalid accessors. -/// -[DiagnosticAnalyzer(LanguageNames.CSharp)] -public sealed class InvalidGeneratedCanvasEffectPropertyDeclarationAnalyzer : DiagnosticAnalyzer -{ - /// - public override ImmutableArray SupportedDiagnostics { get; } = - [ - InvalidGeneratedCanvasEffectPropertyDeclarationIsStatic, - InvalidGeneratedCanvasEffectPropertyDeclarationIsNotIncompletePartialDefinition, - InvalidGeneratedCanvasEffectPropertyDeclarationReturnsByRef, - InvalidGeneratedCanvasEffectPropertyDeclarationReturnsRefLikeType - ]; - - /// - public override void Initialize(AnalysisContext context) - { - context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); - context.EnableConcurrentExecution(); - - context.RegisterCompilationStartAction(static context => - { - // Get the [GeneratedCanvasEffectProperty] and [GeneratedCode] symbols - if (context.Compilation.GetTypeByMetadataName(WellKnownTypeNames.GeneratedCanvasEffectPropertyAttribute) is not { } generatedCanvasEffectPropertyAttributeSymbol || - context.Compilation.GetTypeByMetadataName("System.CodeDom.Compiler.GeneratedCodeAttribute") is not { } generatedCodeAttributeSymbol) - { - return; - } - - context.RegisterSymbolAction(context => - { - // Ensure that we have some target property to analyze (also skip implementation parts) - if (context.Symbol is not IPropertySymbol { PartialDefinitionPart: null } propertySymbol) - { - return; - } - - // If the property is not using [GeneratedCanvasEffectProperty], there's nothing to do - if (!context.Symbol.TryGetAttributeWithType(generatedCanvasEffectPropertyAttributeSymbol, out AttributeData? generatedCanvasEffectPropertyAttribute)) - { - return; - } - - // Emit an error if the property is static - if (propertySymbol.IsStatic) - { - context.ReportDiagnostic(Diagnostic.Create( - InvalidGeneratedCanvasEffectPropertyDeclarationIsStatic, - generatedCanvasEffectPropertyAttribute.GetLocation(), - context.Symbol)); - } - - // Emit an error if the property is not a partial definition with no implementation... - if (propertySymbol is not { IsPartialDefinition: true, PartialImplementationPart: null }) - { - // ...But only if it wasn't actually generated by the [GeneratedCanvasEffectProperty] generator. - bool isImplementationAllowed = - propertySymbol is { IsPartialDefinition: true, PartialImplementationPart: IPropertySymbol implementationPartSymbol } && - implementationPartSymbol.TryGetAttributeWithType(generatedCodeAttributeSymbol, out AttributeData? generatedCodeAttributeData) && - generatedCodeAttributeData.TryGetConstructorArgument(0, out string? toolName) && - toolName == CanvasEffectPropertyGenerator.GeneratorName; - - // Emit the diagnostic only for cases that were not valid generator outputs - if (!isImplementationAllowed) - { - context.ReportDiagnostic(Diagnostic.Create( - InvalidGeneratedCanvasEffectPropertyDeclarationIsNotIncompletePartialDefinition, - generatedCanvasEffectPropertyAttribute.GetLocation(), - context.Symbol)); - } - } - - // Emit an error if the property returns a value by ref - if (propertySymbol.ReturnsByRef || propertySymbol.ReturnsByRefReadonly) - { - context.ReportDiagnostic(Diagnostic.Create( - InvalidGeneratedCanvasEffectPropertyDeclarationReturnsByRef, - generatedCanvasEffectPropertyAttribute.GetLocation(), - context.Symbol)); - } - - // Emit an error if the property type is a ref struct - if (propertySymbol.Type.IsRefLikeType) - { - context.ReportDiagnostic(Diagnostic.Create( - InvalidGeneratedCanvasEffectPropertyDeclarationReturnsRefLikeType, - generatedCanvasEffectPropertyAttribute.GetLocation(), - context.Symbol)); - } - }, SymbolKind.Property); - }); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI.SourceGenerators/Diagnostics/Analyzers/RequireCSharpLanguageVersionPreviewAnalyzer.cs b/src/ComputeSharp.D2D1.UI.SourceGenerators/Diagnostics/Analyzers/RequireCSharpLanguageVersionPreviewAnalyzer.cs deleted file mode 100644 index dead1781..00000000 --- a/src/ComputeSharp.D2D1.UI.SourceGenerators/Diagnostics/Analyzers/RequireCSharpLanguageVersionPreviewAnalyzer.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System.Collections.Immutable; -#if WINDOWS_UWP -using ComputeSharp.D2D1.Uwp.SourceGenerators.Constants; -#else -using ComputeSharp.D2D1.WinUI.SourceGenerators.Constants; -#endif -using ComputeSharp.SourceGeneration.Extensions; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Diagnostics; -#if WINDOWS_UWP -using static ComputeSharp.D2D1.Uwp.SourceGenerators.DiagnosticDescriptors; -#else -using static ComputeSharp.D2D1.WinUI.SourceGenerators.DiagnosticDescriptors; -#endif - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp.SourceGenerators; -#else -namespace ComputeSharp.D2D1.WinUI.SourceGenerators; -#endif - -/// -/// A diagnostic analyzer that generates errors when a property using [GeneratedCanvasEffectProperty] is in a project with the C# language version not set to preview. -/// -[DiagnosticAnalyzer(LanguageNames.CSharp)] -public sealed class RequireCSharpLanguageVersionPreviewAnalyzer : DiagnosticAnalyzer -{ - /// - public override ImmutableArray SupportedDiagnostics { get; } = [CSharpLanguageVersionIsNotPreview]; - - /// - public override void Initialize(AnalysisContext context) - { - context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.Analyze | GeneratedCodeAnalysisFlags.ReportDiagnostics); - context.EnableConcurrentExecution(); - - context.RegisterCompilationStartAction(static context => - { - // If the language version is set to preview, we'll never emit diagnostics - if (context.Compilation.IsLanguageVersionPreview()) - { - return; - } - - // Get the [GeneratedCanvasEffectProperty] symbols - if (context.Compilation.GetTypeByMetadataName(WellKnownTypeNames.GeneratedCanvasEffectPropertyAttribute) is not { } generatedCanvasEffectPropertyAttributeSymbol) - { - return; - } - - context.RegisterSymbolAction(context => - { - // We only want to target partial property definitions (also include non-partial ones for diagnostics) - if (context.Symbol is not IPropertySymbol { PartialDefinitionPart: null }) - { - return; - } - - // If the property is using [GeneratedCanvasEffectProperty], emit the diagnostic - if (context.Symbol.TryGetAttributeWithType(generatedCanvasEffectPropertyAttributeSymbol, out AttributeData? generatedCanvasEffectPropertyAttribute)) - { - context.ReportDiagnostic(Diagnostic.Create( - CSharpLanguageVersionIsNotPreview, - generatedCanvasEffectPropertyAttribute.GetLocation(), - context.Symbol)); - } - }, SymbolKind.Property); - }); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI.SourceGenerators/Diagnostics/Analyzers/UseGeneratedCanvasEffectPropertyOnSemiAutoPropertyAnalyzer.cs b/src/ComputeSharp.D2D1.UI.SourceGenerators/Diagnostics/Analyzers/UseGeneratedCanvasEffectPropertyOnSemiAutoPropertyAnalyzer.cs deleted file mode 100644 index b34fdb6f..00000000 --- a/src/ComputeSharp.D2D1.UI.SourceGenerators/Diagnostics/Analyzers/UseGeneratedCanvasEffectPropertyOnSemiAutoPropertyAnalyzer.cs +++ /dev/null @@ -1,356 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Collections.Immutable; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -#if WINDOWS_UWP -using ComputeSharp.D2D1.Uwp.SourceGenerators.Constants; -#else -using ComputeSharp.D2D1.WinUI.SourceGenerators.Constants; -#endif -using ComputeSharp.SourceGeneration.Extensions; -using ComputeSharp.SourceGeneration.Helpers; -using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.CSharp; -using Microsoft.CodeAnalysis.CSharp.Syntax; -using Microsoft.CodeAnalysis.Diagnostics; -using Microsoft.CodeAnalysis.Operations; -#if WINDOWS_UWP -using static ComputeSharp.D2D1.Uwp.SourceGenerators.DiagnosticDescriptors; -#else -using static ComputeSharp.D2D1.WinUI.SourceGenerators.DiagnosticDescriptors; -#endif - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp.SourceGenerators; -#else -namespace ComputeSharp.D2D1.WinUI.SourceGenerators; -#endif - -/// -/// A diagnostic analyzer that generates a suggestion whenever [GeneratedCanvasEffectProperty] is used on a semi-auto property when a partial property could be used instead. -/// -[DiagnosticAnalyzer(LanguageNames.CSharp)] -public sealed class UseGeneratedCanvasEffectPropertyOnSemiAutoPropertyAnalyzer : DiagnosticAnalyzer -{ - /// - /// The number of pooled flags per stack (ie. how many properties we expect on average per type). - /// - private const int NumberOfPooledFlagsPerStack = 20; - - /// - /// Shared pool for instances. - /// - [SuppressMessage("MicrosoftCodeAnalysisPerformance", "RS1008", Justification = "This is a pool of (empty) dictionaries, it is not actually storing compilation data.")] - private static readonly ObjectPool> PropertyMapPool = new(static () => new Dictionary(SymbolEqualityComparer.Default)); - - /// - /// Shared pool for -s of flags, one per type being processed. - /// - private static readonly ObjectPool> PropertyFlagsStackPool = new(CreatePropertyFlagsStack); - - /// - /// The property name for the serialized invalidation type. - /// - public const string InvalidationTypePropertyName = "InvalidationType"; - - /// - public override ImmutableArray SupportedDiagnostics { get; } = [UseGeneratedCanvasEffectPropertyOnSemiAutoProperty]; - - /// - public override void Initialize(AnalysisContext context) - { - context.ConfigureGeneratedCodeAnalysis(GeneratedCodeAnalysisFlags.None); - context.EnableConcurrentExecution(); - - context.RegisterCompilationStartAction(static context => - { - // Using [GeneratedCanvasEffectProperty] on partial properties is only supported when using C# preview. - // As such, if that is not the case, return immediately, as no diagnostic should be produced. - if (!context.Compilation.IsLanguageVersionPreview()) - { - return; - } - - // Get the [GeneratedCanvasEffectProperty] and CanvasEffect symbols - if (context.Compilation.GetTypeByMetadataName(WellKnownTypeNames.GeneratedCanvasEffectPropertyAttribute) is not { } generatedCanvasEffectPropertyAttributeSymbol || - context.Compilation.GetTypeByMetadataName(WellKnownTypeNames.CanvasEffect) is not { } canvasEffectSymbol) - { - return; - } - - // Get the symbol for the SetPropertyAndInvalidateEffectGraph method as well - if (!TryGetSetPropertyMethodSymbol(canvasEffectSymbol, out IMethodSymbol? setPropertySymbol)) - { - return; - } - - context.RegisterSymbolStartAction(context => - { - // We only care about types that could derive from ObservableObject - if (context.Symbol is not INamedTypeSymbol { IsStatic: false, IsReferenceType: true, BaseType.SpecialType: not SpecialType.System_Object } typeSymbol) - { - return; - } - - // If the type does not derive from ObservableObject, ignore it - if (!typeSymbol.InheritsFromType(canvasEffectSymbol)) - { - return; - } - - Dictionary propertyMap = PropertyMapPool.Allocate(); - Stack propertyFlagsStack = PropertyFlagsStackPool.Allocate(); - - // Crawl all members to discover properties that might be of interest - foreach (ISymbol memberSymbol in typeSymbol.GetMembers()) - { - // We're only looking for properties that might be valid candidates for conversion - if (memberSymbol is not IPropertySymbol - { - IsStatic: false, - IsPartialDefinition: false, - PartialDefinitionPart: null, - PartialImplementationPart: null, - ReturnsByRef: false, - ReturnsByRefReadonly: false, - Type.IsRefLikeType: false, - GetMethod: not null, - SetMethod.IsInitOnly: false - } propertySymbol) - { - continue; - } - - // We can safely ignore properties that already have [GeneratedCanvasEffectProperty]. - // This is because in that case, the other analyzer will already emit an error. - if (propertySymbol.HasAttributeWithType(generatedCanvasEffectPropertyAttributeSymbol)) - { - continue; - } - - // Take an array from the stack or create a new one otherwise - byte[] flags = propertyFlagsStack.Count > 0 - ? propertyFlagsStack.Pop() - : new byte[2]; - - // Track the property for later - propertyMap.Add(propertySymbol, flags); - } - - // We want to process both accessors, where we specifically need both the syntax - // and their semantic model to verify what they're doing. We can use a code callback. - context.RegisterOperationBlockAction(context => - { - // Make sure the current symbol is a property accessor - if (context.OwningSymbol is not IMethodSymbol { MethodKind: MethodKind.PropertyGet or MethodKind.PropertySet, AssociatedSymbol: IPropertySymbol propertySymbol }) - { - return; - } - - // If so, check that we are actually processing one of the properties we care about - if (!propertyMap.TryGetValue(propertySymbol, out byte[]? validFlags)) - { - return; - } - - // Handle the 'get' logic - if (SymbolEqualityComparer.Default.Equals(propertySymbol.GetMethod, context.OwningSymbol)) - { - // We expect a top-level block operation, that immediately returns an expression - if (context.OperationBlocks is not [IBlockOperation { Operations: [IReturnOperation returnOperation] }]) - { - return; - } - - // Next, we expect the return to produce a field reference - if (returnOperation is not { ReturnedValue: IFieldReferenceOperation fieldReferenceOperation }) - { - return; - } - - // The field has to be implicitly declared and not constant (and not static) - if (fieldReferenceOperation.Field is not { IsImplicitlyDeclared: true, IsStatic: false } fieldSymbol) - { - return; - } - - // Validate tha the field is indeed 'field' (it will be associated with the property) - if (!SymbolEqualityComparer.Default.Equals(fieldSymbol.AssociatedSymbol, propertySymbol)) - { - return; - } - - // The 'get' accessor is valid - validFlags[0] = 1; - } - else if (SymbolEqualityComparer.Default.Equals(propertySymbol.SetMethod, context.OwningSymbol)) - { - // We expect a top-level block operation, that immediately performs an invocation - if (context.OperationBlocks is not [IBlockOperation { Operations: [IExpressionStatementOperation { Operation: IInvocationOperation invocationOperation }] }]) - { - return; - } - - // Brief filtering of the target method, also get the original definition - if (invocationOperation.TargetMethod is not { Name: "SetPropertyAndInvalidateEffectGraph", IsGenericMethod: true, IsStatic: false } methodSymbol) - { - return; - } - - // First, check that we're calling 'CanvasEffect.SetPropertyAndInvalidateEffectGraph' - if (!SymbolEqualityComparer.Default.Equals(methodSymbol.ConstructedFrom, setPropertySymbol)) - { - return; - } - - // We matched the method, now let's validate the arguments - if (invocationOperation.Arguments is not [{ } locationArgument, { } valueArgument, { } invalidationTypeArgument]) - { - return; - } - - // The field has to be implicitly declared and not constant (and not static) - if (locationArgument.Value is not IFieldReferenceOperation { Field: { IsImplicitlyDeclared: true, IsStatic: false } fieldSymbol }) - { - return; - } - - // Validate tha the field is indeed 'field' (it will be associated with the property) - if (!SymbolEqualityComparer.Default.Equals(fieldSymbol.AssociatedSymbol, propertySymbol)) - { - return; - } - - // The value is just the 'value' keyword - if (valueArgument.Value is not IParameterReferenceOperation { Syntax: IdentifierNameSyntax { Identifier.Text: "value" } }) - { - return; - } - - // The invalidation mode can either be the default value... - if (invalidationTypeArgument is { IsImplicit: true, ArgumentKind: ArgumentKind.DefaultValue }) - { - validFlags[1] = 1; - } - else if (invalidationTypeArgument is { Value.ConstantValue: { HasValue: true, Value: byte mode } } && mode is 0 or 1) - { - // ...Or is has to be set explicitly to one of the two supported values - validFlags[1] = (byte)(mode + 1); - } - } - }); - - // We also need to track getters which have no body, and we need syntax for that - context.RegisterSyntaxNodeAction(context => - { - // Let's just make sure we do have a property symbol - if (context.ContainingSymbol is not IPropertySymbol { GetMethod: not null } propertySymbol) - { - return; - } - - // Lookup the property to get its flags - if (!propertyMap.TryGetValue(propertySymbol, out byte[]? validFlags)) - { - return; - } - - // We expect two accessors, skip if otherwise (the setter will be validated by the other callback) - if (context.Node is not PropertyDeclarationSyntax { AccessorList.Accessors: [{ } firstAccessor, { } secondAccessor] }) - { - return; - } - - // Check that either of them is a semicolon token 'get;' accessor (it can be in either position) - if ((firstAccessor.IsKind(SyntaxKind.GetAccessorDeclaration) && - firstAccessor.SemicolonToken.IsKind(SyntaxKind.SemicolonToken) && - firstAccessor.ExpressionBody is null) || - (secondAccessor.IsKind(SyntaxKind.GetAccessorDeclaration) && - secondAccessor.SemicolonToken.IsKind(SyntaxKind.SemicolonToken) && - secondAccessor.ExpressionBody is null)) - { - validFlags[0] = 1; - } - }, SyntaxKind.PropertyDeclaration); - - // Finally, we can consume this information when we finish processing the symbol - context.RegisterSymbolEndAction(context => - { - // Emit a diagnostic for each property that was a valid match - foreach (KeyValuePair pair in propertyMap) - { - if (pair.Value is [1, 1 or 2]) - { - // Shift back the index to match the actual enum values, to simplify the code fixer. Here we're adding 1 to - // signal "the setter is valid", but we want to hide this implementation detail to downstream consumers. - int invalidationType = pair.Value[1] - 1; - - context.ReportDiagnostic(Diagnostic.Create( - UseGeneratedCanvasEffectPropertyOnSemiAutoProperty, - pair.Key.Locations.FirstOrDefault(), - ImmutableDictionary.Create().Add(InvalidationTypePropertyName, invalidationType.ToString()), - pair.Key)); - } - } - - // Before clearing the dictionary, move back all values to the stack - foreach (byte[] propertyFlags in propertyMap.Values) - { - // Make sure the array is cleared before returning it - propertyFlags.AsSpan().Clear(); - - propertyFlagsStack.Push(propertyFlags); - } - - // We are now done processing the symbol, we can return the dictionary. - // Note that we must clear it before doing so to avoid leaks and issues. - propertyMap.Clear(); - - PropertyMapPool.Free(propertyMap); - - // Also do the same for the stack, except we don't need to clean it (since it roots no compilation objects) - PropertyFlagsStackPool.Free(propertyFlagsStack); - }); - }, SymbolKind.NamedType); - }); - } - - /// - /// Tries to get the symbol for the target SetPropertyAndInvalidateEffectGraph method this analyzer looks for. - /// - /// The symbol for CanvasEffect. - /// The resulting method symbol, if found (this should always be the case). - /// Whether could be resolved correctly. - private static bool TryGetSetPropertyMethodSymbol(INamedTypeSymbol canvasEffectSymbol, [NotNullWhen(true)] out IMethodSymbol? setPropertySymbol) - { - foreach (ISymbol symbol in canvasEffectSymbol.GetMembers("SetPropertyAndInvalidateEffectGraph")) - { - // There's only one method with this name, so we can just return it directly - setPropertySymbol = (IMethodSymbol)symbol; - - return true; - } - - setPropertySymbol = null; - - return false; - } - - /// - /// Produces a new instance to pool. - /// - /// The resulting instance to use. - private static Stack CreatePropertyFlagsStack() - { - static IEnumerable EnumerateFlags() - { - for (int i = 0; i < NumberOfPooledFlagsPerStack; i++) - { - yield return new byte[2]; - } - } - - return new(EnumerateFlags()); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs b/src/ComputeSharp.D2D1.UI.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs deleted file mode 100644 index 8c062332..00000000 --- a/src/ComputeSharp.D2D1.UI.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs +++ /dev/null @@ -1,166 +0,0 @@ -using Microsoft.CodeAnalysis; - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp.SourceGenerators; -#else -namespace ComputeSharp.D2D1.WinUI.SourceGenerators; -#endif - -/// -/// A container for all instances for errors reported by analyzers in this project. -/// -internal static class DiagnosticDescriptors -{ - /// - /// The prefix of all diagnostics for available analyzers. - /// - private const string DiagnosticIdPrefix = -#if WINDOWS_UWP - "CMPSD2DUWP"; -#else - "CMPSD2DWINUI"; -#endif - - /// - /// The category of all diagnostics for available analyzers. - /// - private const string DiagnosticCategory = -#if WINDOWS_UWP - "ComputeSharp.D2D1.Uwp.Effects"; -#else - "ComputeSharp.D2D1.WinUI.Effects"; -#endif - - /// - /// The diagnostic id for . - /// - public const string UseGeneratedCanvasEffectPropertyOnSemiAutoPropertyId = $"{DiagnosticIdPrefix}0008"; - - /// - /// Gets a for an invalid CanvasEffect property. - /// - /// Format: "The property "{0}" is not in a type that derives from CanvasEffect ([GeneratedCanvasEffectProperty] must be used in effect types that extend CanvasEffect)". - /// - /// - public static readonly DiagnosticDescriptor InvalidGeneratedCanvasEffectPropertyContainingType = new( - id: $"{DiagnosticIdPrefix}0001", - title: "Invalid generated CanvasEffect property containing type", - messageFormat: """The property "{0}" is not in a type that derives from CanvasEffect ([GeneratedCanvasEffectProperty] must be used in effect types that extend CanvasEffect)""", - category: DiagnosticCategory, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A property using [GeneratedCanvasEffectProperty] is in a type that does not derive from CanvasEffect ([GeneratedCanvasEffectProperty] must be used in effect types that extend CanvasEffect).", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a CanvasEffect property with invalid accessors. - /// - /// Format: "The property "{0}" does not have a getter and a setter ([GeneratedCanvasEffectProperty] must be used on properties with get and set accessors)". - /// - /// - public static readonly DiagnosticDescriptor InvalidGeneratedCanvasEffectPropertyAccessors = new( - id: $"{DiagnosticIdPrefix}0002", - title: "Invalid generated CanvasEffect property accessors", - messageFormat: """The property "{0}" does not have a getter and a setter ([GeneratedCanvasEffectProperty] must be used on properties with get and set accessors)""", - category: DiagnosticCategory, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A property using [GeneratedCanvasEffectProperty] does not have a getter and a setter ([GeneratedCanvasEffectProperty] must be used on properties with get and set accessors).", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a static CanvasEffect property. - /// - /// Format: "The property "{0}" is static ([GeneratedCanvasEffectProperty] must be used on instance properties)". - /// - /// - public static readonly DiagnosticDescriptor InvalidGeneratedCanvasEffectPropertyDeclarationIsStatic = new( - id: $"{DiagnosticIdPrefix}0003", - title: "Invalid generated CanvasEffect property declaration (static member)", - messageFormat: """The property "{0}" is static ([GeneratedCanvasEffectProperty] must be used on instance properties)""", - category: DiagnosticCategory, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A property using [GeneratedCanvasEffectProperty] cannot be static ([GeneratedCanvasEffectProperty] must be used on instance properties).", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a CanvasEffect property that is not an incomplete partial property definition. - /// - /// Format: "The property "{0}" is not an incomplete partial definition ([GeneratedCanvasEffectProperty] must be used on partial property definitions with no implementation part)". - /// - /// - public static readonly DiagnosticDescriptor InvalidGeneratedCanvasEffectPropertyDeclarationIsNotIncompletePartialDefinition = new( - id: $"{DiagnosticIdPrefix}0004", - title: "Invalid generated CanvasEffect property declaration (not incomplete partial definition)", - messageFormat: """The property "{0}" is not an incomplete partial definition ([GeneratedCanvasEffectProperty] must be used on partial property definitions with no implementation part)""", - category: DiagnosticCategory, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A property using [GeneratedCanvasEffectProperty] is either not partial, or a partial implementation part ([GeneratedCanvasEffectProperty] must be used on partial property definitions with no implementation part).", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a CanvasEffect property that returns a ref value. - /// - /// Format: "The property "{0}" returns a value by reference ([GeneratedCanvasEffectProperty] must be used on properties returning a type by value)". - /// - /// - public static readonly DiagnosticDescriptor InvalidGeneratedCanvasEffectPropertyDeclarationReturnsByRef = new( - id: $"{DiagnosticIdPrefix}0005", - title: "Invalid generated CanvasEffect property declaration (returns byref)", - messageFormat: """The property "{0}" returns a value by reference ([GeneratedCanvasEffectProperty] must be used on properties returning a type by value)""", - category: DiagnosticCategory, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A property using [GeneratedCanvasEffectProperty] returns a value by reference ([GeneratedCanvasEffectProperty] must be used on properties returning a type by value).", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for a CanvasEffect property that returns a byref-like value. - /// - /// Format: "The property "{0}" returns a ref struct value ([GeneratedCanvasEffectProperty] must be used on properties with a type that is not a ref struct)". - /// - /// - public static readonly DiagnosticDescriptor InvalidGeneratedCanvasEffectPropertyDeclarationReturnsRefLikeType = new( - id: $"{DiagnosticIdPrefix}0006", - title: "Invalid generated CanvasEffect property declaration (returns ref struct type)", - messageFormat: """The property "{0}" returns a ref struct value ([GeneratedCanvasEffectProperty] must be used on properties with a type that is not a ref struct)""", - category: DiagnosticCategory, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "A property using [GeneratedCanvasEffectProperty] has a ref struct type ([GeneratedCanvasEffectProperty] must be used on properties with a type that is not a ref struct).", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for when C# is not set to 'preview'. - /// - /// Format: "Using [GeneratedCanvasEffectProperty] requires the C# language version to be set to 'preview', as support for the 'field' keyword is needed by the source generators to emit valid code (add <LangVersion>preview</LangVersion> to your .csproj/.props file)". - /// - /// - public static readonly DiagnosticDescriptor CSharpLanguageVersionIsNotPreview = new( - id: $"{DiagnosticIdPrefix}0007", - title: "C# language version is not 'preview'", - messageFormat: """Using [GeneratedCanvasEffectProperty] requires the C# language version to be set to 'preview', as support for the 'field' keyword is needed by the source generators to emit valid code (add preview to your .csproj/.props file)""", - category: DiagnosticCategory, - defaultSeverity: DiagnosticSeverity.Error, - isEnabledByDefault: true, - description: "The C# language version must be set to 'preview' when using [GeneratedComputeShaderDescriptor] for the source generators to emit valid code (the preview option must be set in the .csproj/.props file).", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); - - /// - /// Gets a for when a semi-auto property can be converted to use [GeneratedCanvasEffectProperty] instead. - /// - /// Format: "The semi-auto property "{0}" can be converted to a partial property using [GeneratedCanvasEffectProperty], which is recommended (doing so makes the code less verbose and results in more optimized code)". - /// - /// - public static readonly DiagnosticDescriptor UseGeneratedCanvasEffectPropertyOnSemiAutoProperty = new( - id: UseGeneratedCanvasEffectPropertyOnSemiAutoPropertyId, - title: "Prefer using [GeneratedCanvasEffectProperty] over semi-auto properties", - messageFormat: """The semi-auto property "{0}" can be converted to a partial property using [GeneratedCanvasEffectProperty], which is recommended (doing so makes the code less verbose and results in more optimized code)""", - category: DiagnosticCategory, - defaultSeverity: DiagnosticSeverity.Info, - isEnabledByDefault: true, - description: "Semi-auto properties should be converted to partial properties using [GeneratedCanvasEffectProperty] when possible, which is recommended (doing so makes the code less verbose and results in more optimized code).", - helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI.SourceGenerators/Models/CanvasEffectPropertyInfo.cs b/src/ComputeSharp.D2D1.UI.SourceGenerators/Models/CanvasEffectPropertyInfo.cs deleted file mode 100644 index f8eef81a..00000000 --- a/src/ComputeSharp.D2D1.UI.SourceGenerators/Models/CanvasEffectPropertyInfo.cs +++ /dev/null @@ -1,31 +0,0 @@ -using ComputeSharp.SourceGeneration.Models; -using Microsoft.CodeAnalysis; - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp.SourceGenerators.Models; -#else -namespace ComputeSharp.D2D1.WinUI.SourceGenerators.Models; -#endif - -/// -/// A model representing a generated canvas effect property. -/// -/// The hierarchy info for the shader type. -/// The generated property name. -/// The accessibility of the property, if available. -/// The accessibility of the accessor, if available. -/// The accessibility of the accessor, if available. -/// The type name for the generated property, including nullability annotations. -/// Indicates whether the property is of a reference type or an unconstrained type parameter. -/// Whether or not the generated property should be marked as required. -/// The invalidation type to request. -internal sealed record CanvasEffectPropertyInfo( - HierarchyInfo Hierarchy, - string PropertyName, - Accessibility DeclaredAccessibility, - Accessibility GetterAccessibility, - Accessibility SetterAccessibility, - string TypeNameWithNullabilityAnnotations, - bool IsReferenceTypeOrUnconstraindTypeParameter, - bool IsRequired, - CanvasEffectInvalidationType InvalidationType); diff --git a/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ICanvasDevice.cs b/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ICanvasDevice.cs deleted file mode 100644 index 65a1594a..00000000 --- a/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ICanvasDevice.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using ComputeSharp.Win32; - -#pragma warning disable CS0649, IDE1006 - -namespace ABI.Microsoft.Graphics.Canvas; - -/// -/// The native WinRT interface for objects. -/// -[NativeTypeName("class ICanvasDevice : IInspectable")] -[NativeInheritance("IInspectable")] -internal unsafe struct ICanvasDevice -{ - public void** lpVtbl; - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(0)] - public HRESULT QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject) - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[0])((ICanvasDevice*)Unsafe.AsPointer(ref this), riid, ppvObject); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(1)] - [return: NativeTypeName("ULONG")] - public uint AddRef() - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[1])((ICanvasDevice*)Unsafe.AsPointer(ref this)); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(2)] - [return: NativeTypeName("ULONG")] - public uint Release() - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[2])((ICanvasDevice*)Unsafe.AsPointer(ref this)); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ICanvasEffect.cs b/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ICanvasEffect.cs deleted file mode 100644 index 26fc2b73..00000000 --- a/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ICanvasEffect.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ComputeSharp.Win32; - -#pragma warning disable CS0649, IDE0055, IDE1006 - -namespace ABI.Microsoft.Graphics.Canvas.Effects; - -/// -/// The native WinRT interface for objects. -/// -[NativeTypeName("class ICanvasEffect : IInspectable")] -[NativeInheritance("IInspectable")] -internal unsafe struct ICanvasEffect : IComObject -{ - /// - static Guid* IComObject.IID - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - ReadOnlySpan data = - [ - 0x8C, 0x6F, 0xF9, 0x0E, - 0x5E, 0x9B, - 0xF0, 0x4B, - 0x99, - 0xA3, - 0xAA, - 0xD8, - 0xCE, - 0x53, - 0xDB, - 0x55 - ]; - - return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data)); - } - } - - public void** lpVtbl; - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(0)] - public HRESULT QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject) - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[0])((ICanvasEffect*)Unsafe.AsPointer(ref this), riid, ppvObject); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(1)] - [return: NativeTypeName("ULONG")] - public uint AddRef() - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[1])((ICanvasEffect*)Unsafe.AsPointer(ref this)); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(2)] - [return: NativeTypeName("ULONG")] - public uint Release() - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[2])((ICanvasEffect*)Unsafe.AsPointer(ref this)); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ICanvasEffectFactoryNative.cs b/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ICanvasEffectFactoryNative.cs deleted file mode 100644 index 5baf2491..00000000 --- a/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ICanvasEffectFactoryNative.cs +++ /dev/null @@ -1,178 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ComputeSharp.Win32; -using WinRT; -using WinRT.Interop; -using IInspectable = ComputeSharp.Win32.IInspectable; - -#pragma warning disable CS0649, IDE0055, IDE1006 - -namespace ABI.Microsoft.Graphics.Canvas -{ - /// - /// The interop Win2D interface for factories of external effects. - /// - [NativeTypeName("class ICanvasEffectFactoryNative : IUnknown")] - [NativeInheritance("IUnknown")] - internal unsafe struct ICanvasEffectFactoryNative : IComObject - { - /// - public static Guid* IID - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - ReadOnlySpan data = - [ - 0x1F, 0x1A, 0xBA, 0x29, - 0xFE, 0x1C, - 0xC3, 0x44, - 0x98, 0x4D, - 0x42, - 0x6D, - 0x61, - 0xB5, - 0x14, - 0x27 - ]; - - return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data)); - } - } - - public void** lpVtbl; - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(0)] - public HRESULT QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject) - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[0])((ICanvasEffectFactoryNative*)Unsafe.AsPointer(ref this), riid, ppvObject); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(1)] - [return: NativeTypeName("ULONG")] - public uint AddRef() - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[1])((ICanvasEffectFactoryNative*)Unsafe.AsPointer(ref this)); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(2)] - [return: NativeTypeName("ULONG")] - public uint Release() - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[2])((ICanvasEffectFactoryNative*)Unsafe.AsPointer(ref this)); - } - - /// - /// Creates a new inspectable wrapper for an input D2D effect previosly registered through . - /// - /// The input canvas device. - /// The input native effect to create a wrapper for. - /// The realization DPIs for . - /// The resulting wrapper for . - /// The for the operation. - /// - /// All parameters are directly forwarded from the ones the caller passed to . The returned - /// wrapper should implement to be returned correctly from Win2D after this call. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(3)] - public HRESULT CreateWrapper(ICanvasDevice* device, ID2D1Effect* resource, float dpi, IInspectable** wrapper) - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[3])( - (ICanvasEffectFactoryNative*)Unsafe.AsPointer(ref this), - device, - resource, - dpi, - wrapper); - } - } - - /// - /// The ABI methods for . - /// - internal static unsafe class ICanvasEffectFactoryNativeMethods - { - /// - public static Guid IID => *ICanvasEffectFactoryNative.IID; - - /// - public static IntPtr AbiToProjectionVftablePtr => global::Microsoft.Graphics.Canvas.ICanvasEffectFactoryNative.Vftbl.AbiToProjectionVftablePtr; - } -} - -namespace Microsoft.Graphics.Canvas -{ - using ABI.Microsoft.Graphics.Canvas; - - /// - /// The managed implementation of . - /// - [Guid("29BA1A1F-1CFE-44C3-984D-426D61B51427")] - [WindowsRuntimeType] - [WindowsRuntimeHelperType(typeof(ICanvasEffectFactoryNative))] - internal unsafe interface ICanvasEffectFactoryNative - { - /// - [return: NativeTypeName("HRESULT")] - int CreateWrapper(ICanvasDevice* device, ID2D1Effect* resource, float dpi, IInspectable** wrapper); - - /// - /// The vtable type for . - /// - public struct Vftbl - { - /// - /// Allows CsWinRT to retrieve a pointer to the projection vtable (the name is hardcoded by convention). - /// - public static readonly IntPtr AbiToProjectionVftablePtr = InitVtbl(); - - /// - /// Builds the custom method table pointer for . - /// - /// The method table pointer for . - private static IntPtr InitVtbl() - { - Vftbl* lpVtbl = (Vftbl*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), sizeof(Vftbl)); - - lpVtbl->IUnknownVftbl = IUnknownVftbl.AbiToProjectionVftbl; - lpVtbl->CreateWrapper = &CreateWrapperFromAbi; - - return (IntPtr)lpVtbl; - } - - /// - /// The IUnknown vtable. - /// - private IUnknownVftbl IUnknownVftbl; - - /// - /// Function pointer for . - /// - private delegate* unmanaged[MemberFunction] CreateWrapper; - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - [return: NativeTypeName("HRESULT")] - private static int CreateWrapperFromAbi(IntPtr thisPtr, ICanvasDevice* device, ID2D1Effect* resource, float dpi, IInspectable** wrapper) - { - try - { - return ComWrappersSupport.FindObject(thisPtr).CreateWrapper(device, resource, dpi, wrapper); - } - catch (Exception e) - { - ExceptionHelpers.SetErrorInfo(e); - - return ExceptionHelpers.GetHRForException(e); - } - } - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ICanvasFactoryNative.cs b/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ICanvasFactoryNative.cs deleted file mode 100644 index 853052f2..00000000 --- a/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ICanvasFactoryNative.cs +++ /dev/null @@ -1,168 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ComputeSharp.Win32; - -#pragma warning disable CS0649, IDE0055, IDE1006 - -namespace ABI.Microsoft.Graphics.Canvas; - -/// -/// The activation factory for . -/// -[NativeTypeName("class ICanvasFactoryNative : public IInspectable")] -[NativeInheritance("IInspectable")] -internal unsafe struct ICanvasFactoryNative : IComObject -{ - /// - public static Guid* IID - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - ReadOnlySpan data = - [ - 0x0D, 0x44, 0x5C, 0x69, - 0xB3, 0x04, - 0xDD, 0x4E, - 0xBF, 0xD9, - 0x63, - 0xE5, - 0x1E, - 0x9F, - 0x72, - 0x02 - ]; - - return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data)); - } - } - - public void** lpVtbl; - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(0)] - public HRESULT QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject) - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[0])((ICanvasFactoryNative*)Unsafe.AsPointer(ref this), riid, ppvObject); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(1)] - [return: NativeTypeName("ULONG")] - public uint AddRef() - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[1])((ICanvasFactoryNative*)Unsafe.AsPointer(ref this)); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(2)] - [return: NativeTypeName("ULONG")] - public uint Release() - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[2])((ICanvasFactoryNative*)Unsafe.AsPointer(ref this)); - } - - /// - /// Gets or creates an IInspectable Win2D wrapper for a given native D2D resource. - /// - /// The input canvas device (as a marshalled ). - /// The input native resource to create a wrapper for. - /// The realization DPIs for . - /// The resulting wrapper for . - /// The for the operation. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(6)] - public HRESULT GetOrCreate(ICanvasDevice* device, IUnknown* resource, float dpi, IInspectable** wrapper) - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[6])( - (ICanvasFactoryNative*)Unsafe.AsPointer(ref this), - device, - resource, - dpi, - wrapper); - } - - /// - /// Registers an IInspectable wrapper for a given native D2D resource. - /// - /// The input native resource to register a wrapper for. - /// The wrapper to register for . - /// - /// The for the operation. In case of success, it will be if the wrapper - /// was not previously registered, or if was already registered. - /// - /// - /// The method validates at runtime that is an - /// and that is an . Additionally, - /// has to implement IWeakReferenceSource for this method to be successful. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(7)] - public HRESULT RegisterWrapper(IUnknown* resource, IInspectable* wrapper) - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[7])( - (ICanvasFactoryNative*)Unsafe.AsPointer(ref this), - resource, - wrapper); - } - - /// - /// Unregisters a native D2D resource previously registered with . - /// - /// The input native resource to unregister. - /// - /// The for the operation. In case of success, it will be if the - /// resource was previously registered and could be correctly unregistered, otherwise. - /// - /// - /// The method validates at runtime that is an . - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(8)] - public HRESULT UnregisterWrapper(IUnknown* resource) - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[8])( - (ICanvasFactoryNative*)Unsafe.AsPointer(ref this), - resource); - } - - /// - /// Registers a factory of wrappers for custom effects. - /// - /// The id of the effects to register a factory for. - /// The input factory to create wrappers of native effects. - /// - /// The for the operation. In case of success, it will be if the factory - /// was not previously registered, or if was already registered. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(9)] - public HRESULT RegisterEffectFactory([NativeTypeName("const IID &")] Guid* effectId, ICanvasEffectFactoryNative* factory) - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[9])( - (ICanvasFactoryNative*)Unsafe.AsPointer(ref this), - effectId, - factory); - } - - /// - /// Unregisters an effect factory that was previosuly registered with . - /// - /// The id of the effects to unregister the factory for. - /// - /// The for the operation. In case of success, it will be if the - /// factory was previously registered and could be correctly unregistered, otherwise. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(10)] - public HRESULT UnregisterEffectFactory([NativeTypeName("const IID &")] Guid* effectId) - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[10])( - (ICanvasFactoryNative*)Unsafe.AsPointer(ref this), - effectId); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ICanvasImageInterop.cs b/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ICanvasImageInterop.cs deleted file mode 100644 index 7b0b720f..00000000 --- a/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ICanvasImageInterop.cs +++ /dev/null @@ -1,233 +0,0 @@ -using System; -using System.ComponentModel; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ComputeSharp.Win32; -using WinRT; -using WinRT.Interop; - -#pragma warning disable CS0649, IDE0055, IDE1006 - -namespace ABI.Microsoft.Graphics.Canvas -{ - /// - /// An interop Win2D interface for all images and effects that can be drawn. - /// - [NativeTypeName("class ICanvasImageInterop : IUnknown")] - [NativeInheritance("IUnknown")] - internal unsafe struct ICanvasImageInterop : IComObject - { - /// - public static Guid* IID - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - ReadOnlySpan data = - [ - 0xF7, 0xD1, 0x42, 0xE0, - 0xAD, 0xF9, - 0x79, 0x44, - 0xA7, 0x13, - 0x67, - 0x62, - 0x7E, - 0xA3, - 0x18, - 0x63 - ]; - - return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data)); - } - } - - public void** lpVtbl; - - /// - /// Gets the device that the effect is currently realized on, if any. - /// - /// The resulting device, if available (as a marshalled ). - /// The value describing the returned instance. - /// The for the operation. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(3)] - public HRESULT GetDevice(ICanvasDevice** device, WIN2D_GET_DEVICE_ASSOCIATION_TYPE* type) - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[3])((ICanvasImageInterop*)Unsafe.AsPointer(ref this), device, type); - } - - /// - /// Gets an from an instance. - /// - /// The input canvas device (as a marshalled ). - /// - /// The device context in use. This value is is optional (but recommended), except when the - /// flag is specified. This is because - /// not all callers of have easy access to a context. It is always - /// possible to get a resource creation context from the device, but the context is only - /// actually necessary if a new effect realization needs to be created, so it is more efficient - /// to have the implementation do this lookup only if/when it turns out to be needed. - /// - /// The flags to use to get the image. - /// - /// The DPI of the target device context. This is used to determine when a D2D1DpiCompensation - /// effect needs to be inserted. Behavior of this parameter can be overridden by the flag values - /// , - /// - /// or - /// - /// - /// The DPI of a source bitmap, or zero if the image does not have a fixed DPI. A D2D1DpiCompensation effect - /// will be inserted if and are different (flags permitting). - /// - /// The resulting for the effect. - /// The for the operation. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(4)] - public HRESULT GetD2DImage( - ICanvasDevice* device, - ID2D1DeviceContext* deviceContext, - WIN2D_GET_D2D_IMAGE_FLAGS flags, - float targetDpi, - float* realizeDpi, - ID2D1Image** ppImage) - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[4])( - (ICanvasImageInterop*)Unsafe.AsPointer(ref this), - device, - deviceContext, - flags, - targetDpi, - realizeDpi, - ppImage); - } - } - - /// - /// The ABI methods for . - /// - /// - /// This type has public accessibility to allow the AOT generator in CsWinRT to reference - /// the and properties to make - /// marshalling of CCW types AOT-safe. It is not meant to be used directly by developers. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public static unsafe class ICanvasImageInteropMethods - { - /// - public static Guid IID => *ICanvasImageInterop.IID; - - /// - public static IntPtr AbiToProjectionVftablePtr => global::Microsoft.Graphics.Canvas.ICanvasImageInterop.Vftbl.AbiToProjectionVftablePtr; - } -} - -namespace Microsoft.Graphics.Canvas -{ - using ABI.Microsoft.Graphics.Canvas; - - /// - /// The managed implementation of . - /// - [Guid("E042D1F7-F9AD-4479-A713-67627EA31863")] - [WindowsRuntimeType] - [WindowsRuntimeHelperType(typeof(ICanvasImageInterop))] - internal unsafe interface ICanvasImageInterop - { - /// - [return: NativeTypeName("HRESULT")] - int GetDevice(ICanvasDevice** device, WIN2D_GET_DEVICE_ASSOCIATION_TYPE* type); - - /// - [return: NativeTypeName("HRESULT")] - int GetD2DImage( - ICanvasDevice* device, - ID2D1DeviceContext* deviceContext, - WIN2D_GET_D2D_IMAGE_FLAGS flags, - float targetDpi, - float* realizeDpi, - ID2D1Image** ppImage); - - /// - /// The vtable type for . - /// - public struct Vftbl - { - /// - /// Allows CsWinRT to retrieve a pointer to the projection vtable (the name is hardcoded by convention). - /// - public static readonly IntPtr AbiToProjectionVftablePtr = InitVtbl(); - - /// - /// Builds the custom method table pointer for . - /// - /// The method table pointer for . - private static IntPtr InitVtbl() - { - Vftbl* lpVtbl = (Vftbl*)ComWrappersSupport.AllocateVtableMemory(typeof(Vftbl), sizeof(Vftbl)); - - lpVtbl->IUnknownVftbl = IUnknownVftbl.AbiToProjectionVftbl; - lpVtbl->GetDevice = &GetDeviceFromAbi; - lpVtbl->GetD2DImage = &GetD2DImageFromAbi; - - return (IntPtr)lpVtbl; - } - - /// - /// The IUnknown vtable. - /// - private IUnknownVftbl IUnknownVftbl; - - /// - /// Function pointer for . - /// - private delegate* unmanaged[MemberFunction] GetDevice; - - /// - /// Function pointer for . - /// - private delegate* unmanaged[MemberFunction] GetD2DImage; - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - [return: NativeTypeName("HRESULT")] - private static int GetDeviceFromAbi(IntPtr thisPtr, ICanvasDevice** device, WIN2D_GET_DEVICE_ASSOCIATION_TYPE* type) - { - try - { - return ComWrappersSupport.FindObject(thisPtr).GetDevice(device, type); - } - catch (Exception e) - { - ExceptionHelpers.SetErrorInfo(e); - - return ExceptionHelpers.GetHRForException(e); - } - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - [return: NativeTypeName("HRESULT")] - private static int GetD2DImageFromAbi( - IntPtr thisPtr, - ICanvasDevice* device, - ID2D1DeviceContext* deviceContext, - WIN2D_GET_D2D_IMAGE_FLAGS flags, - float targetDpi, - float* realizeDpi, - ID2D1Image** ppImage) - { - try - { - return ComWrappersSupport.FindObject(thisPtr).GetD2DImage(device, deviceContext, flags, targetDpi, realizeDpi, ppImage); - } - catch (Exception e) - { - ExceptionHelpers.SetErrorInfo(e); - - return ExceptionHelpers.GetHRForException(e); - } - } - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ICanvasResourceCreator.cs b/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ICanvasResourceCreator.cs deleted file mode 100644 index 6f429296..00000000 --- a/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ICanvasResourceCreator.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ComputeSharp.Win32; - -#pragma warning disable CS0649, IDE0055, IDE1006 - -namespace ABI.Microsoft.Graphics.Canvas; - -/// -/// The native WinRT interface for objects. -/// -[NativeTypeName("class ICanvasResourceCreator : IInspectable")] -[NativeInheritance("IInspectable")] -internal unsafe struct ICanvasResourceCreator : IComObject -{ - /// - static Guid* IComObject.IID - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - ReadOnlySpan data = - [ - 0xA8, 0x8A, 0x6D, 0x8F, - 0x2F, 0x49, - 0xC6, 0x4B, - 0xB3, - 0xD0, - 0xE7, - 0xF5, - 0xEA, - 0xE8, - 0x4B, - 0x11 - ]; - - return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data)); - } - } - - public void** lpVtbl; - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(0)] - public HRESULT QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject) - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[0])((ICanvasResourceCreator*)Unsafe.AsPointer(ref this), riid, ppvObject); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(1)] - [return: NativeTypeName("ULONG")] - public uint AddRef() - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[1])((ICanvasResourceCreator*)Unsafe.AsPointer(ref this)); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(2)] - [return: NativeTypeName("ULONG")] - public uint Release() - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[2])((ICanvasResourceCreator*)Unsafe.AsPointer(ref this)); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ICanvasResourceCreatorWithDpi.cs b/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ICanvasResourceCreatorWithDpi.cs deleted file mode 100644 index f212305e..00000000 --- a/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ICanvasResourceCreatorWithDpi.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ComputeSharp.Win32; - -#pragma warning disable CS0649, IDE0055, IDE1006 - -namespace ABI.Microsoft.Graphics.Canvas; - -/// -/// The native WinRT interface for objects. -/// -[NativeTypeName("class ICanvasResourceCreatorWithDpi : IInspectable")] -[NativeInheritance("IInspectable")] -internal unsafe struct ICanvasResourceCreatorWithDpi : IComObject -{ - /// - static Guid* IComObject.IID - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - ReadOnlySpan data = - [ - 0x12, 0xB5, 0x75, 0x1A, - 0xFA, 0xE9, - 0xE6, 0x49, - 0xA8, - 0x76, - 0x38, - 0xCA, - 0xE1, - 0x94, - 0x01, - 0x3E - ]; - - return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data)); - } - } - - public void** lpVtbl; - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(0)] - public HRESULT QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject) - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[0])((ICanvasResourceCreatorWithDpi*)Unsafe.AsPointer(ref this), riid, ppvObject); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(1)] - [return: NativeTypeName("ULONG")] - public uint AddRef() - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[1])((ICanvasResourceCreatorWithDpi*)Unsafe.AsPointer(ref this)); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(2)] - [return: NativeTypeName("ULONG")] - public uint Release() - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[2])((ICanvasResourceCreatorWithDpi*)Unsafe.AsPointer(ref this)); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ICanvasResourceWrapperNative.cs b/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ICanvasResourceWrapperNative.cs deleted file mode 100644 index 4ca2e8a0..00000000 --- a/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ICanvasResourceWrapperNative.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ComputeSharp.Win32; - -#pragma warning disable CS0649, IDE0055, IDE1006 - -namespace ABI.Microsoft.Graphics.Canvas; - -/// -/// An interop wrapper type for Win2D objects (see ). -/// -[NativeTypeName("class ICanvasResourceWrapperNative : IUnknown")] -[NativeInheritance("IUnknown")] -internal unsafe struct ICanvasResourceWrapperNative : IComObject -{ - /// - static Guid* IComObject.IID - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - ReadOnlySpan data = - [ - 0x8D, 0x68, 0x10, 0x5F, - 0x55, 0xEA, - 0x55, 0x4D, - 0xA3, - 0xB0, - 0x4D, - 0xDB, - 0x55, - 0xC0, - 0xC2, - 0x0A - ]; - - return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data)); - } - } - - public void** lpVtbl; - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(0)] - public HRESULT QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject) - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[0])((ICanvasResourceWrapperNative*)Unsafe.AsPointer(ref this), riid, ppvObject); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(1)] - [return: NativeTypeName("ULONG")] - public uint AddRef() - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[1])((ICanvasResourceWrapperNative*)Unsafe.AsPointer(ref this)); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(2)] - [return: NativeTypeName("ULONG")] - public uint Release() - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[2])((ICanvasResourceWrapperNative*)Unsafe.AsPointer(ref this)); - } - - /// - /// Interface provided by various Win2D objects that is able to retrieve the wrapped resource. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(3)] - public HRESULT GetNativeResource(ICanvasDevice* device, float dpi, [NativeTypeName("REFIID")] Guid* iid, void** resource) - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[3])((ICanvasResourceWrapperNative*)Unsafe.AsPointer(ref this), device, dpi, iid, resource); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ID2D1DeviceContextLease.cs b/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ID2D1DeviceContextLease.cs deleted file mode 100644 index f1dceaa9..00000000 --- a/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ID2D1DeviceContextLease.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using ComputeSharp.Win32; - -#pragma warning disable CS0649, IDE1006 - -namespace ABI.Microsoft.Graphics.Canvas; - -/// -/// An interface for a COM object that provides access to a pooled object. -/// -[NativeTypeName("class ID2D1DeviceContextLease : IUnknown")] -[NativeInheritance("IUnknown")] -internal unsafe struct ID2D1DeviceContextLease -{ - public void** lpVtbl; - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(0)] - public HRESULT QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject) - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[0])((ID2D1DeviceContextLease*)Unsafe.AsPointer(ref this), riid, ppvObject); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(1)] - [return: NativeTypeName("ULONG")] - public uint AddRef() - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[1])((ID2D1DeviceContextLease*)Unsafe.AsPointer(ref this)); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(2)] - [return: NativeTypeName("ULONG")] - public uint Release() - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[2])((ID2D1DeviceContextLease*)Unsafe.AsPointer(ref this)); - } - - /// - /// Provides access to the object wrapped by the current instance. - /// - /// The resulting object wrapped by the current instance. - /// The for the operation. - /// The returned cannot be used once the owning lease has been released. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(3)] - public HRESULT GetD2DDeviceContext(ID2D1DeviceContext** deviceContext) - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[3])((ID2D1DeviceContextLease*)Unsafe.AsPointer(ref this), deviceContext); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ID2D1DeviceContextPool.cs b/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ID2D1DeviceContextPool.cs deleted file mode 100644 index c66d28d4..00000000 --- a/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/ID2D1DeviceContextPool.cs +++ /dev/null @@ -1,81 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ComputeSharp.Win32; - -#pragma warning disable CS0649, IDE0055, IDE1006 - -namespace ABI.Microsoft.Graphics.Canvas; - -/// -/// An interface for an object that provides access to pooled objects. -/// -[NativeTypeName("class ID2D1DeviceContextPool : IUnknown")] -[NativeInheritance("IUnknown")] -internal unsafe struct ID2D1DeviceContextPool : IComObject -{ - /// - static Guid* IComObject.IID - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - ReadOnlySpan data = - [ - 0xA1, 0x82, 0x4A, 0x45, - 0x24, 0xF0, - 0xDB, 0x40, - 0xBD, - 0x5B, - 0x8F, - 0x52, - 0x7F, - 0xD5, - 0x8A, - 0xD0 - ]; - - return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data)); - } - } - - public void** lpVtbl; - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(0)] - public HRESULT QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject) - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[0])((ID2D1DeviceContextPool*)Unsafe.AsPointer(ref this), riid, ppvObject); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(1)] - [return: NativeTypeName("ULONG")] - public uint AddRef() - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[1])((ID2D1DeviceContextPool*)Unsafe.AsPointer(ref this)); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(2)] - [return: NativeTypeName("ULONG")] - public uint Release() - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[2])((ID2D1DeviceContextPool*)Unsafe.AsPointer(ref this)); - } - - /// - /// Retrieves a new object from the current instance. - /// - /// The resulting object to use. - /// The for the operation. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(3)] - public HRESULT GetDeviceContextLease(ID2D1DeviceContextLease** lease) - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[3])((ID2D1DeviceContextPool*)Unsafe.AsPointer(ref this), lease); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/Inspectable/IInspectable.cs b/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/Inspectable/IInspectable.cs deleted file mode 100644 index 072ef89f..00000000 --- a/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/Inspectable/IInspectable.cs +++ /dev/null @@ -1,47 +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 winrt/inspectable.h in the Windows SDK for Windows 10.0.22621.0 -// Original source is Copyright © Microsoft. All rights reserved. - -using System; -using System.Runtime.CompilerServices; - -#pragma warning disable CS0649, IDE1006 - -namespace ComputeSharp.Win32; - -/// -/// The native WinRT interface for IInspectable objects. -/// -[NativeTypeName("struct IInspectable : IUnknown")] -[NativeInheritance("IUnknown")] -internal unsafe struct IInspectable -{ - public void** lpVtbl; - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(0)] - public HRESULT QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject) - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[0])((IInspectable*)Unsafe.AsPointer(ref this), riid, ppvObject); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(1)] - [return: NativeTypeName("ULONG")] - public uint AddRef() - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[1])((IInspectable*)Unsafe.AsPointer(ref this)); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(2)] - [return: NativeTypeName("ULONG")] - public uint Release() - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[2])((IInspectable*)Unsafe.AsPointer(ref this)); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/WIN2D_GET_D2D_IMAGE_FLAGS.cs b/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/WIN2D_GET_D2D_IMAGE_FLAGS.cs deleted file mode 100644 index 0180f17b..00000000 --- a/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/WIN2D_GET_D2D_IMAGE_FLAGS.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System; - -namespace ABI.Microsoft.Graphics.Canvas; - -/// -/// Options for fine-tuning the behavior of . -/// -[Flags] -internal enum WIN2D_GET_D2D_IMAGE_FLAGS : uint -{ - /// - /// No options specified. - /// - WIN2D_GET_D2D_IMAGE_FLAGS_NONE = 0, - - /// - /// Ignore the targetDpi parameter, read DPI from deviceContext instead. - /// - WIN2D_GET_D2D_IMAGE_FLAGS_READ_DPI_FROM_DEVICE_CONTEXT = 1, - - /// - /// Ignore the targetDpi parameter, always insert DPI compensation. - /// - WIN2D_GET_D2D_IMAGE_FLAGS_ALWAYS_INSERT_DPI_COMPENSATION = 2, - - /// - /// Ignore the targetDpi parameter, never insert DPI compensation. - /// - WIN2D_GET_D2D_IMAGE_FLAGS_NEVER_INSERT_DPI_COMPENSATION = 4, - - /// - /// Do the bare minimum to get back an ID2D1Image, no validation or recursive realization. - /// - WIN2D_GET_D2D_IMAGE_FLAGS_MINIMAL_REALIZATION = 8, - - /// - /// Allow partially configured effect graphs where some inputs are . - /// - WIN2D_GET_D2D_IMAGE_FLAGS_ALLOW_NULL_EFFECT_INPUTS = 16, - - /// - /// If an input is invalid, unrealize the effect and set the output image to . - /// - WIN2D_GET_D2D_IMAGE_FLAGS_UNREALIZE_ON_FAILURE = 32, - - /// - /// Ignored. - /// - WIN2D_GET_D2D_IMAGE_FLAGS_FORCE_DWORD = 0xFFFFFFFF -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/WIN2D_GET_DEVICE_ASSOCIATION_TYPE.cs b/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/WIN2D_GET_DEVICE_ASSOCIATION_TYPE.cs deleted file mode 100644 index 32452df2..00000000 --- a/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/WIN2D_GET_DEVICE_ASSOCIATION_TYPE.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; - -namespace ABI.Microsoft.Graphics.Canvas; - -/// -/// Options for fine-tuning the behavior of . -/// -[Flags] -internal enum WIN2D_GET_DEVICE_ASSOCIATION_TYPE : uint -{ - /// - /// No device info is available, callers will handle the returned device with their own logic. - /// - WIN2D_GET_DEVICE_ASSOCIATION_TYPE_UNSPECIFIED = 0, - - /// - /// The returned device is the one the image is currently realized on, if any. - /// - WIN2D_GET_DEVICE_ASSOCIATION_TYPE_REALIZATION_DEVICE = 1, - - /// - /// The returned device is the one that created the image resource, and cannot change. - /// - WIN2D_GET_DEVICE_ASSOCIATION_TYPE_CREATION_DEVICE = 2, - - /// - /// Ignored. - /// - WIN2D_GET_DEVICE_ASSOCIATION_TYPE_FORCE_DWORD = 0xFFFFFFFF -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/Win2D.cs b/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/Win2D.cs deleted file mode 100644 index 9b2ba99e..00000000 --- a/src/ComputeSharp.D2D1.UI/ABI.Microsoft.Graphics.Canvas/Win2D.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System.Numerics; -using System.Runtime.InteropServices; -using ABI.Microsoft.Graphics.Canvas.Effects; -using ComputeSharp.Win32; -using Windows.Foundation; - -namespace ABI.Microsoft.Graphics.Canvas; - -/// -/// Native APIs from Microsoft.Graphics.Canvas (ie. Win2D). -/// -internal static unsafe class Win2D -{ - /// - /// Calculates the bounds for a given instance. - /// - /// The object in use. - /// The input instance to compute the bounds for. - /// The transform to use (optional). - /// The resulting bounds. - /// The for the operation. - [DllImport("Microsoft.Graphics.Canvas.dll", PreserveSig = true, ExactSpelling = true)] - [return: NativeTypeName("HRESULT")] - public static extern int GetBoundsForICanvasImageInterop( - ICanvasResourceCreator* resourceCreator, - ICanvasImageInterop* image, - [NativeTypeName("Windows::Foundation::Numerics::Matrix3x2 const*")] Matrix3x2* transform, - Rect* rect); - - /// - /// Implements support for for an external instance. - /// - /// The input instance to use to perform the operation. - /// The target instance to execute the operation upon. - /// The input index to invalidate. - /// The rectangle to invalidate. - /// The for the operation. - [DllImport("Microsoft.Graphics.Canvas.dll", PreserveSig = true, ExactSpelling = true)] - [return: NativeTypeName("HRESULT")] - public static extern int InvalidateSourceRectangleForICanvasImageInterop( - ICanvasResourceCreatorWithDpi* resourceCreator, - ICanvasImageInterop* image, - uint sourceIndex, - [NativeTypeName("Windows::Foundation::Rect const*")] Rect* invalidRectangle); - - /// - /// Implements support for for an external instance. - /// - /// The input instance to use to perform the operation. - /// The target instance to execute the operation upon. - /// The resulting length of the COM array returned via . - /// The COM array with the sequence of invalid rectangles for the effect. - /// The for the operation. - [DllImport("Microsoft.Graphics.Canvas.dll", PreserveSig = true, ExactSpelling = true)] - [return: NativeTypeName("HRESULT")] - public static extern int GetInvalidRectanglesForICanvasImageInterop( - ICanvasResourceCreatorWithDpi* resourceCreator, - ICanvasImageInterop* image, - uint* valueCount, - Rect** valueElements); - - /// - /// Implements support for and - /// for an external instance. - /// - /// The input instance to use to perform the operation. - /// The target instance to execute the operation upon. - /// The portion of the output image whose inputs are being inspected. - /// The length of the sequence of input effects. - /// The sequence of input effects whose rectangles are being queries. - /// The length of the sequence of indices for the input effects. - /// The sequence of indices for the input effects. - /// The length of the sequence of bounds to consider. - /// The sequence of bounds to consider in the resulting output. - /// The number of elements provided in . - /// The sequence of resulting required rectangles to compute. - /// The for the operation. - [DllImport("Microsoft.Graphics.Canvas.dll", PreserveSig = true, ExactSpelling = true)] - [return: NativeTypeName("HRESULT")] - public static extern int GetRequiredSourceRectanglesForICanvasImageInterop( - ICanvasResourceCreatorWithDpi* resourceCreator, - ICanvasImageInterop* image, - [NativeTypeName("Windows::Foundation::Rect const*")] Rect* outputRectangle, - uint sourceEffectCount, - [NativeTypeName("ABI::Microsoft::Graphics::Canvas::Effects::ICanvasEffect* const*")] ICanvasEffect** sourceEffects, - uint sourceIndexCount, - [NativeTypeName("uint32_t const*")] uint* sourceIndices, - uint sourceBoundsCount, - [NativeTypeName("Windows::Foundation::Rect const*")] Rect* sourceBounds, - uint valueCount, - Rect* valueElements); -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/Attributes/GeneratedCanvasEffectPropertyAttribute.cs b/src/ComputeSharp.D2D1.UI/Attributes/GeneratedCanvasEffectPropertyAttribute.cs deleted file mode 100644 index 3fee1203..00000000 --- a/src/ComputeSharp.D2D1.UI/Attributes/GeneratedCanvasEffectPropertyAttribute.cs +++ /dev/null @@ -1,69 +0,0 @@ -using System; - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp; -#else -namespace ComputeSharp.D2D1.WinUI; -#endif - -/// -/// An attribute that indicates that a given property represents an effect property, which should invalidate the effect. -/// In order to use this attribute, the containing type has to inherit from . -/// -/// This attribute can be used as follows: -/// -/// partial class MyEffect : CanvasEffect -/// { -/// [GeneratedCanvasEffectProperty] -/// public int BlurAmount { get; set; } -/// } -/// -/// -/// And with this, code analogous to this will be generated: -/// -/// partial class MyEffect -/// { -/// public partial int BlurAmount -/// { -/// get => field; -/// set -/// { -/// if (EqualityComparer<int>.Default.Equals(field, value)) -/// { -/// return; -/// } -/// -/// int oldValue = field; -/// -/// OnBlurAmountChanging(value); -/// OnBlurAmountChanging(oldValue, value); -/// -/// field = value; -/// -/// OnBlurAmountChanged(value); -/// OnBlurAmountChanged(oldValue, value); -/// -/// InvalidateEffectGraph(<INVALIDATION_TYPE>); -/// } -/// } -/// -/// partial void OnBlurAmountChanging(int newValue); -/// partial void OnBlurAmountChanging(int oldValue, int newValue); -/// partial void OnBlurAmountChanged(int newValue); -/// partial void OnBlurAmountChanged(int oldValue, int newValue); -/// } -/// -/// -/// The invalidation type to request. -/// -/// The generated OnChanging and OnChanged methods will be completely removed by -/// the compiler if an implementation for the is not provided, making them fully pay-for-play. -/// -[AttributeUsage(AttributeTargets.Property, AllowMultiple = false)] -public sealed class GeneratedCanvasEffectPropertyAttribute(CanvasEffectInvalidationType invalidationType = CanvasEffectInvalidationType.Update) : Attribute -{ - /// - /// Gets the requested invalidation type for the effect graph when changing the proprty value. - /// - public CanvasEffectInvalidationType InvalidationType { get; } = invalidationType; -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/Buffers/GraphicsEffectSourceBuffer.cs b/src/ComputeSharp.D2D1.UI/Buffers/GraphicsEffectSourceBuffer.cs deleted file mode 100644 index ca524439..00000000 --- a/src/ComputeSharp.D2D1.UI/Buffers/GraphicsEffectSourceBuffer.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Runtime.CompilerServices; -using Windows.Graphics.Effects; - -#pragma warning disable IDE0051 - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp.Buffers; -#else -namespace ComputeSharp.D2D1.WinUI.Buffers; -#endif - -/// -/// A fixed buffer type containing 16 fields. -/// -[InlineArray(16)] -internal struct GraphicsEffectSourceBuffer -{ - /// - /// The instance at index 0. - /// - private SourceReference source0; -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/Buffers/ResourceTextureManagerBuffer.cs b/src/ComputeSharp.D2D1.UI/Buffers/ResourceTextureManagerBuffer.cs deleted file mode 100644 index 25b259e1..00000000 --- a/src/ComputeSharp.D2D1.UI/Buffers/ResourceTextureManagerBuffer.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Runtime.CompilerServices; -using ComputeSharp.D2D1.Interop; - -#pragma warning disable IDE0044, IDE0051 - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp.Buffers; -#else -namespace ComputeSharp.D2D1.WinUI.Buffers; -#endif - -/// -/// A fixed buffer type containing 16 fields. -/// -[InlineArray(16)] -internal struct ResourceTextureManagerBuffer -{ - /// - /// The instance at index 0. - /// - private D2D1ResourceTextureManager? resourceTextureManager0; -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/Buffers/SourceReference.cs b/src/ComputeSharp.D2D1.UI/Buffers/SourceReference.cs deleted file mode 100644 index 861cd136..00000000 --- a/src/ComputeSharp.D2D1.UI/Buffers/SourceReference.cs +++ /dev/null @@ -1,194 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using ABI.Microsoft.Graphics.Canvas; -#if WINDOWS_UWP -using ComputeSharp.D2D1.Uwp.Extensions; -using ComputeSharp.D2D1.Uwp.Helpers; -#else -using ComputeSharp.D2D1.WinUI.Extensions; -using ComputeSharp.D2D1.WinUI.Helpers; -#endif -using ComputeSharp.Win32; -using Windows.Graphics.Effects; - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp.Buffers; -#else -namespace ComputeSharp.D2D1.WinUI.Buffers; -#endif - -/// -/// A wrapper type for an input and its underlying native D2D images. -/// -/// -/// -/// This type is meant to support these two common operations: -/// -/// Look up a D2D resource from a property of some other D2D interface. -/// Get a managed wrapper from a D2D interface. -/// -/// With this, the generated D2D objects can be associated with each original managed wrapper. Similarly, -/// when the other way around is used, this type can also store the generated wrapper for future use. -/// -/// -/// This gives the following improvements: -/// -/// Improved performance for the common case of repeated calls using the same D2D instance. -/// Maintaining a reference to the wrapper avoids it being repeatedly released and recreated. -/// -/// -/// -/// Just like with all other members of an effect, values in this object are considered authoritative when the -/// effect is not realized, otherwise they just act as a cache to speedup the reverse managed wrapper lookups. -/// -/// -/// For realized effects, tracks both the resource and its -/// wrapper (and optional being the DPI compensation effect, -/// if one is needed. For unrealized effects, the resource is and only the wrapper part is used. -/// -/// -internal unsafe struct SourceReference : IDisposable -{ - /// - /// The produced by calling - /// on the input managed wrapper used as source for the effect (ie. ). - /// - private ComPtr d2D1ImageSource; - - /// - /// The for DPI compensation wrapping , if needed. - /// - private ComPtr d2D1EffectDpiCompensation; - - /// - /// The instance being a managed wrapper for the current effect input. - /// - private IGraphicsEffectSource? graphicsEffectSourceWrapper; - - /// - /// Gets whether or not this source ference has a DPI compensation effect. - /// - public readonly bool HasDpiCompensationEffect - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => this.d2D1EffectDpiCompensation.Get() is not null; - } - - /// - /// Gets the object for the DPI compensation effect used, if any. - /// - /// The object for the DPI compensation effect used, if any. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly ID2D1Effect* GetDpiCompensationEffect() - { - return this.d2D1EffectDpiCompensation.Get(); - } - - /// - /// Sets the DPI compensation effet being used, - /// - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SetDpiCompensationEffect(ID2D1Effect* d2D1Effect) - { - this.d2D1EffectDpiCompensation.Dispose(); - - if (d2D1Effect is not null) - { - this.d2D1EffectDpiCompensation = new ComPtr(d2D1Effect); - } - } - - /// - /// Gets the instance being a managed wrapper for the current effect input. - /// - /// The instance being a managed wrapper for the current effect input. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly IGraphicsEffectSource? GetWrapper() - { - return this.graphicsEffectSourceWrapper; - } - - /// - /// Sets the instance being a managed wrapper for the current effect input. - /// - /// The instance being a managed wrapper for the current effect input. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SetWrapper(IGraphicsEffectSource? wrapper) - { - this.d2D1ImageSource.Dispose(); - - this.graphicsEffectSourceWrapper = wrapper; - } - - /// - /// Sets the wrapper and underlying realized resource for the current source reference. - /// - /// The instance being a managed wrapper for the current effect input. - /// The underlying relized instance for . - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void SetWrapperAndResource(IGraphicsEffectSource? wrapper, ID2D1Image* d2D1Image) - { - this.d2D1ImageSource.Dispose(); - - this.d2D1ImageSource = new ComPtr(d2D1Image); - this.graphicsEffectSourceWrapper = wrapper; - } - - /// - /// Gets or creates an wrapper for a given object. - /// - /// The input object the source effect is realized on. - /// The input object to get or create a wrapper for. - /// An wrapper for a given object. - public IGraphicsEffectSource? GetOrCreateWrapper(ICanvasDevice* canvasDevice, ID2D1Image* d2D1Image) - { - // Check if there already is a matching managed wrapper for the input image - if (!this.d2D1ImageSource.Get()->IsSameInstance(d2D1Image)) - { - // If that's not the case, create a new wrapper if the input image is not null - if (d2D1Image is not null) - { - this.graphicsEffectSourceWrapper = ResourceManager.GetOrCreate( - device: canvasDevice, - resource: (IUnknown*)d2D1Image, - dpi: 0); - } - else - { - this.graphicsEffectSourceWrapper = null; - } - - this.d2D1ImageSource = new ComPtr(d2D1Image); - } - - return this.graphicsEffectSourceWrapper; - } - - /// - /// Updates the underlying resource, if needed. - /// This is used after a potential re-realization of a lazily bound effect. - /// - /// The input object. - /// Whether the resource has changed or not. - public bool UpdateResource(ID2D1Image* d2D1Image) - { - if (d2D1Image->IsSameInstance(this.d2D1ImageSource.Get())) - { - return false; - } - - this.d2D1ImageSource.Dispose(); - this.d2D1ImageSource = new ComPtr(d2D1Image); - - return true; - } - - /// - public void Dispose() - { - this.d2D1ImageSource.Dispose(); - this.d2D1EffectDpiCompensation.Dispose(); - this.graphicsEffectSourceWrapper = null; - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/CanvasEffect.Interop.cs b/src/ComputeSharp.D2D1.UI/CanvasEffect.Interop.cs deleted file mode 100644 index be3ead29..00000000 --- a/src/ComputeSharp.D2D1.UI/CanvasEffect.Interop.cs +++ /dev/null @@ -1,123 +0,0 @@ -using System; -using System.Diagnostics.CodeAnalysis; -using System.Numerics; -using ABI.Microsoft.Graphics.Canvas; -using ComputeSharp.D2D1.Extensions; -#if WINDOWS_UWP -using ComputeSharp.D2D1.Uwp.Helpers; -#else -using ComputeSharp.D2D1.WinUI.Helpers; -#endif -using ComputeSharp.Win32; -using Microsoft.Graphics.Canvas; -using Windows.Foundation; -using ICanvasImageInterop = Microsoft.Graphics.Canvas.ICanvasImageInterop; -using ICanvasResourceCreator = Microsoft.Graphics.Canvas.ICanvasResourceCreator; - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp; -#else -namespace ComputeSharp.D2D1.WinUI; -#endif - -/// -partial class CanvasEffect -{ - /// - public Rect GetBounds(ICanvasResourceCreator resourceCreator) - { - return GetCanvasImage().GetBounds(resourceCreator); - } - - /// - public Rect GetBounds(ICanvasResourceCreator resourceCreator, Matrix3x2 transform) - { - return GetCanvasImage().GetBounds(resourceCreator, transform); - } - - /// - unsafe int ICanvasImageInterop.GetDevice(ICanvasDevice** device, WIN2D_GET_DEVICE_ASSOCIATION_TYPE* type) - { - using ComPtr canvasImageInterop = default; - - RcwMarshaller.GetNativeInterface(GetCanvasImage(), canvasImageInterop.GetAddressOf()).Assert(); - - return canvasImageInterop.Get()->GetDevice(device, type); - } - - /// - unsafe int ICanvasImageInterop.GetD2DImage( - ICanvasDevice* device, - ID2D1DeviceContext* deviceContext, - WIN2D_GET_D2D_IMAGE_FLAGS flags, - float targetDpi, - float* realizeDpi, - ID2D1Image** ppImage) - { - using ComPtr canvasImageInterop = default; - - RcwMarshaller.GetNativeInterface(GetCanvasImage(), canvasImageInterop.GetAddressOf()).Assert(); - - return canvasImageInterop.Get()->GetD2DImage(device, deviceContext, flags, targetDpi, realizeDpi, ppImage); - } - - /// - /// Gets or creates the current instance. - /// - /// The current instance. - /// Thrown if the current instance is disposed. - [MemberNotNull(nameof(CanvasImage))] - private ICanvasImage GetCanvasImage() - { - lock (this.TransformNodes) - { - default(ObjectDisposedException).ThrowIf(this.isDisposed, this); - - // Build the effect graph (the output node might not have been set yet) - if (this.InvalidationType == CanvasEffectInvalidationType.Creation) - { - DisposeEffectGraph(); - BuildEffectGraph(new CanvasEffectGraph(this)); - - // We successfully got past the effect graph creation, so update the current - // invalidation state. This ensures that even if the configuration failed, the - // next time the effect is drawn again the graph won't be created again too. - this.InvalidationType = CanvasEffectInvalidationType.Update; - } - - // Configure the effect graph, if the effect is invalidated - if (this.InvalidationType == CanvasEffectInvalidationType.Update) - { - ConfigureEffectGraph(new CanvasEffectGraph(this)); - - // The effect graph is now ready to go: no further work will be done before drawing - // unless it is explicitly invalidated again, using either creation or update mode. - this.InvalidationType = default; - } - - // At this point, there must be an output canvas image being set. - // If not, it means a derived type has forgot to set an output node. - default(InvalidOperationException).ThrowIf(this.CanvasImage is null, "No output node is set in the effect graph."); - - return this.CanvasImage; - } - } - - /// - /// Disposes and clears the current effect graph, if any. - /// - private void DisposeEffectGraph() - { - // Dispose all registered canvas images - foreach (ICanvasImage canvasImage in this.TransformNodes.Values) - { - canvasImage.Dispose(); - } - - // Also clear the current effect graph. Note that the canvas image used as output - // node for the effect graph does not need to be explicitly disposed here, as that - // object is guaranteed to have been part of the dictionary of transform nodes. - this.TransformNodes.Clear(); - this.CanvasImage = null; - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/CanvasEffect.cs b/src/ComputeSharp.D2D1.UI/CanvasEffect.cs deleted file mode 100644 index 3d70e7ff..00000000 --- a/src/ComputeSharp.D2D1.UI/CanvasEffect.cs +++ /dev/null @@ -1,222 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Diagnostics.CodeAnalysis; -using Microsoft.Graphics.Canvas; - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp; -#else -namespace ComputeSharp.D2D1.WinUI; -#endif - -/// -/// A base type to implement packaged and easy to use -based effects that can be used with Win2D. -/// -public abstract partial class CanvasEffect : ICanvasImage, ICanvasImageInterop -{ - /// - /// The mapping of registered transform nodes for the current effect graph. - /// - /// - /// - /// When not empty (ie. when an effect graph has been built), this will always also include . - /// - /// - /// This field and the two below are due to lack of modifier in C#. - /// The type is the only one that needs access to these fields to configure the effect. - /// - /// - internal readonly Dictionary TransformNodes = []; - - /// - /// The current cached result for , if available. - /// - internal ICanvasImage? CanvasImage; - - /// - /// Indicates the current invalidation state for the effect graph (which controls the logic in ). - /// - internal CanvasEffectInvalidationType InvalidationType = CanvasEffectInvalidationType.Creation; - - /// - /// Indicates whether the effect is disposed. - /// - private bool isDisposed; - - /// - /// Builds the effect graph for the current instance, and configures all effect nodes, as well as the output - /// node for the graph. That instance will then be passed to Win2D to perform the actual drawing, when needed. - /// - /// The input value to use to build the effect graph. - /// - /// - /// This method is called once before the current effect is drawn, and the resulting image is automatically cached and reused. - /// It will remain in use until is called with . - /// - /// - /// If the effect is invalidated with , only will be - /// called. As such, derived types should save any effect graph nodes that might need updates into instance fields, for later use. - /// - /// - /// For instance, consider a FrostedGlassEffect type deriving from , with this effect graph: - /// - /// ┌────────┐ ┌──────┐ ┌──────┐ ┌───────┐ ┌────────┐ - /// │ source ├──►│ blur ├──►│ tint ├──►│ noise ├──►│ output │ - /// └────────┘ └──────┘ └──────┘ └───────┘ └────────┘ - /// - /// - /// - /// In this example, blur is a instance, tint - /// is a . and noise is some other custom effect. In this case, - /// the instance returned by will be noise, as that's the output - /// node for the effect graph. At the same time, both blur and tint will also need to be saved as instance fields, - /// so that will be able to set properties on them when needed. For instance, the effect might - /// expose a property to control the blur amount, as well as the tint color and opacity. - /// - /// - /// Generally speaking, an implementation of will consist of these steps: - /// - /// Create an instance of all necessary nodes in the effect graph. - /// Connect the effect nodes as needed to build the connected graph. - /// Register all effects as effect nodes in the graph, including the output node. - /// - /// - /// - /// For convenience, it is recommended to store all necessary objects in - /// fields, so they can easily be accessed from and . - /// - /// - /// This method should never be called directly. It is automatically invoked when an effect graph is needed. - /// - /// - protected abstract void BuildEffectGraph(CanvasEffectGraph effectGraph); - - /// - /// Configures the current effect graph whenever it is invalidated. - /// - /// The input value to use to configure the effect graph. - /// - /// - /// This method is guaranteed to be called after has been invoked already. As such, any instance - /// fields that are set by can be assumed to never be when this method runs. - /// - /// - /// This method should never be called directly. It is used internally to configure the current effect graph. - /// - /// - protected abstract void ConfigureEffectGraph(CanvasEffectGraph effectGraph); - - /// - /// Invalidates the last returned result from . - /// - /// The invalidation type to request. - /// - /// - /// This method is used to signal when the effect graph should be updated, and it can indicate - /// that either the entire graph should be created again (by calling ), - /// or whether it simply needs to refresh its internal state (by calling ). - /// - /// - /// If is called with , the effect - /// graph will only be refreshed the next time the image is actually requested. That is, repeated requests - /// for updates do not result in unnecessarily calls to . - /// - /// - protected void InvalidateEffectGraph(CanvasEffectInvalidationType invalidationType = CanvasEffectInvalidationType.Update) - { - lock (this.TransformNodes) - { - // This method only updates the invalidation type. The next time the effect is drawn, - // the current graph (if existing) will be disposed automatically before building a - // new one. If the invalidation mode just needs an update, no disposal will happen. - // The new invalidation type is always set to the maximum between the current one and - // the requested one. This means that eg. if the current invalidation type is creation, - // and a property only needing an update is set, the creation request will persist. - this.InvalidationType = (CanvasEffectInvalidationType)Math.Max((byte)this.InvalidationType, (byte)invalidationType); - } - } - - /// - /// Updates the backing storage for an effect property and checks if it has changed. - /// If so, it invalidates the effect graph as well with the requested invalidation type. - /// - /// The type of the property that changed. - /// The storage for the effect property value. - /// The new effect property value to set. - /// The invalidation type to request. - protected void SetPropertyAndInvalidateEffectGraph([NotNullIfNotNull(nameof(value))] ref T storage, T value, CanvasEffectInvalidationType invalidationType = CanvasEffectInvalidationType.Update) - { - if (EqualityComparer.Default.Equals(storage, value)) - { - return; - } - - storage = value; - - InvalidateEffectGraph(invalidationType); - } - - /// - [Obsolete("Use 'SetPropertyAndInvalidateEffectGraph' instead.")] - [EditorBrowsable(EditorBrowsableState.Never)] - protected void SetAndInvalidateEffectGraph([NotNullIfNotNull(nameof(value))] ref T storage, T value, CanvasEffectInvalidationType invalidationType = CanvasEffectInvalidationType.Update) - { - SetPropertyAndInvalidateEffectGraph(ref storage, value, invalidationType); - } - - /// - /// Disposes any disposable resources in the current instance. - /// - /// - /// Indicates whether the method was called from of from a finalizer: - /// - /// : the method was called from . - /// : the method was called from a finalizer. - /// - /// - /// - /// - /// If implementing a type that derives from , this method can be overridden to add logic to dispose - /// any additional state. Managed objects should only be disposed when is . - /// - /// - /// If the derived type does not need a finalizer (ie. if it doesn't wrap any native resources), this method should not be - /// called directly. It will be called automatically by . If the derived type does instead define a - /// finalizer, it should call with a value of . As mentioned above, when - /// implementing in a derived type, managed objects should only be disposed when - /// is , otherwise only unmanaged resorces should be disposed. - /// - /// - /// Though the pattern does support this, it is recommended not to add finalizers in types deriving from . - /// Rather, if an effect needs to wrap native resources, it should do so via some same managed wrapper type (such as - /// ), or some other custom unmanaged resource wrapper type. - /// - /// - /// - protected virtual void Dispose(bool disposing) - { - if (disposing) - { - // Only take a lock and dispose the image if the method was called explicitly from user code. If instead it was - // called from the finalizer, we can make no guarantees on the order of objects being collected, meaning that - // the lock itself might have already been collected by the time this code runs, which would lead the lock - // statement to throw a NullReferenceException. So if a finalizer is running, just let objects be collected - // on their own. This is fine here since there are no unmanaged references to free, but just managed wrappers. - lock (this.TransformNodes) - { - DisposeEffectGraph(); - } - } - - this.isDisposed = true; - } - - /// - public void Dispose() - { - Dispose(disposing: true); - - GC.SuppressFinalize(this); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/CanvasEffectGraph.cs b/src/ComputeSharp.D2D1.UI/CanvasEffectGraph.cs deleted file mode 100644 index 4b5aa5e5..00000000 --- a/src/ComputeSharp.D2D1.UI/CanvasEffectGraph.cs +++ /dev/null @@ -1,218 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using Microsoft.Graphics.Canvas; - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp; -#else -namespace ComputeSharp.D2D1.WinUI; -#endif - -/// -/// An object representing an effect graph being built or configured. -/// -public readonly ref struct CanvasEffectGraph -{ - /// - /// The owning instance. - /// - private readonly CanvasEffect owner; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The owning instance. - internal CanvasEffectGraph(CanvasEffect owner) - { - this.owner = owner; - } - - /// - /// Gets a previously registered object associated with a given effect graph node. - /// - /// The instance to use to lookup the object to retrieve. - /// The object associated with in the effect graph. - /// Thrown if is . - /// Thrown if is not currently registered in the effect graph. - /// Thrown if the current instance is not valid. - public ICanvasImage GetNode(ICanvasEffectNode effectNode) - { - default(ArgumentNullException).ThrowIfNull(effectNode); - default(InvalidOperationException).ThrowIf(this.owner is null); - - // Try to get the canvas image associated with the input effect node marker. - // This must have been previously registered in a call to BuildEffectGraph. - if (!this.owner.TransformNodes.TryGetValue(effectNode, out ICanvasImage? canvasImage)) - { - default(ArgumentException).Throw(nameof(effectNode), "The specified node is not registered in the effect graph."); - } - - return canvasImage; - } - - /// - /// Gets a previously registered object (an instance) associated with a given effect graph node. - /// - /// The type of object to retrieve. - /// The instance to use to lookup the object to retrieve. - /// The object associated with in the effect graph. - /// Thrown if is . - /// Thrown if is not currently registered in the effect graph. - /// Thrown if the current instance is not valid. - public T GetNode(ICanvasEffectNode effectNode) - where T : class, ICanvasImage - { - default(ArgumentNullException).ThrowIfNull(effectNode); - default(InvalidOperationException).ThrowIf(this.owner is null); - - // Retrieve the registered canvas image, same as above - if (!this.owner.TransformNodes.TryGetValue(effectNode, out ICanvasImage? canvasImage)) - { - default(ArgumentException).Throw(nameof(effectNode), "The specified node is not registered in the effect graph."); - } - - // Return the T node (we can skip the expensive cast since this is guaranteed to be valid). - // This is because EffectNode being registered can only associate T instances with them. - return Unsafe.As(canvasImage); - } - - /// - /// Registers an object in the effect graph. - /// - /// The object to register in the effect graph. - /// Thrown if is . - /// - /// Thrown if the current instance is not valid or if the effect graph does not support modifications at this time. - /// - /// - /// - /// - /// This method can be used when doesn't need to be retrieved from , ie. - /// when it has no properties that the current effect instance will need to mutate over it. Using this method still allows the effect to - /// correctly track the image ownership, so that it can be disposed when the current effect instance is disposed. - /// - /// - /// If performing lookups on is required, use the overload. - /// - /// - public void RegisterNode(ICanvasImage canvasImage) - { - default(ArgumentNullException).ThrowIfNull(canvasImage); - default(InvalidOperationException).ThrowIf(this.owner is null); - default(InvalidOperationException).ThrowIf(this.owner.InvalidationType != CanvasEffectInvalidationType.Creation, "The effect graph cannot be modified after its creation."); - - // Use a new dummy object as key to register the anonymous effect node. This is cheaper than having to maintain a different - // data structure (eg. a HashSet instance) just to hold the anonymous effects that may be registered. This way, - // the same dictionary can be reused for all kinds of effect nodes instead. Anonymous effects are generally a nicher scenario. - _ = this.owner.TransformNodes.TryAdd(new object(), canvasImage); - } - - /// - /// Registers an object in the effect graph, associated with a given instance. - /// - /// The type of object to register. - /// The instance to use to register . - /// The object to register in the effect graph. - /// Thrown if or are . - /// - /// Thrown if the current instance is not valid or if the effect graph does not support modifications at this time. - /// - /// Thrown if is already registered in the effect graph. - /// - /// This method can only be called from an value being passed to . If this - /// method is called from within , it will fail, as the effect graph cannot be mutated from there. - /// - public void RegisterNode(CanvasEffectNode effectNode, T canvasImage) - where T : class, ICanvasImage - { - default(ArgumentNullException).ThrowIfNull(effectNode); - default(ArgumentNullException).ThrowIfNull(canvasImage); - default(InvalidOperationException).ThrowIf(this.owner is null); - default(InvalidOperationException).ThrowIf(this.owner.InvalidationType != CanvasEffectInvalidationType.Creation, "The effect graph cannot be modified after its creation."); - - // Try to add the new canvas image associated with the input effect node marker. - // This must not have been previously added from another RegisterNode call. - if (!this.owner.TransformNodes.TryAdd(effectNode, canvasImage)) - { - default(ArgumentException).Throw(nameof(effectNode), "The specified node is already registered in the effect graph."); - } - } - - /// - /// Registers an object in the effect graph, and marks it as the output node for the effect graph being built. - /// - /// - /// - /// - /// This method can be used when doesn't need to be retrieved from , ie. - /// when it has no properties that the current effect instance will need to mutate over it. Using this method still allows the effect to - /// correctly track the image ownership, so that it can be disposed when the current effect instance is disposed. - /// - /// - /// If performing lookups on is required, use the overload. - /// - /// - /// - public void RegisterOutputNode(ICanvasImage canvasImage) - { - default(ArgumentNullException).ThrowIfNull(canvasImage); - default(InvalidOperationException).ThrowIf(this.owner is null); - default(InvalidOperationException).ThrowIf(this.owner.InvalidationType != CanvasEffectInvalidationType.Creation, "The effect graph cannot be modified after its creation."); - - // Register the anonymous effect node with a dummy object, same as above - _ = this.owner.TransformNodes.TryAdd(new object(), canvasImage); - - // Store the anonymous output node for later use - this.owner.CanvasImage = canvasImage; - } - - /// - /// Registers an object in the effect graph, associated with a given instance. - /// Additionally, it also marks the input object as the output node for the effect graph being built. - /// - /// - public void RegisterOutputNode(CanvasEffectNode effectNode, T canvasImage) - where T : class, ICanvasImage - { - default(ArgumentNullException).ThrowIfNull(effectNode); - default(ArgumentNullException).ThrowIfNull(canvasImage); - default(InvalidOperationException).ThrowIf(this.owner is null); - default(InvalidOperationException).ThrowIf(this.owner.InvalidationType != CanvasEffectInvalidationType.Creation, "The effect graph cannot be modified after its creation."); - - // Try to add the output node as in the method above (but with an extra check before doing so) - if (!this.owner.TransformNodes.TryAdd(effectNode, canvasImage)) - { - default(ArgumentException).Throw(nameof(effectNode), "The specified node is already registered in the effect graph."); - } - - // Store the output node for later use - this.owner.CanvasImage = canvasImage; - } - - /// - /// Sets a previously registered instance as the output node for the effect graph. - /// - /// The instance to set as output node for the effect graph. - /// Thrown if is . - /// Thrown if the current instance is not valid. - /// Thrown if is not registered in the effect graph. - /// - /// This method can be called from both and . - /// It can be used for efficiently changing the output node of a graph, without having to rebuild it. For instance, this can be used for - /// effects that have multiple paths that can be taken for their inputs, depending on the value of some property describing the effect behavior. - /// - public void SetOutputNode(ICanvasEffectNode effectNode) - { - default(ArgumentNullException).ThrowIfNull(effectNode); - default(InvalidOperationException).ThrowIf(this.owner is null); - - // Get the canvas image for the registered effect node (which has to exist at this point) - if (!this.owner.TransformNodes.TryGetValue(effectNode, out ICanvasImage? canvasImage)) - { - default(ArgumentException).Throw(nameof(effectNode), "The specified output node is not registered in the effect graph."); - } - - // Store the new output node - this.owner.CanvasImage = canvasImage; - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/CanvasEffectInvalidationType.cs b/src/ComputeSharp.D2D1.UI/CanvasEffectInvalidationType.cs deleted file mode 100644 index 31905e32..00000000 --- a/src/ComputeSharp.D2D1.UI/CanvasEffectInvalidationType.cs +++ /dev/null @@ -1,40 +0,0 @@ -#if !D2D1_UI_SOURCE_GENERATOR -using ABI.Microsoft.Graphics.Canvas; -using Microsoft.Graphics.Canvas; -#endif - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp; -#else -namespace ComputeSharp.D2D1.WinUI; -#endif - -/// -/// Indicates the invalidation type to request when invoking and related methods. -/// -public enum CanvasEffectInvalidationType : byte -{ - /// - /// Invalidates the state of the effect graph, causing it to be configured again the next time it is used. - /// - /// - /// - /// This will preserve the last returned instance, if available, and it will only - /// mark the internal state as being out of date, resulting in to be called - /// the next time the effect is used for drawing. - /// - /// - /// This is much less expensive than creating the effect graph again, and should be preferred if possible. - /// - /// - Update, - - /// - /// Fully invalidates the effect graph, causing it to be created again the next time it is needed. - /// - /// - /// This will cause the last returned instance to be disposed and discarded, - /// and to be called again the next time the effect is used for drawing. - /// - Creation -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/CanvasEffectNode{T}.cs b/src/ComputeSharp.D2D1.UI/CanvasEffectNode{T}.cs deleted file mode 100644 index 5cec62d4..00000000 --- a/src/ComputeSharp.D2D1.UI/CanvasEffectNode{T}.cs +++ /dev/null @@ -1,14 +0,0 @@ -using Microsoft.Graphics.Canvas; - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp; -#else -namespace ComputeSharp.D2D1.WinUI; -#endif - -/// -/// A marker type for an effect node that can be registered and retrieved from an value. -/// -/// The type of associated with the current effect node. -public sealed class CanvasEffectNode : ICanvasEffectNode - where T : class, ICanvasImage; \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/Collections/FixedCountList{T}.cs b/src/ComputeSharp.D2D1.UI/Collections/FixedCountList{T}.cs deleted file mode 100644 index 8f93a9b0..00000000 --- a/src/ComputeSharp.D2D1.UI/Collections/FixedCountList{T}.cs +++ /dev/null @@ -1,93 +0,0 @@ -using System; -using System.Collections.Generic; - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp.Collections; -#else -namespace ComputeSharp.D2D1.WinUI.Collections; -#endif - -/// -/// Shared helpers for all types implementing . -/// -/// The type of elements in the list. -internal static class FixedCountList -{ - /// - /// Copies the entire instance to a target array range. - /// - /// The input instance. - /// The array to copy elements to. - /// The initial index within . - public static void CopyTo(IFixedCountList list, T[] array, int index) - { - default(ArgumentNullException).ThrowIfNull(array); - - Span span = array.AsSpan(index); - - default(ArgumentException).ThrowIf(list.Indices.Length > span.Length, nameof(array)); - - foreach (int i in list.Indices) - { - span[i] = list[i]; - } - } - - /// - /// Copies the entire instance to a target array range. - /// - /// The input instance. - /// The array to copy elements to. - /// The initial index within . - public static void CopyTo(IFixedCountList list, Array array, int index) - { - default(ArgumentNullException).ThrowIfNull(array); - default(ArgumentOutOfRangeException).ThrowIfNotInRange(index, 0, array.Length); - - int remainingLength = array.Length - index; - - default(ArgumentException).ThrowIf(list.Indices.Length > remainingLength, nameof(array)); - - foreach (int i in list.Indices) - { - array.SetValue(list[i], i); - } - } - - /// - /// Creates an for an input instance. - /// - /// The input instance. - /// An instance for . - public static IEnumerator GetEnumerator(IFixedCountList list) - { - foreach (int i in list.Indices) - { - yield return list[i]; - } - } - - /// - /// Searches for the specified object and returns the zero-based index of the first occurrence - /// within the range of elements in a given instance. - /// - /// The input instance. - /// - /// The object to locate in . The value can be for reference types. - /// - /// - /// The zero-based index of the first occurrence of item within , otherwise -1. - /// - public static int IndexOf(IFixedCountList list, T value) - { - foreach (int i in list.Indices) - { - if (EqualityComparer.Default.Equals(list[i], value)) - { - return i; - } - } - - return -1; - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/Collections/IFixedCountList{T}.cs b/src/ComputeSharp.D2D1.UI/Collections/IFixedCountList{T}.cs deleted file mode 100644 index d7e3843f..00000000 --- a/src/ComputeSharp.D2D1.UI/Collections/IFixedCountList{T}.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Collections.Generic; -using System.Collections.Immutable; - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp.Collections; -#else -namespace ComputeSharp.D2D1.WinUI.Collections; -#endif - -/// -/// An interface for a list with a fixed collection. -/// -/// The type of elements in the list. -internal interface IFixedCountList -{ - /// - /// Gets the collection of valid indices for the current effect. - /// - ImmutableArray Indices { get; } - - /// - T this[int index] { get; set; } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/ComputeSharp.D2D1.UI.projitems b/src/ComputeSharp.D2D1.UI/ComputeSharp.D2D1.UI.projitems deleted file mode 100644 index 16b740b2..00000000 --- a/src/ComputeSharp.D2D1.UI/ComputeSharp.D2D1.UI.projitems +++ /dev/null @@ -1,59 +0,0 @@ - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - true - a2a2171b-0baf-4a2a-bfb3-3357ef714bf0 - - - ComputeSharp.D2D1.UI - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/ComputeSharp.D2D1.UI.shproj b/src/ComputeSharp.D2D1.UI/ComputeSharp.D2D1.UI.shproj deleted file mode 100644 index 5a8441a2..00000000 --- a/src/ComputeSharp.D2D1.UI/ComputeSharp.D2D1.UI.shproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - a2a2171b-0baf-4a2a-bfb3-3357ef714bf0 - 14.0 - - - - - - - - diff --git a/src/ComputeSharp.D2D1.UI/Extensions/ICanvasDeviceExtensions.cs b/src/ComputeSharp.D2D1.UI/Extensions/ICanvasDeviceExtensions.cs deleted file mode 100644 index f06cb243..00000000 --- a/src/ComputeSharp.D2D1.UI/Extensions/ICanvasDeviceExtensions.cs +++ /dev/null @@ -1,81 +0,0 @@ -using ABI.Microsoft.Graphics.Canvas; -using ComputeSharp.D2D1.Extensions; -using ComputeSharp.Win32; - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp.Extensions; -#else -namespace ComputeSharp.D2D1.WinUI.Extensions; -#endif - -/// -/// A with extensions for the type. -/// -internal static unsafe class ICanvasDeviceExtensions -{ - /// - /// Gets the underlying object from an object. - /// - /// The input object. - /// The underlying object for . - /// The for the operation. - public static HRESULT GetD2DDevice(this ref ICanvasDevice canvasDevice, ID2D1Device1** d2D1Device1) - { - using ComPtr canvasDeviceResourceWrapperNative = default; - - // Get the ICanvasResourceWrapperNative wrapper around the input device - canvasDevice.QueryInterface( - riid: Win32.Windows.__uuidof(), - ppvObject: (void**)canvasDeviceResourceWrapperNative.GetAddressOf()).Assert(); - - // Get the underlying ID2D1Device1 instance in use - HRESULT hresult = canvasDeviceResourceWrapperNative.Get()->GetNativeResource( - device: null, - dpi: 0, - iid: Win32.Windows.__uuidof(), - resource: (void**)d2D1Device1); - - return hresult; - } - - /// - /// Retrieves a usable from an input if one is not available. - /// If a new one had to be rented from the pool, it also returns the owning instance. - /// - /// The input object. - /// The current object, if available. - /// The resulting instance to use. - /// The resulting object, if used. - /// - /// When this method returns, is guaranteed to not be . - /// - public static void GetEffectiveD2DDeviceContextWithOptionalLease( - this ref ICanvasDevice canvasDevice, - ID2D1DeviceContext* d2D1DeviceContext, - ID2D1DeviceContext** d2D1DeviceContextEffective, - ID2D1DeviceContextLease** d2D1DeviceContextLease) - { - // If there is no input device context, just create a new one from the input canvas device - if (d2D1DeviceContext is null) - { - using (ComPtr d2D1DeviceContextPool = default) - { - // Get the ID2D1DeviceContextPool interface reference - canvasDevice.QueryInterface( - riid: Win32.Windows.__uuidof(), - ppvObject: (void**)d2D1DeviceContextPool.GetAddressOf()).Assert(); - - // Get a new ID2D1DeviceContextLease object from the retrieved pool - d2D1DeviceContextPool.Get()->GetDeviceContextLease(d2D1DeviceContextLease).Assert(); - } - - // Get the underlying device context from the lease (this is much faster than creating a new device context) - (*d2D1DeviceContextLease)->GetD2DDeviceContext(d2D1DeviceContextEffective).Assert(); - } - else - { - // Otherwise, just use the input device context - *d2D1DeviceContextEffective = new ComPtr(d2D1DeviceContext).Get(); - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/Extensions/ID2D1DeviceContextExtensions.cs b/src/ComputeSharp.D2D1.UI/Extensions/ID2D1DeviceContextExtensions.cs deleted file mode 100644 index c9fd0792..00000000 --- a/src/ComputeSharp.D2D1.UI/Extensions/ID2D1DeviceContextExtensions.cs +++ /dev/null @@ -1,83 +0,0 @@ -using ComputeSharp.D2D1.Extensions; -using ComputeSharp.Win32; - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp.Extensions; -#else -namespace ComputeSharp.D2D1.WinUI.Extensions; -#endif - -/// -/// A with extensions for the type. -/// -internal static unsafe class ID2D1DeviceContextExtensions -{ - /// - /// Checks whether a given has an as render target. - /// - /// The input instance to check. - /// Whether the target of is an . - public static bool HasCommandListTarget(this ref ID2D1DeviceContext deviceContext) - { - using ComPtr d2D1Image = default; - - // First get the target and check that it is not null - deviceContext.GetTarget(d2D1Image.GetAddressOf()); - - if (d2D1Image.Get() is null) - { - return false; - } - - using ComPtr d2D1CommandList = default; - - // If there is a target, check if it is an ID2D1CommandList - HRESULT hresult = d2D1Image.CopyTo(d2D1CommandList.GetAddressOf()); - - // Special case E_NOINTERFACE: this should return false and it's not an error - if (hresult == E.E_NOINTERFACE) - { - return false; - } - - // Throw for any other failure - hresult.Assert(); - - return true; - } - - /// - /// Reads the DPI value from a target object. - /// - /// The input instance. - /// The DPIs from . - public static float GetDpi(this ref ID2D1DeviceContext deviceContext) - { - float dpiX; - float dpiY; - - deviceContext.GetDpi(&dpiX, &dpiY); - - return dpiX; - } - - /// - /// Gets an object from a given . - /// - /// The input instance. - /// The resulting object. - /// The for the operation. - /// - /// The APIs specifically need an (as is used). - /// - public static HRESULT GetFactory1(this ref ID2D1DeviceContext deviceContext, ID2D1Factory1** d2D1Factory1) - { - using ComPtr d2D1Factory = default; - - // Get the underlying ID2D1Factory from the input context, which can be used to register effects - deviceContext.GetFactory(d2D1Factory.GetAddressOf()); - - // QueryInterface for the ID2D1Factory1 object (which should always be present) - return d2D1Factory.CopyTo(d2D1Factory1); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/Extensions/ID2D1EffectExtensions.cs b/src/ComputeSharp.D2D1.UI/Extensions/ID2D1EffectExtensions.cs deleted file mode 100644 index e67e0a5f..00000000 --- a/src/ComputeSharp.D2D1.UI/Extensions/ID2D1EffectExtensions.cs +++ /dev/null @@ -1,237 +0,0 @@ -using System; -using System.Buffers; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ComputeSharp.D2D1.Descriptors; -using ComputeSharp.D2D1.Extensions; -using ComputeSharp.D2D1.Interop; -using ComputeSharp.D2D1.Shaders.Interop.Effects.ResourceManagers; -using ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers; -using ComputeSharp.Win32; - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp.Extensions; -#else -namespace ComputeSharp.D2D1.WinUI.Extensions; -#endif - -/// -/// A with extensions for the type. -/// -internal static unsafe class ID2D1EffectExtensions -{ - /// - /// Gets the constant buffer of type from a given object. - /// - /// The type of shader being used. - /// The input instance. - /// The constant buffer of type for . - public static T GetConstantBuffer(this ref ID2D1Effect d2D1Effect) - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - int constantBufferSize = T.ConstantBufferSize; - - // Special cases the constant buffer type being empty. If that's the case, there is no - // need to try to retrieve the constant buffer from the underlying effect anyway, and - // most importantly, the ID2D1EffectImpl from ComputeSharp.D2D1 will return E_INVALIDARG. - if (constantBufferSize == 0) - { - return default; - } - - byte[]? bufferArray = null; - - Span buffer = constantBufferSize <= 64 - ? stackalloc byte[64] - : bufferArray = ArrayPool.Shared.Rent(constantBufferSize); - - fixed (byte* p = buffer) - { - // Get the raw constant buffer from the effect - d2D1Effect.GetValue( - index: D2D1PixelShaderEffectProperty.ConstantBuffer, - type: D2D1_PROPERTY_TYPE.D2D1_PROPERTY_TYPE_BLOB, - data: p, - dataSize: (uint)constantBufferSize).Assert(); - } - - T shader = T.CreateFromConstantBuffer(buffer); - - if (bufferArray is not null) - { - ArrayPool.Shared.Return(bufferArray); - } - - return shader; - } - - /// - /// Sets the constant buffer of type from a given object. - /// - /// The type of shader being used. - /// The input instance. - /// The constant buffer value to set. - public static void SetConstantBuffer(this ref ID2D1Effect d2D1Effect, in T value) - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - // Same as above, simply do nothing for empty types. This case is still handled to - // avoid crashing when someone's just setting an empty constant buffer, which is - // unnecessary but still valid (eg. a stateless shader). This could be the case if - // someone was eg. binding or using some other automated system to set constant buffer. - if (T.ConstantBufferSize == 0) - { - return; - } - - D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect((ID2D1Effect*)Unsafe.AsPointer(ref d2D1Effect), in value); - } - - /// - /// Gets the instance from a given object. - /// - /// The type of shader being used. - /// The input instance. - /// The instance for . - public static D2D1DrawTransformMapper? GetTransformMapper(this ref ID2D1Effect d2D1Effect) - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - using ComPtr d2D1TransformMapper = default; - - // Get the ID2D1DrawTransformMapper object from the effect - d2D1Effect.GetValue( - index: D2D1PixelShaderEffectProperty.TransformMapper, - type: D2D1_PROPERTY_TYPE.D2D1_PROPERTY_TYPE_IUNKNOWN, - data: (byte*)d2D1TransformMapper.GetAddressOf(), - dataSize: (uint)sizeof(void*)).Assert(); - - // If there is no transform, just return null (this is the default state) - if (d2D1TransformMapper.Get() is null) - { - return null; - } - - // Otherwise, check if it's an internal CCW and retrieve the managed wrapper - using ComPtr d2D1TransformMapperInternal = default; - - d2D1TransformMapper.CopyTo(d2D1TransformMapperInternal.GetAddressOf()).Assert(); - - IntPtr handlePtr; - - // Get the underlying GCHandle value - d2D1TransformMapperInternal.Get()->GetManagedWrapperHandle((void**)&handlePtr).Assert(); - - // Retrieve the managed wrapper from the GCHandle - return (D2D1DrawTransformMapper)GCHandle.FromIntPtr(handlePtr).Target!; - } - - /// - /// Gets the instance from a given object. - /// - /// The input instance. - /// The current cached source instance. - /// The index of the resource texture manager to retrieve. - /// The instance for . - public static D2D1ResourceTextureManager? GetResourceTextureManager( - this ref ID2D1Effect d2D1Effect, - D2D1ResourceTextureManager? source, - int index) - { - using ComPtr d2D1ResourceTextureManager = default; - - // Get the ID2D1ResourceTextureManager object from the effect - d2D1Effect.GetValue( - index: (uint)(D2D1PixelShaderEffectProperty.ResourceTextureManager0 + index), - type: D2D1_PROPERTY_TYPE.D2D1_PROPERTY_TYPE_IUNKNOWN, - data: (byte*)d2D1ResourceTextureManager.GetAddressOf(), - dataSize: (uint)sizeof(void*)).Assert(); - - // If there is no resource texture manager, just return null (this is the default state) - if (d2D1ResourceTextureManager.Get() is null) - { - return null; - } - - // Otherwise, the source must not be null and wrapping the same CCW - if (source is not null) - { - using ComPtr d2D1ResourceTextureManagerSource = default; - - source.GetD2D1ResourceTextureManager(d2D1ResourceTextureManagerSource.GetAddressOf()); - - // Check if the instances match, and return the managed wrapper we already have - if (d2D1ResourceTextureManager.Get()->IsSameInstance(d2D1ResourceTextureManagerSource.Get())) - { - return source; - } - } - - // There was no way to retrieve the correct managed wrapper - return default(InvalidOperationException).Throw(); - } - - /// - /// Gets the property for a given object. - /// - /// The input instance. - /// The value for . - public static bool GetCachedProperty(this ref ID2D1Effect d2D1Effect) - { - int cacheOutput; - - d2D1Effect.GetValue( - index: (uint)D2D1_PROPERTY.D2D1_PROPERTY_CACHED, - type: D2D1_PROPERTY_TYPE.D2D1_PROPERTY_TYPE_BOOL, - data: (byte*)&cacheOutput, - dataSize: sizeof(int)).Assert(); - - return cacheOutput != 0; - } - - /// - /// Sets the property for a given object. - /// - /// The input instance. - /// The property value to set. - public static void SetCachedProperty(this ref ID2D1Effect d2D1Effect, bool value) - { - int cacheOutput = value ? 1 : 0; - - d2D1Effect.SetValue( - index: (uint)D2D1_PROPERTY.D2D1_PROPERTY_CACHED, - type: D2D1_PROPERTY_TYPE.D2D1_PROPERTY_TYPE_BOOL, - data: (byte*)&cacheOutput, - dataSize: sizeof(int)).Assert(); - } - - /// - /// Gets the property for a given object. - /// - /// The input instance. - /// The value for . - public static D2D1_BUFFER_PRECISION GetPrecisionProperty(this ref ID2D1Effect d2D1Effect) - { - D2D1_BUFFER_PRECISION d2D1BufferPrecision; - - d2D1Effect.GetValue( - index: (uint)D2D1_PROPERTY.D2D1_PROPERTY_PRECISION, - type: D2D1_PROPERTY_TYPE.D2D1_PROPERTY_TYPE_UNKNOWN, - data: (byte*)&d2D1BufferPrecision, - dataSize: sizeof(D2D1_BUFFER_PRECISION)).Assert(); - - return d2D1BufferPrecision; - } - - /// - /// Sets the property for a given object. - /// - /// The input instance. - /// The property value to set. - public static void SetPrecisionProperty(this ref ID2D1Effect d2D1Effect, D2D1_BUFFER_PRECISION value) - { - d2D1Effect.SetValue( - index: (uint)D2D1_PROPERTY.D2D1_PROPERTY_PRECISION, - type: D2D1_PROPERTY_TYPE.D2D1_PROPERTY_TYPE_UNKNOWN, - data: (byte*)&value, - dataSize: sizeof(D2D1_BUFFER_PRECISION)).Assert(); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/Extensions/IUnknownExtensions.cs b/src/ComputeSharp.D2D1.UI/Extensions/IUnknownExtensions.cs deleted file mode 100644 index 1b2735ce..00000000 --- a/src/ComputeSharp.D2D1.UI/Extensions/IUnknownExtensions.cs +++ /dev/null @@ -1,84 +0,0 @@ -using System.Runtime.CompilerServices; -using ComputeSharp.D2D1.Extensions; -using ComputeSharp.Win32; - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp.Extensions; -#else -namespace ComputeSharp.D2D1.WinUI.Extensions; -#endif - -/// -/// Helper methods for working with the type. -/// -internal static unsafe class IUnknownExtensions -{ - /// - /// Checks whether two values have the same underlying COM object. - /// - /// The type of the first value to check. - /// The type of the second value to check. - /// The first object to compare. - /// The second object to compare. - /// Whether and point to the same COM object. - public static bool IsSameInstance(this ref T left, U* right) - where T : unmanaged // IUnknown - where U : unmanaged // IUnknown - { - if (Unsafe.AreSame(ref left, ref *(T*)right)) - { - return true; - } - - if (Unsafe.IsNullRef(ref left) || right is null) - { - return false; - } - - using ComPtr leftUnknown = default; - using ComPtr rightUnknown = default; - - ((IUnknown*)Unsafe.AsPointer(ref left))->QueryInterface(Win32.Windows.__uuidof(), (void**)leftUnknown.GetAddressOf()).Assert(); - ((IUnknown*)right)->QueryInterface(Win32.Windows.__uuidof(), (void**)rightUnknown.GetAddressOf()).Assert(); - - return leftUnknown.Get() == rightUnknown.Get(); - } - - /// - /// Copies the source object onto a target destination. - /// - /// The type of object being copied. - /// The source object. - /// The destination location. - /// The for the operation. - public static HRESULT CopyTo(this ref T source, ref ComPtr destination) - where T : unmanaged // IUnknown - { - // Note: this explicitly needs a temporary copy to avoid issues in case source and destination were - // pointers to the same object (which can be the case even if the two pointers are not identical). - // To double check, a full check through an IUnknown* cast would be needed, but to avoid the extra - // QueryInterface call on both objects, we can just always do one AddRef call which avoids issues in - // all cases as well. The situation we need to avoid is that without a temporary copy, releasing the - // target object might actually destroy the object, causing the following AddRef call to AV. - using ComPtr temporary = new((T*)Unsafe.AsPointer(ref source)); - - return temporary.CopyTo(ref destination); - } - - /// - /// Copies the source object onto a target location. - /// - /// The type of object being copied. - /// The type of destination object being copied. - /// The source object. - /// The destination location. - /// The for the operation. - public static HRESULT CopyTo(this ref T source, U** destination) - where T : unmanaged // IUnknown - where U : unmanaged, IComObject - { - using ComPtr temporary = new((T*)Unsafe.AsPointer(ref source)); - - return temporary.CopyTo(destination); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/Helpers/RcwMarshaller.cs b/src/ComputeSharp.D2D1.UI/Helpers/RcwMarshaller.cs deleted file mode 100644 index 93ad4aa3..00000000 --- a/src/ComputeSharp.D2D1.UI/Helpers/RcwMarshaller.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System; -using ComputeSharp.Win32; -using WinRT; -using IInspectable = ComputeSharp.Win32.IInspectable; - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp.Helpers; -#else -namespace ComputeSharp.D2D1.WinUI.Helpers; -#endif - -/// -/// A helper type to handle marshalling of RCW instances. -/// -internal static unsafe class RcwMarshaller -{ - /// - /// Gets or creates a managed object of a specified type for an input native object. - /// - /// The interface type to retrieve an instance of. - /// A pointer to the native object to get a managed wrapper for. - /// The resulting managed object wrapping . - /// This method should only be called with being a projected interface type. - public static T GetOrCreateManagedInterface(IUnknown* nativeObject) - where T : class - { - return MarshalInterface.FromAbi((IntPtr)nativeObject); - } - - /// - /// Retrieves the underlying native object for an input RCW. - /// - /// The type of managed object to unwrap. - /// The input RCW instance to unwrap. - /// A pointer to the resulting native object to retrieve. - /// This method should only be called with being a concrete projected type. - public static void GetNativeObject(T managedObject, IInspectable** nativeObject) - where T : class - { - *nativeObject = (IInspectable*)MarshalInspectable.FromManaged(managedObject); - } - - /// - /// Retrieves the underlying native object for an input RCW and casts it to the specified type. - /// - /// The type of managed object to unwrap. - /// The interface type to retrieve an instance of. - /// The input RCW instance to unwrap. - /// A pointer to the resulting native object to retrieve. - /// The for the operation. - /// This method should only be called with being a projected interface type. - public static HRESULT GetNativeInterface(TFrom managedObject, TTo** nativeObject) - where TFrom : class - where TTo : unmanaged, IComObject - { - using ComPtr unknownObject = default; - - // Here we only want to get an IUnknown* pointer for a given interface, and then we'll do - // QueryInterface ourselves to get the target COM type. So MarshalInterface is fine. - unknownObject.Attach((IUnknown*)MarshalInterface.FromManaged(managedObject)); - - return unknownObject.CopyTo(nativeObject); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/Helpers/ResourceManager.cs b/src/ComputeSharp.D2D1.UI/Helpers/ResourceManager.cs deleted file mode 100644 index 26a36244..00000000 --- a/src/ComputeSharp.D2D1.UI/Helpers/ResourceManager.cs +++ /dev/null @@ -1,123 +0,0 @@ -using System; -using ABI.Microsoft.Graphics.Canvas; -using ComputeSharp.D2D1.Extensions; -using ComputeSharp.Win32; -using Windows.Graphics.Effects; -using WinRT; - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp.Helpers; -#else -namespace ComputeSharp.D2D1.WinUI.Helpers; -#endif - -using CanvasDevice = Microsoft.Graphics.Canvas.CanvasDevice; -using ICanvasEffectFactoryNative = Microsoft.Graphics.Canvas.ICanvasEffectFactoryNative; -using IInspectable = Win32.IInspectable; - -/// -/// A helper type to replicate Win2D's ResourceManager type. -/// -/// -/// This type provides an entry point to use the Win2D activation factory. -/// -internal static unsafe class ResourceManager -{ - /// - /// Gets or creates an instance for a native resource. - /// - /// The input canvas device (as a marshalled ). - /// The input native resource to create a wrapper for. - /// The realization DPIs for - /// The resulting wrapper instance. - /// Thrown if the managed wrapper could not be retrieved. - public static IGraphicsEffectSource GetOrCreate(ICanvasDevice* device, IUnknown* resource, float dpi) - { - using ComPtr canvasFactoryNative = default; - - GetActivationFactory(canvasFactoryNative.GetAddressOf()); - - using ComPtr wrapperInspectable = default; - - // Get or create a WinRT wrapper for the resource - canvasFactoryNative.Get()->GetOrCreate( - device: device, - resource: resource, - dpi: dpi, - wrapper: wrapperInspectable.GetAddressOf()).Assert(); - - // Get the runtime-provided RCW for the resulting WinRT wrapper - return RcwMarshaller.GetOrCreateManagedInterface((IUnknown*)wrapperInspectable.Get()); - } - - /// - /// Registers a managed wrapper for a given native resource. - /// - /// The input native resource to register a wrapper for. - /// The wrapper to register for . - public static void RegisterWrapper(IUnknown* resource, T wrapper) - where T : class - { - using ComPtr canvasFactoryNative = default; - - GetActivationFactory(canvasFactoryNative.GetAddressOf()); - - using ComPtr wrapperInspectable = default; - - // Unwrap the input wrapper and get an IInspectable* object - RcwMarshaller.GetNativeObject(wrapper, wrapperInspectable.GetAddressOf()); - - // Register this pair of native resource and inspectable wrapper - canvasFactoryNative.Get()->RegisterWrapper(resource, wrapperInspectable.Get()).Assert(); - } - - /// - /// Unregisters a native resource from Win2D's internal cache. - /// - /// The input native resource to unregister a wrapper for. - public static void UnregisterWrapper(IUnknown* resource) - { - using ComPtr canvasFactoryNative = default; - - GetActivationFactory(canvasFactoryNative.GetAddressOf()); - - // Unregister the previously registered native resource - canvasFactoryNative.Get()->UnregisterWrapper(resource).Assert(); - } - - /// - /// Registers a factory of wrappers for custom effect with a given effect id. - /// - /// The id of the effects to register a factory for. - /// The input factory to create wrappers of native effects. - public static void RegisterEffectFactory(Guid effectId, ICanvasEffectFactoryNative factory) - { - using ComPtr canvasFactoryNative = default; - - GetActivationFactory(canvasFactoryNative.GetAddressOf()); - - using ComPtr canvasEffectFactoryNative = default; - - RcwMarshaller.GetNativeInterface(factory, canvasEffectFactoryNative.GetAddressOf()).Assert(); - - // Register the factory for the current effect from the activation factory - canvasFactoryNative.Get()->RegisterEffectFactory(&effectId, canvasEffectFactoryNative.Get()).Assert(); - } - - /// - /// Gets the activation factory. - /// - /// A pointer to the resulting activation factory. - private static void GetActivationFactory(ICanvasFactoryNative** factoryNative) - { - const string ActivatableClassId = "Microsoft.Graphics.Canvas.CanvasDevice"; - - // On WinUI 3, the types are not guaranteed to be registered for activation. Additionally, for - // concistency with other types, we just use the built-in ActivationFactory type, which will - // automatically handle fallback logic to resolve types to activate if they're not registered. - // For instance, this will ensure the following call will work fine in unpackaged apps. - using IObjectReference canvasDeviceActivationFactory = ActivationFactory.Get(ActivatableClassId, *ICanvasFactoryNative.IID); - - *factoryNative = (ICanvasFactoryNative*)canvasDeviceActivationFactory.GetRef(); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/ICanvasEffectNode.cs b/src/ComputeSharp.D2D1.UI/ICanvasEffectNode.cs deleted file mode 100644 index 6cd27918..00000000 --- a/src/ComputeSharp.D2D1.UI/ICanvasEffectNode.cs +++ /dev/null @@ -1,19 +0,0 @@ -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp; -#else -namespace ComputeSharp.D2D1.WinUI; -#endif - -/// -/// A marker interface for an effect node that was registered from an value. -/// -/// -/// -/// This interface allows using and in more scenarios, -/// including where the concrete type of the image being used (eg. to set the output node) is not known (or needed) by the caller. -/// -/// -/// This interface only implemented by and it's not meant to be implemented by external types. -/// -/// -public interface ICanvasEffectNode; \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/ICanvasEffectNode{T}.cs b/src/ComputeSharp.D2D1.UI/ICanvasEffectNode{T}.cs deleted file mode 100644 index 39bfaee0..00000000 --- a/src/ComputeSharp.D2D1.UI/ICanvasEffectNode{T}.cs +++ /dev/null @@ -1,23 +0,0 @@ -using Microsoft.Graphics.Canvas; - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp; -#else -namespace ComputeSharp.D2D1.WinUI; -#endif - -/// -/// A marker interface for a generic effect node that was registered from an value. -/// -/// The covariant type of associated with the current effect node. -/// -/// -/// This interface allows using and in more scenarios, -/// including with ternary expressions returning multiple concrete instances with a common image type. -/// -/// -/// This interface only implemented by and it's not meant to be implemented by external types. -/// -/// -public interface ICanvasEffectNode : ICanvasEffectNode - where T : ICanvasImage; \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.ICanvasEffect.cs b/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.ICanvasEffect.cs deleted file mode 100644 index 34282d13..00000000 --- a/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.ICanvasEffect.cs +++ /dev/null @@ -1,218 +0,0 @@ -using System; -using System.Buffers; -using System.Runtime.InteropServices; -using ABI.Microsoft.Graphics.Canvas; -using ComputeSharp.D2D1.Extensions; -#if WINDOWS_UWP -using ComputeSharp.D2D1.Uwp.Helpers; -#else -using ComputeSharp.D2D1.WinUI.Helpers; -#endif -using ComputeSharp.Interop; -using ComputeSharp.Win32; -using Windows.Foundation; -using ICanvasEffect = Microsoft.Graphics.Canvas.Effects.ICanvasEffect; -using ICanvasResourceCreatorWithDpi = Microsoft.Graphics.Canvas.ICanvasResourceCreatorWithDpi; - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp; -#else -namespace ComputeSharp.D2D1.WinUI; -#endif - -/// -unsafe partial class PixelShaderEffect -{ - /// - public void InvalidateSourceRectangle(ICanvasResourceCreatorWithDpi resourceCreator, uint sourceIndex, Rect invalidRectangle) - { - using ReferenceTracker.Lease _0 = GetReferenceTracker().GetLease(); - - using ComPtr resourceCreatorWithDpi = default; - using ComPtr canvasImageInterop = default; - - GetCanvasResourceCreatorAndCanvasImageInteropUnderlyingObjects( - resourceCreator, - resourceCreatorWithDpi.GetAddressOf(), - canvasImageInterop.GetAddressOf()); - - Win2D.InvalidateSourceRectangleForICanvasImageInterop( - resourceCreator: resourceCreatorWithDpi.Get(), - image: canvasImageInterop.Get(), - sourceIndex: sourceIndex, - invalidRectangle: &invalidRectangle).Assert(); - } - - /// - public Rect[] GetInvalidRectangles(ICanvasResourceCreatorWithDpi resourceCreator) - { - using ReferenceTracker.Lease _0 = GetReferenceTracker().GetLease(); - - using ComPtr resourceCreatorWithDpi = default; - using ComPtr canvasImageInterop = default; - - GetCanvasResourceCreatorAndCanvasImageInteropUnderlyingObjects( - resourceCreator, - resourceCreatorWithDpi.GetAddressOf(), - canvasImageInterop.GetAddressOf()); - - uint valueCount; - Rect* valueElements; - - Win2D.GetInvalidRectanglesForICanvasImageInterop( - resourceCreator: resourceCreatorWithDpi.Get(), - image: canvasImageInterop.Get(), - valueCount: &valueCount, - valueElements: &valueElements).Assert(); - - try - { - // Copy the data back from the COM array that Win2D created and returned. - // If no items were returned, this will automatically return an empty array. - return new Span(valueElements, checked((int)valueCount)).ToArray(); - } - finally - { - // Make sure to release the callee-allocated COM array - Marshal.FreeCoTaskMem((IntPtr)valueElements); - } - } - - /// - public Rect GetRequiredSourceRectangle( - ICanvasResourceCreatorWithDpi resourceCreator, - Rect outputRectangle, - ICanvasEffect sourceEffect, - uint sourceIndex, - Rect sourceBounds) - { - using ReferenceTracker.Lease _0 = GetReferenceTracker().GetLease(); - - using ComPtr resourceCreatorWithDpi = default; - using ComPtr canvasImageInterop = default; - - GetCanvasResourceCreatorAndCanvasImageInteropUnderlyingObjects( - resourceCreator, - resourceCreatorWithDpi.GetAddressOf(), - canvasImageInterop.GetAddressOf()); - - Rect result; - - using ComPtr canvasEffectAbi = default; - - // Get the ABI.Microsoft.Graphics.Canvas.Effects.ICanvasEffect object from the input interface - RcwMarshaller.GetNativeInterface(sourceEffect, canvasEffectAbi.GetAddressOf()).Assert(); - - Win2D.GetRequiredSourceRectanglesForICanvasImageInterop( - resourceCreator: resourceCreatorWithDpi.Get(), - image: canvasImageInterop.Get(), - outputRectangle: &outputRectangle, - sourceEffectCount: 1, - sourceEffects: canvasEffectAbi.GetAddressOf(), - sourceIndexCount: 1, - sourceIndices: &sourceIndex, - sourceBoundsCount: 1, - sourceBounds: &sourceBounds, - valueCount: 1, - valueElements: &result).Assert(); - - return result; - } - - /// - public Rect[] GetRequiredSourceRectangles( - ICanvasResourceCreatorWithDpi resourceCreator, - Rect outputRectangle, - ICanvasEffect[] sourceEffects, - uint[] sourceIndices, - Rect[] sourceBounds) - { - using ReferenceTracker.Lease _0 = GetReferenceTracker().GetLease(); - - using ComPtr resourceCreatorWithDpi = default; - using ComPtr canvasImageInterop = default; - - GetCanvasResourceCreatorAndCanvasImageInteropUnderlyingObjects( - resourceCreator, - resourceCreatorWithDpi.GetAddressOf(), - canvasImageInterop.GetAddressOf()); - - // The array optionally rented from the pool is of IntPtr types to reduce the number of generic - // instantiations. This increases the chances of the pooled arrays being shared with other code. - IntPtr[]? canvasEffectsAbiArray = null; - - // Create the span and optional array of ABI.Microsoft.Graphics.Canvas.Effects.ICanvasEffect objects - Span> canvasEffects = sourceEffects.Length <= 16 - ? stackalloc ComPtr[16] - : MemoryMarshal.Cast>( - (canvasEffectsAbiArray = ArrayPool.Shared.Rent(sourceEffects.Length)).AsSpan()); - - // Clear the span to ensure no false positives are accidentally disposed - canvasEffects.Clear(); - - try - { - // Get the underlying ABI.Microsoft.Graphics.Canvas.Effects.ICanvasEffect object for each input effect - for (int i = 0; i < sourceEffects.Length; i++) - { - RcwMarshaller.GetNativeInterface(sourceEffects[i], canvasEffects[i].GetAddressOf()).Assert(); - } - - Rect[] result = new Rect[sourceEffects.Length]; - - fixed (ComPtr* pCanvasEffects = canvasEffects) - fixed (uint* pSourceIndices = sourceIndices) - fixed (Rect* pSourceBounds = sourceBounds) - fixed (Rect* pResult = result) - { - Win2D.GetRequiredSourceRectanglesForICanvasImageInterop( - resourceCreator: resourceCreatorWithDpi.Get(), - image: canvasImageInterop.Get(), - outputRectangle: &outputRectangle, - sourceEffectCount: (uint)sourceEffects.Length, - sourceEffects: (ABI.Microsoft.Graphics.Canvas.Effects.ICanvasEffect**)pCanvasEffects, - sourceIndexCount: (uint)sourceIndices.Length, - sourceIndices: pSourceIndices, - sourceBoundsCount: (uint)sourceBounds.Length, - sourceBounds: pSourceBounds, - valueCount: (uint)sourceEffects.Length, - valueElements: pResult).Assert(); - } - - // Only return the array to the pool if no exceptions have been thrown - if (canvasEffectsAbiArray is not null) - { - ArrayPool.Shared.Return(canvasEffectsAbiArray); - } - - return result; - } - finally - { - // Release all canvas effects that have been retrieved up until the exception - foreach (ref ComPtr canvasEffect in canvasEffects) - { - canvasEffect.Dispose(); - } - } - } - - /// - /// Gets the underlying and - /// objects from an input object and the current instance. - /// - /// The input object. - /// The resulting object for . - /// The resulting object for the current instance. - private void GetCanvasResourceCreatorAndCanvasImageInteropUnderlyingObjects( - ICanvasResourceCreatorWithDpi resourceCreator, - ABI.Microsoft.Graphics.Canvas.ICanvasResourceCreatorWithDpi** resourceCreatorWithDpi, - ICanvasImageInterop** canvasImageInterop) - { - // Get the ABI.Microsoft.Graphics.Canvas.ICanvasResourceCreatorWithDpi object from the input interface - RcwMarshaller.GetNativeInterface(resourceCreator, resourceCreatorWithDpi).Assert(); - - // Get the ICanvasImageInterop object from the current instance - RcwMarshaller.GetNativeInterface(this, canvasImageInterop).Assert(); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.ICanvasEffectFactoryNative.cs b/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.ICanvasEffectFactoryNative.cs deleted file mode 100644 index 1cdaa96d..00000000 --- a/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.ICanvasEffectFactoryNative.cs +++ /dev/null @@ -1,152 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using ABI.Microsoft.Graphics.Canvas; -using ComputeSharp.D2D1.Extensions; -#if WINDOWS_UWP -using ComputeSharp.D2D1.Uwp.Extensions; -using ComputeSharp.D2D1.Uwp.Helpers; -#else -using ComputeSharp.D2D1.WinUI.Extensions; -using ComputeSharp.D2D1.WinUI.Helpers; -#endif -using ComputeSharp.Win32; -using ICanvasEffectFactoryNative = Microsoft.Graphics.Canvas.ICanvasEffectFactoryNative; - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp; -#else -namespace ComputeSharp.D2D1.WinUI; -#endif - -/// -partial class PixelShaderEffect -{ - /// - /// A manager type to handle the effect factory registration logic for . - /// - private sealed class EffectFactoryManager - { - /// - /// Lock object used to synchronize the registration logic. - /// - private readonly object lockObject = new(); - - /// - /// Indicates whether an effect factory for has been registered. - /// - private volatile bool isEffectFactoryRegistered; - - /// - /// Creates a new instance. - /// - private EffectFactoryManager() - { - } - - /// - /// Gets the shared instance. - /// - public static EffectFactoryManager Instance { get; } = new(); - - /// - /// Ensures an effect factory is registered in Win2D for the current effect type, or registers one otherwise. - /// - public void EnsureEffectFactoryIsRegistered() - { - if (this.isEffectFactoryRegistered) - { - return; - } - - EnsureEffectFactoryIsRegisteredWithLock(); - } - - /// - /// Same as , but with a slower path using a lock. - /// - [MethodImpl(MethodImplOptions.NoInlining)] - private void EnsureEffectFactoryIsRegisteredWithLock() - { - lock (this.lockObject) - { - if (!this.isEffectFactoryRegistered) - { - ResourceManager.RegisterEffectFactory( - effectId: T.EffectId, - factory: new EffectFactory()); - - this.isEffectFactoryRegistered = true; - } - } - } - } - - /// - /// A managed implementation of for . - /// - /// - /// This type is partial even though there are no other explicit partial type declarations in the project, so the CsWinRT - /// generator can generate one using and the precomputed vtable entries. - /// - internal sealed unsafe partial class EffectFactory : ICanvasEffectFactoryNative - { - /// - int ICanvasEffectFactoryNative.CreateWrapper(ICanvasDevice* device, ID2D1Effect* resource, float dpi, IInspectable** wrapper) - { - PixelShaderEffect @this; - - using (ComPtr d2D1Device1 = default) - { - // Get the underlying ID2D1Device1 instance for the input device - device->GetD2DDevice(d2D1Device1.GetAddressOf()).Assert(); - - // Validate that the input underlying D2D device and resource share the same D2D factory - using (ComPtr d2D1ImageResource = default) - using (ComPtr d2D1FactoryFromDevice = default) - using (ComPtr d2D1FactoryFromResource = default) - { - resource->CopyTo(d2D1ImageResource.GetAddressOf()).Assert(); - - d2D1Device1.Get()->GetFactory(d2D1FactoryFromDevice.GetAddressOf()); - d2D1ImageResource.Get()->GetFactory(d2D1FactoryFromResource.GetAddressOf()); - - // Shared logic and comments from Win2D, as this validation path is the same as that of CanvasEffect. - // There is a small chance of constructing a PixelShaderEffect object that is in an invalid state - // when using this method to create a managed wrapper indirectly from the interop APIs exposed in the - // public headers. In general, this would happen if someone did manual interop to get a managed wrapper - // for an orphaned effect previously retrieved from an existing PixelShaderEffect instance that has - // since changed. For more info and a full example, see https://github.com/microsoft/Win2D/issues/913. - // Here we're validating the D2D factories from the wrapped effect and the device to try to minimize - // the chances of this happening. We can't be 100% sure since there is no way with the existing D2D - // APIs to fully determine whether two resources are "compatible", short of just trying to draw with - // both of them to see if that fails. But, comparing factories is at least a nice additional check - // to perform, and due to the fact that Win2D creates a new D2D factory per CanvasDevice, this should - // already cover most scenarios where this might potentially happen, so that's good enough. - if (!d2D1FactoryFromDevice.Get()->IsSameInstance(d2D1FactoryFromResource.Get())) - { - *wrapper = null; - - return D2DERR.D2DERR_WRONG_FACTORY; - } - } - - // Only initialize the effect once we're past the validation - @this = new PixelShaderEffect(); - - // Initialize the effect state - device->CopyTo(ref @this.canvasDevice).Assert(); - d2D1Device1.CopyTo(ref @this.d2D1RealizationDevice).Assert(); - resource->CopyTo(ref @this.d2D1Effect).Assert(); - } - - // Register the new wrapper for the input resource. This has to be done manually in this - // case, as the effect is not being realized through the usual path from GetD2DImage. - ResourceManager.RegisterWrapper((IUnknown*)resource, @this); - - // Unwrap the PixelShaderEffect and return its CCW to the caller - RcwMarshaller.GetNativeObject(@this, wrapper); - - return S.S_OK; - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.ICanvasImage.cs b/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.ICanvasImage.cs deleted file mode 100644 index 24143ff8..00000000 --- a/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.ICanvasImage.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System.Numerics; -using ABI.Microsoft.Graphics.Canvas; -using ComputeSharp.D2D1.Extensions; -#if WINDOWS_UWP -using ComputeSharp.D2D1.Uwp.Helpers; -#else -using ComputeSharp.D2D1.WinUI.Helpers; -#endif -using ComputeSharp.Interop; -using ComputeSharp.Win32; -using Windows.Foundation; -using ICanvasResourceCreator = Microsoft.Graphics.Canvas.ICanvasResourceCreator; - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp; -#else -namespace ComputeSharp.D2D1.WinUI; -#endif - -/// -unsafe partial class PixelShaderEffect -{ - /// - public Rect GetBounds(ICanvasResourceCreator resourceCreator) - { - return GetBounds(resourceCreator, null); - } - - /// - public Rect GetBounds(ICanvasResourceCreator resourceCreator, Matrix3x2 transform) - { - return GetBounds(resourceCreator, &transform); - } - - /// - private Rect GetBounds(ICanvasResourceCreator resourceCreator, Matrix3x2* transform) - { - using ReferenceTracker.Lease _0 = GetReferenceTracker().GetLease(); - - using ComPtr resourceCreatorAbi = default; - - // Get the ABI.Microsoft.Graphics.Canvas.ICanvasResourceCreator object from the input interface - RcwMarshaller.GetNativeInterface(resourceCreator, resourceCreatorAbi.GetAddressOf()).Assert(); - - using ComPtr canvasImageInterop = default; - - // Get the ICanvasImageInterop object from the current instance - RcwMarshaller.GetNativeInterface(this, canvasImageInterop.GetAddressOf()).Assert(); - - Rect bounds; - - // Forward the actual logic to Win2D to compute the image bounds (it needs the internal context) - Win2D.GetBoundsForICanvasImageInterop( - resourceCreator: resourceCreatorAbi.Get(), - image: canvasImageInterop.Get(), - transform: transform, - rect: &bounds).Assert(); - - return bounds; - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.ICanvasImageInterop.cs b/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.ICanvasImageInterop.cs deleted file mode 100644 index d115ba30..00000000 --- a/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.ICanvasImageInterop.cs +++ /dev/null @@ -1,417 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Threading; -using ABI.Microsoft.Graphics.Canvas; -using ComputeSharp.D2D1.Extensions; -using ComputeSharp.D2D1.Interop; -#if WINDOWS_UWP -using ComputeSharp.D2D1.Uwp.Extensions; -using ComputeSharp.D2D1.Uwp.Helpers; -#else -using ComputeSharp.D2D1.WinUI.Extensions; -using ComputeSharp.D2D1.WinUI.Helpers; -#endif -using ComputeSharp.Interop; -using ComputeSharp.Win32; -using Windows.Graphics.Effects; -using static ABI.Microsoft.Graphics.Canvas.WIN2D_GET_D2D_IMAGE_FLAGS; -using static ABI.Microsoft.Graphics.Canvas.WIN2D_GET_DEVICE_ASSOCIATION_TYPE; -using ICanvasImageInterop = Microsoft.Graphics.Canvas.ICanvasImageInterop; - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp; -#else -namespace ComputeSharp.D2D1.WinUI; -#endif - -/// -unsafe partial class PixelShaderEffect -{ - /// - int ICanvasImageInterop.GetDevice(ICanvasDevice** device, WIN2D_GET_DEVICE_ASSOCIATION_TYPE* type) - { - // Validate all input parameters - if (device is null || type is null) - { - return E.E_POINTER; - } - - // Set parameters to default values - *device = null; - *type = WIN2D_GET_DEVICE_ASSOCIATION_TYPE_UNSPECIFIED; - - using ReferenceTracker.Lease _0 = GetReferenceTracker().TryGetLease(out bool leaseTaken); - - // Check for disposal - if (!leaseTaken) - { - return RO.RO_E_CLOSED; - } - - // Ensure we can take a lock without blocking. We can't access the realization device with no - // lock, as that could lead to memory leaks or corruption if GetD2DImage was to manipulate that - // field concurrently. We also cannot lock directly, because that would deadlock if someone was - // to (incorrectly) try to use the same effect from two different threads. To protect against - // that, we try to lock, and just return E_NOT_VALID_STATE if another thread holds the lock. If - // this call had GetD2DImage in the stack, that would work fine because locks are recursive. - if (!Monitor.TryEnter(this.lockObject)) - { - return E.E_NOT_VALID_STATE; - } - - HRESULT hresult; - - try - { - // Copy the device over to the target - hresult = this.canvasDevice.CopyTo(device); - } - finally - { - Monitor.Exit(this.lockObject); - } - - // Set the association type if the copy was successful - if (Win32.Windows.SUCCEEDED(hresult)) - { - *type = WIN2D_GET_DEVICE_ASSOCIATION_TYPE_REALIZATION_DEVICE; - } - - return hresult; - } - - /// - int ICanvasImageInterop.GetD2DImage( - ICanvasDevice* device, - ID2D1DeviceContext* deviceContext, - WIN2D_GET_D2D_IMAGE_FLAGS flags, - float targetDpi, - float* realizeDpi, - ID2D1Image** ppImage) - { - // The device and resulting image pointers cannot be null - if (device is null || ppImage is null) - { - return E.E_POINTER; - } - - // Set the resulting image to null - *ppImage = null; - - using ReferenceTracker.Lease _0 = GetReferenceTracker().TryGetLease(out bool leaseTaken); - - // Check for disposal - if (!leaseTaken) - { - return RO.RO_E_CLOSED; - } - - // Check for graph cycles - if (Interlocked.CompareExchange(ref this.isInsideGetD2DImage, 1, 0) == 1) - { - return D2DERR.D2DERR_CYCLIC_GRAPH; - } - - try - { - // Lock after checking for graph cycles (other public APIs also lock on this object) - lock (this.lockObject) - { - // Process the ReadDpiFromDeviceContext flag (same logic as CanvasEffect::GetD2DImage) - if ((flags & WIN2D_GET_D2D_IMAGE_FLAGS_READ_DPI_FROM_DEVICE_CONTEXT) != WIN2D_GET_D2D_IMAGE_FLAGS_NONE) - { - // If ReadDpiFromDeviceContext is used, the context cannot be null - if (deviceContext is null) - { - return E.E_POINTER; - } - - if (deviceContext->HasCommandListTarget()) - { - // Command lists are DPI dependent, so DPI compensation effects are always needed - flags |= WIN2D_GET_D2D_IMAGE_FLAGS_ALWAYS_INSERT_DPI_COMPENSATION; - } - else - { - // If the effect is not being drawn onto a command list, the DPIs can be read from the device context - targetDpi = deviceContext->GetDpi(); - } - - // ReadDpiFromDeviceContext has been processed, so it can be removed now - flags &= ~WIN2D_GET_D2D_IMAGE_FLAGS_READ_DPI_FROM_DEVICE_CONTEXT; - } - - using ComPtr d2D1Device1 = default; - - // Get the underlying ID2D1Device1 instance in use - device->GetD2DDevice(d2D1Device1.GetAddressOf()).Assert(); - - // Check that the input D2D device is the same instance as the current realization device, if any. - // If not and the effect has already been realized, unrealize it and store the new device to use. - if (!d2D1Device1.Get()->IsSameInstance(this.d2D1RealizationDevice.Get())) - { - Unrealize(); - - // Store the input realization device and canvas device for future uses - d2D1Device1.CopyTo(ref this.d2D1RealizationDevice).Assert(); - device->CopyTo(ref this.canvasDevice).Assert(); - } - - // Create the effect, if it doesn't exist already - if (this.d2D1Effect.Get() is null) - { - if (!Realize(flags, targetDpi, deviceContext)) - { - return E.E_FAIL; - } - } - else if (!flags.HasFlag(WIN2D_GET_D2D_IMAGE_FLAGS_MINIMAL_REALIZATION)) - { - // Recurse through the effect graph and ensure all nodes are initialized - RefreshInputs(flags, targetDpi, deviceContext); - } - - // The realized DPIs are always 0 for pixel shader effects - if (realizeDpi is not null) - { - *realizeDpi = 0; - } - - this.d2D1Effect.CopyTo(ppImage).Assert(); - - return S.S_OK; - } - } - finally - { - // Ensure that reset this flag so that this method can be called again - this.isInsideGetD2DImage = 0; - } - } - - /// - /// Unrealizes the currently realized object. - /// - /// The value to set for . - /// The index of the source to get or set. - private void Unrealize(IGraphicsEffectSource source, int index) - { - // Unrealize the effect and indicate to the logic to skip the source at the current index. - // That is, there is no need to marshal it back to the cache, as we're about to do that here. - Unrealize(index); - - // Once the effect is unrealized, also update the cached source managed wrapper - Sources.Storage[index].SetWrapper(source); - } - - /// - /// Unrealizes the currently realized object. - /// - private void Unrealize(int? sourceIndexToSkip = null) - { - // If there is no ID2D1Effect object, there is nothing left to do - if (this.d2D1Effect.Get() is null) - { - return; - } - - // Cache the last update values for the constant buffer, cache output, buffer precision properties, etc. - // Note: the resource texture managers are deliberately not read back, as the only supported way to set - // those is directly from the current effect instance. As such, they'd all either be the same instances - // that are already stored locally, or trying to retrieve them would just throw an exception. - this.constantBuffer = this.d2D1Effect.Get()->GetConstantBuffer(); - this.transformMapper = this.d2D1Effect.Get()->GetTransformMapper(); - this.cacheOutput = this.d2D1Effect.Get()->GetCachedProperty(); - this.d2D1BufferPrecision = this.d2D1Effect.Get()->GetPrecisionProperty(); - - // Loop over all effect inputs and update the cache back as well - for (int i = 0; i < Sources.Count; i++) - { - // If this index has been explicitly requested to be skipped, just dispose the source reference. - // This is the case when the effect is being unrealized, and callers will set this value on their own. - if (i == sourceIndexToSkip) - { - Sources.Storage[i].Dispose(); - } - else - { - // Otherwise, just get the input, which will automatically update the cached values. The - // returned IGraphicsEffectSource managed wrapper is not used here and is safe to ignore. - _ = GetD2DInput(i); - } - } - - // Unregister the wrapper for the effect. In case someone is still holding a reference - // to it, the effect is now "orphaned" and without a registered inspectable wrapper. - ResourceManager.UnregisterWrapper((IUnknown*)this.d2D1Effect.Get()); - - // Finally release the effect as well - this.d2D1Effect.Dispose(); - } - - /// - /// Realizes the underlying for this object. - /// - /// The current flags in use. - /// The target DPI in use. - /// The instance in use. - /// Whether the effect was realized correctly. - private bool Realize(WIN2D_GET_D2D_IMAGE_FLAGS flags, float targetDpi, ID2D1DeviceContext* deviceContext) - { - fixed (ID2D1Effect** d2D1Effect = this.d2D1Effect) - { - Guid effectId = T.EffectId; - - using ComPtr d2D1DeviceContextEffective = default; - using ComPtr d2D1DeviceContextLease = default; - - // We need to realize the current effect (ComputeSharp.D2D1's ID2D1Effect), which needs a device context - this.canvasDevice.Get()->GetEffectiveD2DDeviceContextWithOptionalLease( - d2D1DeviceContext: deviceContext, - d2D1DeviceContextEffective: d2D1DeviceContextEffective.GetAddressOf(), - d2D1DeviceContextLease: d2D1DeviceContextLease.GetAddressOf()); - - // Try to create an instance of the effect in use and store it in the current object - HRESULT hresult = d2D1DeviceContextEffective.Get()->CreateEffect(effectId: &effectId, effect: d2D1Effect); - - // Check if creation failed due to the effect not being registered. In that case, register - // it and then try again. This is much faster than check whether the effect is registered - // manually every time, by enumerating all registered effects for the target device context. - // An unregistered effect can also sometimes return E_NOTFOUND, although it's not documented. - if (hresult == D2DERR.D2DERR_EFFECT_IS_NOT_REGISTERED || - hresult == E.E_NOTFOUND) - { - using ComPtr d2D1Factory1 = default; - - // Get the ID2D1Factory1 object to register the effect (required by D2D1PixelShaderEffect) - d2D1DeviceContextEffective.Get()->GetFactory1(d2D1Factory1.GetAddressOf()).Assert(); - - // Register the effect with the factory (pass the same D2D1 draw transform mapper factory that was used before) - D2D1PixelShaderEffect.RegisterForD2D1Factory1(d2D1Factory1.Get(), out _); - - // Try to create the effect again - hresult = d2D1DeviceContextEffective.Get()->CreateEffect(effectId: &effectId, effect: d2D1Effect); - } - - // Rethrow any other errors - hresult.Assert(); - } - - // Set the constant buffer for the effect - D2D1PixelShaderEffect.SetConstantBufferForD2D1Effect(this.d2D1Effect.Get(), in this.constantBuffer); - - // If there is a transform mapper, set it in the effect - if (this.transformMapper is not null) - { - D2D1PixelShaderEffect.SetTransformMapperForD2D1Effect(this.d2D1Effect.Get(), this.transformMapper); - } - - // If cache input has been set, forward that to the new effect - if (this.cacheOutput) - { - this.d2D1Effect.Get()->SetCachedProperty(true); - } - - // If the buffer precision isn't unknown, forward that as well - if (this.d2D1BufferPrecision != D2D1_BUFFER_PRECISION.D2D1_BUFFER_PRECISION_UNKNOWN) - { - this.d2D1Effect.Get()->SetPrecisionProperty(this.d2D1BufferPrecision); - } - - // Forward all available sources (the effect is being created now, so no need to validate the underlying resources) - for (int i = 0; i < Sources.Count; i++) - { - if (!SetD2DInput( - index: i, - value: Sources.Storage[i].GetWrapper(), - flags: flags, - targetDpi: targetDpi, - d2D1DeviceContext: deviceContext)) - { - return false; - } - } - - // Set all available resource texture managers (only set those that are not null, as they're all null by default anyway). - // The loop only goes over the indices of valid slots for resource textures for the current effect, and ignores the others. - foreach (int index in ResourceTextureManagerCollection.Indices) - { - if (ResourceTextureManagers.Storage[index] is D2D1ResourceTextureManager resourceTextureManager) - { - D2D1PixelShaderEffect.SetResourceTextureManagerForD2D1Effect(this.d2D1Effect.Get(), resourceTextureManager, index); - } - } - - // Register the new realized effect - ResourceManager.RegisterWrapper((IUnknown*)this.d2D1Effect.Get(), this); - - // Register the effect factory, if necessary - EffectFactoryManager.Instance.EnsureEffectFactoryIsRegistered(); - - return true; - } - - /// - /// Updates the draw state for the currently realized effect. - /// - /// The current flags in use. - /// The target DPI in use. - /// The instance in use. - private void RefreshInputs(WIN2D_GET_D2D_IMAGE_FLAGS flags, float targetDpi, ID2D1DeviceContext* deviceContext) - { - for (int i = 0; i < Sources.Count; i++) - { - // Retrieve the managed wrapper for the current source - IGraphicsEffectSource? source = GetD2DInput(i); - - if (source is null) - { - // If the source is null and that is not valid here (eg. when drawing), just throw - default(InvalidOperationException).ThrowIf((flags & WIN2D_GET_D2D_IMAGE_FLAGS_ALLOW_NULL_EFFECT_INPUTS) == WIN2D_GET_D2D_IMAGE_FLAGS_NONE); - } - else - { - using ComPtr canvasImageInterop = default; - - // Convert to ICanvasImageInterop (this must always succeed, and throws if it doesn't) - RcwMarshaller.GetNativeInterface(source, canvasImageInterop.GetAddressOf()).Assert(); - - using ComPtr d2D1Image = default; - - float realizedDpi; - - // Invoke GetD2DImage on the underlying object (either a built-in effect or a custom one) - HRESULT hresult = canvasImageInterop.Get()->GetD2DImage( - device: this.canvasDevice.Get(), - deviceContext: deviceContext, - flags: flags, - targetDpi: targetDpi, - realizeDpi: &realizedDpi, - ppImage: d2D1Image.GetAddressOf()); - - // To match the behavior of ICanvasImageInternal::GetD2DImage in case of failure, check if the flags being used did have the flag - // WIN2D_GET_D2D_IMAGE_FLAGS_UNREALIZE_ON_FAILURE set. If not, and the call failed, then we explicitly throw from the returned HRESULT. - if ((flags & WIN2D_GET_D2D_IMAGE_FLAGS_UNREALIZE_ON_FAILURE) == WIN2D_GET_D2D_IMAGE_FLAGS_NONE) - { - Marshal.ThrowExceptionForHR(hresult); - } - - bool isDifferentResource = Sources.Storage[i].UpdateResource(d2D1Image.Get()); - - bool isDifferentDpi = ApplyDpiCompensation( - index: i, - d2D1Image: ref *&d2D1Image, - inputDpi: realizedDpi, - flags: flags, - targetDpi: targetDpi, - d2D1DeviceContext: deviceContext); - - // If the source or the DPI setting has changed, also update the D2D effect graph - if (isDifferentResource || isDifferentDpi) - { - this.d2D1Effect.Get()->SetInput(index: (uint)i, input: d2D1Image.Get()); - } - } - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.Properties.Interop.Sources.cs b/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.Properties.Interop.Sources.cs deleted file mode 100644 index e6624e05..00000000 --- a/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.Properties.Interop.Sources.cs +++ /dev/null @@ -1,365 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ABI.Microsoft.Graphics.Canvas; -using ComputeSharp.D2D1.Extensions; -#if WINDOWS_UWP -using ComputeSharp.D2D1.Uwp.Buffers; -using ComputeSharp.D2D1.Uwp.Extensions; -using ComputeSharp.D2D1.Uwp.Helpers; -#else -using ComputeSharp.D2D1.WinUI.Buffers; -using ComputeSharp.D2D1.WinUI.Extensions; -using ComputeSharp.D2D1.WinUI.Helpers; -#endif -using ComputeSharp.Interop; -using ComputeSharp.Win32; -using Windows.Graphics.Effects; -using static ABI.Microsoft.Graphics.Canvas.WIN2D_GET_D2D_IMAGE_FLAGS; -using static ABI.Microsoft.Graphics.Canvas.WIN2D_GET_DEVICE_ASSOCIATION_TYPE; -using static ComputeSharp.Win32.D2D1_BORDER_MODE; -using static ComputeSharp.Win32.D2D1_DPICOMPENSATION_INTERPOLATION_MODE; -using static ComputeSharp.Win32.D2D1_DPICOMPENSATION_PROP; -using static ComputeSharp.Win32.D2D1_PROPERTY_TYPE; - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp; -#else -namespace ComputeSharp.D2D1.WinUI; -#endif - -/// -unsafe partial class PixelShaderEffect -{ - /// - /// Gets the marshalled value for . - /// - /// The index of the source to get or set. - /// The marshalled value for . - private IGraphicsEffectSource? GetSource(int index) - { - using ReferenceTracker.Lease _0 = GetReferenceTracker().GetLease(); - - lock (this.lockObject) - { - return this.d2D1Effect.Get() switch - { - not null => GetD2DInput(index), - _ => Sources.Storage[index].GetWrapper() - }; - } - } - - /// - /// Sets the marshalled value for . - /// - /// The value to set for . - /// The index of the source to get or set. - private void SetSource(IGraphicsEffectSource? value, int index) - { - using ReferenceTracker.Lease _0 = GetReferenceTracker().GetLease(); - - lock (this.lockObject) - { - ref SourceReference source = ref Sources.Storage[index]; - - if (this.d2D1Effect.Get() is not null) - { - const WIN2D_GET_D2D_IMAGE_FLAGS flags = - WIN2D_GET_D2D_IMAGE_FLAGS_MINIMAL_REALIZATION | - WIN2D_GET_D2D_IMAGE_FLAGS_ALLOW_NULL_EFFECT_INPUTS | - WIN2D_GET_D2D_IMAGE_FLAGS_UNREALIZE_ON_FAILURE; - - // The WIN2D_GET_D2D_IMAGE_FLAGS_UNREALIZE_ON_FAILURE flag is passed, so we just let the effect - // unrealize in case of failure and take no other action (including throwing) if that happens. - _ = SetD2DInput(index, value, flags, targetDpi: 0.0f, d2D1DeviceContext: null); - } - else - { - source.SetWrapper(value); - } - } - } - - /// This method assumes a lock is taken and the effect is already realized. - /// - private IGraphicsEffectSource? GetD2DInput(int index) - { - using ComPtr d2D1Image = default; - - // Get the ID2D1Image input from the effect - this.d2D1Effect.Get()->GetInput( - index: (uint)index, - input: d2D1Image.GetAddressOf()); - - ref SourceReference sourceReference = ref Sources.Storage[index]; - - // Check whether the input had a DPI compensation effect added to it, and skip it if so - if (sourceReference.HasDpiCompensationEffect) - { - // Since a realized effect is the only source of authority for the effect state, we also - // need to check that the actual source is in fact the same that was previous set by the - // managed wrapper. If it is, we get the input and return that (ie. the underlying image). - // If not, we just return it directly and reset the locally stored DPI compensation effect. - if (d2D1Image.Get()->IsSameInstance(sourceReference.GetDpiCompensationEffect())) - { - sourceReference.GetDpiCompensationEffect()->GetInput(0, d2D1Image.ReleaseAndGetAddressOf()); - } - else - { - sourceReference.SetDpiCompensationEffect(null); - } - } - - // Get or create a wrapper for the input image - return sourceReference.GetOrCreateWrapper(this.canvasDevice.Get(), d2D1Image.Get()); - } - - /// The index of the source to get or set. - /// The value to set for . - /// The flags for . - /// The target DPI for the realized image, if present. - /// The input object to use, if present. - /// Whether the input was set successfully or not. - /// This method assumes a lock is taken and the effect is already realized. - /// - private bool SetD2DInput( - int index, - IGraphicsEffectSource? value, - WIN2D_GET_D2D_IMAGE_FLAGS flags, - float targetDpi, - ID2D1DeviceContext* d2D1DeviceContext) - { - using ComPtr d2D1Image = default; - - float realizedDpi = 0; - - if (value is not null) - { - using ComPtr canvasImageInterop = default; - - // Try to get the ICanvasImageInterop interface from the input source - HRESULT hresult = RcwMarshaller.GetNativeInterface(value, canvasImageInterop.GetAddressOf()); - - if (!Win32.Windows.SUCCEEDED(hresult)) - { - // Only potentially handle E_NOINTERFACE, always throw in other cases - if (hresult != E.E_NOINTERFACE) - { - Marshal.ThrowExceptionForHR(hresult); - } - - // If unrealization isn't requested for failures, just throw - default(InvalidOperationException).ThrowIf((flags & WIN2D_GET_D2D_IMAGE_FLAGS_UNREALIZE_ON_FAILURE) == WIN2D_GET_D2D_IMAGE_FLAGS_NONE); - - Unrealize(value, index); - - return false; - } - - using ComPtr sourceCanvasDevice = default; - - WIN2D_GET_DEVICE_ASSOCIATION_TYPE sourceCanvasDeviceType = WIN2D_GET_DEVICE_ASSOCIATION_TYPE_UNSPECIFIED; - - // Get the canvas device the source is realized on, if any, and its association type - canvasImageInterop.Get()->GetDevice(sourceCanvasDevice.GetAddressOf(), &sourceCanvasDeviceType).Assert(); - - // If the specified source is bound to a creation device, validate that this matches the one we are realized on. - // A "creation device" is a canvas device that is used to create the native resources in a given canvas image - // implementation, such that the canvas device and the canvas image are bound for the entire lifetime of the - // canvas image itself. This applies to eg. CanvasBitmap, which directly wraps some native memory allocated on - // a specific device. In these cases, if the associated device doesn't match the one this effect is currently - // realized on, that is an error and the source is invalid. - // - // Otherwise, the device returned here will depend on the specific implementation of this external effect. That is, - // it could be null for an unrealized effect, it could be null for a lazily initialized device-bound resource, or it - // could also be an already instantiated resource tied to a specific device. - // - // The only case where the device has to be an exact match is if the device is an owning device for the canvas image. - // In all other cases (including when the device is null), we can proceed to resolve the effects graph normally. This - // will allow sources to either just work in case the device matches, or unrealize and re-realize themselves on the - // new device if they were already realized on a different device (so that things would just work fine if someone was - // trying to draw a reused effect after a device lost event, for instance). In the niche scenario where a given source - // was some lazily-initialized instance that doesn't allow changing device after that, then the call to Get2D2Image - // on that specific source will just fail during the recursive traversal, but that couldn't be checked from here anyway. - if (sourceCanvasDeviceType == WIN2D_GET_DEVICE_ASSOCIATION_TYPE_CREATION_DEVICE && !this.canvasDevice.Get()->IsSameInstance(sourceCanvasDevice.Get())) - { - default(InvalidOperationException).ThrowIf((flags & WIN2D_GET_D2D_IMAGE_FLAGS_UNREALIZE_ON_FAILURE) == WIN2D_GET_D2D_IMAGE_FLAGS_NONE); - - Unrealize(value, index); - - return false; - } - - // Try to realize the image from the input source (this will recurse through the effect graph) - hresult = canvasImageInterop.Get()->GetD2DImage( - device: this.canvasDevice.Get(), - deviceContext: d2D1DeviceContext, - flags: flags, - targetDpi: targetDpi, - realizeDpi: &realizedDpi, - ppImage: d2D1Image.GetAddressOf()); - - // Unless requested, a failure to retrieve the image should just bubble up the HRESULT in an exception - if ((flags & WIN2D_GET_D2D_IMAGE_FLAGS_UNREALIZE_ON_FAILURE) == WIN2D_GET_D2D_IMAGE_FLAGS_NONE) - { - hresult.Assert(); - } - - // If no realized image is available, unrealize the effect - if (d2D1Image.Get() is null) - { - Unrealize(value, index); - - return false; - } - } - else if ((flags & WIN2D_GET_D2D_IMAGE_FLAGS_ALLOW_NULL_EFFECT_INPUTS) == WIN2D_GET_D2D_IMAGE_FLAGS_NONE) - { - // If the source is null and this is not explicitly allowed, the invocation is not valid - default(ArgumentNullException).Throw(nameof(value)); - } - - // Save the managed wrapper and realized image - Sources.Storage[index].SetWrapperAndResource(value, d2D1Image.Get()); - - // Handle DPI compensation (the return is ignored here as whether DPI compensation was applied doesn't matter) - _ = ApplyDpiCompensation( - index: index, - d2D1Image: ref *&d2D1Image, - inputDpi: realizedDpi, - flags: flags, - targetDpi: targetDpi, - d2D1DeviceContext: d2D1DeviceContext); - - // Set the actual effect input - this.d2D1Effect.Get()->SetInput(index: (uint)index, input: d2D1Image.Get()); - - return true; - } - - /// - /// Applies a DPI compensation effect onto a realized image, if needed. - /// - /// The index of the source being processed. - /// A reference to the realized source (this might be replaced if DPI compensation is added). - /// The input DPU for . - /// The flags for . - /// The target DPI for the realized image, if present. - /// The input object to use, if present. - /// Whether the DPI configuration has changed. - private bool ApplyDpiCompensation( - int index, - ref ComPtr d2D1Image, - float inputDpi, - WIN2D_GET_D2D_IMAGE_FLAGS flags, - float targetDpi, - ID2D1DeviceContext* d2D1DeviceContext) - { - ref SourceReference sourceReference = ref Sources.Storage[index]; - - bool isDpiCompensationNeeded; - - // Detemine whether DPI compensation is needed (direct port of Win2D's CanvasEffect::ApplyDpiCompensation) - if ((flags & WIN2D_GET_D2D_IMAGE_FLAGS_MINIMAL_REALIZATION) != WIN2D_GET_D2D_IMAGE_FLAGS_NONE) - { - // In minimal mode, we don't yet know the target DPI. For instance this occurs when setting an - // effect as the source of an image brush. We'll fix up later when the brush is drawn to a device - // context, at which point the real DPI is known. Since we don't yet know whether to include - // compensation, we just preserve the existing state. This avoids repeated recreation during - // set-draw-set-draw sequences. - isDpiCompensationNeeded = sourceReference.HasDpiCompensationEffect && (inputDpi != 0); - } - else - { - bool neverCompensate = (flags & WIN2D_GET_D2D_IMAGE_FLAGS_NEVER_INSERT_DPI_COMPENSATION) != WIN2D_GET_D2D_IMAGE_FLAGS_NONE; - bool alwaysCompensate = (flags & WIN2D_GET_D2D_IMAGE_FLAGS_ALWAYS_INSERT_DPI_COMPENSATION) != WIN2D_GET_D2D_IMAGE_FLAGS_NONE; - - // We need DPI compensation if: - // - The input has a fixed DPI - // - We were not told never to include it - // - Either we were told to always include it, or the input DPI is different from the target - isDpiCompensationNeeded = (inputDpi != 0) && !neverCompensate && (alwaysCompensate || (inputDpi != targetDpi)); - - // Early out if we are already in the right state - if (isDpiCompensationNeeded == sourceReference.HasDpiCompensationEffect) - { - return false; - } - } - - // Apply the determined DPI compensation configuration - if (isDpiCompensationNeeded) - { - using ComPtr d2D1EffectDpiCompensation = default; - - // Create an ID2D1Effect for the DPI compensation, if there isn't one already - if (!sourceReference.HasDpiCompensationEffect) - { - using (ComPtr d2D1DeviceContextEffective = default) - using (ComPtr d2D1DeviceContextLease = default) - { - // Just like when realizing the current effect, rent a device context from the pool if one is not available - this.canvasDevice.Get()->GetEffectiveD2DDeviceContextWithOptionalLease( - d2D1DeviceContext: d2D1DeviceContext, - d2D1DeviceContextEffective: d2D1DeviceContextEffective.GetAddressOf(), - d2D1DeviceContextLease: d2D1DeviceContextLease.GetAddressOf()); - - // Create the DPI compensation effect - d2D1DeviceContextEffective.Get()->CreateEffect( - effectId: (Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in CLSID.CLSID_D2D1DpiCompensation)), - effect: d2D1EffectDpiCompensation.GetAddressOf()).Assert(); - } - - D2D1_BORDER_MODE d2D1BorderMode = D2D1_BORDER_MODE_HARD; - D2D1_DPICOMPENSATION_INTERPOLATION_MODE d2D1DpiCompensationInterpolationMode = D2D1_DPICOMPENSATION_INTERPOLATION_MODE_LINEAR; - - // Set the border mode to hard - d2D1EffectDpiCompensation.Get()->SetValue( - index: (uint)D2D1_DPICOMPENSATION_PROP_BORDER_MODE, - type: D2D1_PROPERTY_TYPE_UNKNOWN, - data: (byte*)&d2D1BorderMode, - dataSize: sizeof(D2D1_BORDER_MODE)).Assert(); - - // Set the interpolation mode to linear - d2D1EffectDpiCompensation.Get()->SetValue( - index: (uint)D2D1_DPICOMPENSATION_PROP_INTERPOLATION_MODE, - type: D2D1_PROPERTY_TYPE_UNKNOWN, - data: (byte*)&d2D1DpiCompensationInterpolationMode, - dataSize: sizeof(D2D1_DPICOMPENSATION_INTERPOLATION_MODE)).Assert(); - - // Store the DPI effect for later use - sourceReference.SetDpiCompensationEffect(d2D1EffectDpiCompensation.Get()); - } - else - { - // Just reuse the existing DPI effect otherwise - d2D1EffectDpiCompensation.Attach(new ComPtr(sourceReference.GetDpiCompensationEffect()).Get()); - } - - // Set the input image as source for the DPI compensation effect - sourceReference.GetDpiCompensationEffect()->SetInput(index: (uint)index, input: d2D1Image.Get()); - - D2D_VECTOR_2F d2DVectorDpi; - d2DVectorDpi.x = inputDpi; - d2DVectorDpi.y = inputDpi; - - // Set the DPI setting - sourceReference.GetDpiCompensationEffect()->SetValue( - index: (uint)D2D1_DPICOMPENSATION_PROP_INPUT_DPI, - type: D2D1_PROPERTY_TYPE_UNKNOWN, - data: (byte*)&d2DVectorDpi, - dataSize: (uint)sizeof(D2D_VECTOR_2F)).Assert(); - - // Substitute the input image with the DPI compensation effect - d2D1EffectDpiCompensation.CopyTo(ref d2D1Image).Assert(); - } - else - { - // Ensure the existing effect is released, if present - sourceReference.SetDpiCompensationEffect(null); - } - - return true; - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.Properties.Interop.cs b/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.Properties.Interop.cs deleted file mode 100644 index 9cf76c11..00000000 --- a/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.Properties.Interop.cs +++ /dev/null @@ -1,243 +0,0 @@ -using System; -using ComputeSharp.D2D1.Interop; -#if WINDOWS_UWP -using ComputeSharp.D2D1.Uwp.Extensions; -#else -using ComputeSharp.D2D1.WinUI.Extensions; -#endif -using ComputeSharp.Interop; -using ComputeSharp.Win32; -using Microsoft.Graphics.Canvas; - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp; -#else -namespace ComputeSharp.D2D1.WinUI; -#endif - -/// -unsafe partial class PixelShaderEffect -{ - /// - /// Gets the marshalled value for . - /// - /// The marshalled value for . - private T GetConstantBuffer() - { - using ReferenceTracker.Lease _0 = GetReferenceTracker().GetLease(); - - lock (this.lockObject) - { - return this.d2D1Effect.Get() switch - { - not null => this.d2D1Effect.Get()->GetConstantBuffer(), - _ => this.constantBuffer - }; - } - } - - /// - /// Sets the marshalled value for . - /// - /// The value to set for . - private void SetConstantBuffer(in T value) - { - using ReferenceTracker.Lease _0 = GetReferenceTracker().GetLease(); - - lock (this.lockObject) - { - // If the effect is realized, set the property on the underlying ID2D1Effect object - if (this.d2D1Effect.Get() is not null) - { - this.d2D1Effect.Get()->SetConstantBuffer(in value); - } - else - { - // Otherwise, just store the value locally - this.constantBuffer = value; - } - } - } - - /// - /// Gets the marshalled value for . - /// - /// The marshalled value for . - private D2D1DrawTransformMapper? GetTransformMapper() - { - using ReferenceTracker.Lease _0 = GetReferenceTracker().GetLease(); - - lock (this.lockObject) - { - return this.d2D1Effect.Get() switch - { - not null => this.d2D1Effect.Get()->GetTransformMapper(), - _ => this.transformMapper - }; - } - } - - /// - /// Sets the marshalled value for . - /// - /// The value to set for . - private void SetTransformMapper(D2D1DrawTransformMapper value) - { - using ReferenceTracker.Lease _0 = GetReferenceTracker().GetLease(); - - lock (this.lockObject) - { - if (this.d2D1Effect.Get() is not null) - { - D2D1PixelShaderEffect.SetTransformMapperForD2D1Effect(this.d2D1Effect.Get(), value); - } - else - { - // If the effect is not realized, manually ensure the transform isn't null - default(ArgumentNullException).ThrowIfNull(value); - - this.transformMapper = value; - } - } - } - - /// - /// Gets the marshalled value for . - /// - /// The index of the source to get or set. - /// The marshalled value for . - private D2D1ResourceTextureManager? GetResourceTextureManager(int index) - { - using ReferenceTracker.Lease _0 = GetReferenceTracker().GetLease(); - - lock (this.lockObject) - { - D2D1ResourceTextureManager? resourceTextureManager = ResourceTextureManagers.Storage[index]; - - return this.d2D1Effect.Get() switch - { - not null => this.d2D1Effect.Get()->GetResourceTextureManager(resourceTextureManager, index), - _ => resourceTextureManager - }; - } - } - - /// - /// Sets the marshalled value for . - /// - /// The value to set for . - /// The index of the source to get or set. - private void SetResourceTextureManager(D2D1ResourceTextureManager value, int index) - { - using ReferenceTracker.Lease _0 = GetReferenceTracker().GetLease(); - - lock (this.lockObject) - { - if (this.d2D1Effect.Get() is not null) - { - D2D1PixelShaderEffect.SetResourceTextureManagerForD2D1Effect(this.d2D1Effect.Get(), value, index); - } - else - { - ResourceTextureManagers.Storage[index] = value; - } - } - } - - /// - /// Gets the marshalled value for . - /// - /// The marshalled value for . - private bool GetCacheOutput() - { - using ReferenceTracker.Lease _0 = GetReferenceTracker().GetLease(); - - lock (this.lockObject) - { - return this.d2D1Effect.Get() switch - { - not null => this.d2D1Effect.Get()->GetCachedProperty(), - _ => this.cacheOutput - }; - } - } - - /// - /// Sets the marshalled value for . - /// - /// The value to set for . - private void SetCacheOutput(bool value) - { - using ReferenceTracker.Lease _0 = GetReferenceTracker().GetLease(); - - lock (this.lockObject) - { - if (this.d2D1Effect.Get() is not null) - { - this.d2D1Effect.Get()->SetCachedProperty(value); - } - else - { - this.cacheOutput = value; - } - } - } - - /// - /// Gets the marshalled value for . - /// - /// The marshalled value for . - private CanvasBufferPrecision? GetBufferPrecision() - { - using ReferenceTracker.Lease _0 = GetReferenceTracker().GetLease(); - - lock (this.lockObject) - { - D2D1_BUFFER_PRECISION d2D1BufferPrecision = this.d2D1Effect.Get() switch - { - not null => this.d2D1Effect.Get()->GetPrecisionProperty(), - _ => this.d2D1BufferPrecision - }; - - // Map from D2D1_BUFFER_PRECISION to CanvasBufferPrecision, and return null for D2D1_BUFFER_PRECISION_UNKNOWN - return d2D1BufferPrecision switch - { - D2D1_BUFFER_PRECISION.D2D1_BUFFER_PRECISION_8BPC_UNORM => CanvasBufferPrecision.Precision8UIntNormalized, - D2D1_BUFFER_PRECISION.D2D1_BUFFER_PRECISION_8BPC_UNORM_SRGB => CanvasBufferPrecision.Precision8UIntNormalizedSrgb, - D2D1_BUFFER_PRECISION.D2D1_BUFFER_PRECISION_16BPC_UNORM => CanvasBufferPrecision.Precision16UIntNormalized, - D2D1_BUFFER_PRECISION.D2D1_BUFFER_PRECISION_16BPC_FLOAT => CanvasBufferPrecision.Precision16Float, - D2D1_BUFFER_PRECISION.D2D1_BUFFER_PRECISION_32BPC_FLOAT => CanvasBufferPrecision.Precision32Float, - _ => null - }; - } - } - - /// - /// Sets the marshalled value for . - /// - /// The value to set for . - private void SetBufferPrecision(CanvasBufferPrecision? value) - { - using ReferenceTracker.Lease _0 = GetReferenceTracker().GetLease(); - - lock (this.lockObject) - { - // Map back from CanvasBufferPrecision? to D2D1_BUFFER_PRECISION (null results in D2D1_BUFFER_PRECISION_UNKNOWN) - this.d2D1BufferPrecision = value switch - { - CanvasBufferPrecision.Precision8UIntNormalized => D2D1_BUFFER_PRECISION.D2D1_BUFFER_PRECISION_8BPC_UNORM, - CanvasBufferPrecision.Precision8UIntNormalizedSrgb => D2D1_BUFFER_PRECISION.D2D1_BUFFER_PRECISION_8BPC_UNORM_SRGB, - CanvasBufferPrecision.Precision16UIntNormalized => D2D1_BUFFER_PRECISION.D2D1_BUFFER_PRECISION_16BPC_UNORM, - CanvasBufferPrecision.Precision16Float => D2D1_BUFFER_PRECISION.D2D1_BUFFER_PRECISION_16BPC_FLOAT, - CanvasBufferPrecision.Precision32Float => D2D1_BUFFER_PRECISION.D2D1_BUFFER_PRECISION_32BPC_FLOAT, - _ => D2D1_BUFFER_PRECISION.D2D1_BUFFER_PRECISION_UNKNOWN - }; - - // If the effect is realized, set the property on the underlying ID2D1Effect object too - if (this.d2D1Effect.Get() is not null) - { - this.d2D1Effect.Get()->SetPrecisionProperty(this.d2D1BufferPrecision); - } - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.Properties.ResourceTextureManagerCollection.cs b/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.Properties.ResourceTextureManagerCollection.cs deleted file mode 100644 index 8b6ce3d3..00000000 --- a/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.Properties.ResourceTextureManagerCollection.cs +++ /dev/null @@ -1,270 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Collections.Immutable; -using System.Diagnostics.CodeAnalysis; -using System.Runtime.InteropServices; -using ComputeSharp.D2D1.Interop; -#if WINDOWS_UWP -using ComputeSharp.D2D1.Uwp.Buffers; -using ComputeSharp.D2D1.Uwp.Collections; -#else -using ComputeSharp.D2D1.WinUI.Buffers; -using ComputeSharp.D2D1.WinUI.Collections; -#endif - -#pragma warning disable CS8767 - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp; -#else -namespace ComputeSharp.D2D1.WinUI; -#endif - -/// -partial class PixelShaderEffect -{ - /// - /// Represents the collection of objects in a instance. - /// - /// - public sealed partial class ResourceTextureManagerCollection : IList, IReadOnlyList, IList, IFixedCountList - { - /// - /// The bitmask of valid indices for resource texture managers in the current shader type. - /// - private static readonly int IndexBitmask = GetIndexBitmask(); - - /// - /// The fixed buffer of instances. - /// - private ResourceTextureManagerBuffer fixedBuffer; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The owning instance. - internal ResourceTextureManagerCollection(PixelShaderEffect owner) - { - Owner = owner; - } - - /// - public int Count => Indices.Length; - - /// - /// Gets or sets the object at a specified index. - /// - /// The index of the source to get or set. - /// The object at the specified index. - /// Thrown if the value is set to . - /// Thrown if is not a valid index for the current effect. - [DisallowNull] - public D2D1ResourceTextureManager? this[int index] - { - get - { - default(ArgumentOutOfRangeException).ThrowIfNotInRange(index, 0, 16, nameof(index)); - default(ArgumentOutOfRangeException).ThrowIf((IndexBitmask & (1 << index)) == 0, nameof(index)); - - return Owner.GetResourceTextureManager(index); - } - set - { - default(ArgumentOutOfRangeException).ThrowIfNotInRange(index, 0, 16, nameof(index)); - default(ArgumentOutOfRangeException).ThrowIf((IndexBitmask & (1 << index)) == 0, nameof(index)); - default(ArgumentNullException).ThrowIfNull(value); - - Owner.SetResourceTextureManager(value, index); - } - } - - /// - object? IList.this[int index] - { - get => this[index]; - set => this[index] = (D2D1ResourceTextureManager?)value!; - } - - /// - /// Gets the collection of valid resource texture indices for the current effect. - /// - internal static ImmutableArray Indices { get; } = GetIndices(); - - /// - /// Gets the owning instance. - /// - internal PixelShaderEffect Owner { get; } - - /// - /// Gets a reference to the value containing the available -s. - /// - internal ref ResourceTextureManagerBuffer Storage => ref this.fixedBuffer; - - /// - ImmutableArray IFixedCountList.Indices => Indices; - - /// - bool ICollection.IsReadOnly => false; - - /// - bool IList.IsReadOnly => false; - - /// - bool IList.IsFixedSize => true; - - /// - bool ICollection.IsSynchronized => true; - - /// - object ICollection.SyncRoot => default(NotSupportedException).Throw(); - - /// - void ICollection.Add(D2D1ResourceTextureManager? item) - { - default(NotSupportedException).Throw(); - } - - /// - int IList.Add(object? value) - { - return default(NotSupportedException).Throw(); - } - - /// - void ICollection.Clear() - { - default(NotSupportedException).Throw(); - } - - /// - void IList.Clear() - { - default(NotSupportedException).Throw(); - } - - /// - bool ICollection.Contains(D2D1ResourceTextureManager? item) - { - return FixedCountList.IndexOf(this, item) != -1; - } - - /// - bool IList.Contains(object? value) - { - return FixedCountList.IndexOf(this, (D2D1ResourceTextureManager?)value) != -1; - } - - /// - void ICollection.CopyTo(D2D1ResourceTextureManager?[] array, int arrayIndex) - { - FixedCountList.CopyTo(this, array, arrayIndex); - } - - /// - void ICollection.CopyTo(Array array, int index) - { - FixedCountList.CopyTo(this, array, index); - } - - /// - IEnumerator IEnumerable.GetEnumerator() - { - return FixedCountList.GetEnumerator(this); - } - - /// - IEnumerator IEnumerable.GetEnumerator() - { - return FixedCountList.GetEnumerator(this); - } - - /// - int IList.IndexOf(D2D1ResourceTextureManager? item) - { - return FixedCountList.IndexOf(this, item); - } - - /// - int IList.IndexOf(object? value) - { - return FixedCountList.IndexOf(this, (D2D1ResourceTextureManager?)value); - } - - /// - void IList.Insert(int index, D2D1ResourceTextureManager? item) - { - default(NotSupportedException).Throw(); - } - - /// - void IList.Insert(int index, object? value) - { - default(NotSupportedException).Throw(); - } - - /// - bool ICollection.Remove(D2D1ResourceTextureManager? item) - { - return default(NotSupportedException).Throw(); - } - - /// - void IList.Remove(object? value) - { - default(NotSupportedException).Throw(); - } - - /// - void IList.RemoveAt(int index) - { - default(NotSupportedException).Throw(); - } - - /// - void IList.RemoveAt(int index) - { - default(NotSupportedException).Throw(); - } - - /// - /// Gets the bitmask of indices for resource textures in the target shader. - /// - /// The bitmask of indices for resource textures in the target shader. - private static int GetIndexBitmask() - { - int indexBitmask = 0; - - foreach (ref readonly D2D1ResourceTextureDescription description in T.ResourceTextureDescriptions.Span) - { - indexBitmask |= 1 << description.Index; - } - - return indexBitmask; - } - - /// - /// Gets the collection of valid indices for the current effect. - /// - /// The collection of valid indices for the current effect. - private static ImmutableArray GetIndices() - { - ReadOnlySpan descriptions = T.ResourceTextureDescriptions.Span; - - // Skip the array allocation if there are no resource texture descriptions - if (descriptions.IsEmpty) - { - return []; - } - - int[] indices = new int[descriptions.Length]; - - for (int i = 0; i < descriptions.Length; i++) - { - indices[i] = descriptions[i].Index; - } - - return ImmutableCollectionsMarshal.AsImmutableArray(indices); - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.Properties.SourceCollection.cs b/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.Properties.SourceCollection.cs deleted file mode 100644 index 036c1137..00000000 --- a/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.Properties.SourceCollection.cs +++ /dev/null @@ -1,240 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Collections.Immutable; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -#if WINDOWS_UWP -using ComputeSharp.D2D1.Uwp.Buffers; -using ComputeSharp.D2D1.Uwp.Collections; -#else -using ComputeSharp.D2D1.WinUI.Buffers; -using ComputeSharp.D2D1.WinUI.Collections; -#endif -using Windows.Graphics.Effects; - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp; -#else -namespace ComputeSharp.D2D1.WinUI; -#endif - -/// -partial class PixelShaderEffect -{ - /// - /// Represents the collection of sources in a instance. - /// - /// - public sealed partial class SourceCollection : IList, IReadOnlyList, IList, IFixedCountList - { - /// - /// The collection of valid resource texture indices for the current effect. - /// - private static readonly ImmutableArray Indices = GetIndices(); - - /// - /// The fixed buffer of instances. - /// - private GraphicsEffectSourceBuffer fixedBuffer; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The owning instance. - internal SourceCollection(PixelShaderEffect owner) - { - Owner = owner; - } - - /// - public int Count - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => T.InputCount; - } - - /// - public IGraphicsEffectSource? this[int index] - { - get - { - default(ArgumentOutOfRangeException).ThrowIfNotInRange(index, 0, T.InputCount, nameof(index)); - - return Owner.GetSource(index); - } - set - { - default(ArgumentOutOfRangeException).ThrowIfNotInRange(index, 0, T.InputCount, nameof(index)); - - Owner.SetSource(value, index); - } - } - - /// - object? IList.this[int index] - { - get => this[index]; - set => this[index] = (IGraphicsEffectSource?)value; - } - - /// - /// Gets the owning instance. - /// - internal PixelShaderEffect Owner { get; } - - /// - /// Gets a reference to the value containing the available -s. - /// - internal ref GraphicsEffectSourceBuffer Storage => ref this.fixedBuffer; - - /// - ImmutableArray IFixedCountList.Indices => Indices; - - /// - bool ICollection.IsReadOnly => false; - - /// - bool IList.IsReadOnly => false; - - /// - bool IList.IsFixedSize => true; - - /// - bool ICollection.IsSynchronized => true; - - /// - object ICollection.SyncRoot => default(NotSupportedException).Throw(); - - /// - void ICollection.Add(IGraphicsEffectSource? item) - { - default(NotSupportedException).Throw(); - } - - /// - int IList.Add(object? value) - { - return default(NotSupportedException).Throw(); - } - - /// - void ICollection.Clear() - { - default(NotSupportedException).Throw(); - } - - /// - void IList.Clear() - { - default(NotSupportedException).Throw(); - } - - /// - bool ICollection.Contains(IGraphicsEffectSource? item) - { - return FixedCountList.IndexOf(this, item) != -1; - } - - /// - bool IList.Contains(object? value) - { - return FixedCountList.IndexOf(this, (IGraphicsEffectSource?)value) != -1; - } - - /// - void ICollection.CopyTo(IGraphicsEffectSource?[] array, int arrayIndex) - { - FixedCountList.CopyTo(this, array, arrayIndex); - } - - /// - void ICollection.CopyTo(Array array, int index) - { - FixedCountList.CopyTo(this, array, index); - } - - /// - IEnumerator IEnumerable.GetEnumerator() - { - return FixedCountList.GetEnumerator(this); - } - - /// - IEnumerator IEnumerable.GetEnumerator() - { - return FixedCountList.GetEnumerator(this); - } - - /// - int IList.IndexOf(IGraphicsEffectSource? item) - { - return FixedCountList.IndexOf(this, item); - } - - /// - int IList.IndexOf(object? value) - { - return FixedCountList.IndexOf(this, (IGraphicsEffectSource?)value); - } - - /// - void IList.Insert(int index, IGraphicsEffectSource? item) - { - default(NotSupportedException).Throw(); - } - - /// - void IList.Insert(int index, object? value) - { - default(NotSupportedException).Throw(); - } - - /// - bool ICollection.Remove(IGraphicsEffectSource? item) - { - return default(NotSupportedException).Throw(); - } - - /// - void IList.Remove(object? value) - { - default(NotSupportedException).Throw(); - } - - /// - void IList.RemoveAt(int index) - { - default(NotSupportedException).Throw(); - } - - /// - void IList.RemoveAt(int index) - { - default(NotSupportedException).Throw(); - } - - /// - /// Gets the collection of valid indices for the current effect. - /// - /// The collection of valid indices for the current effect. - private static ImmutableArray GetIndices() - { - int inputCount = T.InputCount; - - if (inputCount == 0) - { - return []; - } - - int[] indices = new int[inputCount]; - - for (int i = 0; i < indices.Length; i++) - { - indices[i] = i; - } - - return ImmutableCollectionsMarshal.AsImmutableArray(indices); - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.Properties.cs b/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.Properties.cs deleted file mode 100644 index ad9487e6..00000000 --- a/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.Properties.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.Diagnostics.CodeAnalysis; -using ComputeSharp.D2D1.Interop; -using Microsoft.Graphics.Canvas; - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp; -#else -namespace ComputeSharp.D2D1.WinUI; -#endif - -/// -partial class PixelShaderEffect -{ - /// - /// Gets or sets the current value in use. - /// - public T ConstantBuffer - { - get => GetConstantBuffer(); - set => SetConstantBuffer(in value); - } - - /// - /// Gets or sets the instance to use for the effect, if any. - /// - /// Thrown if the value is set to . - [DisallowNull] - public D2D1DrawTransformMapper? TransformMapper - { - get => GetTransformMapper(); - set => SetTransformMapper(value); - } - - /// - public bool CacheOutput - { - get => GetCacheOutput(); - set => SetCacheOutput(value); - } - - /// - public CanvasBufferPrecision? BufferPrecision - { - get => GetBufferPrecision(); - set => SetBufferPrecision(value); - } - - /// - public string? Name { get; set; } - - /// - /// Gets the object associated with the current instance. - /// - public SourceCollection Sources { get; } - - /// - /// Gets the object associated with the current instance. - /// - public ResourceTextureManagerCollection ResourceTextureManagers { get; } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.ReferenceTracking.cs b/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.ReferenceTracking.cs deleted file mode 100644 index 927d097f..00000000 --- a/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.ReferenceTracking.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; -using ComputeSharp.Interop; -using System.Runtime.CompilerServices; -#if WINDOWS_UWP -using ComputeSharp.D2D1.Uwp.Helpers; -#else -using ComputeSharp.D2D1.WinUI.Helpers; -#endif -using ComputeSharp.Win32; - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp; -#else -namespace ComputeSharp.D2D1.WinUI; -#endif - -/// -partial class PixelShaderEffect -{ - /// - /// Releases unmanaged resources and performs other cleanup operations. - /// - ~PixelShaderEffect() - { - this.referenceTracker.Dispose(); - } - - /// - public void Dispose() - { - this.referenceTracker.Dispose(); - - GC.SuppressFinalize(this); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal ref ReferenceTracker GetReferenceTracker() - { - return ref this.referenceTracker; - } - - /// - ref ReferenceTracker IReferenceTrackedObject.GetReferenceTracker() - { - return ref this.referenceTracker; - } - - /// - unsafe void IReferenceTrackedObject.DangerousOnDispose() - { - // When the effect is disposed, we also unregister it from the resource manager cache. This - // is analogous to what is done when manually unrealizing the effect (eg. when using a new - // device). Without this call, the resource manager would keep registered effects alive for - // the entire process duration, even if their original wrappers are gone (ie. collected). - if (this.d2D1Effect.Get() is not null) - { - ResourceManager.UnregisterWrapper((IUnknown*)this.d2D1Effect.Get()); - } - - // Release the native D2D objects that were set during realization - this.canvasDevice.Dispose(); - this.d2D1RealizationDevice.Dispose(); - this.d2D1Effect.Dispose(); - - // Also release all native resources for the used sources. The transform mapper and - // resource texture managers don't need to be disposed, as those could be shared - // between effects. Note that SourceReference.Dispose() will only release the native - // resources (ie. D2D images and effects), but it will not also dispose the managed - // wrappers (ie. IGraphicsEffectSource objects), as those can be shared as well. - for (int i = 0; i < Sources.Count; i++) - { - Sources.Storage[i].Dispose(); - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.cs b/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.cs deleted file mode 100644 index abf04dc0..00000000 --- a/src/ComputeSharp.D2D1.UI/PixelShaderEffect{T}.cs +++ /dev/null @@ -1,83 +0,0 @@ -using ABI.Microsoft.Graphics.Canvas; -using ComputeSharp.D2D1.Descriptors; -using ComputeSharp.D2D1.Interop; -using ComputeSharp.Interop; -using ComputeSharp.Win32; -using Microsoft.Graphics.Canvas; -using Microsoft.Graphics.Canvas.Effects; -using ICanvasImageInterop = Microsoft.Graphics.Canvas.ICanvasImageInterop; - -#if WINDOWS_UWP -namespace ComputeSharp.D2D1.Uwp; -#else -namespace ComputeSharp.D2D1.WinUI; -#endif - -/// -/// A custom implementation powered by a supplied shader type. -/// -/// The type of shader to use to render frames. -public sealed partial class PixelShaderEffect : IReferenceTrackedObject, ICanvasEffect, ICanvasImageInterop - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor -{ - /// - /// The value for the current instance. - /// - private ReferenceTracker referenceTracker; - - /// - /// Lock object used to synchronize calls to APIs. - /// - private readonly object lockObject = new(); - - /// - /// Flag to track whether a given call is recursively invoked by , to avoid graph cycles. - /// - private volatile int isInsideGetD2DImage; - - /// - /// The current device the effect is realized on, if one is available (this is the underlying COM object for ). - /// - private ComPtr canvasDevice; - - /// - /// The underlying D2D1 device the effect is realized on, if one is available (this is the D2D device backing ). - /// - private ComPtr d2D1RealizationDevice; - - /// - /// The current realized , if one is available. - /// - private ComPtr d2D1Effect; - - /// - /// The backing field for . - /// - private T constantBuffer; - - /// - /// The backing field for . - /// - private D2D1DrawTransformMapper? transformMapper; - - /// - /// The backing field for . - /// - private bool cacheOutput; - - /// - /// The backing field for . - /// - private D2D1_BUFFER_PRECISION d2D1BufferPrecision; - - /// - /// Creates a new instance. - /// - public PixelShaderEffect() - { - using ReferenceTracker.Lease _0 = ReferenceTracker.Create(this, out this.referenceTracker); - - Sources = new SourceCollection(this); - ResourceTextureManagers = new ResourceTextureManagerCollection(this); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1.Uwp.CodeFixers/ComputeSharp.D2D1.Uwp.CodeFixers.csproj b/src/ComputeSharp.D2D1.Uwp.CodeFixers/ComputeSharp.D2D1.Uwp.CodeFixers.csproj deleted file mode 100644 index 725f187a..00000000 --- a/src/ComputeSharp.D2D1.Uwp.CodeFixers/ComputeSharp.D2D1.Uwp.CodeFixers.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - netstandard2.0 - $(DefineConstants);WINDOWS_UWP;D2D1_UI_SOURCE_GENERATOR - - - - - - - - - - - - diff --git a/src/ComputeSharp.D2D1.Uwp.SourceGenerators/AnalyzerReleases.Shipped.md b/src/ComputeSharp.D2D1.Uwp.SourceGenerators/AnalyzerReleases.Shipped.md deleted file mode 100644 index d1feb69c..00000000 --- a/src/ComputeSharp.D2D1.Uwp.SourceGenerators/AnalyzerReleases.Shipped.md +++ /dev/null @@ -1,17 +0,0 @@ -; Shipped analyzer releases -; https://github.com/dotnet/roslyn-analyzers/blob/master/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md - -## Release 1.0 - -### New Rules - -Rule ID | Category | Severity | Notes ---------|----------|----------|------- -CMPSD2DUWP0001 | ComputeSharp.D2D1.Uwp.Effects | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2DUWP0002 | ComputeSharp.D2D1.Uwp.Effects | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2DUWP0003 | ComputeSharp.D2D1.Uwp.Effects | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2DUWP0004 | ComputeSharp.D2D1.Uwp.Effects | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2DUWP0005 | ComputeSharp.D2D1.Uwp.Effects | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2DUWP0006 | ComputeSharp.D2D1.Uwp.Effects | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2DUWP0007 | ComputeSharp.D2D1.Uwp.Effects | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2DUWP0008 | ComputeSharp.D2D1.Uwp.Effects | Info | [Documentation](https://github.com/Sergio0694/ComputeSharp) diff --git a/src/ComputeSharp.D2D1.Uwp.SourceGenerators/AnalyzerReleases.Unshipped.md b/src/ComputeSharp.D2D1.Uwp.SourceGenerators/AnalyzerReleases.Unshipped.md deleted file mode 100644 index 6a6dd08d..00000000 --- a/src/ComputeSharp.D2D1.Uwp.SourceGenerators/AnalyzerReleases.Unshipped.md +++ /dev/null @@ -1,2 +0,0 @@ -; Unshipped analyzer release -; https://github.com/dotnet/roslyn-analyzers/blob/master/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md diff --git a/src/ComputeSharp.D2D1.Uwp.SourceGenerators/ComputeSharp.D2D1.Uwp.SourceGenerators.csproj b/src/ComputeSharp.D2D1.Uwp.SourceGenerators/ComputeSharp.D2D1.Uwp.SourceGenerators.csproj deleted file mode 100644 index 29b983fc..00000000 --- a/src/ComputeSharp.D2D1.Uwp.SourceGenerators/ComputeSharp.D2D1.Uwp.SourceGenerators.csproj +++ /dev/null @@ -1,26 +0,0 @@ - - - netstandard2.0 - $(DefineConstants);WINDOWS_UWP;D2D1_UI_SOURCE_GENERATOR - - - $(NoWarn);CS1574 - - - - - - - - - - - - - - - - - - - diff --git a/src/ComputeSharp.D2D1.Uwp/ComputeSharp.D2D1.Uwp.csproj b/src/ComputeSharp.D2D1.Uwp/ComputeSharp.D2D1.Uwp.csproj deleted file mode 100644 index d7bc70f3..00000000 --- a/src/ComputeSharp.D2D1.Uwp/ComputeSharp.D2D1.Uwp.csproj +++ /dev/null @@ -1,32 +0,0 @@ - - - net8.0-windows10.0.22621.0 - 10.0.17763.0 - true - x64;ARM64 - win-x64;win-arm64 - en-US - $(DefineConstants);WINDOWS_UWP - false - - - - - - $(NoWarn);CS0419 - $(NoWarn);IDE0065 - - - $(WarningsNotAsErrors);CS8002 - - - - - - - - - - - - diff --git a/src/ComputeSharp.D2D1.Uwp/ComputeSharp.D2D1.Uwp.targets b/src/ComputeSharp.D2D1.Uwp/ComputeSharp.D2D1.Uwp.targets deleted file mode 100644 index 6ce36516..00000000 --- a/src/ComputeSharp.D2D1.Uwp/ComputeSharp.D2D1.Uwp.targets +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - <_ComputeSharpD2D1UwpAnalyzer Include="@(Analyzer)" Condition="'%(Analyzer.NuGetPackageId)' == 'ComputeSharp.D2D1.Uwp'" /> - - - - - - - - - - - - - - - @(ComputeSharpD2D1UwpCurrentCompilerAssemblyIdentity->'%(Version)') - - - true - - - - - - - - - - - - - - - - - - - - - diff --git a/src/ComputeSharp.D2D1.Uwp/README.md b/src/ComputeSharp.D2D1.Uwp/README.md deleted file mode 100644 index 15c65a63..00000000 --- a/src/ComputeSharp.D2D1.Uwp/README.md +++ /dev/null @@ -1,9 +0,0 @@ -![ComputeSharp cover image](https://user-images.githubusercontent.com/10199417/108635546-3512ea00-7480-11eb-8172-99bc59f4eb6f.png) - -# Overview 📖 - -**ComputeSharp.D2D1.Uwp** is a UWP library with APIs to leverage D2D1 functionality with D2D1 pixel shaders powered by **ComputeSharp.D2D1**. You can refer to the [Win2D docs on custom effects](https://learn.microsoft.com/en-us/windows/apps/develop/win2d/custom-effects) to learn more about how to implement custom effects using the APIs provided by this package. - -# There's more! - -For a complete list of all features available in **ComputeSharp**, check the documentation in the [GitHub repo](https://github.com/Sergio0694/ComputeSharp). diff --git a/src/ComputeSharp.D2D1.WinUI.CodeFixers/ComputeSharp.D2D1.WinUI.CodeFixers.csproj b/src/ComputeSharp.D2D1.WinUI.CodeFixers/ComputeSharp.D2D1.WinUI.CodeFixers.csproj deleted file mode 100644 index f305ea87..00000000 --- a/src/ComputeSharp.D2D1.WinUI.CodeFixers/ComputeSharp.D2D1.WinUI.CodeFixers.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - netstandard2.0 - $(DefineConstants);D2D1_UI_SOURCE_GENERATOR - - - - - - - - - - - - diff --git a/src/ComputeSharp.D2D1.WinUI.SourceGenerators/AnalyzerReleases.Shipped.md b/src/ComputeSharp.D2D1.WinUI.SourceGenerators/AnalyzerReleases.Shipped.md deleted file mode 100644 index 6573ce3d..00000000 --- a/src/ComputeSharp.D2D1.WinUI.SourceGenerators/AnalyzerReleases.Shipped.md +++ /dev/null @@ -1,17 +0,0 @@ -; Shipped analyzer releases -; https://github.com/dotnet/roslyn-analyzers/blob/master/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md - -## Release 1.0 - -### New Rules - -Rule ID | Category | Severity | Notes ---------|----------|----------|------- -CMPSD2DWINUI0001 | ComputeSharp.D2D1.WinUI.Effects | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2DWINUI0002 | ComputeSharp.D2D1.WinUI.Effects | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2DWINUI0003 | ComputeSharp.D2D1.WinUI.Effects | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2DWINUI0004 | ComputeSharp.D2D1.WinUI.Effects | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2DWINUI0005 | ComputeSharp.D2D1.WinUI.Effects | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2DWINUI0006 | ComputeSharp.D2D1.WinUI.Effects | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2DWINUI0007 | ComputeSharp.D2D1.WinUI.Effects | Error | [Documentation](https://github.com/Sergio0694/ComputeSharp) -CMPSD2DWINUI0008 | ComputeSharp.D2D1.WinUI.Effects | Info | [Documentation](https://github.com/Sergio0694/ComputeSharp) diff --git a/src/ComputeSharp.D2D1.WinUI.SourceGenerators/AnalyzerReleases.Unshipped.md b/src/ComputeSharp.D2D1.WinUI.SourceGenerators/AnalyzerReleases.Unshipped.md deleted file mode 100644 index 6a6dd08d..00000000 --- a/src/ComputeSharp.D2D1.WinUI.SourceGenerators/AnalyzerReleases.Unshipped.md +++ /dev/null @@ -1,2 +0,0 @@ -; Unshipped analyzer release -; https://github.com/dotnet/roslyn-analyzers/blob/master/src/Microsoft.CodeAnalysis.Analyzers/ReleaseTrackingAnalyzers.Help.md diff --git a/src/ComputeSharp.D2D1.WinUI.SourceGenerators/ComputeSharp.D2D1.WinUI.SourceGenerators.csproj b/src/ComputeSharp.D2D1.WinUI.SourceGenerators/ComputeSharp.D2D1.WinUI.SourceGenerators.csproj deleted file mode 100644 index 338ece16..00000000 --- a/src/ComputeSharp.D2D1.WinUI.SourceGenerators/ComputeSharp.D2D1.WinUI.SourceGenerators.csproj +++ /dev/null @@ -1,26 +0,0 @@ - - - netstandard2.0 - $(DefineConstants);D2D1_UI_SOURCE_GENERATOR - - - $(NoWarn);CS1574 - - - - - - - - - - - - - - - - - - - diff --git a/src/ComputeSharp.D2D1.WinUI/ComputeSharp.D2D1.WinUI.csproj b/src/ComputeSharp.D2D1.WinUI/ComputeSharp.D2D1.WinUI.csproj deleted file mode 100644 index 72d5e97c..00000000 --- a/src/ComputeSharp.D2D1.WinUI/ComputeSharp.D2D1.WinUI.csproj +++ /dev/null @@ -1,34 +0,0 @@ - - - net8.0-windows10.0.22621.0 - 10.0.17763.0 - x64;ARM64 - win-x64;win-arm64 - - - - - - $(NoWarn);CS0419 - - - $(NoWarn);IDE0065 - - - - - - - - - - - - - - - diff --git a/src/ComputeSharp.D2D1.WinUI/ComputeSharp.D2D1.WinUI.targets b/src/ComputeSharp.D2D1.WinUI/ComputeSharp.D2D1.WinUI.targets deleted file mode 100644 index 792dd290..00000000 --- a/src/ComputeSharp.D2D1.WinUI/ComputeSharp.D2D1.WinUI.targets +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - <_ComputeSharpD2D1WinUIAnalyzer Include="@(Analyzer)" Condition="'%(Analyzer.NuGetPackageId)' == 'ComputeSharp.D2D1.WinUI'" /> - - - - - - - - - - - - - - - @(ComputeSharpD2D1WinUICurrentCompilerAssemblyIdentity->'%(Version)') - - - true - - - - - - - - - - - - - - - - - - - - - diff --git a/src/ComputeSharp.D2D1.WinUI/README.md b/src/ComputeSharp.D2D1.WinUI/README.md deleted file mode 100644 index 730d0043..00000000 --- a/src/ComputeSharp.D2D1.WinUI/README.md +++ /dev/null @@ -1,9 +0,0 @@ -![ComputeSharp cover image](https://user-images.githubusercontent.com/10199417/108635546-3512ea00-7480-11eb-8172-99bc59f4eb6f.png) - -# Overview 📖 - -**ComputeSharp.D2D1.WinUI** is a WinUI 3 library with APIs to leverage D2D1 functionality with D2D1 pixel shaders powered by **ComputeSharp.D2D1**. You can refer to the [Win2D docs on custom effects](https://learn.microsoft.com/en-us/windows/apps/develop/win2d/custom-effects) to learn more about how to implement custom effects using the APIs provided by this package. - -# There's more! - -For a complete list of all features available in **ComputeSharp**, check the documentation in the [GitHub repo](https://github.com/Sergio0694/ComputeSharp). \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Attributes/D2DCompileOptionsAttribute.cs b/src/ComputeSharp.D2D1/Attributes/D2DCompileOptionsAttribute.cs deleted file mode 100644 index bf27291f..00000000 --- a/src/ComputeSharp.D2D1/Attributes/D2DCompileOptionsAttribute.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; - -namespace ComputeSharp.D2D1; - -/// -/// An attribute that indicates the compile options that should be used when compiling a given D2D1 shader. -/// This applies when the shader is precompiled (through ) as well. -/// -/// This attribute can be used to annotate shader types as follows: -/// -/// [D2DCompileOptions(D2D1CompileOptions.IeeeStrictness | D2D1CompileOptions.OptimizationLevel3)] -/// struct MyShader : ID2D1PixelShader -/// { -/// } -/// -/// -/// -/// Note that the is always enabled automatically and does not need to be -/// specified. This option is mandatory, as the generated code to load the constant buffer from a shader assumes the layout -/// for matrix types is row major. For the same reason, using is not -/// allowed, as it would cause the constant buffer retrieved from a shader to be potentially incorrect. -/// -/// -/// This attribute can also be added to a whole assembly, and will be used by default if not overridden by a shader type. -/// -/// -/// The compile options to use to compile the shader. -[AttributeUsage(AttributeTargets.Struct | AttributeTargets.Assembly | AttributeTargets.Method, AllowMultiple = false)] -public sealed class D2DCompileOptionsAttribute(D2D1CompileOptions options) : Attribute -{ - /// - /// Gets the compile options to use to compile the shader. - /// - public D2D1CompileOptions Options { get; } = options; -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Attributes/D2DEffectAuthorAttribute.cs b/src/ComputeSharp.D2D1/Attributes/D2DEffectAuthorAttribute.cs deleted file mode 100644 index 924bc6d9..00000000 --- a/src/ComputeSharp.D2D1/Attributes/D2DEffectAuthorAttribute.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; - -namespace ComputeSharp.D2D1; - -/// -/// An attribute for a D2D1 shader indicating the author of the shader effect to create. -/// -/// -/// This only applies to effects created from . -/// -/// The value for the author. -[AttributeUsage(AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = false)] -public sealed class D2DEffectAuthorAttribute(string value) : Attribute -{ - /// - /// Gets the author value. - /// - public string Value { get; } = value; -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Attributes/D2DEffectCategoryAttribute.cs b/src/ComputeSharp.D2D1/Attributes/D2DEffectCategoryAttribute.cs deleted file mode 100644 index 646672d0..00000000 --- a/src/ComputeSharp.D2D1/Attributes/D2DEffectCategoryAttribute.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; - -namespace ComputeSharp.D2D1; - -/// -/// An attribute for a D2D1 shader indicating the category of the shader effect to create. -/// -/// -/// This only applies to effects created from . -/// -/// The value for the category. -[AttributeUsage(AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = false)] -public sealed class D2DEffectCategoryAttribute(string value) : Attribute -{ - /// - /// Gets the category value. - /// - public string Value { get; } = value; -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Attributes/D2DEffectDescriptionAttribute.cs b/src/ComputeSharp.D2D1/Attributes/D2DEffectDescriptionAttribute.cs deleted file mode 100644 index 19bd37e9..00000000 --- a/src/ComputeSharp.D2D1/Attributes/D2DEffectDescriptionAttribute.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; - -namespace ComputeSharp.D2D1; - -/// -/// An attribute for a D2D1 shader indicating the description of the shader effect to create. -/// -/// -/// This only applies to effects created from . -/// -/// The value for the description. -[AttributeUsage(AttributeTargets.Struct, AllowMultiple = false)] -public sealed class D2DEffectDescriptionAttribute(string value) : Attribute -{ - /// - /// Gets the description value. - /// - public string Value { get; } = value; -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Attributes/D2DEffectDisplayNameAttribute.cs b/src/ComputeSharp.D2D1/Attributes/D2DEffectDisplayNameAttribute.cs deleted file mode 100644 index 35046822..00000000 --- a/src/ComputeSharp.D2D1/Attributes/D2DEffectDisplayNameAttribute.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; - -namespace ComputeSharp.D2D1; - -/// -/// An attribute for a D2D1 shader indicating the display name of the shader effect to create. -/// -/// -/// This only applies to effects created from . -/// -/// The value for the display name. -[AttributeUsage(AttributeTargets.Struct, AllowMultiple = false)] -public sealed class D2DEffectDisplayNameAttribute(string value) : Attribute -{ - /// - /// Gets the display name value. - /// - public string Value { get; } = value; -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Attributes/D2DEffectIdAttribute.cs b/src/ComputeSharp.D2D1/Attributes/D2DEffectIdAttribute.cs deleted file mode 100644 index 46b0eccf..00000000 --- a/src/ComputeSharp.D2D1/Attributes/D2DEffectIdAttribute.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; - -namespace ComputeSharp.D2D1; - -/// -/// An attribute for a D2D1 shader indicating the id of the shader effect to create. -/// -/// -/// This only applies to effects created from . -/// -/// The value for the effect id. -[AttributeUsage(AttributeTargets.Struct, AllowMultiple = false)] -public sealed class D2DEffectIdAttribute(string value) : Attribute -{ - /// - /// Gets the effect id value. - /// - public Guid Value { get; } = Guid.Parse(value); -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Attributes/D2DEnableRuntimeCompilation.cs b/src/ComputeSharp.D2D1/Attributes/D2DEnableRuntimeCompilation.cs deleted file mode 100644 index 503bf6fe..00000000 --- a/src/ComputeSharp.D2D1/Attributes/D2DEnableRuntimeCompilation.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; - -namespace ComputeSharp.D2D1; - -/// -/// An attribute that indicates that runtime compilation of D2D shaders is enabled. -/// This attribute is required for all shaders that are not compiled at build time. -/// -/// -/// -/// Precompiling shaders at build time is recommended, as it enables additional validation -/// and diagnostics, and provides better performance at runtime when dispatching the shaders. -/// -/// -/// This option can be used in advanced scenarios, for instance when trying to minimize -/// binary size (which should only be done after carefully measuring the actual difference). -/// -/// -/// Note that not using this attribute does not mean that trying to compile shaders at runtime will -/// fail. The purpose of this attribute is to allow declaring shader types that are not precompiled. -/// All other features, such as manually compiling a shader type with specific compile options or -/// with a different shader profile, or manually compiling a shader from source at runtime, are -/// always supported, regardless of whether nor not this attribute is used. -/// -/// -[AttributeUsage(AttributeTargets.Struct | AttributeTargets.Assembly, AllowMultiple = false)] -public sealed class D2DEnableRuntimeCompilationAttribute : Attribute; \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Attributes/D2DGeneratedPixelShaderDescriptorAttribute.cs b/src/ComputeSharp.D2D1/Attributes/D2DGeneratedPixelShaderDescriptorAttribute.cs deleted file mode 100644 index 92c531b3..00000000 --- a/src/ComputeSharp.D2D1/Attributes/D2DGeneratedPixelShaderDescriptorAttribute.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; - -namespace ComputeSharp.D2D1; - -/// -/// An attribute that indicates that a given D2D1 shader should have its associated descriptor code being generated. -/// -/// This attribute can be used on shader types that are declared as : -/// -/// [D2DGeneratedPixelShaderDescriptor] -/// partial struct MyShader : ID2D1PixelShader -/// { -/// } -/// -/// -/// -/// When a shader is annotated with , the source generator will also add -/// to its implemented interfaces, and implement its APIs automatically. -/// -/// -[AttributeUsage(AttributeTargets.Struct, AllowMultiple = false)] -public sealed class D2DGeneratedPixelShaderDescriptorAttribute : Attribute; \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Attributes/D2DInputComplexAttribute.cs b/src/ComputeSharp.D2D1/Attributes/D2DInputComplexAttribute.cs deleted file mode 100644 index de52a0b1..00000000 --- a/src/ComputeSharp.D2D1/Attributes/D2DInputComplexAttribute.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; - -namespace ComputeSharp.D2D1; - -/// -/// An attribute for a D2D1 shader indicating that an input resource at a specified index uses complex sampling. -/// This attribute is optional, and not using it will cause inputs to default to complex sampling as well. -/// -/// -/// This attribute directly maps to #define D2D_INPUT<N>_COMPLEX. -/// For more info, see . -/// -/// The index of the resource to declare as using complex sampling. -[AttributeUsage(AttributeTargets.Struct, AllowMultiple = true)] -public sealed class D2DInputComplexAttribute(int index) : Attribute -{ - /// - /// Gets the index of the resource declared as using complex sampling. - /// - public int Index { get; } = index; -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Attributes/D2DInputCountAttribute.cs b/src/ComputeSharp.D2D1/Attributes/D2DInputCountAttribute.cs deleted file mode 100644 index db472c14..00000000 --- a/src/ComputeSharp.D2D1/Attributes/D2DInputCountAttribute.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; - -namespace ComputeSharp.D2D1; - -/// -/// An attribute for a D2D1 shader indicating the number of texture inputs for the shader. -/// Using this attribute is mandatory when defining a D2D1 shader. -/// -/// -/// This attribute directly maps to #define D2D_INPUT_COUNT <N>. -/// For more info, see . -/// -/// The number of texture inputs for the shader. -[AttributeUsage(AttributeTargets.Struct, AllowMultiple = false)] -public sealed class D2DInputCountAttribute(int count) : Attribute -{ - /// - /// Gets the number of texture inputs for the shader. - /// - public int Count { get; } = count; -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Attributes/D2DInputDescriptionAttribute.cs b/src/ComputeSharp.D2D1/Attributes/D2DInputDescriptionAttribute.cs deleted file mode 100644 index b2ea705a..00000000 --- a/src/ComputeSharp.D2D1/Attributes/D2DInputDescriptionAttribute.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; - -namespace ComputeSharp.D2D1; - -/// -/// An attribute for a D2D1 shader indicating the description of a given input resource. -/// This attribute is optional, and not using it will cause no description to be declared. -/// -/// -/// This attribute exposes the options that can be set via D2D1_INPUT_DESCRIPTION. -/// For more info, see . -/// -/// The index of the resource to declare the description for. -/// The type of filter to apply to the input texture. -[AttributeUsage(AttributeTargets.Struct, AllowMultiple = true)] -public sealed class D2DInputDescriptionAttribute(int index, D2D1Filter filter) : Attribute -{ - /// - /// Gets the index of the resource to declare the description for. - /// - public int Index { get; } = index; - - /// - /// Gets the type of filter to apply to the input texture. - /// - public D2D1Filter Filter { get; } = filter; - - /// - /// Gets the mip level to retrieve from the upstream transform, if specified. - /// - public int LevelOfDetailCount { get; init; } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Attributes/D2DInputSimpleAttribute.cs b/src/ComputeSharp.D2D1/Attributes/D2DInputSimpleAttribute.cs deleted file mode 100644 index 484ed9ee..00000000 --- a/src/ComputeSharp.D2D1/Attributes/D2DInputSimpleAttribute.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System; - -namespace ComputeSharp.D2D1; - -/// -/// An attribute for a D2D1 shader indicating that an input resource at a specified index uses simple -/// sampling. This attribute is optional, and not using it will cause inputs to default to complex sampling. -/// -/// -/// This attribute directly maps to #define D2D_INPUT<N>_SIMPLE. -/// For more info, see . -/// -/// The index of the resource to declare as using simple sampling. -[AttributeUsage(AttributeTargets.Struct, AllowMultiple = true)] -public sealed class D2DInputSimpleAttribute(int index) : Attribute -{ - /// - /// Gets the index of the resource declared as using simple sampling. - /// - public int Index { get; } = index; -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Attributes/D2DOutputBufferAttribute.cs b/src/ComputeSharp.D2D1/Attributes/D2DOutputBufferAttribute.cs deleted file mode 100644 index 5a206a5f..00000000 --- a/src/ComputeSharp.D2D1/Attributes/D2DOutputBufferAttribute.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System; - -namespace ComputeSharp.D2D1; - -/// -/// An attribute for a D2D1 shader with a description on the resulting output buffer. -/// Using this attribute is optional when defining a D2D1 shader. -/// -/// -/// For more info, see . -/// -[AttributeUsage(AttributeTargets.Struct, AllowMultiple = false)] -public sealed class D2DOutputBufferAttribute : Attribute -{ - /// - /// Creates a new instance of the type with the specified arguments. - /// - /// The buffer precision for the resulting output buffer. - public D2DOutputBufferAttribute(D2D1BufferPrecision bufferPrecision) - { - BufferPrecision = bufferPrecision; - } - - /// - /// Creates a new instance of the type with the specified arguments. - /// - /// The channel depth for the resulting output buffer. - public D2DOutputBufferAttribute(D2D1ChannelDepth channelDepth) - { - ChannelDepth = channelDepth; - } - - /// - /// Creates a new instance of the type with the specified arguments. - /// - /// The buffer precision for the resulting output buffer. - /// The channel depth for the resulting output buffer. - public D2DOutputBufferAttribute(D2D1BufferPrecision bufferPrecision, D2D1ChannelDepth channelDepth) - { - BufferPrecision = bufferPrecision; - ChannelDepth = channelDepth; - } - - /// - /// Gets the buffer precision for the resulting output buffer. - /// - public D2D1BufferPrecision BufferPrecision { get; } - - /// - /// Gets the channel depth for the resulting output buffer. - /// - public D2D1ChannelDepth ChannelDepth { get; } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Attributes/D2DPixelOptionsAttribute.cs b/src/ComputeSharp.D2D1/Attributes/D2DPixelOptionsAttribute.cs deleted file mode 100644 index f410980a..00000000 --- a/src/ComputeSharp.D2D1/Attributes/D2DPixelOptionsAttribute.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; - -namespace ComputeSharp.D2D1; - -/// -/// An attribute for a D2D1 shader indicating the pixel options to use. -/// Using this attribute is optional when defining a D2D1 shader. -/// -/// -/// For more info, see . -/// -/// The options to specify for the shader. -[AttributeUsage(AttributeTargets.Struct, AllowMultiple = false)] -public sealed class D2DPixelOptionsAttribute(D2D1PixelOptions options) : Attribute -{ - /// - /// Gets the options to specify for the shader. - /// - public D2D1PixelOptions Options { get; } = options; -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Attributes/D2DPixelShaderSourceAttribute.cs b/src/ComputeSharp.D2D1/Attributes/D2DPixelShaderSourceAttribute.cs deleted file mode 100644 index f1887143..00000000 --- a/src/ComputeSharp.D2D1/Attributes/D2DPixelShaderSourceAttribute.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Diagnostics.CodeAnalysis; - -namespace ComputeSharp.D2D1; - -/// -/// An attribute that indicates that a given D2D1 shader should be precompiled at build time and embedded -/// directly into the containing assembly as static bytecode, to be retrieved as a . -/// -/// This attribute can be used to annotate methods as follows: -/// -/// [D2DPixelShaderSource(""" -/// #define D2D_INPUT_COUNT 1 -/// #define D2D_INPUT0_SIMPLE -/// -/// #include ""d2d1effecthelpers.hlsli"" -/// -/// D2D_PS_ENTRY(PSMain) -/// { -/// float4 color = D2DGetInput(0); -/// float3 rgb = saturate(1.0 - color.rgb); -/// return float4(rgb, 1); -/// } -/// """)] -/// static partial ReadOnlySpan<byte> GetBytecode(); -/// -/// -/// -/// -/// -/// Methods can also be annotated with and -/// to further customize the shader profile to use when compiling the HLSL source, and the compile options to use. -/// -/// -/// The number of texture inputs for the shader. -[AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] -public sealed class D2DPixelShaderSourceAttribute([StringSyntax("Hlsl")] string hlslSource) : Attribute -{ - /// - /// Gets the number of texture inputs for the shader. - /// - public string HlslSource { get; } = hlslSource; -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Attributes/D2DRequiresDoublePrecisionSupportAttribute.cs b/src/ComputeSharp.D2D1/Attributes/D2DRequiresDoublePrecisionSupportAttribute.cs deleted file mode 100644 index dde64edd..00000000 --- a/src/ComputeSharp.D2D1/Attributes/D2DRequiresDoublePrecisionSupportAttribute.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; - -namespace ComputeSharp.D2D1; - -/// -/// An attribute for a D2D1 shader indicating that the shader requires support for double precision operations. -/// -/// -/// -/// This attribute does not map to any HLSL feature or compile option directly, but it is needed to make using double -/// precision operations opt-in. It is easy to accidentally introduce them in a shader when that is not intented, and -/// doing so can make the shader run slower and not being compatible with some GPUs (eg. many arm64 GPUs lack support -/// for double precision operations). To avoid this, support is disabled by default, and it is necessary to add this -/// attribute over a shader type to explicitly allow using these operations. -/// -/// -/// Validation can only be performed when the shader is being precompiled. If that is not the case (ie. if the shader -/// is using and not ), then -/// no build time check for double precision operations can be done. Using this attribute in that scenarios is not valid. -/// -/// -[AttributeUsage(AttributeTargets.Struct, AllowMultiple = false)] -public sealed class D2DRequiresDoublePrecisionSupportAttribute : Attribute; \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Attributes/D2DRequiresScenePositionAttribute.cs b/src/ComputeSharp.D2D1/Attributes/D2DRequiresScenePositionAttribute.cs deleted file mode 100644 index fb4ecb2e..00000000 --- a/src/ComputeSharp.D2D1/Attributes/D2DRequiresScenePositionAttribute.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace ComputeSharp.D2D1; - -/// -/// An attribute for a D2D1 shader indicating that the shader function calls helper methods that use the scene position -/// value (that is, ). This parameter should only be included when necessary, since -/// only one function per linked shader can utilize this parameter. Defining this value is optional. -/// -/// -/// This attribute directly maps to #define D2D_REQUIRES_SCENE_POSITION. -/// For more info, see . -/// -[AttributeUsage(AttributeTargets.Struct, AllowMultiple = false)] -public sealed class D2DRequiresScenePositionAttribute : Attribute; \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Attributes/D2DResourceTextureIndexAttribute.cs b/src/ComputeSharp.D2D1/Attributes/D2DResourceTextureIndexAttribute.cs deleted file mode 100644 index fa487717..00000000 --- a/src/ComputeSharp.D2D1/Attributes/D2DResourceTextureIndexAttribute.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; - -namespace ComputeSharp.D2D1; - -/// -/// An attribute for resource fields in a D2D1 shader indicating the index of the D2D1 resource texture. -/// This is needed to bind an input resource in a shader to the correct input. Using this attribute is mandatory. -/// -/// -/// For more info, see . -/// -/// The index of the annotated resource field. -[AttributeUsage(AttributeTargets.Field, AllowMultiple = false)] -public sealed class D2DResourceTextureIndexAttribute(int index) : Attribute -{ - /// - /// Gets the index of the annotated resource field. - /// - public int Index { get; } = index; -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Attributes/D2DShaderProfileAttribute.cs b/src/ComputeSharp.D2D1/Attributes/D2DShaderProfileAttribute.cs deleted file mode 100644 index 93c30a5e..00000000 --- a/src/ComputeSharp.D2D1/Attributes/D2DShaderProfileAttribute.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; - -namespace ComputeSharp.D2D1; - -/// -/// An attribute that indicates that a given D2D1 shader should be precompiled at build time using a specific shader -/// profile and embedded directly into the containing assembly as static bytecode, to avoid compiling it at runtime. -/// -/// This attribute can be used to annotate shader types as follows: -/// -/// [D2DShaderProfile(D2D1ShaderProfile.PixelShader50)] -/// struct MyShader : ID2D1PixelShader -/// { -/// } -/// -/// -/// -/// -/// -/// The runtime compilation will automatically be skipped if the shader bytecode is then retrieved using a matching profile, -/// otherwise the usual runtime compilation will be used as fallback (or an exception will be thrown, depending on the API). -/// -/// -/// This attribute can also be added to a whole assembly, and will be used by default if not overridden by a shader type. -/// -/// -/// The target shader profile to use to compile the shader. -[AttributeUsage(AttributeTargets.Struct | AttributeTargets.Assembly | AttributeTargets.Method, AllowMultiple = false)] -public sealed class D2DShaderProfileAttribute(D2D1ShaderProfile shaderProfile) : Attribute -{ - /// - /// The shader profile used to compile the annotated D2D1 pixel shader. - /// - public D2D1ShaderProfile ShaderProfile { get; } = shaderProfile; -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Attributes/Enums/D2D1BufferPrecision.cs b/src/ComputeSharp.D2D1/Attributes/Enums/D2D1BufferPrecision.cs deleted file mode 100644 index bf2da03c..00000000 --- a/src/ComputeSharp.D2D1/Attributes/Enums/D2D1BufferPrecision.cs +++ /dev/null @@ -1,47 +0,0 @@ -#if SOURCE_GENERATOR -using static Windows.Win32.Graphics.Direct2D.D2D1_BUFFER_PRECISION; -#else -using static ComputeSharp.Win32.D2D1_BUFFER_PRECISION; -#endif - -namespace ComputeSharp.D2D1; - -/// -/// Indicates the bit depth to use in the imaging pipeline in Direct2D to produce the result of a D2D1 shader. -/// -/// -/// This type exposes the available values in . -/// For more info, see . -/// -public enum D2D1BufferPrecision -{ - /// - /// The buffer precision is not specified. - /// - Unknown = (int)D2D1_BUFFER_PRECISION_UNKNOWN, - - /// - /// The buffer precision uses 8-bit normalized integer values per channel. - /// - UInt8Normalized = (int)D2D1_BUFFER_PRECISION_8BPC_UNORM, - - /// - /// The buffer precision uses 8-bit normalized integer values per channel with standard RGB data. - /// - UInt8NormalizedSrgb = (int)D2D1_BUFFER_PRECISION_8BPC_UNORM_SRGB, - - /// - /// The buffer precision uses 16-bit normalized integer values per channel. - /// - UInt16Normalized = (int)D2D1_BUFFER_PRECISION_16BPC_UNORM, - - /// - /// The buffer precision uses 16-bit float values per channel. - /// - Float16 = (int)D2D1_BUFFER_PRECISION_16BPC_FLOAT, - - /// - /// The buffer precision uses 32-bit float values per channel. - /// - Float32 = (int)D2D1_BUFFER_PRECISION_32BPC_FLOAT -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Attributes/Enums/D2D1ChannelDepth.cs b/src/ComputeSharp.D2D1/Attributes/Enums/D2D1ChannelDepth.cs deleted file mode 100644 index aa9f897e..00000000 --- a/src/ComputeSharp.D2D1/Attributes/Enums/D2D1ChannelDepth.cs +++ /dev/null @@ -1,32 +0,0 @@ -#if SOURCE_GENERATOR -using static Windows.Win32.Graphics.Direct2D.D2D1_CHANNEL_DEPTH; -#else -using static ComputeSharp.Win32.D2D1_CHANNEL_DEPTH; -#endif - -namespace ComputeSharp.D2D1; - -/// -/// Indicates the channel depth of a stage in a Direct2D rendering pipeline. -/// -/// -/// This type exposes the available values in . -/// For more info, see . -/// -public enum D2D1ChannelDepth -{ - /// - /// The channel depth is the default, and it will be inherited from the inputs. - /// - Default = (int)D2D1_CHANNEL_DEPTH_DEFAULT, - - /// - /// The channel depth is 1. - /// - One = (int)D2D1_CHANNEL_DEPTH_1, - - /// - /// The channel depth is 4. - /// - Four = (int)D2D1_CHANNEL_DEPTH_4 -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Attributes/Enums/D2D1CompileOptions.cs b/src/ComputeSharp.D2D1/Attributes/Enums/D2D1CompileOptions.cs deleted file mode 100644 index 0f3bc559..00000000 --- a/src/ComputeSharp.D2D1/Attributes/Enums/D2D1CompileOptions.cs +++ /dev/null @@ -1,203 +0,0 @@ -using System; -#if SOURCE_GENERATOR -using D3DCOMPILE = Windows.Win32.PInvoke; -#else -using ComputeSharp.D2D1.Interop; -using ComputeSharp.Win32; - -#pragma warning disable IDE0004 -#endif - -namespace ComputeSharp.D2D1; - -/// -/// Flags to control the options that can be used to compile a D2D1 shader. -/// -/// -/// For more info, see For more info, see . -/// -[Flags] -public enum D2D1CompileOptions -{ - /// - /// Directs the compiler to insert debug file/line/type/symbol information into the output code. - /// - /// - /// This flag maps to D3DCOMPILE_DEBUG and /Zi. - /// - Debug = (int)D3DCOMPILE.D3DCOMPILE_DEBUG, - - /// - /// Directs the compiler not to validate the generated code against known capabilities and constraints. - /// This option should only be used with shaders that have been successfully compiled in the past. - /// DirectX always validates shaders before it sets them to a device. - /// - /// - /// This flag maps to D3DCOMPILE_SKIP_VALIDATION and /Vd. - /// - SkipValidation = (int)D3DCOMPILE.D3DCOMPILE_SKIP_VALIDATION, - - /// - /// Directs the compiler to skip optimization steps during code generation. - /// This option should only be used for debug purposes. - /// - /// - /// This flag maps to D3DCOMPILE_SKIP_OPTIMIZATION and /Od. - /// - SkipOptimization = (int)D3DCOMPILE.D3DCOMPILE_SKIP_OPTIMIZATION, - - /// - /// Directs the compiler to pack matrices in row-major order on input and output from the shader. - /// - /// - /// This value is needed to have the constant buffer loading from generated shaders map to compiled shaders. - /// This flag maps to D3DCOMPILE_PACK_MATRIX_ROW_MAJOR and /Zpr. - /// - PackMatrixRowMajor = (int)D3DCOMPILE.D3DCOMPILE_PACK_MATRIX_ROW_MAJOR, - - /// - /// Directs the compiler to pack matrices in column-major order on input and output from the shader. - /// This type of packing is generally more efficient because a series of dot-products can then - /// perform vector-matrix multiplication. - /// - /// - /// Using this flag makes shaders incompatible with the constant buffer loading code produced by ComputeSharp.D2D1. - /// That is, trying to load a constant buffer from a shader processed by the source generator is undefined behavior. - /// This flag maps to D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR and /Zpc. - /// - PackMatrixColumnMajor = (int)D3DCOMPILE.D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR, - - /// - /// Directs the compiler to perform all computations with partial precision. - /// If this flag is set, the compiled code might run faster on some hardware. - /// - /// - /// This flag maps to D3DCOMPILE_PARTIAL_PRECISION and /Gpp. - /// - PartialPrecision = (int)D3DCOMPILE.D3DCOMPILE_PARTIAL_PRECISION, - - /// - /// Directs the compiler to not use flow-control constructs where possible. - /// - /// - /// This flag maps to D3DCOMPILE_AVOID_FLOW_CONTROL and /Gfa. - /// - AvoidFlowControl = (int)D3DCOMPILE.D3DCOMPILE_AVOID_FLOW_CONTROL, - - /// - /// Forces strict compile, which might not allow for legacy syntax. - /// By default, the compiler disables strictness on deprecated syntax. - /// - /// - /// This flag maps to D3DCOMPILE_ENABLE_STRICTNESS and /Ges. - /// - EnableStrictness = (int)D3DCOMPILE.D3DCOMPILE_ENABLE_STRICTNESS, - - /// - /// Forces the IEEE strict compile which avoids optimizations that may break IEEE rules. - /// - /// - /// This flag maps to D3DCOMPILE_IEEE_STRICTNESS and /Gis. - /// - IeeeStrictness = (int)D3DCOMPILE.D3DCOMPILE_IEEE_STRICTNESS, - - /// - /// Directs the compiler to enable older shaders to compile to 5_0 targets. - /// - /// - /// This flag maps to D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY and /Gec. - /// - EnableBackwardsCompatibility = (int)D3DCOMPILE.D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY, - - /// - /// Directs the compiler to use the lowest optimization level. If this option is set, the compiler - /// might produce slower code but produces the code more quickly. This option should be set when - /// shaders are developed iteratively, as it can reduce compilation times. - /// - /// - /// This flag maps to D3DCOMPILE_OPTIMIZATION_LEVEL0 and /O0. - /// - OptimizationLevel0 = (int)D3DCOMPILE.D3DCOMPILE_OPTIMIZATION_LEVEL0, - - /// - /// Directs the compiler to use the second lowest optimization level. - /// - /// - /// This flag maps to D3DCOMPILE_OPTIMIZATION_LEVEL1 and /O1. - /// - OptimizationLevel1 = (int)D3DCOMPILE.D3DCOMPILE_OPTIMIZATION_LEVEL1, - - /// - /// Directs the compiler to use the second highest optimization level. - /// - /// - /// This flag maps to D3DCOMPILE_OPTIMIZATION_LEVEL2 and /O2. - /// - OptimizationLevel2 = (int)D3DCOMPILE.D3DCOMPILE_OPTIMIZATION_LEVEL2, - - /// - /// Directs the compiler to use the highest optimization level. If this option is set, the compiler - /// produces the best possible code but might take significantly longer to do so. This option should - /// be set for final builds of an application when performance is the most important factor. - /// - /// - /// This flag maps to D3DCOMPILE_OPTIMIZATION_LEVEL3 and /O3. - /// - OptimizationLevel3 = (int)D3DCOMPILE.D3DCOMPILE_OPTIMIZATION_LEVEL3, - - /// - /// Directs the compiler to treat all warnings as errors when it compiles the shader code. This - /// option is recommended for new shader code, so that warnings can be resolved and the - /// number of hard-to-find code defects can be minimized. - /// - /// - /// This flag maps to D3DCOMPILE_WARNINGS_ARE_ERRORS and /WX. - /// - WarningsAreErrors = (int)D3DCOMPILE.D3DCOMPILE_WARNINGS_ARE_ERRORS, - - /// - /// Strips the reflection data from the generated shader bytecode. The bytecode size will be smaller, but trying - /// to perform reflection on the shader will return inaccurate results. It is recommend if not reflection is used. - /// - /// - /// This flag maps to D3DCOMPILER_STRIP_REFLECTION_DATA, when passed as input to D3DStripShader. - /// For more info, see . - /// - StripReflectionData = 1 << 30, - - /// - /// This flag enables the support for shader linking. Specifically, when set, this flag causes the APIs from - /// to compile the input shader twice: once as a full D2D1 shader, and once - /// as an export function, which is then set as private blob data into the final bytecode that is returned. - /// - /// - /// For more info, see . - /// - EnableLinking = 1 << 31, - - /// - /// The default options for shaders compiled by ComputeSharp.D2D1. Specifically, this combination of options - /// is the one used by precompiled shaders (ie. when using ), and when - /// using or any of the overloads, if not manually set. - /// - /// - /// - /// This combination is also meant to provide the maximum speed possible without potentially introducing visual artifacts or altering - /// the shader outputs in any way. For instance, is not included, because it might affect all computations - /// inside the shader on some GPU devices, making issues hard to investigate. As such, it can be considered equivalent to "OptimizeForSpeed", - /// which is not available on specifically because it would be identical to this. - /// - /// - /// In order to ensure the best performance possible, this combination also includes . This will include an - /// export function for all shaders, to allow D2D to opportunistically link them for better performance whenever possible. Doing so - /// incurs a small binary size cost, as this option will also enable linking for shaders that D2D might never actually link. For most - /// scenarios, this cost is minimal and not noticeable. If size is critical, consider using instead. - /// - /// - Default = OptimizationLevel3 | WarningsAreErrors | PackMatrixRowMajor | EnableLinking, - - /// - /// A combination of options to optimize for minimum size. - /// - OptimizeForSize = OptimizationLevel3 | WarningsAreErrors | PackMatrixRowMajor | StripReflectionData -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Attributes/Enums/D2D1Filter.cs b/src/ComputeSharp.D2D1/Attributes/Enums/D2D1Filter.cs deleted file mode 100644 index 0acefef9..00000000 --- a/src/ComputeSharp.D2D1/Attributes/Enums/D2D1Filter.cs +++ /dev/null @@ -1,69 +0,0 @@ -#if SOURCE_GENERATOR -using static Windows.Win32.Graphics.Direct2D.D2D1_FILTER; -#else -using static ComputeSharp.Win32.D2D1_FILTER; -#endif - -namespace ComputeSharp.D2D1; - -/// -/// Represents the filtering mode that a transform may select to use on input textures. -/// -/// -/// -/// In most scenarios, or when unsure on what values to use, consider this reference: -/// -/// : point sampling. -/// : linear sampling. -/// -/// Other values can be used when explicit fine grained control is needed on how inputs are sampled. -/// -/// This type exposes the available values in . -/// -public enum D2D1Filter -{ - /// - /// Use point sampling for minification, magnification, and mip-level sampling. - /// - MinMagMipPoint = (int)D2D1_FILTER_MIN_MAG_MIP_POINT, - - /// - /// Use point sampling for minification and magnification, use linear interpolation for mip-level sampling. - /// - MinMagPointMipLinear = (int)D2D1_FILTER_MIN_MAG_POINT_MIP_LINEAR, - - /// - /// Use point sampling for minification, use linear interpolation for magnification, use point sampling for mip-level sampling. - /// - MinPointMagLinearMipPoint = (int)D2D1_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT, - - /// - /// Use point sampling for minification, use linear interpolation for magnification and mip-level sampling. - /// - MinPointMagMipLinear = (int)D2D1_FILTER_MIN_POINT_MAG_MIP_LINEAR, - - /// - /// Use linear interpolation for minification, use point sampling for magnification and mip-level sampling. - /// - MinLinearMagMipPoint = (int)D2D1_FILTER_MIN_LINEAR_MAG_MIP_POINT, - - /// - /// Use linear interpolation for minification, use point sampling for magnification, use linear interpolation for mip-level sampling. - /// - MinLinearMagPointMinLinear = (int)D2D1_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR, - - /// - /// Use linear interpolation for minification and magnification, use point sampling for mip-level sampling. - /// - MinMagLinearMipPoint = (int)D2D1_FILTER_MIN_MAG_LINEAR_MIP_POINT, - - /// - /// Use linear interpolation for minification, magnification, and mip-level sampling. - /// - MinMagMipLinear = (int)D2D1_FILTER_MIN_MAG_MIP_LINEAR, - - /// - /// Use anisotropic interpolation for minification, magnification, and mip-level sampling. - /// - Anisotropic = (int)D2D1_FILTER_ANISOTROPIC -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Attributes/Enums/D2D1PixelOptions.cs b/src/ComputeSharp.D2D1/Attributes/Enums/D2D1PixelOptions.cs deleted file mode 100644 index 7aa710ce..00000000 --- a/src/ComputeSharp.D2D1/Attributes/Enums/D2D1PixelOptions.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -#if SOURCE_GENERATOR -using static Windows.Win32.Graphics.Direct2D.D2D1_PIXEL_OPTIONS; -#else -using static ComputeSharp.Win32.D2D1_PIXEL_OPTIONS; -#endif - -namespace ComputeSharp.D2D1; - -/// -/// Indicates how the sampling of a D2D1 pixel shader will be restricted. -/// -/// -/// This type exposes the available values in . -/// -[Flags] -public enum D2D1PixelOptions -{ - /// - /// The pixel shader is not restricted in its sampling. - /// - None = (int)D2D1_PIXEL_OPTIONS_NONE, - - /// - /// The pixel shader samples inputs only at the same scene coordinate as the output pixel - /// and returns transparent black whenever the input pixels are also transparent black. - /// - TrivialSampling = (int)D2D1_PIXEL_OPTIONS_TRIVIAL_SAMPLING -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Attributes/Enums/D2D1ShaderProfile.cs b/src/ComputeSharp.D2D1/Attributes/Enums/D2D1ShaderProfile.cs deleted file mode 100644 index 7fcc0290..00000000 --- a/src/ComputeSharp.D2D1/Attributes/Enums/D2D1ShaderProfile.cs +++ /dev/null @@ -1,69 +0,0 @@ -namespace ComputeSharp.D2D1; - -/// -/// A to be used with to indicate the shader profile to use to precompile a shader. -/// -public enum D2D1ShaderProfile -{ - /// - /// Indicates a D2D1 pixel shader compiled for Direct3D 9.1 feature level. - /// - /// This has the following features: - /// - /// 64 arithmetic and 32 texture instructions. - /// 12 temporary registers. - /// 4 levels of dependent reads. - /// - /// - /// - /// - /// For more info, see . - /// - PixelShader40Level91, - - /// - /// Indicates a D2D1 pixel shader compiled for Direct3D 9.3 feature level. - /// - /// This has the following features: - /// - /// 512 instructions. - /// 32 temporary registers. - /// Static flow control (max depth of 4). - /// Dynamic flow control (max depth of 24). - /// D3DPS20CAPS_ARBITRARYSWIZZLE. - /// D3DPS20CAPS_GRADIENTINSTRUCTIONS. - /// D3DPS20CAPS_PREDICATION. - /// D3DPS20CAPS_NODEPENDENTREADLIMIT. - /// D3DPS20CAPS_NOTEXINSTRUCTIONLIMIT. - /// - /// - /// - /// - /// For more info, see . - /// - PixelShader40Level93, - - /// - /// Indicates a D2D1 pixel shader compiled for Direct3D 10.0 feature level. - /// - /// - /// For more info, see . - /// - PixelShader40, - - /// - /// Indicates a D2D1 pixel shader compiled for Direct3D 10.1 feature level. - /// - /// - /// For more info, see . - /// - PixelShader41, - - /// - /// Indicates a D2D1 pixel shader compiled for Direct3D 11.0 and 11.1 feature levels. - /// - /// - /// For more info, see . - /// - PixelShader50 -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/ComputeSharp.D2D1.csproj b/src/ComputeSharp.D2D1/ComputeSharp.D2D1.csproj deleted file mode 100644 index 8f67f5e9..00000000 --- a/src/ComputeSharp.D2D1/ComputeSharp.D2D1.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - net8.0 - 6.1 - - - - - - - - - - - - - - - - - - - diff --git a/src/ComputeSharp.D2D1/ComputeSharp.D2D1.targets b/src/ComputeSharp.D2D1/ComputeSharp.D2D1.targets deleted file mode 100644 index 7b6a59ac..00000000 --- a/src/ComputeSharp.D2D1/ComputeSharp.D2D1.targets +++ /dev/null @@ -1,60 +0,0 @@ - - - - - - <_ComputeSharpD2D1Analyzer Include="@(Analyzer)" Condition="'%(Analyzer.NuGetPackageId)' == 'ComputeSharp.D2D1'" /> - - - - - - - - - - - - - - - @(ComputeSharpD2D1CurrentCompilerAssemblyIdentity->'%(Version)') - - - true - - - - - - - - - - - - - - - - - - - - - diff --git a/src/ComputeSharp.D2D1/Extensions/ComPtrExtensions.cs b/src/ComputeSharp.D2D1/Extensions/ComPtrExtensions.cs deleted file mode 100644 index ee9d2ece..00000000 --- a/src/ComputeSharp.D2D1/Extensions/ComPtrExtensions.cs +++ /dev/null @@ -1,28 +0,0 @@ -using System.Runtime.CompilerServices; -using ComputeSharp.Win32; - -namespace ComputeSharp.D2D1.Extensions; - -/// -/// Helper methods for working with the type. -/// -/// Trimmed down version of the same file in ComputeSharp. -internal static class ComPtrExtensions -{ - /// - /// Moves the current instance and resets it without releasing the reference. - /// - /// The type to wrap in the current instance. - /// The input instance to move. - /// The moved instance. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static unsafe ComPtr Move(this in ComPtr ptr) - where T : unmanaged - { - ComPtr copy = default; - - Unsafe.AsRef(in ptr).Swap(ref copy); - - return copy; - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Extensions/HRESULTExtensions.cs b/src/ComputeSharp.D2D1/Extensions/HRESULTExtensions.cs deleted file mode 100644 index 149f0eaf..00000000 --- a/src/ComputeSharp.D2D1/Extensions/HRESULTExtensions.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.ComponentModel; -using System.Diagnostics; -using System.Runtime.CompilerServices; -using ComputeSharp.Win32; - -namespace ComputeSharp.D2D1.Extensions; - -/// -/// Helper methods to efficiently throw exceptions. -/// -/// Trimmed down version of the same file in ComputeSharp. -[DebuggerStepThrough] -internal static class HRESULTExtensions -{ - /// - /// Throws a if represents an error. - /// - /// The input to check. - /// Thrown if represents an error. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void Assert(this HRESULT result) - { - default(Win32Exception).ThrowIfFailed((int)result); - } - - /// - /// Throws a if represents an error. - /// - /// The input to check. - /// Thrown if represents an error. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void Assert(this int result) - { - default(Win32Exception).ThrowIfFailed(result); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Extensions/RECTExtensions.cs b/src/ComputeSharp.D2D1/Extensions/RECTExtensions.cs deleted file mode 100644 index 9ac00c19..00000000 --- a/src/ComputeSharp.D2D1/Extensions/RECTExtensions.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System; -using System.Drawing; -using System.Runtime.CompilerServices; -using ComputeSharp.Win32; - -namespace ComputeSharp.D2D1.Extensions; - -/// -/// Helper methods for and . -/// -internal static class RECTExtensions -{ - /// - /// Modifies a target instance to be a D2D1 infinite rectangle. - /// - /// The target instance to modify. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void MakeD2D1Infinite(this ref RECT rect) - { - rect.left = int.MinValue; - rect.top = int.MinValue; - rect.right = int.MaxValue; - rect.bottom = int.MaxValue; - } - - /// - /// Creates a from a value. - /// - /// The input value. - /// The resulting value. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rectangle ToRectangle(this in RECT rect) - { - int left = Math.Clamp(rect.left, int.MinValue / 2, int.MaxValue / 2); - int top = Math.Clamp(rect.top, int.MinValue / 2, int.MaxValue / 2); - int right = Math.Clamp(rect.right, int.MinValue / 2, int.MaxValue / 2); - int bottom = Math.Clamp(rect.bottom, int.MinValue / 2, int.MaxValue / 2); - - int minX = Math.Min(left, right); - int minY = Math.Min(top, bottom); - int maxX = Math.Max(left, right); - int maxY = Math.Max(top, bottom); - - return new(minX, minY, maxX - minX, maxY - minY); - } - - /// - /// Creates a from a value. - /// - /// The input value. - /// The resulting value. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RECT ToRECT(this in Rectangle rectangle) - { - if (rectangle.IsD2D1Infinite()) - { - return new() - { - left = int.MinValue, - top = int.MinValue, - right = int.MaxValue, - bottom = int.MaxValue - }; - } - - return new() - { - left = rectangle.Left, - top = rectangle.Top, - right = rectangle.Right, - bottom = rectangle.Bottom - }; - } - - /// - /// Creates a with the area being the union of two other values. - /// - /// The first input instance to read. - /// The second input instance to read. - /// A with the area being the union of that of and . - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static RECT Union(this in RECT rect, in RECT other) - { - int left = Math.Min(rect.left, other.left); - int top = Math.Min(rect.top, other.top); - int right = Math.Max(rect.right, other.right); - int bottom = Math.Max(rect.bottom, other.bottom); - - return new() - { - left = left, - top = top, - right = right, - bottom = bottom - }; - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Extensions/RectangleExtensions.cs b/src/ComputeSharp.D2D1/Extensions/RectangleExtensions.cs deleted file mode 100644 index 22151150..00000000 --- a/src/ComputeSharp.D2D1/Extensions/RectangleExtensions.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.Drawing; -using System.Runtime.CompilerServices; - -namespace ComputeSharp.D2D1; - -/// -/// Helper methods for . -/// -public static class RectangleExtensions -{ - /// - /// Modifies a target instance to be a D2D1 infinite rectangle. - /// - /// The target instance to modify. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static void ToD2D1Infinite(this ref Rectangle rectangle) - { - rectangle = new Rectangle( - int.MinValue / 2, - int.MinValue / 2, - int.MaxValue, - int.MaxValue); - } - - /// - /// Checks whether a given instance represents a D2D1 infinite rectangle. - /// - /// The input instance to check. - /// Whether or not represents a D2D1 infinite rectangle. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static bool IsD2D1Infinite(this in Rectangle rectangle) - { - return rectangle == new Rectangle( - int.MinValue / 2, - int.MinValue / 2, - int.MaxValue, - int.MaxValue); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Interfaces/Descriptors/ID2D1ConstantBufferLoader.cs b/src/ComputeSharp.D2D1/Interfaces/Descriptors/ID2D1ConstantBufferLoader.cs deleted file mode 100644 index 1f318330..00000000 --- a/src/ComputeSharp.D2D1/Interfaces/Descriptors/ID2D1ConstantBufferLoader.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; - -namespace ComputeSharp.D2D1.Descriptors; - -/// -/// A type representing a data loader for the constant buffer of a D2D1 shader. -/// -public interface ID2D1ConstantBufferLoader -{ - /// - /// Loads the constant buffer of a D2D1 shader. - /// - /// The constant buffer for the D2D1 shader. - void LoadConstantBuffer(ReadOnlySpan data); -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Interfaces/Descriptors/ID2D1PixelShaderDescriptor{T}.cs b/src/ComputeSharp.D2D1/Interfaces/Descriptors/ID2D1PixelShaderDescriptor{T}.cs deleted file mode 100644 index 48f880f2..00000000 --- a/src/ComputeSharp.D2D1/Interfaces/Descriptors/ID2D1PixelShaderDescriptor{T}.cs +++ /dev/null @@ -1,160 +0,0 @@ -using System; -using ComputeSharp.D2D1.Interop; - -namespace ComputeSharp.D2D1.Descriptors; - -/// -/// An interface for a descriptor for a given D2D1 pixel shader. -/// Descriptors contain metadata associated to D2D1 pixel shaders, -/// with all information needed to run them and create effects. -/// -/// The type of D2D1 pixel shader being described. -public interface ID2D1PixelShaderDescriptor - where T : unmanaged, ID2D1PixelShader -{ - /// - /// Gets the effect id of the D2D effect using this shader. - /// - /// - /// This only applies to effects created from . - /// - static abstract ref readonly Guid EffectId { get; } - - /// - /// Gets the display name of the D2D effect using this shader, if specified. - /// - /// - /// This only applies to effects created from . - /// - static abstract string? EffectDisplayName { get; } - - /// - /// Gets the description of the D2D effect using this shader, if specified. - /// - /// - /// This only applies to effects created from . - /// - static abstract string? EffectDescription { get; } - - /// - /// Gets the category of the D2D effect using this shader, if specified. - /// - /// - /// This only applies to effects created from . - /// - static abstract string? EffectCategory { get; } - - /// - /// Gets the author of the D2D effect using this shader, if specified. - /// - /// - /// This only applies to effects created from . - /// - static abstract string? EffectAuthor { get; } - - /// - /// Gets a pointer to the effect factory for the current shader. - /// - /// - /// - /// This only applies to effects created from . - /// - /// - /// The returned function pointer should have a signature matching PD2D1_EFFECT_FACTORY, - /// and it should point to a method calling . Using other D2D effect implementations is not a supported scenario, and might not work correctly. - /// - /// - static abstract nint EffectFactory { get; } - - /// - /// Gets the size in bytes of the constant buffer for the current shader. - /// - static abstract int ConstantBufferSize { get; } - - /// - /// Gets the number of inputs for the current shader. - /// - static abstract int InputCount { get; } - - /// - /// Gets the number of resource textures for the current shader. - /// - static abstract int ResourceTextureCount { get; } - - /// - /// Gets the input types for the current shader. - /// - static abstract ReadOnlyMemory InputTypes { get; } - - /// - /// Gets the input descriptions for the current shader. - /// - static abstract ReadOnlyMemory InputDescriptions { get; } - - /// - /// Gets the resource texture descriptions for the shader. - /// - static abstract ReadOnlyMemory ResourceTextureDescriptions { get; } - - /// - /// Gets the pixel options for the current shader. - /// - static abstract D2D1PixelOptions PixelOptions { get; } - - /// - /// Gets the buffer precision for the shader. - /// - static abstract D2D1BufferPrecision BufferPrecision { get; } - - /// - /// Gets the channel depth for the shader. - /// - static abstract D2D1ChannelDepth ChannelDepth { get; } - - /// - /// Gets the shader profile for the current shader. - /// - /// - /// This shader profile is either explicitly set by users, or the default one for D2D1 shaders. - /// - static abstract D2D1ShaderProfile ShaderProfile { get; } - - /// - /// Gets the compile options for the current shader. - /// - /// - /// This compile options are either explicitly set by users, or the default one for D2D1 shaders. - /// - static abstract D2D1CompileOptions CompileOptions { get; } - - /// - /// Gets the HLSL source code for the current shader instance. - /// - static abstract string HlslSource { get; } - - /// - /// Gets the HLSL bytecode for the current shader, if available. - /// - /// - /// If no precompiled HLSL bytecode is available, the returned instance will be empty. - /// - static abstract ReadOnlyMemory HlslBytecode { get; } - - /// - /// Creates a new shader instance from a constant buffer. - /// - /// The input constant buffer to read. - /// The resulting instance. - /// The input buffer must be retrieved from . - /// Thrown if is not large enough for the current shader type. - static abstract T CreateFromConstantBuffer(ReadOnlySpan buffer); - - /// - /// Loads the constant buffer of a given input shader. - /// - /// The type of data loader being used. - /// The input shader to load the constant buffer for. - /// The instance to use to load the constant buffer. - static abstract void LoadConstantBuffer(in T shader, ref TLoader loader) - where TLoader : struct, ID2D1ConstantBufferLoader; -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Interfaces/ID2D1PixelShader.cs b/src/ComputeSharp.D2D1/Interfaces/ID2D1PixelShader.cs deleted file mode 100644 index 1a6e91a0..00000000 --- a/src/ComputeSharp.D2D1/Interfaces/ID2D1PixelShader.cs +++ /dev/null @@ -1,13 +0,0 @@ -namespace ComputeSharp.D2D1; - -/// -/// An representing a D2D1 pixel shader. -/// -public interface ID2D1PixelShader -{ - /// - /// Executes the current pixel shader. - /// - /// The pixel value for the current invocation. - Float4 Execute(); -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Intrinsics/Attributes/HlslD2DIntrinsicInputTypeAttribute.cs b/src/ComputeSharp.D2D1/Intrinsics/Attributes/HlslD2DIntrinsicInputTypeAttribute.cs deleted file mode 100644 index 2e7b726b..00000000 --- a/src/ComputeSharp.D2D1/Intrinsics/Attributes/HlslD2DIntrinsicInputTypeAttribute.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Diagnostics; -using ComputeSharp.D2D1.Interop; - -namespace ComputeSharp.D2D1.Intrinsics; - -/// -/// An attribute indicating the input type associated with a given D2D HLSL intrinsic. -/// -/// The input type for the current instance. -/// -/// If this attribute is not present, methods will be considered as supporting all input types. -/// This matches the behavior for , when not present. -/// -[AttributeUsage(AttributeTargets.Method, AllowMultiple = true)] -[Conditional("SOURCE_GENERATOR")] -internal sealed class HlslD2DIntrinsicInputTypeAttribute(D2D1PixelShaderInputType inputType) : Attribute -{ - /// - /// Gets the input type for the current instance. - /// - public D2D1PixelShaderInputType InputType { get; } = inputType; -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Intrinsics/D2D.cs b/src/ComputeSharp.D2D1/Intrinsics/D2D.cs deleted file mode 100644 index 5cb1aa31..00000000 --- a/src/ComputeSharp.D2D1/Intrinsics/D2D.cs +++ /dev/null @@ -1,73 +0,0 @@ -using ComputeSharp.Core.Intrinsics; -using ComputeSharp.D2D1.Interop; -using ComputeSharp.D2D1.Intrinsics; - -#pragma warning disable IDE0022 - -namespace ComputeSharp.D2D1; - -/// -/// A that maps the supported HLSL intrinsic functions specifically for D2D1 shaders. -/// -/// For more info, see . -public static class D2D -{ - /// - /// Returns the color of the input texture at a specific index, for the current coordinate. - /// - /// The index of the input texture to get the input from. - /// The color from the target input at the current coordinate, in INPUTN format. - [HlslIntrinsicName("D2DGetInput")] - public static Float4 GetInput(int index) => throw new InvalidExecutionContextException($"{typeof(D2D)}.{nameof(GetInput)}({typeof(int)})"); - - /// - /// Returns the coordinate of the input texture at a specific index. - /// - /// The index of the input texture to get the coordinate for. - /// The input coordinate, in TEXCOORDN format. - /// This method is only available for complex inputs. - [HlslIntrinsicName("D2DGetInputCoordinate")] - [HlslD2DIntrinsicInputType(D2D1PixelShaderInputType.Complex)] - public static Float4 GetInputCoordinate(int index) => throw new InvalidExecutionContextException($"{typeof(D2D)}.{nameof(GetInputCoordinate)}({typeof(int)})"); - - /// - /// Returns the value of the current scene position. - /// - /// The current scene position, in SCENE_POSITION format. - /// This method is only available when is used on the shader type. - [HlslIntrinsicName("D2DGetScenePosition")] - public static Float4 GetScenePosition() => throw new InvalidExecutionContextException($"{typeof(D2D)}.{nameof(GetScenePosition)}()"); - - /// - /// Samples the input texture at a specified index and at a given position. - /// - /// The index of the input texture to sample. - /// The normalized coordinate to use to sample the texture. - /// The sampled value from the texture, in TEXCOORDN format. - /// This method is only available for complex inputs. - [HlslIntrinsicName("D2DSampleInput")] - [HlslD2DIntrinsicInputType(D2D1PixelShaderInputType.Complex)] - public static Float4 SampleInput(int index, Float2 uv) => throw new InvalidExecutionContextException($"{typeof(D2D)}.{nameof(SampleInput)}({typeof(int)}, {typeof(Float2)})"); - - /// - /// Samples the input texture at a specified index and at a given offset from the input coordinate. - /// - /// The index of the input texture to sample. - /// The normalized offset to use to sample the texture. - /// The sampled value from the texture, in TEXCOORDN format. - /// This method is only available for complex inputs. - [HlslIntrinsicName("D2DSampleInputAtOffset")] - [HlslD2DIntrinsicInputType(D2D1PixelShaderInputType.Complex)] - public static Float4 SampleInputAtOffset(int index, Float2 offset) => throw new InvalidExecutionContextException($"{typeof(D2D)}.{nameof(SampleInputAtOffset)}({typeof(int)}, {typeof(Float2)})"); - - /// - /// Samples the input texture at a specified index and at an absolute scene position (not an input-relative position). - /// - /// The index of the input texture to sample. - /// The normalized coordinate to use to sample the texture. - /// The sampled value from the texture, in TEXCOORDN format. - /// This method is only available for complex inputs. - [HlslIntrinsicName("D2DSampleInputAtPosition")] - [HlslD2DIntrinsicInputType(D2D1PixelShaderInputType.Complex)] - public static Float4 SampleInputAtPosition(int index, Float2 uv) => throw new InvalidExecutionContextException($"{typeof(D2D)}.{nameof(SampleInputAtPosition)}({typeof(int)}, {typeof(Float2)})"); -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/README.md b/src/ComputeSharp.D2D1/README.md deleted file mode 100644 index e7513aa4..00000000 --- a/src/ComputeSharp.D2D1/README.md +++ /dev/null @@ -1,39 +0,0 @@ -![ComputeSharp cover image](https://user-images.githubusercontent.com/10199417/108635546-3512ea00-7480-11eb-8172-99bc59f4eb6f.png) - -# Overview 📖 - -**ComputeSharp.D2D1** is a library to write D2D1 pixel shaders entirely with C# code, and to easily register and create `ID2D1Effect`-s from them. This shares the same base APIs (primitives, intrinsics, etc.) as **ComputeSharp**, but then adds D2D1 specific support, instead of using DX12 compute shaders like the main package. This means it offers the ability to implement D2D1 pixel shaders, and to then either load them manually, or to register a D2D1 effect using them, optionally with a custom draw transform as well. - -# Quick start 🚀 - -Here's a simple D2D1 pixel shader written using **ComputeSharp.D2D1**: - -```csharp -[D2DInputCount(1)] -[D2DInputSimple(0)] -[D2DShaderProfile(D2D1ShaderProfile.PixelShader50)] -[D2DGeneratedPixelShaderDescriptor] -public readonly partial struct DifferenceEffect(float amount) : ID2D1PixelShader -{ - /// - public float4 Execute() - { - float4 color = D2D.GetInput(0); - float3 rgb = Hlsl.Saturate(this.amount - color.RGB); - - return new(rgb, 1); - } -} -``` - -This can then be used directly to get the shader bytecode and the buffer, like so: - -```csharp -ReadOnlyMemory bytecode = D2D1PixelShader.LoadBytecode(); -ReadOnlyMemory buffer = D2D1PixelShader.GetConstantBuffer(new DifferenceEffect(1)); -``` - -There are also several other APIs to easily register a pixel shader effect from a shader written using **ComputeSharp.D2D1**, and to then create an `ID2D1Effect` instance from it (from the `D2D1PixelShaderEffect` type), as well as for reflecting into a shader and extract information about it, such as its HLSL source code (from the `D2D1ReflectionServices` type). - -# There's more! -For a complete list of all features available in **ComputeSharp**, check the documentation in the [GitHub repo](https://github.com/Sergio0694/ComputeSharp). \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Resources/D2D1ResourceTexture1D{T}.cs b/src/ComputeSharp.D2D1/Resources/D2D1ResourceTexture1D{T}.cs deleted file mode 100644 index 7a321e10..00000000 --- a/src/ComputeSharp.D2D1/Resources/D2D1ResourceTexture1D{T}.cs +++ /dev/null @@ -1,32 +0,0 @@ -#pragma warning disable IDE0022 - -namespace ComputeSharp.D2D1; - -/// -/// A representing a readonly 1D texture stored on GPU memory. -/// This can be used from D2D1 pixel shaders to be able to pass arbitrary inputs to them. -/// -/// The type of items stored on the texture (only and are supported). -public readonly struct D2D1ResourceTexture1D - where T : unmanaged -{ - /// - /// Gets the width of the current texture. - /// - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - public int Width => throw new InvalidExecutionContextException($"{typeof(D2D1ResourceTexture1D)}.{nameof(Width)}"); - - /// - /// Gets a single value from the current readonly texture. - /// - /// The horizontal offset of the value to get. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - public ref readonly T this[int x] => throw new InvalidExecutionContextException($"{typeof(D2D1ResourceTexture1D)}[{typeof(int)}]"); - - /// - /// Retrieves a single value from the current readonly texture with linear sampling. - /// - /// The horizontal normalized offset of the value to get. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - public ref readonly T Sample(float u) => throw new InvalidExecutionContextException($"{typeof(D2D1ResourceTexture1D)}.{nameof(Sample)}({typeof(float)})"); -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Resources/D2D1ResourceTexture2D{T}.cs b/src/ComputeSharp.D2D1/Resources/D2D1ResourceTexture2D{T}.cs deleted file mode 100644 index c2f1c8c4..00000000 --- a/src/ComputeSharp.D2D1/Resources/D2D1ResourceTexture2D{T}.cs +++ /dev/null @@ -1,54 +0,0 @@ -#pragma warning disable IDE0022 - -namespace ComputeSharp.D2D1; - -/// -/// A representing a readonly 2D texture stored on GPU memory. -/// This can be used from D2D1 pixel shaders to be able to pass arbitrary inputs to them. -/// -/// The type of items stored on the texture (only and are supported). -public readonly struct D2D1ResourceTexture2D - where T : unmanaged -{ - /// - /// Gets the width of the current texture. - /// - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - public int Width => throw new InvalidExecutionContextException($"{typeof(D2D1ResourceTexture2D)}.{nameof(Width)}"); - - /// - /// Gets the height of the current texture. - /// - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - public int Height => throw new InvalidExecutionContextException($"{typeof(D2D1ResourceTexture2D)}.{nameof(Height)}"); - - /// - /// Gets a single value from the current readonly texture. - /// - /// The horizontal offset of the value to get. - /// The vertical offset of the value to get. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - public ref readonly T this[int x, int y] => throw new InvalidExecutionContextException($"{typeof(D2D1ResourceTexture2D)}[{typeof(int)}, {typeof(int)}]"); - - /// - /// Gets a single value from the current readonly texture. - /// - /// The coordinates of the value to get. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - public ref readonly T this[Int2 xy] => throw new InvalidExecutionContextException($"{typeof(D2D1ResourceTexture2D)}[{typeof(Int2)}]"); - - /// - /// Retrieves a single value from the current readonly texture with linear sampling. - /// - /// The horizontal normalized offset of the value to get. - /// The vertical normalized offset of the value to get. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - public ref readonly T Sample(float u, float v) => throw new InvalidExecutionContextException($"{typeof(D2D1ResourceTexture2D)}.{nameof(Sample)}({typeof(float)}, {typeof(float)})"); - - /// - /// Retrieves a single value from the current readonly texture with linear sampling. - /// - /// The normalized coordinates of the value to get. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - public ref readonly T Sample(Float2 uv) => throw new InvalidExecutionContextException($"{typeof(D2D1ResourceTexture2D)}.{nameof(Sample)}({typeof(Float2)})"); -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Resources/D2D1ResourceTexture3D{T}.cs b/src/ComputeSharp.D2D1/Resources/D2D1ResourceTexture3D{T}.cs deleted file mode 100644 index 32cc272c..00000000 --- a/src/ComputeSharp.D2D1/Resources/D2D1ResourceTexture3D{T}.cs +++ /dev/null @@ -1,62 +0,0 @@ -#pragma warning disable IDE0022 - -namespace ComputeSharp.D2D1; - -/// -/// A representing a readonly 3D texture stored on GPU memory. -/// This can be used from D2D1 pixel shaders to be able to pass arbitrary inputs to them. -/// -/// The type of items stored on the texture (only and are supported). -public readonly struct D2D1ResourceTexture3D - where T : unmanaged -{ - /// - /// Gets the width of the current texture. - /// - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - public int Width => throw new InvalidExecutionContextException($"{typeof(D2D1ResourceTexture3D)}.{nameof(Width)}"); - - /// - /// Gets the height of the current texture. - /// - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - public int Height => throw new InvalidExecutionContextException($"{typeof(D2D1ResourceTexture3D)}.{nameof(Height)}"); - - /// - /// Gets the depth of the current texture. - /// - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - public int Depth => throw new InvalidExecutionContextException($"{typeof(D2D1ResourceTexture3D)}.{nameof(Depth)}"); - - /// - /// Gets a single value from the current readonly texture. - /// - /// The horizontal offset of the value to get. - /// The vertical offset of the value to get. - /// The depthwise offset of the value to get. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - public ref readonly T this[int x, int y, int z] => throw new InvalidExecutionContextException($"{typeof(D2D1ResourceTexture3D)}[{typeof(int)}, {typeof(int)}, {typeof(int)}]"); - - /// - /// Gets a single value from the current readonly texture. - /// - /// The coordinates of the value to get. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - public ref readonly T this[Int3 xyz] => throw new InvalidExecutionContextException($"{typeof(D2D1ResourceTexture3D)}[{typeof(Int3)}]"); - - /// - /// Retrieves a single value from the current readonly texture with linear sampling. - /// - /// The horizontal normalized offset of the value to get. - /// The vertical normalized offset of the value to get. - /// The depthwise offset of the value to get. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - public ref readonly T Sample(float u, float v, float w) => throw new InvalidExecutionContextException($"{typeof(D2D1ResourceTexture3D)}.{nameof(Sample)}({typeof(float)}, {typeof(float)}, {typeof(float)})"); - - /// - /// Retrieves a single value from the current readonly texture with linear sampling. - /// - /// The normalized coordinates of the value to get. - /// This API can only be used from a compute shader, and will always throw if used anywhere else. - public ref readonly T Sample(Float3 uvw) => throw new InvalidExecutionContextException($"{typeof(D2D1ResourceTexture3D)}.{nameof(Sample)}({typeof(Float3)})"); -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Exceptions/FxcCompilationException.cs b/src/ComputeSharp.D2D1/Shaders/Exceptions/FxcCompilationException.cs deleted file mode 100644 index 2d9cc834..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Exceptions/FxcCompilationException.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; - -namespace ComputeSharp.D2D1; - -/// -/// A custom type that indicates when a shader compilation with the FXC compiler has failed. -/// -public sealed class FxcCompilationException : Exception -{ - /// - /// Creates a new instance. - /// - /// The error message produced by the DXC compiler. - internal FxcCompilationException(string error) - : base(GetExceptionMessage(error)) - { - } - - /// - /// Gets a formatted exception message for a given compilation error. - /// - /// The input compilatin error message from the FXC compiler. - /// A formatted error message for a new instance. - private static string GetExceptionMessage(string error) - { -#if !SOURCE_GENERATOR - ReadOnlySpan message = error.AsSpan().Trim(); -#else - string message = error.Trim(); -#endif - - return - $"""The FXC compiler encountered one or more errors while trying to compile the shader: "{message}". """ + - $"""Make sure to only be using supported features by checking the README file in the ComputeSharp repository: https://github.com/Sergio0694/ComputeSharp. """ + - $"""If you're sure that your C# shader code is valid, please open an issue an include a working repro and this error message."""; - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Buffers/ArrayPoolBinaryWriter.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Buffers/ArrayPoolBinaryWriter.cs deleted file mode 100644 index d27451af..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Buffers/ArrayPoolBinaryWriter.cs +++ /dev/null @@ -1,169 +0,0 @@ -using System; -using System.Buffers; -using System.Diagnostics.CodeAnalysis; -using System.Numerics; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace ComputeSharp.D2D1.Shaders.Interop.Buffers; - -/// -/// Represents a heap-based, array-backed output sink into which binary data can be written. -/// -/// The initial capacity of the writer object. -internal ref struct ArrayPoolBinaryWriter(int capacity) -{ - /// - /// The default buffer size to use to expand empty arrays. - /// - public const int DefaultInitialBufferSize = 256; - - /// - /// The underlying array. - /// - private byte[]? array = ArrayPool.Shared.Rent(capacity); - - /// - /// The starting offset within . - /// - private int index = 0; - - /// - /// Gets the data written to the underlying buffer so far, as a . - /// - [UnscopedRef] - public readonly ReadOnlySpan WrittenSpan - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - byte[]? array = this.array; - - default(ObjectDisposedException).ThrowIfNull(array); - - return array.AsSpan(0, this.index); - } - } - - /// - /// Writes the raw value of type into the buffer. - /// - /// The type of value to write. - /// The value to write. - /// This method will just blit the data of into the target buffer. - public unsafe void Write(scoped in T value) - { - Span span = GetSpan(sizeof(T)); - - Unsafe.WriteUnaligned(ref MemoryMarshal.GetReference(span), value); - - Advance(sizeof(T)); - } - - /// - /// Writes the raw data from the input into the buffer. - /// - /// The data to write. - public void Write(scoped ReadOnlySpan data) - { - Span span = GetSpan(data.Length); - - data.CopyTo(span); - - Advance(data.Length); - } - - /// - public void Dispose() - { - byte[]? array = this.array; - - if (array is null) - { - return; - } - - this.array = null; - - ArrayPool.Shared.Return(array); - } - - /// - /// Advances the current writer. - /// - /// The amount to advance. - /// Must be called after . - private void Advance(int count) - { - byte[]? array = this.array; - - default(ObjectDisposedException).ThrowIfNull(array); - default(ArgumentException).ThrowIf(this.index > array.Length - count); - - this.index += count; - } - - /// - /// Gets a to write data to, with an optional minimum capacity. - /// - /// The capacity to request. - /// A to write data to. - [UnscopedRef] - private Span GetSpan(int sizeHint = 0) - { - CheckBufferAndEnsureCapacity(sizeHint); - - return this.array.AsSpan(this.index); - } - - /// - /// Ensures that has enough free space to contain a given number of new items. - /// - /// The minimum number of items to ensure space for in . - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private void CheckBufferAndEnsureCapacity(int sizeHint) - { - byte[]? array = this.array; - - default(ObjectDisposedException).ThrowIfNull(array); - default(ArgumentOutOfRangeException).ThrowIfNegative(sizeHint); - - if (sizeHint == 0) - { - sizeHint = 1; - } - - if (sizeHint > array.Length - this.index) - { - ResizeBuffer(sizeHint); - } - } - - /// - /// Resizes to ensure it can fit the specified number of new items. - /// - /// The minimum number of items to ensure space for in . - [MethodImpl(MethodImplOptions.NoInlining)] - private unsafe void ResizeBuffer(int sizeHint) - { - uint minimumSize = (uint)this.index + (uint)sizeHint; - - // The ArrayPool class has a maximum threshold of 1024 * 1024 for the maximum length of - // pooled arrays, and once this is exceeded it will just allocate a new array every time - // of exactly the requested size. In that case, we manually round up the requested size to - // the nearest power of two, to ensure that repeated consecutive writes when the array in - // use is bigger than that threshold don't end up causing a resize every single time. - if (minimumSize > 1024 * 1024) - { - minimumSize = BitOperations.RoundUpToPowerOf2(minimumSize); - } - - byte[] newArray = ArrayPool.Shared.Rent((int)minimumSize); - - Buffer.BlockCopy(this.array!, 0, newArray, 0, this.index); - - ArrayPool.Shared.Return(this.array!); - - this.array = newArray; - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1DrawInfoUpdateContext{T}.cs b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1DrawInfoUpdateContext{T}.cs deleted file mode 100644 index 35d90c17..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1DrawInfoUpdateContext{T}.cs +++ /dev/null @@ -1,72 +0,0 @@ -using System; -using System.Buffers; -using ComputeSharp.D2D1.Descriptors; -using ComputeSharp.D2D1.Extensions; -using ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers; -using ComputeSharp.D2D1.Shaders.Loaders; - -namespace ComputeSharp.D2D1.Interop; - -/// -/// An object allowing to interact with the shader data from within a transform. -/// -/// The type of shader the transform will interact with. -public readonly unsafe ref struct D2D1DrawInfoUpdateContext - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor -{ - /// - /// The instance associated with the current object. - /// - private readonly ID2D1DrawInfoUpdateContext* d2D1DrawInfoUpdateContext; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The instance associated with the current object. - internal D2D1DrawInfoUpdateContext(ID2D1DrawInfoUpdateContext* d2D1DrawInfoUpdateContext) - { - this.d2D1DrawInfoUpdateContext = d2D1DrawInfoUpdateContext; - } - - /// - /// Retrieves the instance currently being used in the associated effect. - /// - /// The instance currently being used in the associated effect. - public T GetConstantBuffer() - { - uint constantBufferSize; - - this.d2D1DrawInfoUpdateContext->GetConstantBufferSize(&constantBufferSize).Assert(); - - byte[]? bufferArray = null; - - Span buffer = constantBufferSize <= 64 - ? stackalloc byte[64] - : bufferArray = ArrayPool.Shared.Rent((int)constantBufferSize); - - fixed (byte* pBuffer = buffer) - { - this.d2D1DrawInfoUpdateContext->GetConstantBuffer(pBuffer, constantBufferSize).Assert(); - } - - T shader = T.CreateFromConstantBuffer(buffer); - - if (bufferArray is not null) - { - ArrayPool.Shared.Return(bufferArray); - } - - return shader; - } - - /// - /// Updates the instance to be used in the associated effect. - /// - /// The instance to be used in the associated effect. - public void SetConstantBuffer(in T shader) - { - D2D1DrawInfoUpdateContextConstantBufferLoader dataLoader = new(this.d2D1DrawInfoUpdateContext); - - T.LoadConstantBuffer(in shader, ref dataLoader); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1DrawTransformMapper{T}.Factories.cs b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1DrawTransformMapper{T}.Factories.cs deleted file mode 100644 index e7c297b4..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1DrawTransformMapper{T}.Factories.cs +++ /dev/null @@ -1,88 +0,0 @@ -using System; -using System.Numerics; -using ComputeSharp.D2D1.Shaders.Interop.Factories; - -namespace ComputeSharp.D2D1.Interop; - -/// -partial class D2D1DrawTransformMapper -{ - /// - /// Creates an instance for an inflate transform. - /// - /// The fixed inflate amount to use (applies to all edges of the input area). - /// The resulting instance for an inflate transform. - public static D2D1DrawTransformMapper Inflate(int amount) - { - return new D2D1InflateTransformMapper.ConstantAmount { Amount = amount }; - } - - /// - /// Creates an instance for an inflate transform. - /// - /// The fixed left inflate amount to use. - /// The fixed top inflate amount to use. - /// The fixed right inflate amount to use. - /// The fixed bottom inflate amount to use. - /// The resulting instance for an inflate transform. - public static D2D1DrawTransformMapper Inflate(int left, int top, int right, int bottom) - { - return new D2D1InflateTransformMapper.ConstantLeftTopRightBottomAmount { Left = left, Top = top, Right = right, Bottom = bottom }; - } - - /// - /// Creates an instance for an inflate transform. - /// - /// The input instance to retrieve the inflate amount to use (applies to all edges of the input area). - /// The resulting instance for an inflate transform. - /// Thrown if is . - public static D2D1DrawTransformMapper Inflate(Accessor accessor) - { - default(ArgumentNullException).ThrowIfNull(accessor); - - return new D2D1InflateTransformMapper.DynamicAmount { Accessor = accessor }; - } - - /// - /// Creates an instance for an inflate transform. - /// - /// The input instance to retrieve the inflate amount to use. - /// The resulting instance for an inflate transform. - public static D2D1DrawTransformMapper Inflate(Accessor<(int Left, int Top, int Right, int Bottom)> accessor) - { - default(ArgumentNullException).ThrowIfNull(accessor); - - return new D2D1InflateTransformMapper.DynamicLeftTopRightBottomAmount { Accessor = accessor }; - } - - /// - /// Creates an instance for an affine transform. - /// - /// The fixed transformation matrix to use. - /// The resulting instance for an affine transform. - public static D2D1DrawTransformMapper Transform(Matrix3x2 matrix) - { - return new D2D1AffineTransformMapper.ConstantMatrix { Amount = matrix }; - } - - /// - /// Creates an instance for an affine transform. - /// - /// The input instance to retrieve the transformation matrix to use. - /// The resulting instance for an affine transform. - /// Thrown if is . - public static D2D1DrawTransformMapper Transform(Accessor accessor) - { - default(ArgumentNullException).ThrowIfNull(accessor); - - return new D2D1AffineTransformMapper.DynamicMatrix { Accessor = accessor }; - } - - /// - /// An accessor of parameters to be used in D2D1 transform mapping implementations. - /// - /// The type of parameters that the transform mapper will use. - /// The input D2D1 pixel shader being executed on the current effect (this can be used to retrieve shader properties). - /// The resulting parameters to be used by the transform mapper. - public delegate TResult Accessor(in T shader); -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1DrawTransformMapper{T}.cs b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1DrawTransformMapper{T}.cs deleted file mode 100644 index 23d8d6de..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1DrawTransformMapper{T}.cs +++ /dev/null @@ -1,277 +0,0 @@ -using System; -using System.Drawing; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ComputeSharp.D2D1.Descriptors; -using ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers; -using ComputeSharp.Win32; - -#pragma warning disable CA1033 - -namespace ComputeSharp.D2D1.Interop; - -/// -/// Provides an ID2D1DrawTransformMapper implementation, which can be used to customize the draw transform logic in -/// an effect created with and also shared across multiple instances of a given effect. -/// -/// The type of shader the transform will interact with. -/// -/// -/// The built-in ID2D1EffectImpl -/// implementation provided by (which makes it possible to register and create -/// ID2D1Effect -/// instances that can be used to run D2D1 pixel shaders) uses draw transform objects to allow customizing the transform logic externally. -/// -/// -/// These managers are COM objects implementing the following interface: -/// -/// [uuid(02E6D48D-B892-4FBC-AA54-119203BAB802)] -/// interface ID2D1DrawTransformMapper : IUnknown -/// { -/// HRESULT MapInputRectsToOutputRect( -/// [in] const ID2D1DrawInfoUpdateContext* updateContext, -/// [in] const RECT* inputRects, -/// [in] const RECT* inputOpaqueSubRects, -/// UINT32 inputRectCount, -/// [out] RECT* outputRect, -/// [out] RECT* outputOpaqueSubRect); -/// -/// HRESULT MapOutputRectToInputRects( -/// [in] const RECT* outputRect, -/// [out] RECT* inputRects, -/// UINT32 inputRectsCount); -/// -/// HRESULT MapInvalidRect( -/// UINT32 inputIndex, -/// RECT invalidInputRect, -/// [out] RECT* invalidOutputRect); -/// }; -/// -/// -/// -/// These can be used to implement custom draw transform logic, assign it to an effect and also share these transforms over multiple effects. -/// -/// -/// For details of how these work, MapInputRectsToOutputRect maps to -/// ID2D1Transform::MapInputRectsToOutputRect, -/// MapOutputRectToInputRects maps to ID2D1Transform::MapOutputRectToInputRects. -/// and MapInvalidRect maps to ID2D1Transform::MapInvalidRect. -/// -/// -/// The main difference between these APIs and the ones in ID2D1Transform is the fact that this interface is standalone (ie. it doesn't inherit from ID2D1TransformNode), -/// and that it allows transform mappers to also read and update additional data tied to an effect instance (such as the shader constant buffer). This is done through the -/// ID2D1DrawInfoUpdateContext interface, that is passed to MapInputRectsToOutputRect. This interface is defined as follows: -/// -/// [uuid(430C5B40-AE16-485F-90E6-4FA4915144B6)] -/// interface ID2D1DrawInfoUpdateContext : IUnknown -/// { -/// HRESULT GetConstantBufferSize([out] UINT32 *size); -/// -/// HRESULT GetConstantBuffer( -/// [out] BYTE *buffer, -/// UINT32 bufferCount); -/// -/// HRESULT SetConstantBuffer( -/// [in] const BYTE *buffer, -/// UINT32 bufferCount); -/// } -/// -/// -/// -/// That is, ID2D1DrawInfoUpdateContext allows a custom transform (an ID2D1DrawTransformMapper instance) to interact with the underlying ID2D1DrawInfo object -/// that is owned by the effect being used, in a safe way. For instance, it allows a transform to read and update the constant buffer, which can be used to allow a transform to -/// pass the exact dispatch area size to an input shader, without the consumer having to manually query that information beforehand (which might not be available either). -/// -/// -/// This interface is implemented by ComputeSharp.D2D1, and it can be used through the APIs in , in several ways. -/// That is, consumers can either implement a type inheriting from to implement their own fully customized transform -/// mapping logic, or they can use the helper methods exposed by to easily retrieve ready to use transforms. -/// -/// -/// A CCW (COM callable wrapper, see ) is also available for all -/// of these APIs, implemented via the same type. That is, a given instance can expose its underlying CCW through the -/// interface, and this can then be passed to an existing D2D1 effect instance. -/// -/// -public abstract unsafe partial class D2D1DrawTransformMapper : ICustomQueryInterface, ID2D1DrawTransformMapperInterop - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor -{ - /// - /// The object wrapped by the current instance. - /// - private ComPtr d2D1TransformMapperImpl; - - /// - /// Creates a new instance. - /// - public D2D1DrawTransformMapper() - { - fixed (D2D1DrawTransformMapperImpl** d2D1TransformMapperImpl = this.d2D1TransformMapperImpl) - { - D2D1DrawTransformMapperImpl.Factory(this, d2D1TransformMapperImpl); - } - } - - /// - /// Releases the underlying ID2D1DrawTransformMapper object. - /// - ~D2D1DrawTransformMapper() - { - this.d2D1TransformMapperImpl.Dispose(); - } - - /// - /// - /// Allows a transform to state how it would map a a set of sample rectangles on its input to an output rectangle. - /// - /// - /// This is effectively the inverse mapping of . - /// - /// - /// The input value, which can be used to access and modify shader data. - /// The input rectangles to be mapped to the output rectangle. This parameter is always equal to the input bounds. - /// The input rectangles to be mapped to the opaque output rectangle. - /// The output rectangle that maps to the corresponding input rectangle. - /// The output rectangle that maps to the corresponding opaque input rectangle. - /// - /// - /// Unlike and , this method is explicitly called by the renderer at - /// a determined place in its rendering algorithm. The transform implementation may change its state based on the input rectangles - /// and use this information to control its rendering information. This method is always called before the - /// and methods. - /// - /// - /// For more info, see . - /// - /// - public abstract void MapInputsToOutput( - D2D1DrawInfoUpdateContext drawInfoUpdateContext, - ReadOnlySpan inputs, - ReadOnlySpan opaqueInputs, - out Rectangle output, - out Rectangle opaqueOutput); - - /// - /// Allows a transform to state how it would map a rectangle requested on its output to a set of sample rectangles on its input. - /// - /// The output rectangle from which the inputs must be mapped. - /// The corresponding set of inputs. The inputs will directly correspond to the transform inputs. - /// - /// - /// The transform implementation must regard this method as purely functional. It can base the mapped input and output rectangles on its - /// current state as specified by the encapsulating effect properties. However, it must not change its own state in response to this method - /// being invoked. The Direct2D renderer implementation reserves the right to call this method at any time and in any sequence. - /// - /// - /// For more info, see . - /// - /// - public abstract void MapOutputToInputs(in Rectangle output, Span inputs); - - /// - /// Sets the input rectangles for this rendering pass into the transform. - /// - /// The index of the input rectangle. - /// The invalid input rectangle. - /// The output rectangle to which the input rectangle must be mapped. - /// - /// - /// The transform implementation must regard this method as purely functional. The transform implementation can base the mapped input rectangle on - /// the transform implementation's current state as specified by the encapsulating effect properties. But the transform implementation can't change - /// its own state in response to a call to . Direct2D can call this method at any time - /// and in any sequence following a call to . - /// - /// - /// For more info, see . - /// - /// - public abstract void MapInvalidOutput(int inputIndex, in Rectangle invalidInput, out Rectangle invalidOutput); - - /// - /// Gets the underlying object. - /// - /// The underlying object. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal void GetD2D1TransformMapper(ID2D1DrawTransformMapper** transformMapper) - { - bool lockTaken = false; - - this.d2D1TransformMapperImpl.Get()->SpinLock.Enter(ref lockTaken); - - // Whenever the CCW is requested from this object, we also make sure that the current instance is tracked - // in the GC handle stored in the CCW. This could've been reset in case there were no other references to - // the CCW (see comments in D2D1TransformMapperImpl about this), so here we're assigning a reference to the - // current object again to ensure the returned CCW object will keep the instance alive if needed. - try - { - this.d2D1TransformMapperImpl.Get()->EnsureTargetIsTracked(this); - this.d2D1TransformMapperImpl.Get()->CopyToWithNoLock(transformMapper); - } - finally - { - this.d2D1TransformMapperImpl.Get()->SpinLock.Exit(); - - GC.KeepAlive(this); - } - } - - /// - CustomQueryInterfaceResult ICustomQueryInterface.GetInterface(ref Guid iid, out IntPtr ppv) - { - fixed (Guid* pIid = &iid) - fixed (IntPtr* pPpv = &ppv) - { - int hresult; - bool lockTaken = false; - - this.d2D1TransformMapperImpl.Get()->SpinLock.Enter(ref lockTaken); - - try - { - this.d2D1TransformMapperImpl.Get()->EnsureTargetIsTracked(this); - - hresult = this.d2D1TransformMapperImpl.Get()->QueryInterfaceWithNoLock(pIid, (void**)pPpv); - } - finally - { - this.d2D1TransformMapperImpl.Get()->SpinLock.Exit(); - - GC.KeepAlive(this); - } - - return hresult switch - { - S.S_OK => CustomQueryInterfaceResult.Handled, - _ => CustomQueryInterfaceResult.Failed - }; - } - } - - /// - void ID2D1DrawTransformMapperInterop.MapInputsToOutput( - ID2D1DrawInfoUpdateContext* d2D1DrawInfoUpdateContext, - ReadOnlySpan inputs, - ReadOnlySpan opaqueInputs, - out Rectangle output, - out Rectangle opaqueOutput) - { - MapInputsToOutput( - new D2D1DrawInfoUpdateContext(d2D1DrawInfoUpdateContext), - inputs, - opaqueInputs, - out output, - out opaqueOutput); - } - - /// - void ID2D1DrawTransformMapperInterop.MapOutputToInputs(in Rectangle output, Span inputs) - { - MapOutputToInputs(in output, inputs); - } - - /// - void ID2D1DrawTransformMapperInterop.MapInvalidOutput(int inputIndex, in Rectangle invalidInput, out Rectangle invalidOutput) - { - MapInvalidOutput(inputIndex, in invalidInput, out invalidOutput); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1EffectRegistrationData.cs b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1EffectRegistrationData.cs deleted file mode 100644 index 4dfc7fa8..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1EffectRegistrationData.cs +++ /dev/null @@ -1,297 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using System.Text; - -namespace ComputeSharp.D2D1.Interop; - -/// -/// A helper type used to read and validate effect registration blobs produced -/// by . -/// -/// -/// -/// The values in a instance contain all necessary -/// information to register a new D2D1 effect by calling ID2D1Factory1::RegisterEffectFromString. -/// -/// -/// For more info, see . -/// -/// -public static class D2D1EffectRegistrationData -{ - /// - /// The containing type for deserialized version 1 registration blobs. - /// - public readonly unsafe struct V1 - { - /// - /// The blob id for V1 registration data. - /// - internal static readonly Guid BlobId = new(0xA1B4A55E, 0x4C78, 0x413F, 0xA2, 0xE6, 0x0A, 0x02, 0xE6, 0x0A, 0x76, 0x18); - - /// - /// Creates a new instance with the specified parameters. - /// - /// The effect class id. - /// The number of inputs for the effect. - /// The XML text that can be used to register the effect. - /// The values for the effect. - /// A pointer to the effect factory callback. - private V1( - Guid classId, - int numberOfInputs, - string propertyXml, - D2D1PropertyBinding[] propertyBindings, - nint effectFactory) - { - ClassId = classId; - NumberOfInputs = numberOfInputs; - PropertyXml = propertyXml; - PropertyBindings = propertyBindings; - EffectFactory = (void*)effectFactory; - } - - /// - /// Gets the id to use to register the effect. - /// - public Guid ClassId { get; } - - /// - /// Gets the number of inputs for the effect. - /// - public int NumberOfInputs { get; } - - /// - /// Gets the XML text with the effect description, that can be used to register it. - /// - public string PropertyXml { get; } - - /// - /// Gets the sequence of values for the effect. - /// - public ReadOnlyMemory PropertyBindings { get; } - - /// - /// Gets a callback to an effect factory (a ). - /// - public void* EffectFactory { get; } - - /// - /// Loads a instance from the input binary blob. - /// - /// The input binary blob to deserialize. - /// The resulting instance. - /// Thrown if the loading failed. - /// - /// The input blob should have been created by a call to any of the overloads - /// of . - /// - public static V1 Load(ReadOnlyMemory blob) - { - switch (TryLoadAndGetResult(blob, out V1 data)) - { - case LoadingResult.Success: - return data; - case LoadingResult.EmptyBuffer: - default(ArgumentException).Throw(nameof(blob), "The input blob is empty."); - break; - case LoadingResult.BufferTooShort: - default(ArgumentException).Throw(nameof(blob), "The input blob is too short."); - break; - case LoadingResult.BufferTooLong: - default(ArgumentException).Throw(nameof(blob), "The input blob is too long."); - break; - case LoadingResult.MismatchedBlobVersionId: - default(ArgumentException).Throw(nameof(blob), "The blob version id from the input blob does not match."); - break; - case LoadingResult.InvalidNumberOfInputs: - default(ArgumentException).Throw(nameof(blob), "The input blob has an invalid number of inputs."); - break; - case LoadingResult.InvalidPropertyXml: - default(ArgumentException).Throw(nameof(blob), "The property XML value in the input blob is invalid."); - break; - case LoadingResult.InvalidNumberOfBindings: - default(ArgumentException).Throw(nameof(blob), "The input blob declares an invalid number of bindings."); - break; - case LoadingResult.InvalidBindingPropertyName: - default(ArgumentException).Throw(nameof(blob), "The input blob has an invalid property name for one of its property bindings."); - break; - default: - default(ArgumentException).Throw(nameof(blob), "The input blob failed to be loaded for an unknown reason."); - break; - } - - return data; - } - - /// - /// Tries to load a instance from the input binary blob. - /// - /// The input binary blob to deserialize. - /// The resulting instance, if successful. - /// Whether or not the input blob has been correctly deserialized (if it was not malformed). - /// - /// The input blob should have been created by a call to any of the overloads - /// of . - /// - public static bool TryLoad(ReadOnlyMemory blob, out V1 data) - { - return TryLoadAndGetResult(blob, out data) is LoadingResult.Success; - } - - /// - /// Tries to load a instance from the input binary blob and returns a result. - /// - /// The input binary blob to deserialize. - /// The resulting instance, if successful. - /// The result of the loading operation. - private static LoadingResult TryLoadAndGetResult(ReadOnlyMemory blob, out V1 data) - { - data = default; - - if (blob.IsEmpty) - { - return LoadingResult.EmptyBuffer; - } - - ReadOnlySpan span = blob.Span; - - // Blob id - if (!MemoryMarshal.TryRead(span, out Guid blobId)) - { - return LoadingResult.BufferTooShort; - } - - // Validate the blob id - if (blobId != BlobId) - { - return LoadingResult.MismatchedBlobVersionId; - } - - span = span.Slice(sizeof(Guid)); - - // Effect class id - if (!MemoryMarshal.TryRead(span, out Guid effectId)) - { - return LoadingResult.BufferTooShort; - } - - span = span.Slice(sizeof(Guid)); - - // Number of inputs - if (!MemoryMarshal.TryRead(span, out int numberOfInputs)) - { - return LoadingResult.BufferTooShort; - } - - // Validate the number of inputs - if (numberOfInputs < 0) - { - return LoadingResult.InvalidNumberOfInputs; - } - - span = span.Slice(sizeof(int)); - - // Effect property XML - int lengthOfXml = span.IndexOf((byte)'\0'); - - if (lengthOfXml == -1) - { - return LoadingResult.InvalidPropertyXml; - } - - string xml = Encoding.UTF8.GetString(span.Slice(0, lengthOfXml)); - - span = span.Slice(lengthOfXml + 1); - - // Number of bindings - if (!MemoryMarshal.TryRead(span, out int numberOfBindings)) - { - return LoadingResult.BufferTooShort; - } - - // Validate the number of bindings - if (numberOfBindings < 0) - { - return LoadingResult.InvalidNumberOfBindings; - } - - span = span.Slice(sizeof(int)); - - D2D1PropertyBinding[] propertyBindings = new D2D1PropertyBinding[numberOfBindings]; - - // Property bindings - for (int i = 0; i < numberOfBindings; i++) - { - // Property name - int lengthOfName = span.IndexOf((byte)'\0'); - - if (lengthOfName == -1) - { - return LoadingResult.InvalidBindingPropertyName; - } - - string name = Encoding.UTF8.GetString(span.Slice(0, lengthOfName)); - - span = span.Slice(lengthOfName + 1); - - // Property get function - if (!MemoryMarshal.TryRead(span, out nint getFunction)) - { - return LoadingResult.BufferTooShort; - } - - span = span.Slice(sizeof(nint)); - - // Property set function - if (!MemoryMarshal.TryRead(span, out nint setFunction)) - { - return LoadingResult.BufferTooShort; - } - - span = span.Slice(sizeof(nint)); - - propertyBindings[i] = new D2D1PropertyBinding(name, (void*)getFunction, (void*)setFunction); - } - - // Effect factory - if (!MemoryMarshal.TryRead(span, out nint effectFactory)) - { - return LoadingResult.BufferTooShort; - } - - span = span.Slice(sizeof(nint)); - - // If the buffer is bigger than expected, also consider it malformed - if (span.Length > 0) - { - return LoadingResult.BufferTooLong; - } - - data = new V1( - effectId, - numberOfInputs, - xml, - propertyBindings, - effectFactory); - - return LoadingResult.Success; - } - - /// - /// Indicates the result of a blob loading operation. - /// - private enum LoadingResult - { - Success, - EmptyBuffer, - BufferTooShort, - BufferTooLong, - MismatchedBlobVersionId, - InvalidNumberOfInputs, - InvalidPropertyXml, - InvalidNumberOfBindings, - InvalidBindingPropertyName - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1ExtendMode.cs b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1ExtendMode.cs deleted file mode 100644 index 613478ca..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1ExtendMode.cs +++ /dev/null @@ -1,28 +0,0 @@ -using static ComputeSharp.Win32.D2D1_EXTEND_MODE; - -namespace ComputeSharp.D2D1; - -/// -/// Specifies how a brush paints areas outside of its normal content area. -/// -/// -/// This type exposes the available values in . -/// -public enum D2D1ExtendMode -{ - /// - /// Repeat the edge pixels of the brush's content for all regions outside the normal content area. - /// - Clamp = (int)D2D1_EXTEND_MODE_CLAMP, - - /// - /// Repeat the brush's content. - /// - Wrap = (int)D2D1_EXTEND_MODE_WRAP, - - /// - /// The same as , except that alternate tiles of the brush's - /// content are flipped (the brush's normal content is drawn untransformed). - /// - Mirror = (int)D2D1_EXTEND_MODE_MIRROR -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1InputDescription.cs b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1InputDescription.cs deleted file mode 100644 index 9482e9af..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1InputDescription.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System.Runtime.InteropServices; - -#pragma warning disable IDE0290 - -namespace ComputeSharp.D2D1.Interop; - -/// -/// A type containing info on a description for a given D2D1 pixel shader input resource. -/// -/// -/// This type exposes the values that can be set via ID2D1RenderInfo::SetInputDescription. -/// For more info, see . -/// -[StructLayout(LayoutKind.Sequential)] -public readonly struct D2D1InputDescription -{ - /// - /// Creates a new instance with the specified parameters. - /// - /// The index of the resource the description belongs to. - /// The type of filter to apply to the input texture. - public D2D1InputDescription(int index, D2D1Filter filter) - { - Index = index; - Filter = filter; - } - - /// - /// Gets the index of the resource the description belongs to. - /// - public int Index { get; } - - /// - /// Gets the type of filter to apply to the input texture. - /// - public D2D1Filter Filter { get; } - - /// - /// Gets the mip level to retrieve from the upstream transform, if specified. - /// - public int LevelOfDetailCount { get; init; } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1PixelShader.cs b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1PixelShader.cs deleted file mode 100644 index 481d9791..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1PixelShader.cs +++ /dev/null @@ -1,472 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using ComputeSharp.D2D1.Descriptors; -using ComputeSharp.D2D1.Shaders.Loaders; -using ComputeSharp.D2D1.Shaders.Translation; -using ComputeSharp.Win32; - -namespace ComputeSharp.D2D1.Interop; - -/// -/// Provides methods to interop with D2D1 APIs and compile shaders or extract their constant buffer data. -/// -public static class D2D1PixelShader -{ - /// - /// Gets the size of the constant buffer for a D2D1 pixel shader of a specified type. - /// - /// The type of D2D1 pixel shader to retrieve info for. - /// The size of the constant buffer for a D2D1 pixel shader of type . - public static int GetConstantBufferSize() - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - return T.ConstantBufferSize; - } - - /// - /// Gets the number of inputs from an input D2D1 pixel shader. - /// - /// The type of D2D1 pixel shader to get the input count for. - /// The number of inputs for the D2D1 pixel shader of type . - public static int GetInputCount() - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - return T.InputCount; - } - - /// - /// Gets the number of resource textures for a D2D1 pixel shader. - /// - /// The type of D2D1 pixel shader to get the resource texture count for. - /// The number of resource texture for the D2D1 pixel shader of type . - public static int GetResourceTextureCount() - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - return T.ResourceTextureCount; - } - - /// - /// Gets the input types for a D2D1 pixel shader. - /// - /// The type of D2D1 pixel shader to get the input types for. - /// The input types of the target D2D1 pixel shader. - public static ReadOnlyMemory GetInputTypes() - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - return T.InputTypes; - } - - /// - /// Gets the available input descriptions for a D2D1 pixel shader. - /// - /// The type of D2D1 pixel shader to get the input descriptions for. - /// A with the available input descriptions for the shader. - public static ReadOnlyMemory GetInputDescriptions() - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - return T.InputDescriptions; - } - - /// - /// Gets the available resource texture descriptions for a D2D1 pixel shader. - /// - /// The type of D2D1 pixel shader to get the resource texture descriptions for. - /// A with the available resource texture descriptions for the shader. - public static ReadOnlyMemory GetResourceTextureDescriptions() - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - return T.ResourceTextureDescriptions; - } - - /// - /// Gets the pixel options from an input D2D1 pixel shader. - /// - /// The type of D2D1 pixel shader to get the pixel options for. - /// The pixel options for the D2D1 pixel shader of type . - public static D2D1PixelOptions GetPixelOptions() - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - return T.PixelOptions; - } - - /// - /// Gets the buffer precision for the output buffer of a D2D1 pixel shader. - /// - /// The type of D2D1 pixel shader to get the output buffer precision for. - /// The output buffer precision for the D2D1 pixel shader of type . - public static D2D1BufferPrecision GetOutputBufferPrecision() - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - return T.BufferPrecision; - } - - /// - /// Gets the channel depth for the output buffer of a D2D1 pixel shader. - /// - /// The type of D2D1 pixel shader to get the output buffer channel depth for. - /// The output buffer channel depth for the D2D1 pixel shader of type . - public static D2D1ChannelDepth GetOutputBufferChannelDepth() - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - return T.ChannelDepth; - } - - /// - /// Loads the bytecode from an input D2D1 pixel shader. - /// - /// The type of D2D1 pixel shader to load the bytecode for. - /// A instance with the resulting shader bytecode. - /// - /// This method will only compile the shader using if no precompiled shader is available. - /// - /// If the input shader was precompiled, the returned instance will wrap a pinned memory buffer (from the PE section). - /// If the shader was compiled at runtime, the returned instance will wrap a array with the bytecode. - /// - /// - public static ReadOnlyMemory LoadBytecode() - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - // This method is the one used by the built-in ID2D1Effect, so it has special optimization - // to help both performance and especially trimming. That is, we first check whether the - // HLSL code is already available, which should get completely inlined when using the - // generated code. This allows the entire fallback path below to be trimmed out. - if (T.HlslBytecode is ReadOnlyMemory { Length: > 0 } hlslBytecode) - { - return hlslBytecode; - } - - return CompileBytecode(null, null, out _, out _); - } - - /// - /// Loads the bytecode from an input D2D1 pixel shader. - /// - /// The type of D2D1 pixel shader to load the bytecode for. - /// The resulting that was used to compile the returned bytecode. - /// The resulting that were used to compile the returned bytecode. - /// A instance with the resulting shader bytecode. - /// - /// This method will only compile the shader using if no precompiled shader is available. - /// - /// If the input shader was precompiled, the returned instance will wrap a pinned memory buffer (from the PE section). - /// If the shader was compiled at runtime, the returned instance will wrap a array with the bytecode. - /// - /// - public static ReadOnlyMemory LoadBytecode(out D2D1ShaderProfile shaderProfile, out D2D1CompileOptions compileOptions) - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - return LoadOrCompileBytecode(null, null, out shaderProfile, out compileOptions); - } - - /// - /// Loads the bytecode from an input D2D1 pixel shader. - /// - /// The type of D2D1 pixel shader to load the bytecode for. - /// The shader profile to use to get the shader bytecode. - /// A instance with the resulting shader bytecode. - /// - /// - /// If precompiled shader for the profile does not exist, the shader will be compiled with either the custom compile options specified on the shader - /// type (through ), or using otherwise. - /// - /// - /// Additionally, in case no custom compile options are specified and the the shader type - /// supports linking, will also be automatically added. - /// - /// - /// If the input shader was precompiled, the returned instance will wrap a pinned memory buffer (from the PE section). - /// If the shader was compiled at runtime, the returned instance will wrap a array with the bytecode. - /// - /// - public static ReadOnlyMemory LoadBytecode(D2D1ShaderProfile shaderProfile) - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - return LoadOrCompileBytecode(shaderProfile, null, out _, out _); - } - - /// - /// Loads the bytecode from an input D2D1 pixel shader. - /// - /// The type of D2D1 pixel shader to load the bytecode for. - /// The shader profile to use to get the shader bytecode. - /// The resulting that were used to compile the returned bytecode. - /// A instance with the resulting shader bytecode. - /// - /// - /// If precompiled shader for the profile does not exist, the shader will be compiled with either the custom compile options specified on the shader - /// type (through ), or using otherwise. - /// - /// - /// Additionally, in case no custom compile options are specified and the the shader type - /// supports linking, will also be automatically added. - /// - /// - /// If the input shader was precompiled, the returned instance will wrap a pinned memory buffer (from the PE section). - /// If the shader was compiled at runtime, the returned instance will wrap a array with the bytecode. - /// - /// - public static ReadOnlyMemory LoadBytecode(D2D1ShaderProfile shaderProfile, out D2D1CompileOptions compileOptions) - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - return LoadOrCompileBytecode(shaderProfile, null, out _, out compileOptions); - } - - /// - /// Loads the bytecode from an input D2D1 pixel shader. - /// - /// The type of D2D1 pixel shader to load the bytecode for. - /// - /// The compile options to use to get the shader bytecode. - /// For consistency with , will be automatically added. - /// - /// A instance with the resulting shader bytecode. - /// Thrown if is specified within . - /// - /// - /// If precompiled shader with the requested options does not exist, the shader will be compiled with the input options. If additional compile - /// options have been specified on the shader type (through ), they will be ignored. - /// - /// - /// If the shader needs to be recompiled, the shader profile that will be used is . - /// - /// - /// If the input shader was precompiled, the returned instance will wrap a pinned memory buffer (from the PE section). - /// If the shader was compiled at runtime, the returned instance will wrap a array with the bytecode. - /// - /// - public static ReadOnlyMemory LoadBytecode(D2D1CompileOptions compileOptions) - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - default(ArgumentException).ThrowIf((compileOptions & D2D1CompileOptions.PackMatrixColumnMajor) != 0, nameof(compileOptions)); - - return LoadOrCompileBytecode(null, compileOptions | D2D1CompileOptions.PackMatrixRowMajor, out _, out _); - } - - /// - /// Loads the bytecode from an input D2D1 pixel shader. - /// - /// The type of D2D1 pixel shader to load the bytecode for. - /// - /// The compile options to use to get the shader bytecode. - /// For consistency with , will be automatically added. - /// - /// The resulting that was used to compile the returned bytecode. - /// A instance with the resulting shader bytecode. - /// Thrown if is specified within . - /// - /// - /// If precompiled shader with the requested options does not exist, the shader will be compiled with the input options. If additional compile - /// options have been specified on the shader type (through ), they will be ignored. - /// - /// - /// If the shader needs to be recompiled, the shader profile that will be used is . - /// - /// - /// If the input shader was precompiled, the returned instance will wrap a pinned memory buffer (from the PE section). - /// If the shader was compiled at runtime, the returned instance will wrap a array with the bytecode. - /// - /// - public static ReadOnlyMemory LoadBytecode(D2D1CompileOptions compileOptions, out D2D1ShaderProfile shaderProfile) - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - default(ArgumentException).ThrowIf((compileOptions & D2D1CompileOptions.PackMatrixColumnMajor) != 0, nameof(compileOptions)); - - return LoadOrCompileBytecode(null, compileOptions | D2D1CompileOptions.PackMatrixRowMajor, out shaderProfile, out _); - } - - /// - /// Loads the bytecode from an input D2D1 pixel shader. - /// - /// The type of D2D1 pixel shader to load the bytecode for. - /// The shader profile to use to get the shader bytecode. - /// - /// The compile options to use to get the shader bytecode. - /// For consistency with , will be automatically added. - /// - /// A instance with the resulting shader bytecode. - /// Thrown if is specified within . - /// - /// If the input shader was precompiled, the returned instance will wrap a pinned memory buffer (from the PE section). - /// If the shader was compiled at runtime, the returned instance will wrap a array with the bytecode. - /// - public static ReadOnlyMemory LoadBytecode(D2D1ShaderProfile shaderProfile, D2D1CompileOptions compileOptions) - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - default(ArgumentException).ThrowIf((compileOptions & D2D1CompileOptions.PackMatrixColumnMajor) != 0, nameof(compileOptions)); - - return LoadOrCompileBytecode(shaderProfile, compileOptions | D2D1CompileOptions.PackMatrixRowMajor, out _, out _); - } - - /// - /// Compiles the bytecode from an input D2D1 pixel shader. - /// - /// The type of D2D1 pixel shader to load the bytecode for. - /// The requested shader profile to use to get the shader bytecode. - /// The requested compile options to use to get the shader bytecode. - /// The effective shader profile that was used to get the shader bytecode. - /// The effective compile options that were used to get the shader bytecode. - /// A instance with the resulting shader bytecode. - [MethodImpl(MethodImplOptions.NoInlining)] - private static unsafe ReadOnlyMemory CompileBytecode( - D2D1ShaderProfile? requestedShaderProfile, - D2D1CompileOptions? requestedCompileOptions, - out D2D1ShaderProfile effectiveShaderProfile, - out D2D1CompileOptions effectiveCompileOptions) - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - // Set the effective profile and option to the requested ones or the default values - effectiveShaderProfile = requestedShaderProfile ?? T.ShaderProfile; - effectiveCompileOptions = requestedCompileOptions ?? T.CompileOptions; - - // Compile the shader with the current settings - using ComPtr dynamicBytecode = D3DCompiler.Compile(T.HlslSource, effectiveShaderProfile, effectiveCompileOptions); - - byte* bytecodePtr = (byte*)dynamicBytecode.Get()->GetBufferPointer(); - int bytecodeSize = (int)dynamicBytecode.Get()->GetBufferSize(); - - return new ReadOnlySpan(bytecodePtr, bytecodeSize).ToArray(); - } - - /// - /// Loads or compiles the bytecode from an input D2D1 pixel shader. - /// - /// The type of D2D1 pixel shader to load the bytecode for. - /// The requested shader profile to use to get the shader bytecode. - /// The requested compile options to use to get the shader bytecode. - /// The effective shader profile that was used to get the shader bytecode. - /// The effective compile options that were used to get the shader bytecode. - /// A instance with the resulting shader bytecode. - private static unsafe ReadOnlyMemory LoadOrCompileBytecode( - D2D1ShaderProfile? requestedShaderProfile, - D2D1CompileOptions? requestedCompileOptions, - out D2D1ShaderProfile effectiveShaderProfile, - out D2D1CompileOptions effectiveCompileOptions) - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - // Check whether there is precompiled bytecode we can use - if (T.HlslBytecode is ReadOnlyMemory { Length: > 0 } hlslBytecode && - (requestedShaderProfile is null || T.ShaderProfile == requestedShaderProfile.GetValueOrDefault()) && - (requestedCompileOptions is null || T.CompileOptions == requestedCompileOptions.GetValueOrDefault())) - { - effectiveShaderProfile = T.ShaderProfile; - effectiveCompileOptions = T.CompileOptions; - - return hlslBytecode; - } - - // Fallback path just compiling the HLSL code on the fly - return CompileBytecode(requestedShaderProfile, requestedCompileOptions, out effectiveShaderProfile, out effectiveCompileOptions); - } - - /// - /// Gets the constant buffer from an input D2D1 pixel shader. - /// - /// The type of D2D1 pixel shader to retrieve info for. - /// The input D2D1 pixel shader to retrieve info for. - /// A instance with the pixel shader constant buffer. - /// - /// This method will allocate a buffer every time it is invoked. - /// For a zero-allocation alternative, use . - public static ReadOnlyMemory GetConstantBuffer(in T shader) - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - D2D1ByteArrayConstantBufferLoader dataLoader = default; - - T.LoadConstantBuffer(in shader, ref dataLoader); - - return dataLoader.GetResultingDispatchData(); - } - - /// - /// Gets the constant buffer from an input D2D1 pixel shader. - /// - /// The type of D2D1 pixel shader to retrieve info for. - /// The input D2D1 pixel shader to retrieve info for. - /// The target to write the constant buffer to. - /// The number of bytes written into . - /// Thrown if is not large enough to contain the constant buffer. - public static int GetConstantBuffer(in T shader, Span span) - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - if (!TryGetConstantBuffer(in shader, span, out int writtenBytes)) - { - default(ArgumentException).Throw(nameof(span)); - } - - return writtenBytes; - } - - /// - /// Tries to get the constant buffer from an input D2D1 pixel shader. - /// - /// The type of D2D1 pixel shader to retrieve info for. - /// The input D2D1 pixel shader to retrieve info for. - /// The target to write the constant buffer to. - /// The number of bytes written into . - /// Whether or not the constant buffer was retrieved successfully. - public static unsafe bool TryGetConstantBuffer(in T shader, Span span, out int bytesWritten) - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - fixed (byte* buffer = span) - { - D2D1ByteBufferConstantBufferLoader dataLoader = new(buffer, span.Length); - - T.LoadConstantBuffer(in shader, ref dataLoader); - - return dataLoader.TryGetWrittenBytes(out bytesWritten); - } - } - - /// - /// Sets the constant buffer from an input D2D1 pixel shader, by calling ID2D1DrawInfo::SetPixelShaderConstantBuffer. - /// - /// The type of D2D1 pixel shader to set the constant buffer for. - /// A pointer to the ID2D1DrawInfo instance to use. - /// The input D2D1 pixel shader to set the contant buffer for. - /// Thrown if is . - /// For more info, see . - public static unsafe void SetConstantBufferForD2D1DrawInfo(void* d2D1DrawInfo, in T shader) - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - default(ArgumentNullException).ThrowIfNull(d2D1DrawInfo); - - D2D1DrawInfoConstantBufferLoader dataLoader = new((ID2D1DrawInfo*)d2D1DrawInfo); - - T.LoadConstantBuffer(in shader, ref dataLoader); - } - - /// - /// Creates a new value from constant buffer data. - /// - /// The type of D2D1 pixel shader value to create. - /// The input with the constant buffer data. - /// The resulting instance. - /// Thrown if is not large enough for the current shader type. - public static T CreateFromConstantBuffer(ReadOnlySpan span) - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - return T.CreateFromConstantBuffer(span); - } - - /// - /// Tries to create a value from constant buffer data. - /// - /// The type of D2D1 pixel shader value to create. - /// The input with the constant buffer data. - /// The resulting value, if successful. - /// Whether or not the value was retrieved successfully. - public static bool TryCreateFromConstantBuffer(ReadOnlySpan span, out T shader) - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - if (span.Length >= T.ConstantBufferSize) - { - shader = T.CreateFromConstantBuffer(span); - - return true; - } - - shader = default; - - return false; - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1PixelShaderEffect.cs b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1PixelShaderEffect.cs deleted file mode 100644 index b341f72a..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1PixelShaderEffect.cs +++ /dev/null @@ -1,553 +0,0 @@ -using System; -using System.Buffers; -using System.Text; -using ComputeSharp.D2D1.Descriptors; -using ComputeSharp.D2D1.Extensions; -using ComputeSharp.D2D1.Interop.Effects; -using ComputeSharp.D2D1.Shaders.Interop.Buffers; -using ComputeSharp.D2D1.Shaders.Interop.Effects.ResourceManagers; -using ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers; -using ComputeSharp.D2D1.Shaders.Loaders; -using ComputeSharp.Win32; - -namespace ComputeSharp.D2D1.Interop; - -/// -/// An implementation of a D2D1 pixel shader effect that can be used to instantiate ID2D1Effect objects. -/// -public static unsafe class D2D1PixelShaderEffect -{ - /// - /// Gets the effect id of the D2D effect using this shader. - /// - /// The type of D2D1 pixel shader to get the effect id for. - /// The effect id of the D2D effect using shaders. - public static ref readonly Guid GetEffectId() - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - return ref T.EffectId; - } - - /// - /// Gets the effect display name of the D2D effect using this shader, if available. - /// - /// The type of D2D1 pixel shader to get the effect display name for. - /// The effect display name of the D2D effect using shaders, if available. - public static string? GetEffectDisplayName() - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - return T.EffectDisplayName; - } - - /// - /// Gets the effect description of the D2D effect using this shader, if available. - /// - /// The type of D2D1 pixel shader to get the effect description for. - /// The effect description of the D2D effect using shaders, if available. - public static string? GetEffectDescription() - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - return T.EffectDescription; - } - - /// - /// Gets the effect category of the D2D effect using this shader, if available. - /// - /// The type of D2D1 pixel shader to get the effect category for. - /// The effect category of the D2D effect using shaders, if available. - public static string? GetEffectCategory() - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - return T.EffectCategory; - } - - /// - /// Gets the effect author of the D2D effect using this shader, if available. - /// - /// The type of D2D1 pixel shader to get the effect author for. - /// The effect author of the D2D effect using shaders, if available. - public static string? GetEffectAuthor() - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - return T.EffectAuthor; - } - - /// - /// Creates a D2D effect instance for a given pixel shader type. - /// - /// The type of D2D1 pixel shader to create a D2D effect instance for. - /// The effect implementation returned by the factory. - /// The error code for the operation. - /// - /// - /// This method provides the PD2D1_EFFECT_FACTORY - /// implementation for a given pixel shader type . It is only meant to be used to register an effect with this shader type, and - /// should only ever be used implicitly by the ComputeSharp infrastructure, or in advanced scenarios where effects are registered manually. - /// - /// - /// This method is guaranteed to never throw an exception, and can be used directly in a method exported to native code. - /// - /// - /// The main use case scenario for calling is to produce the factory for - /// ID2D1Factory1::RegisterEffectFromString, - /// which should then be returned from implementations (either generated or manually authored). - /// - /// - public static int CreateEffectUnsafe(void** effectImpl) - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - return PixelShaderEffect.Factory(PixelShaderEffect.Globals.Instance, (IUnknown**)effectImpl); - } - - /// - /// Registers an effect from an input D2D1 pixel shader, by calling ID2D1Factory1::RegisterEffectFromString. - /// - /// The type of D2D1 pixel shader to register. - /// A pointer to the ID2D1Factory1 instance to use. - /// The of the registered effect, which can be used to call ID2D1DeviceContext::CreateEffect. - /// Thrown if is . - /// Thrown if an effect is registered multiple times with different properties. - /// - /// The returned value is the same as that returned by . - /// For more info, see . - /// - public static void RegisterForD2D1Factory1(void* d2D1Factory1, out Guid effectId) - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - default(ArgumentNullException).ThrowIfNull(d2D1Factory1); - - effectId = default; - - using D2D1EffectXmlFactory.EffectXml effectXml = D2D1EffectXmlFactory.GetXmlBuffer(); - - fixed (char* pXml = effectXml.GetBuffer()) - fixed (char* pBufferPropertyName = nameof(D2D1PixelShaderEffectProperty.ConstantBuffer)) - fixed (char* pTransformMapperPropertyName = nameof(D2D1PixelShaderEffectProperty.TransformMapper)) - fixed (char* pResourceTextureManager0PropertyName = nameof(D2D1PixelShaderEffectProperty.ResourceTextureManager0)) - fixed (char* pResourceTextureManager1PropertyName = nameof(D2D1PixelShaderEffectProperty.ResourceTextureManager1)) - fixed (char* pResourceTextureManager2PropertyName = nameof(D2D1PixelShaderEffectProperty.ResourceTextureManager2)) - fixed (char* pResourceTextureManager3PropertyName = nameof(D2D1PixelShaderEffectProperty.ResourceTextureManager3)) - fixed (char* pResourceTextureManager4PropertyName = nameof(D2D1PixelShaderEffectProperty.ResourceTextureManager4)) - fixed (char* pResourceTextureManager5PropertyName = nameof(D2D1PixelShaderEffectProperty.ResourceTextureManager5)) - fixed (char* pResourceTextureManager6PropertyName = nameof(D2D1PixelShaderEffectProperty.ResourceTextureManager6)) - fixed (char* pResourceTextureManager7PropertyName = nameof(D2D1PixelShaderEffectProperty.ResourceTextureManager7)) - fixed (char* pResourceTextureManager8PropertyName = nameof(D2D1PixelShaderEffectProperty.ResourceTextureManager8)) - fixed (char* pResourceTextureManager9PropertyName = nameof(D2D1PixelShaderEffectProperty.ResourceTextureManager9)) - fixed (char* pResourceTextureManager10PropertyName = nameof(D2D1PixelShaderEffectProperty.ResourceTextureManager10)) - fixed (char* pResourceTextureManager11PropertyName = nameof(D2D1PixelShaderEffectProperty.ResourceTextureManager11)) - fixed (char* pResourceTextureManager12PropertyName = nameof(D2D1PixelShaderEffectProperty.ResourceTextureManager12)) - fixed (char* pResourceTextureManager13PropertyName = nameof(D2D1PixelShaderEffectProperty.ResourceTextureManager13)) - fixed (char* pResourceTextureManager14PropertyName = nameof(D2D1PixelShaderEffectProperty.ResourceTextureManager14)) - fixed (char* pResourceTextureManager15PropertyName = nameof(D2D1PixelShaderEffectProperty.ResourceTextureManager15)) - { - // Prepare the effect binding functions - D2D1_PROPERTY_BINDING* d2D1PropertyBinding = stackalloc D2D1_PROPERTY_BINDING[D2D1PixelShaderEffectProperty.MaximumNumberOfAvailableProperties]; - - // Property names - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ConstantBuffer].propertyName = (ushort*)pBufferPropertyName; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.TransformMapper].propertyName = (ushort*)pTransformMapperPropertyName; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager0].propertyName = (ushort*)pResourceTextureManager0PropertyName; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager1].propertyName = (ushort*)pResourceTextureManager1PropertyName; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager2].propertyName = (ushort*)pResourceTextureManager2PropertyName; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager3].propertyName = (ushort*)pResourceTextureManager3PropertyName; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager4].propertyName = (ushort*)pResourceTextureManager4PropertyName; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager5].propertyName = (ushort*)pResourceTextureManager5PropertyName; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager6].propertyName = (ushort*)pResourceTextureManager6PropertyName; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager7].propertyName = (ushort*)pResourceTextureManager7PropertyName; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager8].propertyName = (ushort*)pResourceTextureManager8PropertyName; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager9].propertyName = (ushort*)pResourceTextureManager9PropertyName; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager10].propertyName = (ushort*)pResourceTextureManager10PropertyName; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager11].propertyName = (ushort*)pResourceTextureManager11PropertyName; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager12].propertyName = (ushort*)pResourceTextureManager12PropertyName; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager13].propertyName = (ushort*)pResourceTextureManager13PropertyName; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager14].propertyName = (ushort*)pResourceTextureManager14PropertyName; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager15].propertyName = (ushort*)pResourceTextureManager15PropertyName; - - // Property getters - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ConstantBuffer].getFunction = &PixelShaderEffect.GetConstantBufferImpl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.TransformMapper].getFunction = &PixelShaderEffect.GetTransformMapperImpl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager0].getFunction = &PixelShaderEffect.GetResourceTextureManager0Impl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager1].getFunction = &PixelShaderEffect.GetResourceTextureManager1Impl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager2].getFunction = &PixelShaderEffect.GetResourceTextureManager2Impl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager3].getFunction = &PixelShaderEffect.GetResourceTextureManager3Impl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager4].getFunction = &PixelShaderEffect.GetResourceTextureManager4Impl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager5].getFunction = &PixelShaderEffect.GetResourceTextureManager5Impl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager6].getFunction = &PixelShaderEffect.GetResourceTextureManager6Impl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager7].getFunction = &PixelShaderEffect.GetResourceTextureManager7Impl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager8].getFunction = &PixelShaderEffect.GetResourceTextureManager8Impl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager9].getFunction = &PixelShaderEffect.GetResourceTextureManager9Impl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager10].getFunction = &PixelShaderEffect.GetResourceTextureManager10Impl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager11].getFunction = &PixelShaderEffect.GetResourceTextureManager11Impl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager12].getFunction = &PixelShaderEffect.GetResourceTextureManager12Impl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager13].getFunction = &PixelShaderEffect.GetResourceTextureManager13Impl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager14].getFunction = &PixelShaderEffect.GetResourceTextureManager14Impl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager15].getFunction = &PixelShaderEffect.GetResourceTextureManager15Impl; - - // Property setters - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ConstantBuffer].setFunction = &PixelShaderEffect.SetConstantBufferImpl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.TransformMapper].setFunction = &PixelShaderEffect.SetTransformMapperImpl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager0].setFunction = &PixelShaderEffect.SetResourceTextureManager0Impl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager1].setFunction = &PixelShaderEffect.SetResourceTextureManager1Impl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager2].setFunction = &PixelShaderEffect.SetResourceTextureManager2Impl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager3].setFunction = &PixelShaderEffect.SetResourceTextureManager3Impl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager4].setFunction = &PixelShaderEffect.SetResourceTextureManager4Impl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager5].setFunction = &PixelShaderEffect.SetResourceTextureManager5Impl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager6].setFunction = &PixelShaderEffect.SetResourceTextureManager6Impl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager7].setFunction = &PixelShaderEffect.SetResourceTextureManager7Impl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager8].setFunction = &PixelShaderEffect.SetResourceTextureManager8Impl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager9].setFunction = &PixelShaderEffect.SetResourceTextureManager9Impl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager10].setFunction = &PixelShaderEffect.SetResourceTextureManager10Impl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager11].setFunction = &PixelShaderEffect.SetResourceTextureManager11Impl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager12].setFunction = &PixelShaderEffect.SetResourceTextureManager12Impl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager13].setFunction = &PixelShaderEffect.SetResourceTextureManager13Impl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager14].setFunction = &PixelShaderEffect.SetResourceTextureManager14Impl; - d2D1PropertyBinding[D2D1PixelShaderEffectProperty.ResourceTextureManager15].setFunction = &PixelShaderEffect.SetResourceTextureManager15Impl; - - fixed (Guid* pGuid = &T.EffectId) - { - // Register the effect - ((ID2D1Factory1*)d2D1Factory1)->RegisterEffectFromString( - classId: pGuid, - propertyXml: (ushort*)pXml, - bindings: d2D1PropertyBinding, - bindingsCount: (uint)(D2D1PixelShaderEffectProperty.NumberOfAlwaysAvailableProperties + T.ResourceTextureCount), - effectFactory: (delegate* unmanaged)T.EffectFactory).Assert(); - } - - effectId = T.EffectId; - } - } - - /// - /// Gets a binary blob containing serialized information that can be used to register an effect, by using ID2D1Factory1::RegisterEffectFromString. - /// - /// The type of D2D1 pixel shader to get the registration blob for. - /// The of the registered effect, which can be used to call ID2D1DeviceContext::CreateEffect. - /// A blob containing serialized information that can be used to register an effect. - /// Thrown if an effect is registered multiple times with different properties. - /// - /// - /// This blob can be useful to marshal registration data across an app domain boundary without having assembly references cross this boundary as well. - /// - /// - /// For instance, an application could allow plugins to create effects through the ComputeSharp.D2D1 APIs, and to then create an effect registration - /// blob to pass to the main application, which could then use it to register the effect. This way, even if a plugin was loaded with a separate assembly load - /// context and using a different (potentially incompatible) version of ComputeSharp.D2D1, the two could still work side by side with no issues. - /// - /// - /// The binary blob contains information with the following format: - /// - /// The blob version id (a ). - /// The effect id (a ). - /// The number of inputs for the effect (an ). - /// The effect XML description (as null-terminated UTF8 text). - /// The number of property bindings (an ). - /// The property name (as null-terminated UTF8 text). - /// The property getter (a ). - /// The property setter (a ). - /// The effect factory (a ). - /// - /// The property name, getter and setter are grouped together after the number of bindings. - /// - /// - /// To make the deserialization easier, the type can be used to read and validate the returned blob. - /// The leading blob id will determine what subtype should be used to deserialize the blob (eg. ). - /// - /// The returned value is the same as that returned by . - /// For more info, see . - /// - public static ReadOnlyMemory GetRegistrationBlob(out Guid effectId) - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - ArrayPoolBinaryWriter writer = new(ArrayPoolBinaryWriter.DefaultInitialBufferSize); - - // Blob id - writer.Write(D2D1EffectRegistrationData.V1.BlobId); - - // Effect id and number of inputs - writer.Write(T.EffectId); - writer.Write(T.InputCount); - - // Retrieve the effect XML and include it into the registration blob - using (D2D1EffectXmlFactory.EffectXml effectXml = D2D1EffectXmlFactory.GetXmlBuffer()) - { - ReadOnlySpan registrationText = effectXml.GetBuffer(); - int maxRegistrationTextByteCount = Encoding.UTF8.GetMaxByteCount(registrationText.Length); - byte[] registrationTextUtf8 = ArrayPool.Shared.Rent(maxRegistrationTextByteCount); - - // Encode the effect XML into UTF8 to write into the registration blob. - // This is marginally slower than building it inline here directly in - // UTF8 format, but the registration blob is not the primary scenario. - // Besides, the overhead is just a matter of a few more microseconds. - int registrationTextByteCount = Encoding.UTF8.GetBytes(registrationText, registrationTextUtf8); - - // Build the XML text - writer.Write(registrationTextUtf8.AsSpan(0, registrationTextByteCount)); - - ArrayPool.Shared.Return(registrationTextUtf8); - } - - // Bindings - writer.Write(D2D1PixelShaderEffectProperty.NumberOfAlwaysAvailableProperties + T.ResourceTextureCount); - writer.Write("ConstantBuffer"u8); - writer.Write((byte)'\0'); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.GetConstantBufferImpl); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.SetConstantBufferImpl); - writer.Write("TransformMapper"u8); - writer.Write((byte)'\0'); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.GetTransformMapperImpl); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.SetTransformMapperImpl); - - // Add all resource texture manager property bindings - for (int i = 0; i < T.ResourceTextureCount; i++) - { - switch (i) - { - case 0: - writer.Write("ResourceTextureManager0"u8); - writer.Write((byte)'\0'); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.GetResourceTextureManager0Impl); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.SetResourceTextureManager0Impl); - break; - case 1: - writer.Write("ResourceTextureManager1"u8); - writer.Write((byte)'\0'); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.GetResourceTextureManager1Impl); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.SetResourceTextureManager1Impl); - break; - case 2: - writer.Write("ResourceTextureManager2"u8); - writer.Write((byte)'\0'); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.GetResourceTextureManager2Impl); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.SetResourceTextureManager2Impl); - break; - case 3: - writer.Write("ResourceTextureManager3"u8); - writer.Write((byte)'\0'); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.GetResourceTextureManager3Impl); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.SetResourceTextureManager3Impl); - break; - case 4: - writer.Write("ResourceTextureManager4"u8); - writer.Write((byte)'\0'); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.GetResourceTextureManager4Impl); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.SetResourceTextureManager4Impl); - break; - case 5: - writer.Write("ResourceTextureManager5"u8); - writer.Write((byte)'\0'); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.GetResourceTextureManager5Impl); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.SetResourceTextureManager5Impl); - break; - case 6: - writer.Write("ResourceTextureManager6"u8); - writer.Write((byte)'\0'); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.GetResourceTextureManager6Impl); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.SetResourceTextureManager6Impl); - break; - case 7: - writer.Write("ResourceTextureManager7"u8); - writer.Write((byte)'\0'); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.GetResourceTextureManager7Impl); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.SetResourceTextureManager7Impl); - break; - case 8: - writer.Write("ResourceTextureManager8"u8); - writer.Write((byte)'\0'); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.GetResourceTextureManager8Impl); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.SetResourceTextureManager8Impl); - break; - case 9: - writer.Write("ResourceTextureManager9"u8); - writer.Write((byte)'\0'); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.GetResourceTextureManager9Impl); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.SetResourceTextureManager9Impl); - break; - case 10: - writer.Write("ResourceTextureManager10"u8); - writer.Write((byte)'\0'); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.GetResourceTextureManager10Impl); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.SetResourceTextureManager10Impl); - break; - case 11: - writer.Write("ResourceTextureManager11"u8); - writer.Write((byte)'\0'); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.GetResourceTextureManager11Impl); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.SetResourceTextureManager11Impl); - break; - case 12: - writer.Write("ResourceTextureManager12"u8); - writer.Write((byte)'\0'); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.GetResourceTextureManager12Impl); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.SetResourceTextureManager12Impl); - break; - case 13: - writer.Write("ResourceTextureManager13"u8); - writer.Write((byte)'\0'); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.GetResourceTextureManager13Impl); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.SetResourceTextureManager13Impl); - break; - case 14: - writer.Write("ResourceTextureManager14"u8); - writer.Write((byte)'\0'); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.GetResourceTextureManager14Impl); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.SetResourceTextureManager14Impl); - break; - case 15: - writer.Write("ResourceTextureManager15"u8); - writer.Write((byte)'\0'); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.GetResourceTextureManager15Impl); - writer.Write((nint)(delegate* unmanaged)&PixelShaderEffect.SetResourceTextureManager15Impl); - break; - } - } - - // Effect factory - writer.Write(T.EffectFactory); - - byte[] registrationBlob = writer.WrittenSpan.ToArray(); - - writer.Dispose(); - - // Extract the effect id (the same that was encoded in the registration blob) - effectId = T.EffectId; - - return registrationBlob; - } - - /// - /// Creates an effect wrapping an input D2D1 pixel shader, by calling ID2D1DeviceContext::CreateEffect. - /// - /// The type of D2D1 pixel shader to create an effect for. - /// A pointer to the ID2D1DeviceContext instance to use. - /// A pointer to the resulting ID2D1Effect* pointer to produce. - /// Thrown if or are . - /// - /// Thrown if this method is called before initializing a shader effect for the shader type . - /// To do so, make sure to call either (or an overload), or - /// to use (or an overload), and use that blob to register an effect. - /// - /// For more info, see . - public static void CreateFromD2D1DeviceContext(void* d2D1DeviceContext, void** d2D1Effect) - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - default(ArgumentNullException).ThrowIfNull(d2D1DeviceContext); - default(ArgumentNullException).ThrowIfNull(d2D1Effect); - - fixed (Guid* pGuid = &T.EffectId) - { - ((ID2D1DeviceContext*)d2D1DeviceContext)->CreateEffect( - effectId: pGuid, - effect: (ID2D1Effect**)d2D1Effect).Assert(); - } - } - - /// - /// Sets the constant buffer from an input D2D1 effect, by calling ID2D1Effect::SetValue. - /// - /// The type of D2D1 pixel shader to set the constant buffer for. - /// A pointer to the ID2D1Effect instance to use. - /// The input D2D1 pixel shader to set the contant buffer for. - /// Thrown if is . - /// For more info, see . - public static void SetConstantBufferForD2D1Effect(void* d2D1Effect, in T shader) - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - default(ArgumentNullException).ThrowIfNull(d2D1Effect); - - D2D1EffectConstantBufferLoader dataLoader = new((ID2D1Effect*)d2D1Effect); - - T.LoadConstantBuffer(in shader, ref dataLoader); - } - - /// - /// Sets the resource texture manager from an input D2D1 effect, by calling ID2D1Effect::SetValue. - /// - /// A pointer to the ID2D1Effect instance to use. - /// The input ID2D1ResourceTextureManager object (see ). - /// The index of the resource texture manager to assign the resource texture manager to (note: this might not match the resource texture index). - /// Thrown if or are . - /// Thrown if is outside of the allowed range (ie. [0, 16]). - /// For more info, see . - public static void SetResourceTextureManagerForD2D1Effect(void* d2D1Effect, void* resourceTextureManager, int index) - { - default(ArgumentNullException).ThrowIfNull(d2D1Effect); - default(ArgumentNullException).ThrowIfNull(resourceTextureManager); - default(ArgumentOutOfRangeException).ThrowIfNotInRange(index, 0, 16); - - ((ID2D1Effect*)d2D1Effect)->SetValue( - index: D2D1PixelShaderEffectProperty.ResourceTextureManager0 + (uint)index, - type: D2D1_PROPERTY_TYPE.D2D1_PROPERTY_TYPE_IUNKNOWN, - data: (byte*)&resourceTextureManager, - dataSize: (uint)sizeof(void*)).Assert(); - } - - /// - /// Sets the resource texture manager from an input D2D1 effect, by calling ID2D1Effect::SetValue. - /// - /// A pointer to the ID2D1Effect instance to use. - /// The input instance. - /// The index of the resource texture manager to assign the resource texture manager to (note: this might not match the resource texture index) - /// Thrown if or are . - /// Thrown if is outside of the allowed range (ie. [0, 16]). - /// For more info, see . - public static void SetResourceTextureManagerForD2D1Effect(void* d2D1Effect, D2D1ResourceTextureManager resourceTextureManager, int index) - { - default(ArgumentNullException).ThrowIfNull(d2D1Effect); - default(ArgumentNullException).ThrowIfNull(resourceTextureManager); - default(ArgumentOutOfRangeException).ThrowIfNotInRange(index, 0, 16); - - using ComPtr resourceTextureManager2 = default; - - resourceTextureManager.GetD2D1ResourceTextureManager(resourceTextureManager2.GetAddressOf()); - - ((ID2D1Effect*)d2D1Effect)->SetValue( - index: D2D1PixelShaderEffectProperty.ResourceTextureManager0 + (uint)index, - type: D2D1_PROPERTY_TYPE.D2D1_PROPERTY_TYPE_IUNKNOWN, - data: (byte*)resourceTextureManager2.GetAddressOf(), - dataSize: (uint)sizeof(void*)).Assert(); - } - - /// - /// Sets the transform mapper for an input D2D1 effect, by calling ID2D1Effect::SetValue. - /// - /// A pointer to the ID2D1Effect instance to use. - /// The input ID2D1DrawTransformMapper object (see ). - /// Thrown if or are . - /// For more info, see . - public static void SetTransformMapperForD2D1Effect(void* d2D1Effect, void* transformMapper) - { - default(ArgumentNullException).ThrowIfNull(d2D1Effect); - default(ArgumentNullException).ThrowIfNull(transformMapper); - - ((ID2D1Effect*)d2D1Effect)->SetValue( - index: D2D1PixelShaderEffectProperty.TransformMapper, - type: D2D1_PROPERTY_TYPE.D2D1_PROPERTY_TYPE_IUNKNOWN, - data: (byte*)&transformMapper, - dataSize: (uint)sizeof(void*)).Assert(); - } - - /// - /// Sets the transform mapper for an input D2D1 effect, by calling ID2D1Effect::SetValue. - /// - /// A pointer to the ID2D1Effect instance to use. - /// The input ID2D1DrawTransformMapper object. - /// Thrown if or are . - /// For more info, see . - public static void SetTransformMapperForD2D1Effect(void* d2D1Effect, D2D1DrawTransformMapper transformMapper) - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - default(ArgumentNullException).ThrowIfNull(d2D1Effect); - default(ArgumentNullException).ThrowIfNull(transformMapper); - - using ComPtr transformMapper2 = default; - - transformMapper.GetD2D1TransformMapper(transformMapper2.GetAddressOf()); - - ((ID2D1Effect*)d2D1Effect)->SetValue( - index: D2D1PixelShaderEffectProperty.TransformMapper, - type: D2D1_PROPERTY_TYPE.D2D1_PROPERTY_TYPE_IUNKNOWN, - data: (byte*)transformMapper2.GetAddressOf(), - dataSize: (uint)sizeof(void*)).Assert(); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1PixelShaderEffectProperty.cs b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1PixelShaderEffectProperty.cs deleted file mode 100644 index 5b823089..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1PixelShaderEffectProperty.cs +++ /dev/null @@ -1,140 +0,0 @@ -namespace ComputeSharp.D2D1.Interop; - -/// -/// A container for indices of properties from the type. -/// The values in this type can be used to easily set and retrieve properties from effect instances. -/// -public static class D2D1PixelShaderEffectProperty -{ - /// - /// The index for the constant buffer property of a object. - /// - /// - /// The value to set for this property can be retrieved with . - /// The value of this property is of type D2D1_PROPERTY_TYPE_BLOB. - /// This value can be passed when calling ID2D1Effect::GetValue. - /// For more info, see . - /// - public const uint ConstantBuffer = 0; - - /// - /// The index for the ID2D1DrawTransformMapper property of a object. - /// - /// - /// The value of this property is of type D2D1_PROPERTY_TYPE_IUNKNOWN. - /// This value can be passed when calling ID2D1Effect::SetValue. - /// For more info, see . - /// - public const uint TransformMapper = 1; - - /// - /// The index for the ID2D1ResourceTextureManager instance for the resource texture at index 0. - /// - /// - /// For more info, see . - /// This property is only available if a shader declares at least N + 1 resource textures. - /// - public const uint ResourceTextureManager0 = 2; - - /// - /// The index for the ID2D1ResourceTextureManager instance for the resource texture at index 1. - /// - /// - public const uint ResourceTextureManager1 = 3; - - /// - /// The index for the ID2D1ResourceTextureManager instance for the resource texture at index 2. - /// - /// - public const uint ResourceTextureManager2 = 4; - - /// - /// The index for the ID2D1ResourceTextureManager instance for the resource texture at index 3. - /// - /// - public const uint ResourceTextureManager3 = 5; - - /// - /// The index for the ID2D1ResourceTextureManager instance for the resource texture at index 4. - /// - /// - public const uint ResourceTextureManager4 = 6; - - /// - /// The index for the ID2D1ResourceTextureManager instance for the resource texture at index 5. - /// - /// - public const uint ResourceTextureManager5 = 7; - - /// - /// The index for the ID2D1ResourceTextureManager instance for the resource texture at index 6. - /// - /// - public const uint ResourceTextureManager6 = 8; - - /// - /// The index for the ID2D1ResourceTextureManager instance for the resource texture at index 7. - /// - /// - public const uint ResourceTextureManager7 = 9; - - /// - /// The index for the ID2D1ResourceTextureManager instance for the resource texture at index 8. - /// - /// - public const uint ResourceTextureManager8 = 10; - - /// - /// The index for the ID2D1ResourceTextureManager instance for the resource texture at index 9. - /// - /// - public const uint ResourceTextureManager9 = 11; - - /// - /// The index for the ID2D1ResourceTextureManager instance for the resource texture at index 10. - /// - /// - public const uint ResourceTextureManager10 = 12; - - /// - /// The index for the ID2D1ResourceTextureManager instance for the resource texture at index 11. - /// - /// - public const uint ResourceTextureManager11 = 13; - - /// - /// The index for the ID2D1ResourceTextureManager instance for the resource texture at index 12. - /// - /// - public const uint ResourceTextureManager12 = 14; - - /// - /// The index for the ID2D1ResourceTextureManager instance for the resource texture at index 13. - /// - /// - public const uint ResourceTextureManager13 = 15; - - /// - /// The index for the ID2D1ResourceTextureManager instance for the resource texture at index 14. - /// - /// - public const uint ResourceTextureManager14 = 16; - - /// - /// The index for the ID2D1ResourceTextureManager instance for the resource texture at index 15. - /// - /// - public const uint ResourceTextureManager15 = 17; - - /// - /// The maximum total number of properties. - /// - /// This should always be the value of the last property above, plus 1. - internal const int MaximumNumberOfAvailableProperties = 18; - - /// - /// The number of always available properties. - /// - /// These are and . - internal const int NumberOfAlwaysAvailableProperties = 2; -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1PixelShaderInputType.cs b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1PixelShaderInputType.cs deleted file mode 100644 index d7fd74c0..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1PixelShaderInputType.cs +++ /dev/null @@ -1,31 +0,0 @@ -namespace ComputeSharp.D2D1.Interop; - -/// -/// Indicates the type of a given input for a D2D1 pixel shader. -/// -public enum D2D1PixelShaderInputType -{ - /// - /// The input is of simple type. - /// - /// - /// - /// A pixel shader is of simple type when the consuming pixel shader requires only a single input value to perform its computation. This value would normally - /// come from sampling an input texture at the texture coordinate emitted by the vertex shader. Such a pixel shader is said to perform simple sampling. - /// - /// For more info, see . - /// - Simple, - - /// - /// The input is of complex type. - /// - /// - /// - /// Some pixel shaders, such as a Gaussian blur, compute their output from multiple input samples - /// rather than just a single sample. Such a pixel shader is said to perform complex sampling. - /// - /// For more info, see . - /// - Complex -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1PropertyBinding.cs b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1PropertyBinding.cs deleted file mode 100644 index 620320b3..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1PropertyBinding.cs +++ /dev/null @@ -1,35 +0,0 @@ -namespace ComputeSharp.D2D1.Interop; - -/// -/// A model representing a property binding for an effect. -/// -public readonly unsafe struct D2D1PropertyBinding -{ - /// - /// Creates a new instance with the specified parameters. - /// - /// The property name. - /// A pointer to the property get function callback - /// A pointer to the property set function callback - internal D2D1PropertyBinding(string name, void* getFunction, void* setFunction) - { - PropertyName = name; - GetFunction = getFunction; - SetFunction = setFunction; - } - - /// - /// Gets the name of the property. - /// - public string PropertyName { get; } - - /// - /// Gets the property get function (a ). - /// - public void* GetFunction { get; } - - /// - /// Gets the property set function (a ). - /// - public void* SetFunction { get; } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1ReflectionServices.cs b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1ReflectionServices.cs deleted file mode 100644 index 164b45f2..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1ReflectionServices.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System; -using ComputeSharp.D2D1.Descriptors; -using ComputeSharp.D2D1.Extensions; -using ComputeSharp.Win32; - -namespace ComputeSharp.D2D1.Interop; - -/// -/// Provides methods to extract reflection info on D2D1 shaders generated using this library. -/// -public static class D2D1ReflectionServices -{ - /// - /// Gets the shader info associated with a given D2D1 shader. - /// - /// The type of D2D1 shader to retrieve info for. - /// The resulting instance. - /// - /// If the target shader type is precompiled (ie. it's annotated with ), that bytecode will - /// be reused to reflect on the shader, so the same shader profile and compile options will be reused, which can make the returned metadata more accurate. - /// - /// If the shader is not precompiled, it will be compiled on the fly using the default settings for both the shader profile and the compile options. That is, - /// and (with linking optionally enabled if supported by the shader type). - /// - /// - public static unsafe D2D1ShaderInfo GetShaderInfo() - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - ReadOnlyMemory hlslBytecode = D2D1PixelShader.LoadBytecode(); - - using ComPtr d3D11ShaderReflection = default; - - fixed (byte* hlslBytecodePtr = hlslBytecode.Span) - { - DirectX.D3DReflect( - pSrcData: hlslBytecodePtr, - SrcDataSize: (nuint)hlslBytecode.Length, - pInterface: Windows.__uuidof(), - ppReflector: (void**)d3D11ShaderReflection.GetAddressOf()).Assert(); - } - - D3D11_SHADER_DESC d3D11ShaderDescription; - - d3D11ShaderReflection.Get()->GetDesc(&d3D11ShaderDescription).Assert(); - - D3D_FEATURE_LEVEL d3DFeatureLevel = default; - - d3D11ShaderReflection.Get()->GetMinFeatureLevel(&d3DFeatureLevel).Assert(); - - return new( - CompilerVersion: new string(d3D11ShaderDescription.Creator), - HlslSource: T.HlslSource, - HlslBytecode: hlslBytecode, - ConstantBufferCount: d3D11ShaderDescription.ConstantBuffers, - BoundResourceCount: d3D11ShaderDescription.BoundResources, - InstructionCount: d3D11ShaderDescription.InstructionCount, - TemporaryRegisterCount: d3D11ShaderDescription.TempRegisterCount, - TemporaryArrayCount: d3D11ShaderDescription.TempArrayCount, - ConstantDefineCount: d3D11ShaderDescription.DefCount, - DeclarationCount: d3D11ShaderDescription.DclCount, - TextureNormalInstructions: d3D11ShaderDescription.TextureNormalInstructions, - TextureLoadInstructionCount: d3D11ShaderDescription.TextureLoadInstructions, - TextureStoreInstructionCount: d3D11ShaderDescription.cTextureStoreInstructions, - FloatInstructionCount: d3D11ShaderDescription.FloatInstructionCount, - IntInstructionCount: d3D11ShaderDescription.IntInstructionCount, - UIntInstructionCount: d3D11ShaderDescription.UintInstructionCount, - StaticFlowControlInstructionCount: d3D11ShaderDescription.StaticFlowControlCount, - DynamicFlowControlInstructionCount: d3D11ShaderDescription.DynamicFlowControlCount, - EmitInstructionCount: d3D11ShaderDescription.EmitInstructionCount, - BarrierInstructionCount: d3D11ShaderDescription.cBarrierInstructions, - InterlockedInstructionCount: d3D11ShaderDescription.cInterlockedInstructions, - BitwiseInstructionCount: d3D11ShaderReflection.Get()->GetBitwiseInstructionCount(), - MovcInstructionCount: d3D11ShaderReflection.Get()->GetMovcInstructionCount(), - MovInstructionCount: d3D11ShaderReflection.Get()->GetMovInstructionCount(), - InterfaceSlotCount: d3D11ShaderReflection.Get()->GetNumInterfaceSlots(), - RequiresDoublePrecisionSupport: (d3D11ShaderReflection.Get()->GetRequiresFlags() & (D3D.D3D_SHADER_REQUIRES_DOUBLES | D3D.D3D_SHADER_REQUIRES_11_1_DOUBLE_EXTENSIONS)) != 0, - MinimumFeatureLevel: (D3DFeatureLevel)d3DFeatureLevel); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1ResourceTextureDescription.cs b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1ResourceTextureDescription.cs deleted file mode 100644 index 75e6f9b7..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1ResourceTextureDescription.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System.Runtime.InteropServices; - -#pragma warning disable IDE0290 - -namespace ComputeSharp.D2D1.Interop; - -/// -/// A type containing info on a description for a given D2D1 pixel shader resource resource. -/// -[StructLayout(LayoutKind.Sequential)] -public readonly struct D2D1ResourceTextureDescription -{ - /// - /// Creates a new instance with the specified parameters. - /// - /// The index of the resource texture the description belongs to. - /// The number of dimensions of the resource texture the description belongs to. - public D2D1ResourceTextureDescription(int index, int dimensions) - { - Index = index; - Dimensions = dimensions; - } - - /// - /// Gets the index of the resource texture the description belongs to. - /// - public int Index { get; } - - /// - /// Gets the rank of the resource texture the description belongs to. - /// - public int Dimensions { get; } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1ResourceTextureManager.cs b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1ResourceTextureManager.cs deleted file mode 100644 index 2909a1af..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1ResourceTextureManager.cs +++ /dev/null @@ -1,534 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ComputeSharp.D2D1.Extensions; -using ComputeSharp.D2D1.Shaders.Interop.Effects.ResourceManagers; -using ComputeSharp.Win32; - -namespace ComputeSharp.D2D1.Interop; - -/// -/// Provides an ID2D1ResourceTextureManager implementation, which can be used to manage resources in -/// an effect created with and share them across multiple effect instances. -/// -/// -/// -/// The built-in ID2D1EffectImpl -/// implementation provided by (which makes it possible to register and create -/// ID2D1Effect -/// instances that can be used to run D2D1 pixel shaders) uses resource texture manager objects to handle resource textures. -/// -/// -/// These managers are COM objects implementing the following interface: -/// -/// [uuid(3C4FC7E4-A419-46CA-B5F6-66EB4FF18D64)] -/// interface ID2D1ResourceTextureManager : IUnknown -/// { -/// HRESULT Initialize( -/// [in, optional] const GUID *resourceId, -/// [in] const D2D1_RESOURCE_TEXTURE_PROPERTIES *resourceTextureProperties, -/// [in, optional] const BYTE *data, -/// [in, optional] const UINT32 *strides, -/// UINT32 dataSize); -/// -/// HRESULT Update( -/// [in, optional] const UINT32 *minimumExtents, -/// [in, optional] const UINT32 *maximimumExtents, -/// [in] const UINT32 *strides, -/// UINT32 dimensions, -/// [in] const BYTE *data, -/// UINT32 dataCount); -/// }; -/// -/// -/// -/// These can be used to create resource textures, pass them to effects, and also share resources among different effects. -/// -/// -/// For details of how these work, Initialize maps to -/// ID2D1EffectContext::CreateResourceTexture, -/// whereas Update maps to ID2D1ResourceTexture::Update. -/// The same behavior and parameters as those methods is used. -/// -/// -/// This interface is implemented by ComputeSharp.D2D1, and it can be used through the APIs in . -/// That is, is first used to create an ID2D1ResourceTextureManager instance. Then, -/// can be used to initialize the resource texture held by the manager. The manager can also be assigned to an effect at any time, -/// using the available property indices from . To update texture data after its initial -/// creation, can be used. -/// -/// -/// An RCW (runtime callable wrapper, see ), -/// is also available for all of these APIs, implemented by the same . In this case, the constructor can -/// be used to create and initialize an instance (equivalent to calling and ), and then -/// is available for texture data updates. -/// The instance implements , which can be used in advanced scenarios to retrieve the underlying COM object. -/// -/// -/// The ID2D1ResourceTextureManager contract allows callers to create a resource texture at any time even before the effect -/// has been initialized and the manager assigned to it. In that case, the manager will buffer the data internally, and will defer -/// the creation of the actual resource texture until it's possible for it to do so, at which point it will also free the buffer. -/// -/// -/// If implementing a custom resource manager is needed, in order for external implementations to be accepted by the effect objects -/// created by , the ID2D1ResourceTextureManagerInternal interface also needs to be implemented: -/// -/// [uuid(5CBB1024-8EA1-4689-81BF-8AD190B5EF5D)] -/// interface ID2D1ResourceTextureManagerInternal : IUnknown -/// { -/// HRESULT Initialize( -/// [in] const ID2D1EffectContext *effectContext, -/// [in, optional] const UINT32 *dimensions); -/// -/// HRESULT GetResourceTexture([out] ID2D1ResourceTexture **resourceTexture); -/// }; -/// -/// -/// -/// Note that due to the fact ID2D1EffectContext -/// and ID2D1ResourceTexture are not thread safe, -/// they are only safe to use without additional synchronization when Initialize and GetResourceTexture are called. This happens from the internal -/// ID2D1EffectImpl object, which is invoked by D2D, which will handle -/// taking the necessary lock before invoking these APIs. Due to the fact the context has to be stored internally, custom implementations have to make sure to retrieve the -/// right ID2D1Multithread instance from the effect context and use that to synchronize all accesses to those two objects from all APIs (including those exposed by -/// ID2D1ResourceTextureManager). The built-in implementation of these two interfaces provided by takes care of all this. -/// -/// -/// The dimensions parameter in ID2D1ResourceTextureManagerInternal::Initialize is optional, and can be passed by an ID2D1Effect -/// when initializing an input resurce texture manager, if the dimensions of the resource texture at the target index are known in advance. -/// This can allow the manager to perform additional validation when the resource texture is initialized. Not providing a value is not an -/// error, but if a resource texture with invalid size is used the effect might fail to render later on and be more difficult to troubleshoot. -/// -/// -public sealed unsafe class D2D1ResourceTextureManager : ICustomQueryInterface -{ - /// - /// The object wrapped by the current instance. - /// - private ComPtr d2D1ResourceManagerImpl; - - /// - /// Creates a new instance with the specified parameters. - /// - /// The extents of the resource to create. - /// The buffer precision for the resource to create. - /// The channel depth for the resource to create. - /// The filter for the resource to create. - /// The extend modes for the resource to create. - /// Thrown if creating or initializing the instance failed. - /// - /// - /// Since has a finalizer, which can be invoked at any point on the finalizer - /// thread, it can only be used in effects associated with a device context using a factory that supports multithreaded - /// use (ie. the underlying ID2D1Factory has to be created using D2D1_FACTORY_TYPE_MULTI_THREADED ). - /// Not doing so will cause the resource texture manager to fail to be initialized when used in an effect. - /// - /// - /// For more info, see . - /// - /// - public D2D1ResourceTextureManager( - ReadOnlySpan extents, - D2D1BufferPrecision bufferPrecision, - D2D1ChannelDepth channelDepth, - D2D1Filter filter, - ReadOnlySpan extendModes) - : this( - null, - extents, - bufferPrecision, - channelDepth, - filter, - extendModes, - [], - []) - { - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The resource id for the resource to create. - /// The extents of the resource to create. - /// The buffer precision for the resource to create. - /// The channel depth for the resource to create. - /// The filter for the resource to create. - /// The extend modes for the resource to create. - /// Thrown if creating or initializing the instance failed. - /// - /// - /// Since has a finalizer, which can be invoked at any point on the finalizer - /// thread, it can only be used in effects associated with a device context using a factory that supports multithreaded - /// use (ie. the underlying ID2D1Factory has to be created using D2D1_FACTORY_TYPE_MULTI_THREADED ). - /// Not doing so will cause the resource texture manager to fail to be initialized when used in an effect. - /// - /// - /// For more info, see . - /// - /// - public D2D1ResourceTextureManager( - Guid resourceId, - ReadOnlySpan extents, - D2D1BufferPrecision bufferPrecision, - D2D1ChannelDepth channelDepth, - D2D1Filter filter, - ReadOnlySpan extendModes) - : this( - &resourceId, - extents, - bufferPrecision, - channelDepth, - filter, - extendModes, - [], - []) - { - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The extents of the resource to create. - /// The buffer precision for the resource to create. - /// The channel depth for the resource to create. - /// The filter for the resource to create. - /// The extend modes for the resource to create. - /// The data to load in the resource to create. - /// The strides for the data supplied for the resource to create. - /// Thrown if creating or initializing the instance failed. - /// - /// - /// Since has a finalizer, which can be invoked at any point on the finalizer - /// thread, it can only be used in effects associated with a device context using a factory that supports multithreaded - /// use (ie. the underlying ID2D1Factory has to be created using D2D1_FACTORY_TYPE_MULTI_THREADED ). - /// Not doing so will cause the resource texture manager to fail to be initialized when used in an effect. - /// - /// - /// For more info, see . - /// - /// - public D2D1ResourceTextureManager( - ReadOnlySpan extents, - D2D1BufferPrecision bufferPrecision, - D2D1ChannelDepth channelDepth, - D2D1Filter filter, - ReadOnlySpan extendModes, - ReadOnlySpan data, - ReadOnlySpan strides) - : this( - null, - extents, - bufferPrecision, - channelDepth, - filter, - extendModes, - data, - strides) - { - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The resource id for the resource to create. - /// The extents of the resource to create. - /// The buffer precision for the resource to create. - /// The channel depth for the resource to create. - /// The filter for the resource to create. - /// The extend modes for the resource to create. - /// The data to load in the resource to create. - /// The strides for the data supplied for the resource to create. - /// Thrown if creating or initializing the instance failed. - /// - /// - /// Since has a finalizer, which can be invoked at any point on the finalizer - /// thread, it can only be used in effects associated with a device context using a factory that supports multithreaded - /// use (ie. the underlying ID2D1Factory has to be created using D2D1_FACTORY_TYPE_MULTI_THREADED ). - /// Not doing so will cause the resource texture manager to fail to be initialized when used in an effect. - /// - /// - /// For more info, see . - /// - /// - public D2D1ResourceTextureManager( - Guid resourceId, - ReadOnlySpan extents, - D2D1BufferPrecision bufferPrecision, - D2D1ChannelDepth channelDepth, - D2D1Filter filter, - ReadOnlySpan extendModes, - ReadOnlySpan data, - ReadOnlySpan strides) - : this( - &resourceId, - extents, - bufferPrecision, - channelDepth, - filter, - extendModes, - data, - strides) - { - } - - /// - /// Creates a new instance with the specified parameters. - /// - /// The resource id for the resource to create. - /// The extents of the resource to create. - /// The buffer precision for the resource to create. - /// The channel depth for the resource to create. - /// The filter for the resource to create. - /// The extend modes for the resource to create. - /// The data to load in the resource to create. - /// The strides for the data supplied for the resource to create. - /// Thrown if creating or initializing the instance failed. - private D2D1ResourceTextureManager( - Guid* resourceId, - ReadOnlySpan extents, - D2D1BufferPrecision bufferPrecision, - D2D1ChannelDepth channelDepth, - D2D1Filter filter, - ReadOnlySpan extendModes, - ReadOnlySpan data, - ReadOnlySpan strides) - { - // Manually validate the parameters here to ensure the native objects wouldn't try - // to read out of bounds and potentially AV. For those cases, we just throw here. - if (extents.Length == 0 || - extendModes.Length == 0 || - extents.Length != extendModes.Length || - (data.Length > 0 && strides.Length != extents.Length - 1)) - { - GC.SuppressFinalize(this); - - Marshal.ThrowExceptionForHR(E.E_INVALIDARG); - } - - fixed (D2D1ResourceTextureManagerImpl** d2D1ResourceManagerImpl = this.d2D1ResourceManagerImpl) - { - D2D1ResourceTextureManagerImpl.Factory(d2D1ResourceManagerImpl, requiresMultithread: true); - } - - fixed (uint* pExtents = extents) - fixed (D2D1ExtendMode* pExtendModes = extendModes) - fixed (byte* pData = data) - fixed (uint* pStrides = strides) - { - D2D1_RESOURCE_TEXTURE_PROPERTIES d2D1ResourceTextureProperties; - d2D1ResourceTextureProperties.extents = pExtents; - d2D1ResourceTextureProperties.dimensions = (uint)extents.Length; - d2D1ResourceTextureProperties.bufferPrecision = (D2D1_BUFFER_PRECISION)bufferPrecision; - d2D1ResourceTextureProperties.channelDepth = (D2D1_CHANNEL_DEPTH)channelDepth; - d2D1ResourceTextureProperties.filter = (D2D1_FILTER)filter; - d2D1ResourceTextureProperties.extendModes = (D2D1_EXTEND_MODE*)pExtendModes; - - int hresult = D2D1ResourceTextureManagerImpl.Initialize( - @this: this.d2D1ResourceManagerImpl.Get(), - resourceId: resourceId, - resourceTextureProperties: &d2D1ResourceTextureProperties, - data: pData, - strides: pStrides, - dataSize: (uint)data.Length); - - Marshal.ThrowExceptionForHR(hresult); - } - } - - /// - /// Releases the underlying ID2D1ResourceTextureManager object. - /// - ~D2D1ResourceTextureManager() - { - this.d2D1ResourceManagerImpl.Dispose(); - } - - /// - /// Updates the specific resource texture inside the specific range or box using the supplied data. - /// - /// The "left" extent of the updates if specified. If , the entire texture is updated. - /// The "right" extent of the updates if specified. If , the entire texture is updated. - /// The stride to advance through the input data, according to dimension. - /// The data to be placed into the resource texture. - public void Update( - ReadOnlySpan minimumExtents, - ReadOnlySpan maximimumExtents, - ReadOnlySpan strides, - ReadOnlySpan data) - { - fixed (uint* pMinimumExtents = minimumExtents) - fixed (uint* pMaximumExtents = maximimumExtents) - fixed (uint* pStrides = strides) - fixed (byte* pData = data) - { - int dimensions = strides.Length + 1; - - // Ensure that if the extents are not null, their length is correct. This is again to - // avoid the native method assuming they'd be longer than they are and causing an AV. - if (pMinimumExtents is not null && - pMaximumExtents is not null && - (minimumExtents.Length != dimensions || maximimumExtents.Length != dimensions)) - { - Marshal.ThrowExceptionForHR(E.E_INVALIDARG); - } - - int hresult = D2D1ResourceTextureManagerImpl.Update( - @this: this.d2D1ResourceManagerImpl.Get(), - minimumExtents: pMinimumExtents, - maximimumExtents: pMaximumExtents, - strides: pStrides, - dimensions: (uint)dimensions, - data: pData, - dataCount: (uint)data.Length); - - GC.KeepAlive(this); - - Marshal.ThrowExceptionForHR(hresult); - } - } - - /// - /// Gets the underlying object. - /// - /// The underlying object. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal void GetD2D1ResourceTextureManager(ID2D1ResourceTextureManager** resourceTextureManager) - { - this.d2D1ResourceManagerImpl.CopyTo(resourceTextureManager).Assert(); - - GC.KeepAlive(this); - } - - /// - CustomQueryInterfaceResult ICustomQueryInterface.GetInterface(ref Guid iid, out IntPtr ppv) - { - fixed (Guid* pIid = &iid) - fixed (IntPtr* pPpv = &ppv) - { - int hresult = this.d2D1ResourceManagerImpl.CopyTo(pIid, (void**)pPpv); - - GC.KeepAlive(this); - - return hresult switch - { - S.S_OK => CustomQueryInterfaceResult.Handled, - _ => CustomQueryInterfaceResult.Failed - }; - } - } - - /// - /// Creates a new ID2D1ResourceTextureManager instance. - /// - /// A pointer to the resulting ID2D1ResourceTextureManager instance. - /// - /// The resulting ID2D1ResourceTextureManager instance does not require multithread support for the factory that is - /// assigned to it when initialized from an effect. Callers have the responsibility of ensuring thread safety when using it. - /// - public static void Create(void** resourceTextureManager) - { - D2D1ResourceTextureManagerImpl.Factory((D2D1ResourceTextureManagerImpl**)resourceTextureManager, requiresMultithread: false); - } - - /// - /// Initializes a given ID2D1ResourceTextureManager instance. - /// - /// A pointer to the ID2D1ResourceTextureManager instance to use. - /// The resource id for the resource to create. - /// The extents of the resource to create. - /// The buffer precision for the resource to create. - /// The channel depth for the resource to create. - /// The filter for the resource to create. - /// The extend modes for the resource to create. - /// The data to load in the resource to create. - /// The strides for the data supplied for the resource to create. - /// - /// Depending on internal state, might immediately create the resource - /// texture, or it might buffer the data internally and then create the resource texture at a later time. - /// - public static void Initialize( - void* resourceTextureManager, - Guid resourceId, - ReadOnlySpan extents, - D2D1BufferPrecision bufferPrecision, - D2D1ChannelDepth channelDepth, - D2D1Filter filter, - ReadOnlySpan extendModes, - ReadOnlySpan data, - ReadOnlySpan strides) - { - // Validate parameters early from here too to avoid AVs in the native method - if (extents.Length == 0 || - extendModes.Length == 0 || - extents.Length != extendModes.Length || - (data.Length > 0 && strides.Length != extents.Length - 1)) - { - Marshal.ThrowExceptionForHR(E.E_INVALIDARG); - } - - fixed (uint* pExtents = extents) - fixed (D2D1ExtendMode* pExtendModes = extendModes) - fixed (byte* pData = data) - fixed (uint* pStrides = strides) - { - D2D1_RESOURCE_TEXTURE_PROPERTIES d2D1ResourceTextureProperties; - d2D1ResourceTextureProperties.extents = pExtents; - d2D1ResourceTextureProperties.dimensions = (uint)extents.Length; - d2D1ResourceTextureProperties.bufferPrecision = (D2D1_BUFFER_PRECISION)bufferPrecision; - d2D1ResourceTextureProperties.channelDepth = (D2D1_CHANNEL_DEPTH)channelDepth; - d2D1ResourceTextureProperties.filter = (D2D1_FILTER)filter; - d2D1ResourceTextureProperties.extendModes = (D2D1_EXTEND_MODE*)pExtendModes; - - int hresult = ((ID2D1ResourceTextureManager*)resourceTextureManager)->Initialize( - resourceId: &resourceId, - resourceTextureProperties: &d2D1ResourceTextureProperties, - data: pData, - strides: pStrides, - dataSize: (uint)data.Length); - - Marshal.ThrowExceptionForHR(hresult); - } - } - - /// - /// Updates the data in a given ID2D1ResourceTextureManager instance. - /// - /// A pointer to the ID2D1ResourceTextureManager instance to use. - /// The "left" extent of the updates if specified (if empty, the entire texture is updated). - /// The "right" extent of the updates if specified (if empty, the entire texture is updated). - /// The stride to advance through the input data. - /// The data to be placed into the resource texture. - public static void Update( - void* resourceTextureManager, - ReadOnlySpan minimumExtents, - ReadOnlySpan maximimumExtents, - ReadOnlySpan strides, - ReadOnlySpan data) - { - fixed (uint* pMinimumExtents = minimumExtents) - fixed (uint* pMaximumExtents = maximimumExtents) - fixed (uint* pStrides = strides) - fixed (byte* pData = data) - { - int dimensions = strides.Length + 1; - - // Same validation as in the Update instance method above - if (pMinimumExtents is not null && - pMaximumExtents is not null && - (minimumExtents.Length != dimensions || maximimumExtents.Length != dimensions)) - { - Marshal.ThrowExceptionForHR(E.E_INVALIDARG); - } - - int hresult = ((ID2D1ResourceTextureManager*)resourceTextureManager)->Update( - minimumExtents: pMinimumExtents, - maximimumExtents: pMaximumExtents, - strides: pStrides, - dimensions: (uint)dimensions, - data: pData, - dataCount: (uint)data.Length); - - Marshal.ThrowExceptionForHR(hresult); - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1ShaderCompiler.cs b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1ShaderCompiler.cs deleted file mode 100644 index 8a8400b8..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1ShaderCompiler.cs +++ /dev/null @@ -1,112 +0,0 @@ -using System; -using System.Buffers; -using System.Text; -using ComputeSharp.D2D1.Shaders.Translation; -using ComputeSharp.Win32; - -namespace ComputeSharp.D2D1.Interop; - -/// -/// Provides methods to manually compile D2D1 shaders. -/// -public static class D2D1ShaderCompiler -{ - /// - /// Compiles a new HLSL shader from the input source code. - /// - /// The HLSL source code to compile. - /// The entry point of the shader being compiled. - /// The shader profile to use to compile the shader. - /// The compiler options to use to compile the shader. - /// The bytecode for the compiled shader. - /// Thrown if the compilation fails. - public static ReadOnlyMemory Compile( - ReadOnlySpan hlslSource, - ReadOnlySpan entryPoint, - D2D1ShaderProfile shaderProfile, - D2D1CompileOptions options) - { - // Encode the HLSL source to ASCII - int maxSourceLength = Encoding.ASCII.GetMaxByteCount(hlslSource.Length); - byte[] sourceBuffer = ArrayPool.Shared.Rent(maxSourceLength); - int sourceWrittenBytes = Encoding.ASCII.GetBytes(hlslSource, sourceBuffer); - - // Encode the entry point to ASCII - int maxEntryPointLength = Encoding.ASCII.GetMaxByteCount(entryPoint.Length) + 1; - byte[] entryPointBuffer = ArrayPool.Shared.Rent(maxEntryPointLength); - int entryPointWrittenBytes = Encoding.ASCII.GetBytes(entryPoint, entryPointBuffer); - - // The entry point has to be null-terminated - entryPointBuffer[entryPointWrittenBytes] = (byte)'\0'; - - ReadOnlySpan sourceAscii = sourceBuffer.AsSpan(0, sourceWrittenBytes); - ReadOnlySpan entryPointAscii = entryPointBuffer.AsSpan(0, entryPointWrittenBytes); - - ReadOnlyMemory bytecode = Compile(sourceAscii, entryPointAscii, shaderProfile, options); - - ArrayPool.Shared.Return(sourceBuffer); - ArrayPool.Shared.Return(entryPointBuffer); - - return bytecode; - } - - /// - /// Compiles a new HLSL shader from the input source code. - /// - /// The HLSL source code to compile (in ASCII). - /// The entry point of the shader being compiled (in ASCII, null-terminated). - /// The shader profile to use to compile the shader. - /// The compiler options to use to compile the shader. - /// The bytecode for the compiled shader. - /// Thrown if the compilation fails. - public static unsafe ReadOnlyMemory Compile( - ReadOnlySpan hlslSourceAscii, - ReadOnlySpan entryPointAscii, - D2D1ShaderProfile shaderProfile, - D2D1CompileOptions options) - { - // Check the additional compile options (not provided by FXC directly) - bool enableLinking = (options & D2D1CompileOptions.EnableLinking) == D2D1CompileOptions.EnableLinking; - bool stripReflectionData = (options & D2D1CompileOptions.StripReflectionData) == D2D1CompileOptions.StripReflectionData; - - // Remove the additional options to make them blittable to flags - options &= ~D2D1CompileOptions.EnableLinking; - options &= ~D2D1CompileOptions.StripReflectionData; - - // Compile the standalone D2D1 full shader - using ComPtr d3DBlobFullShader = D3DCompiler.Compile( - source: hlslSourceAscii, - macro: ASCII.D2D_FULL_SHADER, - d2DEntry: entryPointAscii, - entryPoint: entryPointAscii, - target: ASCII.GetPixelShaderProfile(shaderProfile), - flags: (uint)options, - stripReflectionData: stripReflectionData); - - if (!enableLinking) - { - void* blobFullShaderPtr = d3DBlobFullShader.Get()->GetBufferPointer(); - nuint blobFullShaderSize = d3DBlobFullShader.Get()->GetBufferSize(); - - return new Span(blobFullShaderPtr, (int)blobFullShaderSize).ToArray(); - } - - // Compile the export function - using ComPtr d3DBlobFunction = D3DCompiler.Compile( - source: hlslSourceAscii, - macro: ASCII.D2D_FUNCTION, - d2DEntry: entryPointAscii, - entryPoint: default, - target: ASCII.GetLibraryProfile(shaderProfile), - flags: (uint)options, - stripReflectionData: stripReflectionData); - - // Embed it as private data if requested - using ComPtr d3DBlobLinked = D3DCompiler.SetD3DPrivateData(d3DBlobFullShader.Get(), d3DBlobFunction.Get()); - - void* blobLinkedPtr = d3DBlobLinked.Get()->GetBufferPointer(); - nuint blobLinkedSize = d3DBlobLinked.Get()->GetBufferSize(); - - return new Span(blobLinkedPtr, (int)blobLinkedSize).ToArray(); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1ShaderInfo.cs b/src/ComputeSharp.D2D1/Shaders/Interop/D2D1ShaderInfo.cs deleted file mode 100644 index 1106b56f..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/D2D1ShaderInfo.cs +++ /dev/null @@ -1,62 +0,0 @@ -using System; - -namespace ComputeSharp.D2D1.Interop; - -/// -/// A model representing reflection info for a given D2D1 shader. -/// -/// The compiler version used to build the shader. -/// The HLSL source code the shader was built from. -/// The HLSL bytecode for the shader. -/// The number of shader constant buffers. -/// The number of resource (textures and buffers) bound to a shader. -/// The number of intermediate-language instructions in the compiled shader. -/// The number of temporary registers in the compiled shader. -/// The number of temporary arrays used. -/// The number of constant defines. -/// The number of declarations (input + output). -/// The number of non-categorized texture instructions. -/// The number of texture load instructions. -/// The number of texture write instructions. -/// The number of floating point arithmetic instructions used. -/// The number of signed integer arithmetic instructions used. -/// The number of unsigned integer arithmetic instructions used. -/// The number of static flow control instructions used. -/// The number of dynamic flow control instructions used. -/// The number of emit instructions used. -/// The number of barrier instructions used. -/// The number of interlocked instructions used. -/// The number of bitwise instructions used. -/// The number of movc instructions used. -/// The number of mov instructions used. -/// The number of interface slots used. -/// Indicates whether support for double precision floating point numbers is required. -/// The minimum feature level for the shader. -public sealed record D2D1ShaderInfo( - string CompilerVersion, - string HlslSource, - ReadOnlyMemory HlslBytecode, - uint ConstantBufferCount, - uint BoundResourceCount, - uint InstructionCount, - uint TemporaryRegisterCount, - uint TemporaryArrayCount, - uint ConstantDefineCount, - uint DeclarationCount, - uint TextureNormalInstructions, - uint TextureLoadInstructionCount, - uint TextureStoreInstructionCount, - uint FloatInstructionCount, - uint IntInstructionCount, - uint UIntInstructionCount, - uint StaticFlowControlInstructionCount, - uint DynamicFlowControlInstructionCount, - uint EmitInstructionCount, - uint BarrierInstructionCount, - uint InterlockedInstructionCount, - uint BitwiseInstructionCount, - uint MovcInstructionCount, - uint MovInstructionCount, - uint InterfaceSlotCount, - bool RequiresDoublePrecisionSupport, - D3DFeatureLevel MinimumFeatureLevel); \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/D3DFeatureLevel.cs b/src/ComputeSharp.D2D1/Shaders/Interop/D3DFeatureLevel.cs deleted file mode 100644 index 9fb4b546..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/D3DFeatureLevel.cs +++ /dev/null @@ -1,69 +0,0 @@ -using static ComputeSharp.Win32.D3D_FEATURE_LEVEL; - -namespace ComputeSharp.D2D1.Interop; - -/// -/// Describes the set of features targeted by a Direct3D device. -/// -public enum D3DFeatureLevel -{ - /// - /// Allows Microsoft Compute Driver Model (MCDM) devices to be used, or more feature-rich devices (such as - /// traditional GPUs) that support a superset of the functionality. MCDM is the overall driver model for - /// compute-only; it's a scaled-down peer of the larger scoped Windows Device Driver Model (WDDM). - /// - FeatureLevel1_0_Core = D3D_FEATURE_LEVEL_1_0_CORE, - - /// - /// Targets features supported by feature level 9.1, including shader model 2. - /// - FeatureLevel9_1 = D3D_FEATURE_LEVEL_9_1, - - /// - /// Targets features supported by feature level 9.2, including shader model 2. - /// - FeatureLevel9_2 = D3D_FEATURE_LEVEL_9_2, - - /// - /// Targets features supported by feature level 9.3, including shader model 2. - /// - FeatureLevel9_3 = D3D_FEATURE_LEVEL_9_3, - - /// - /// Targets features supported by Direct3D 10.0, including shader model 4. - /// - FeatureLevel10_0 = D3D_FEATURE_LEVEL_10_0, - - /// - /// Targets features supported by Direct3D 10.1, including shader model 4. - /// - FeatureLevel10_1 = D3D_FEATURE_LEVEL_10_1, - - /// - /// Targets features supported by Direct3D 11.0, including shader model 5. - /// - FeatureLevel11_0 = D3D_FEATURE_LEVEL_11_0, - - /// - /// Targets features supported by Direct3D 11.1, including shader model 5 and logical blend operations. This - /// feature level requires a display driver that is at least implemented to WDDM for Windows 8 (WDDM 1.2). - /// - FeatureLevel11_1 = D3D_FEATURE_LEVEL_11_1, - - /// - /// Targets features supported by Direct3D 12.0, including shader model 5. - /// - FeatureLevel12_0 = D3D_FEATURE_LEVEL_12_0, - - /// - /// Targets features supported by Direct3D 12.1, including shader model 5. - /// - FeatureLevel12_1 = D3D_FEATURE_LEVEL_12_1, - - /// - /// Targets features supported by Direct3D 12.2, including shader model 6.5. For more information about feature - /// level 12_2, see its specification page. - /// Feature level 12_2 is available in Windows SDK builds 20170 and later. - /// - FeatureLevel12_2 = D3D_FEATURE_LEVEL_12_2 -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.Globals{T}.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.Globals{T}.cs deleted file mode 100644 index 0f92fed0..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.Globals{T}.cs +++ /dev/null @@ -1,121 +0,0 @@ -using System; -using ComputeSharp.D2D1.Descriptors; -using ComputeSharp.Win32; - -namespace ComputeSharp.D2D1.Interop.Effects; - -/// -/// A simple and implementation for a given pixel shader. -/// -internal unsafe partial struct PixelShaderEffect -{ - /// - /// A base type with global values for pixel shader effects. - /// - public abstract class Globals - { - /// - public abstract ref readonly Guid EffectId { get; } - - /// - public abstract int ConstantBufferSize { get; } - - /// - public abstract int InputCount { get; } - - /// - public abstract int ResourceTextureCount { get; } - - /// - public abstract ReadOnlyMemory InputTypes { get; } - - /// - public abstract ReadOnlyMemory InputDescriptions { get; } - - /// - public abstract ReadOnlyMemory ResourceTextureDescriptions { get; } - - /// - public abstract D2D1PixelOptions PixelOptions { get; } - - /// - public abstract D2D1BufferPrecision BufferPrecision { get; } - - /// - public abstract D2D1ChannelDepth ChannelDepth { get; } - - /// - public abstract ReadOnlyMemory HlslBytecode { get; } - } - - /// - /// A generic pixel shader implementation. - /// - /// The type of shader. - public sealed class Globals : Globals - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - /// - /// The HLSL bytecode (either precompiled, or the currently available one after compilation). - /// - private ReadOnlyMemory hlslBytecode; - - /// - /// Creates a new instance for shaders of type . - /// - private Globals() - { - } - - /// - /// Gets the shared instance to use. - /// - public static Globals Instance { get; } = new(); - - /// - public override ref readonly Guid EffectId => ref T.EffectId; - - /// - public override int ConstantBufferSize => T.ConstantBufferSize; - - /// - public override int InputCount => T.InputCount; - - /// - public override int ResourceTextureCount => T.ResourceTextureCount; - - /// - public override ReadOnlyMemory InputTypes => T.InputTypes; - - /// - public override ReadOnlyMemory InputDescriptions => T.InputDescriptions; - - /// - public override ReadOnlyMemory ResourceTextureDescriptions => T.ResourceTextureDescriptions; - - /// - public override D2D1PixelOptions PixelOptions => T.PixelOptions; - - /// - public override D2D1BufferPrecision BufferPrecision => T.BufferPrecision; - - /// - public override D2D1ChannelDepth ChannelDepth => T.ChannelDepth; - - /// - public override ReadOnlyMemory HlslBytecode - { - get - { - // Fast path if we already have some bytecode (either precompiled, or already compiled) - if (this.hlslBytecode is ReadOnlyMemory { Length: > 0 } hlslBytecode) - { - return hlslBytecode; - } - - // If not, lazily compile the bytecode when requested - return this.hlslBytecode = D2D1PixelShader.LoadBytecode(); - } - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.ID2D1DrawTransformMethods.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.ID2D1DrawTransformMethods.cs deleted file mode 100644 index 8b6feab4..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.ID2D1DrawTransformMethods.cs +++ /dev/null @@ -1,290 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ComputeSharp.D2D1.Extensions; -using ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers; -using ComputeSharp.Win32; - -namespace ComputeSharp.D2D1.Interop.Effects; - -/// -partial struct PixelShaderEffect -{ - /// - /// The implementation for . - /// - private static unsafe class ID2D1DrawTransformMethods - { - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static int QueryInterface(PixelShaderEffect* @this, Guid* riid, void** ppvObject) - { - @this = (PixelShaderEffect*)&((void**)@this)[-1]; - - return @this->QueryInterface(riid, ppvObject); - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static uint AddRef(PixelShaderEffect* @this) - { - @this = (PixelShaderEffect*)&((void**)@this)[-1]; - - return @this->AddRef(); - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static uint Release(PixelShaderEffect* @this) - { - @this = (PixelShaderEffect*)&((void**)@this)[-1]; - - return @this->Release(); - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static uint GetInputCount(PixelShaderEffect* @this) - { - @this = (PixelShaderEffect*)&((void**)@this)[-1]; - - try - { - return (uint)@this->GetGlobals().InputCount; - } - catch - { - // GetInputCount doesn't respect COM, so it does not return an HRESULT. - // The only thing we can do in this case is just to return 0 instead. - return 0; - } - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static int MapOutputRectToInputRects(PixelShaderEffect* @this, RECT* outputRect, RECT* inputRects, uint inputRectsCount) - { - @this = (PixelShaderEffect*)&((void**)@this)[-1]; - - try - { - default(ArgumentOutOfRangeException).ThrowIfNotEqual((int)inputRectsCount, @this->GetGlobals().InputCount, nameof(inputRectsCount)); - - if (@this->d2D1TransformMapper.Get() is not null) - { - // Forward to the current ID2D1DrawTransformMapper instance - @this->d2D1TransformMapper.Get()->MapOutputRectToInputRects(outputRect, inputRects, inputRectsCount).Assert(); - } - else - { - ReadOnlySpan inputTypes = @this->GetGlobals().InputTypes.Span; - - // If no custom transform is used, apply the default mapping. In this case, the loop will - // automatically handle cases where no inputs are defined. If inputs are present instead, - // the default mapping will set the input rect for a simple input to be the same as the - // output rect, and the input rect for a complex rect to be infinite. In both cases, D2D - // will handle clipping the inputs to the actual output rect area, if needed. - for (uint i = 0; i < inputRectsCount; i++) - { - switch (inputTypes[(int)i]) - { - case D2D1PixelShaderInputType.Simple: - inputRects[i] = *outputRect; - break; - case D2D1PixelShaderInputType.Complex: - inputRects[i].MakeD2D1Infinite(); - break; - default: - return E.E_FAIL; - } - } - } - - return S.S_OK; - } - catch (Exception e) - { - return Marshal.GetHRForException(e); - } - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static int MapInputRectsToOutputRect(PixelShaderEffect* @this, RECT* inputRects, RECT* inputOpaqueSubRects, uint inputRectCount, RECT* outputRect, RECT* outputOpaqueSubRect) - { - @this = (PixelShaderEffect*)&((void**)@this)[-1]; - - try - { - default(ArgumentOutOfRangeException).ThrowIfNotEqual((int)inputRectCount, @this->GetGlobals().InputCount, nameof(inputRectCount)); - - if (@this->d2D1TransformMapper.Get() is not null) - { - using ComPtr d2D1DrawInfoUpdateContext = default; - - // Create an ID2D1DrawInfoUpdateContext instance - D2D1DrawInfoUpdateContextImpl.Factory( - drawInfoUpdateContext: d2D1DrawInfoUpdateContext.GetAddressOf(), - constantBuffer: @this->constantBuffer, - constantBufferSize: @this->GetGlobals().ConstantBufferSize, - d2D1DrawInfo: @this->d2D1DrawInfo.Get()).Assert(); - - // Forward the call to the input ID2D1DrawTransformMapper instance - HRESULT hresult = @this->d2D1TransformMapper.Get()->MapInputRectsToOutputRect( - updateContext: (ID2D1DrawInfoUpdateContext*)d2D1DrawInfoUpdateContext.Get(), - inputRects: inputRects, - inputOpaqueSubRects: inputOpaqueSubRects, - inputRectCount: inputRectCount, - outputRect: outputRect, - outputOpaqueSubRect: outputOpaqueSubRect); - - // Regardless of the operation result, always invalidate the context - d2D1DrawInfoUpdateContext.Get()->Close().Assert(); - - // Now we can validate that the call was in fact successful - hresult.Assert(); - } - else if (inputRectCount == 0) - { - // If there are no inputs, make the output rectangle infinite. This is useful - // to make output-only effects work fine by default, without needing a custom - // transform. In this case, the target area will be the output node anyway. - outputRect->MakeD2D1Infinite(); - - *outputOpaqueSubRect = default; - } - else - { - ReadOnlySpan inputTypes = @this->GetGlobals().InputTypes.Span; - - // If at least one input is present and no custom mapper is available, apply the default - // mapping. In this case, the output rect should be the union of the input rects for all - // the simple shader inputs, or infinite if there are no simple inputs. The input rects - // for complex inputs, if present, are not needed in this scenario, so they're ignored. - RECT unionOfSimpleRects = default; - bool isUnionOfSimpleRectsEmpty = true; - - for (uint i = 0; i < inputRectCount; i++) - { - if (inputTypes[(int)i] == D2D1PixelShaderInputType.Simple) - { - if (isUnionOfSimpleRectsEmpty) - { - unionOfSimpleRects = inputRects[i]; - isUnionOfSimpleRectsEmpty = false; - } - else - { - unionOfSimpleRects = unionOfSimpleRects.Union(inputRects[i]); - } - } - } - - if (isUnionOfSimpleRectsEmpty) - { - outputRect->MakeD2D1Infinite(); - } - else - { - *outputRect = unionOfSimpleRects; - } - - *outputOpaqueSubRect = default; - } - - return S.S_OK; - } - catch (Exception e) - { - return Marshal.GetHRForException(e); - } - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static int MapInvalidRect(PixelShaderEffect* @this, uint inputIndex, RECT invalidInputRect, RECT* invalidOutputRect) - { - @this = (PixelShaderEffect*)&((void**)@this)[-1]; - - try - { - default(ArgumentOutOfRangeException).ThrowIfGreaterThanOrEqual((int)inputIndex, @this->GetGlobals().InputCount, nameof(inputIndex)); - - if (@this->d2D1TransformMapper.Get() is not null) - { - // Forward to the current ID2D1DrawTransformMapper instance - @this->d2D1TransformMapper.Get()->MapInvalidRect(inputIndex, invalidInputRect, invalidOutputRect).Assert(); - } - else - { - // The default mapping in this scenario just needs to set the invalid output rect for simple inputs to - // be the invalid input rect, and to set the invalid output rect for complex inputs to an infinite rect. - switch (@this->GetGlobals().InputTypes.Span[(int)inputIndex]) - { - case D2D1PixelShaderInputType.Simple: - *invalidOutputRect = invalidInputRect; - break; - case D2D1PixelShaderInputType.Complex: - invalidOutputRect->MakeD2D1Infinite(); - break; - default: - return E.E_FAIL; - } - } - - return S.S_OK; - } - catch (Exception e) - { - return Marshal.GetHRForException(e); - } - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static int SetDrawInfo(PixelShaderEffect* @this, ID2D1DrawInfo* drawInfo) - { - @this = (PixelShaderEffect*)&((void**)@this)[-1]; - - try - { - // Store the new ID2D1DrawInfo object - @this->d2D1DrawInfo.Attach(new ComPtr(drawInfo).Get()); - - Guid shaderId = @this->GetGlobals().EffectId; - D2D1PixelOptions pixelOptions = @this->GetGlobals().PixelOptions; - - // Set the pixel shader for the effect - drawInfo->SetPixelShader(&shaderId, (D2D1_PIXEL_OPTIONS)pixelOptions).Assert(); - - // If any input descriptions are present, set them - foreach (ref readonly D2D1InputDescription inputDescription in @this->GetGlobals().InputDescriptions.Span) - { - D2D1_INPUT_DESCRIPTION d2D1InputDescription; - d2D1InputDescription.filter = (D2D1_FILTER)inputDescription.Filter; - d2D1InputDescription.levelOfDetailCount = (uint)inputDescription.LevelOfDetailCount; - - drawInfo->SetInputDescription((uint)inputDescription.Index, d2D1InputDescription).Assert(); - } - - D2D1BufferPrecision bufferPrecision = @this->GetGlobals().BufferPrecision; - D2D1ChannelDepth channelDepth = @this->GetGlobals().ChannelDepth; - - // If a custom buffer precision or channel depth is requested, set it - if (bufferPrecision != D2D1BufferPrecision.Unknown || - channelDepth != D2D1ChannelDepth.Default) - { - drawInfo->SetOutputBuffer( - (D2D1_BUFFER_PRECISION)bufferPrecision, - (D2D1_CHANNEL_DEPTH)channelDepth).Assert(); - } - - return S.S_OK; - } - catch (Exception e) - { - return Marshal.GetHRForException(e); - } - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.ID2D1EffectImplMethods.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.ID2D1EffectImplMethods.cs deleted file mode 100644 index 7b442015..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.ID2D1EffectImplMethods.cs +++ /dev/null @@ -1,157 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ComputeSharp.D2D1.Extensions; -using ComputeSharp.D2D1.Shaders.Interop.Effects.ResourceManagers; -using ComputeSharp.D2D1.Shaders.Interop.Extensions; -using ComputeSharp.Win32; - -#pragma warning disable IDE0060 - -namespace ComputeSharp.D2D1.Interop.Effects; - -/// -/// A simple and implementation for a given pixel shader. -/// -internal unsafe partial struct PixelShaderEffect -{ - /// - /// The implementation for . - /// - private static class ID2D1EffectImplMethods - { - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static int QueryInterface(PixelShaderEffect* @this, Guid* riid, void** ppvObject) - { - return @this->QueryInterface(riid, ppvObject); - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static uint AddRef(PixelShaderEffect* @this) - { - return @this->AddRef(); - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static uint Release(PixelShaderEffect* @this) - { - return @this->Release(); - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static int Initialize(PixelShaderEffect* @this, ID2D1EffectContext* effectContext, ID2D1TransformGraph* transformGraph) - { - try - { - ReadOnlySpan bytecode = @this->GetGlobals().HlslBytecode.Span; - - fixed (Guid* pShaderId = &@this->GetGlobals().EffectId) - fixed (byte* pBytecode = bytecode) - { - HRESULT hresult = effectContext->LoadPixelShader( - shaderId: pShaderId, - shaderBuffer: pBytecode, - shaderBufferCount: (uint)bytecode.Length); - - // If E_INVALIDARG was returned, try to check whether double precision support was requested when not available. This - // is only done to provide a more helpful error message to callers. If no error was returned, the behavior is the same. - // If any error is detected while trying to check for shader support, ignore the value and propagate the current HRESULT. - if (hresult == E.E_INVALIDARG && effectContext->IsShaderSupported(pBytecode, bytecode.Length) == S.S_FALSE) - { - hresult = D2DERR.D2DERR_INSUFFICIENT_DEVICE_CAPABILITIES; - } - - // Finally, assert that we did load the pixel shader correctly - hresult.Assert(); - } - - // If loading the bytecode succeeded, set the transform node - transformGraph->SetSingleTransformNode((ID2D1TransformNode*)&@this->lpVtblForID2D1DrawTransform).Assert(); - - // Store the new ID2D1EffectContext object - @this->d2D1EffectContext.Attach(new ComPtr(effectContext).Get()); - - return S.S_OK; - } - catch (Exception e) - { - return Marshal.GetHRForException(e); - } - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static int PrepareForRender(PixelShaderEffect* @this, D2D1_CHANGE_TYPE changeType) - { - try - { - // Validate the constant buffer. We either must have a stateless shader, in which case - // the constant buffer might either be null or empty (both cases are allowed), or we - // must have a shader with some state and a constant buffer being set. In that case - // the code setting the constant buffer will have already validated its length. - if (@this->GetGlobals().ConstantBufferSize > 0 && - @this->constantBuffer is null) - { - return E.E_NOT_VALID_STATE; - } - - // First, set the constant buffer, if available - if (@this->constantBuffer is not null) - { - @this->d2D1DrawInfo.Get()->SetPixelShaderConstantBuffer( - buffer: @this->constantBuffer, - bufferCount: (uint)@this->GetGlobals().ConstantBufferSize).Assert(); - } - - ReadOnlySpan resourceTextureDescriptions = @this->GetGlobals().ResourceTextureDescriptions.Span; - - for (int i = 0; i < resourceTextureDescriptions.Length; i++) - { - ref readonly ComPtr resourceTextureManager = ref @this->resourceTextureManagerBuffer[i]; - - // If the current resource texture manager is not set, we cannot render, as there's an unbound resource texture - if (resourceTextureManager.Get() is null) - { - return E.E_NOT_VALID_STATE; - } - - using ComPtr resourceTextureManagerInternal = default; - - // Get the ID2D1ResourceTextureManagerInternal object. This cast should always succeed, as when - // an input resource texture managers is set it's also checked for ID2D1ResourceTextureManagerInternal, - // but still validate for good measure. - resourceTextureManager.CopyTo(resourceTextureManagerInternal.GetAddressOf()).Assert(); - - using ComPtr d2D1ResourceTexture = default; - - // Try to get the ID2D1ResourceTexture from the manager - resourceTextureManagerInternal.Get()->GetResourceTexture(d2D1ResourceTexture.GetAddressOf()).Assert(); - - ref readonly D2D1ResourceTextureDescription resourceTextureDescription = ref resourceTextureDescriptions[i]; - - // Set the ID2D1ResourceTexture object to the current index in the ID2D1DrawInfo object in use - @this->d2D1DrawInfo.Get()->SetResourceTexture( - textureIndex: (uint)resourceTextureDescription.Index, - resourceTexture: d2D1ResourceTexture.Get()).Assert(); - } - - return S.S_OK; - } - catch (Exception e) - { - return Marshal.GetHRForException(e); - } - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static int SetGraph(PixelShaderEffect* @this, ID2D1TransformGraph* transformGraph) - { - return E.E_NOTIMPL; - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.Properties.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.Properties.cs deleted file mode 100644 index cf1c5497..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.Properties.cs +++ /dev/null @@ -1,241 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using ComputeSharp.D2D1.Extensions; -using ComputeSharp.D2D1.Shaders.Interop.Effects.ResourceManagers; -using ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers; -using ComputeSharp.Win32; - -namespace ComputeSharp.D2D1.Interop.Effects; - -/// -unsafe partial struct PixelShaderEffect -{ - /// - [UnmanagedCallersOnly] - public static HRESULT GetConstantBufferImpl(IUnknown* effect, byte* data, uint dataSize, uint* actualSize) - { - PixelShaderEffect* @this = (PixelShaderEffect*)effect; - - try - { - // This is a call likely from ID2D1Effect::GetValueSize, to query the property size. - // In that case we explicitly allow these inputs, and return the size of the buffer. - if (data is null && - dataSize == 0 && - actualSize is not null) - { - *actualSize = (uint)@this->GetGlobals().ConstantBufferSize; - - return S.S_FALSE; - } - - default(ArgumentNullException).ThrowIfNull(data); - - if (dataSize < @this->GetGlobals().ConstantBufferSize) - { - return E.E_NOT_SUFFICIENT_BUFFER; - } - - if (@this->constantBuffer is null) - { - return E.E_NOT_VALID_STATE; - } - - uint writtenBytes = 0; - - if (@this->GetGlobals().ConstantBufferSize > 0) - { - Buffer.MemoryCopy(@this->constantBuffer, data, dataSize, @this->GetGlobals().ConstantBufferSize); - - writtenBytes = (uint)@this->GetGlobals().ConstantBufferSize; - } - - if (actualSize is not null) - { - *actualSize = writtenBytes; - } - - return S.S_OK; - } - catch (Exception e) - { - return Marshal.GetHRForException(e); - } - } - - /// - [UnmanagedCallersOnly] - public static HRESULT SetConstantBufferImpl(IUnknown* effect, byte* data, uint dataSize) - { - PixelShaderEffect* @this = (PixelShaderEffect*)effect; - - try - { - default(ArgumentNullException).ThrowIfNull(data); - default(ArgumentOutOfRangeException).ThrowIfNotEqual((int)dataSize, @this->GetGlobals().ConstantBufferSize, nameof(dataSize)); - - // Reuse the existing buffer if there is one, otherwise allocate a new one - if (@this->constantBuffer is not null) - { - Buffer.MemoryCopy(data, @this->constantBuffer, dataSize, dataSize); - } - else - { - void* buffer = NativeMemory.Alloc(dataSize); - - Buffer.MemoryCopy(data, buffer, dataSize, dataSize); - - @this->constantBuffer = (byte*)buffer; - } - - return S.S_OK; - } - catch (Exception e) - { - return Marshal.GetHRForException(e); - } - } - - /// - [UnmanagedCallersOnly] - public static HRESULT GetTransformMapperImpl(IUnknown* effect, byte* data, uint dataSize, uint* actualSize) - { - PixelShaderEffect* @this = (PixelShaderEffect*)effect; - - try - { - default(ArgumentNullException).ThrowIfNull(data); - default(ArgumentOutOfRangeException).ThrowIfLessThan((int)dataSize, sizeof(void*), nameof(dataSize)); - - @this->d2D1TransformMapper.CopyTo((ID2D1DrawTransformMapper**)data).Assert(); - - if (actualSize is not null) - { - *actualSize = (uint)sizeof(void*); - } - - return S.S_OK; - } - catch (Exception e) - { - return Marshal.GetHRForException(e); - } - } - - /// - [UnmanagedCallersOnly] - public static HRESULT SetTransformMapperImpl(IUnknown* effect, byte* data, uint dataSize) - { - PixelShaderEffect* @this = (PixelShaderEffect*)effect; - - try - { - default(ArgumentNullException).ThrowIfNull(data); - default(ArgumentOutOfRangeException).ThrowIfLessThan((int)dataSize, sizeof(void*), nameof(dataSize)); - - void* value = *(void**)data; - - default(ArgumentNullException).ThrowIfNull(value); - - using ComPtr unknown = new((IUnknown*)value); - using ComPtr transformMapper = default; - - // Check that the input object implements ID2D1DrawTransformMapper - unknown.CopyTo(transformMapper.GetAddressOf()).Assert(); - - // Store the transform mapper manager into the effect - @this->d2D1TransformMapper.Attach(transformMapper.Detach()); - - return S.S_OK; - } - catch (Exception e) - { - return Marshal.GetHRForException(e); - } - } - - /// - /// Gets the resource texture manager for a given index. - /// - /// The index of the resource texture manager to assign the resource texture manager to (this might not match the resource texture index). - /// A pointer to a variable that stores the data that this function retrieves on the property. - /// The number of bytes in the property to retrieve. - /// A optional pointer to a variable that stores the actual number of bytes retrieved on the property. - /// The for the operation. - private int GetResourceTextureManagerAtIndex(int index, byte* data, uint dataSize, uint* actualSize) - { - try - { - default(ArgumentNullException).ThrowIfNull(data); - default(ArgumentOutOfRangeException).ThrowIfLessThan((int)dataSize, sizeof(void*), nameof(dataSize)); - default(ArgumentOutOfRangeException).ThrowIfGreaterThanOrEqual(index, GetGlobals().ResourceTextureCount); - - this.resourceTextureManagerBuffer[index].CopyTo((ID2D1ResourceTextureManager**)data).Assert(); - - if (actualSize is not null) - { - *actualSize = (uint)sizeof(void*); - } - - return S.S_OK; - } - catch (Exception e) - { - return Marshal.GetHRForException(e); - } - } - - /// - /// Sets the resource texture manager for a given index. - /// - /// The index of the resource texture manager to assign the resource texture manager to (this might not match the resource texture index). - /// A pointer to the data to be set on the property. - /// The number of bytes in the property set by the function. - /// The for the operation. - private int SetResourceTextureManagerAtIndex(int index, byte* data, uint dataSize) - { - try - { - default(ArgumentNullException).ThrowIfNull(data); - default(ArgumentOutOfRangeException).ThrowIfLessThan((int)dataSize, sizeof(void*), nameof(dataSize)); - default(ArgumentOutOfRangeException).ThrowIfGreaterThanOrEqual(index, GetGlobals().ResourceTextureCount); - - void* value = *(void**)data; - - default(ArgumentNullException).ThrowIfNull(value); - - using ComPtr unknown = new((IUnknown*)value); - using ComPtr resourceTextureManager = default; - - // Check that the input object implements ID2D1ResourceTextureManager - unknown.CopyTo(resourceTextureManager.GetAddressOf()).Assert(); - - using ComPtr resourceTextureManagerInternal = default; - - // Then, also check that it implements ID2D1ResourceTextureManagerInternal - unknown.CopyTo(resourceTextureManagerInternal.GetAddressOf()).Assert(); - - // Initialize the resource texture manager, if an effect context is available - if (this.d2D1EffectContext.Get() is not null) - { - uint dimensions = (uint)GetGlobals().ResourceTextureDescriptions.Span[index].Dimensions; - - // ID2D1ResourceTextureManager::Initialize should generally return either S_OK for first - // initialization, S_FALSE if an ID2D1EffectContext is already present (which is allowed, to - // enable sharing resource texture managers across different source textures and effects), or - // E_INVALIDARG if the manager has already been initialized through the public interface, - // and the stored dimensions for that don't match the ones for this resource texture index. - resourceTextureManagerInternal.Get()->Initialize(this.d2D1EffectContext.Get(), &dimensions).Assert(); - } - - // Store the resource texture manager into the buffer - this.resourceTextureManagerBuffer[index].Attach(resourceTextureManager.Detach()); - - return S.S_OK; - } - catch (Exception e) - { - return Marshal.GetHRForException(e); - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.Properties.g.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.Properties.g.cs deleted file mode 100644 index e0f590c6..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.Properties.g.cs +++ /dev/null @@ -1,232 +0,0 @@ -using System.Runtime.InteropServices; -using ComputeSharp.Win32; - -namespace ComputeSharp.D2D1.Interop.Effects; - -/// -unsafe partial struct PixelShaderEffect -{ - /// - [UnmanagedCallersOnly] - public static HRESULT GetResourceTextureManager0Impl(IUnknown* effect, byte* data, uint dataSize, uint* actualSize) - { - return ((PixelShaderEffect*)effect)->GetResourceTextureManagerAtIndex(0, data, dataSize, actualSize); - } - - /// - [UnmanagedCallersOnly] - public static HRESULT SetResourceTextureManager0Impl(IUnknown* effect, byte* data, uint dataSize) - { - return ((PixelShaderEffect*)effect)->SetResourceTextureManagerAtIndex(0, data, dataSize); - } - - /// - [UnmanagedCallersOnly] - public static HRESULT GetResourceTextureManager1Impl(IUnknown* effect, byte* data, uint dataSize, uint* actualSize) - { - return ((PixelShaderEffect*)effect)->GetResourceTextureManagerAtIndex(1, data, dataSize, actualSize); - } - - /// - [UnmanagedCallersOnly] - public static HRESULT SetResourceTextureManager1Impl(IUnknown* effect, byte* data, uint dataSize) - { - return ((PixelShaderEffect*)effect)->SetResourceTextureManagerAtIndex(1, data, dataSize); - } - - /// - [UnmanagedCallersOnly] - public static HRESULT GetResourceTextureManager2Impl(IUnknown* effect, byte* data, uint dataSize, uint* actualSize) - { - return ((PixelShaderEffect*)effect)->GetResourceTextureManagerAtIndex(2, data, dataSize, actualSize); - } - - /// - [UnmanagedCallersOnly] - public static HRESULT SetResourceTextureManager2Impl(IUnknown* effect, byte* data, uint dataSize) - { - return ((PixelShaderEffect*)effect)->SetResourceTextureManagerAtIndex(2, data, dataSize); - } - - /// - [UnmanagedCallersOnly] - public static HRESULT GetResourceTextureManager3Impl(IUnknown* effect, byte* data, uint dataSize, uint* actualSize) - { - return ((PixelShaderEffect*)effect)->GetResourceTextureManagerAtIndex(3, data, dataSize, actualSize); - } - - /// - [UnmanagedCallersOnly] - public static HRESULT SetResourceTextureManager3Impl(IUnknown* effect, byte* data, uint dataSize) - { - return ((PixelShaderEffect*)effect)->SetResourceTextureManagerAtIndex(3, data, dataSize); - } - - /// - [UnmanagedCallersOnly] - public static HRESULT GetResourceTextureManager4Impl(IUnknown* effect, byte* data, uint dataSize, uint* actualSize) - { - return ((PixelShaderEffect*)effect)->GetResourceTextureManagerAtIndex(4, data, dataSize, actualSize); - } - - /// - [UnmanagedCallersOnly] - public static HRESULT SetResourceTextureManager4Impl(IUnknown* effect, byte* data, uint dataSize) - { - return ((PixelShaderEffect*)effect)->SetResourceTextureManagerAtIndex(4, data, dataSize); - } - - /// - [UnmanagedCallersOnly] - public static HRESULT GetResourceTextureManager5Impl(IUnknown* effect, byte* data, uint dataSize, uint* actualSize) - { - return ((PixelShaderEffect*)effect)->GetResourceTextureManagerAtIndex(5, data, dataSize, actualSize); - } - - /// - [UnmanagedCallersOnly] - public static HRESULT SetResourceTextureManager5Impl(IUnknown* effect, byte* data, uint dataSize) - { - return ((PixelShaderEffect*)effect)->SetResourceTextureManagerAtIndex(5, data, dataSize); - } - - /// - [UnmanagedCallersOnly] - public static HRESULT GetResourceTextureManager6Impl(IUnknown* effect, byte* data, uint dataSize, uint* actualSize) - { - return ((PixelShaderEffect*)effect)->GetResourceTextureManagerAtIndex(6, data, dataSize, actualSize); - } - - /// - [UnmanagedCallersOnly] - public static HRESULT SetResourceTextureManager6Impl(IUnknown* effect, byte* data, uint dataSize) - { - return ((PixelShaderEffect*)effect)->SetResourceTextureManagerAtIndex(6, data, dataSize); - } - - /// - [UnmanagedCallersOnly] - public static HRESULT GetResourceTextureManager7Impl(IUnknown* effect, byte* data, uint dataSize, uint* actualSize) - { - return ((PixelShaderEffect*)effect)->GetResourceTextureManagerAtIndex(7, data, dataSize, actualSize); - } - - /// - [UnmanagedCallersOnly] - public static HRESULT SetResourceTextureManager7Impl(IUnknown* effect, byte* data, uint dataSize) - { - return ((PixelShaderEffect*)effect)->SetResourceTextureManagerAtIndex(7, data, dataSize); - } - - /// - [UnmanagedCallersOnly] - public static HRESULT GetResourceTextureManager8Impl(IUnknown* effect, byte* data, uint dataSize, uint* actualSize) - { - return ((PixelShaderEffect*)effect)->GetResourceTextureManagerAtIndex(8, data, dataSize, actualSize); - } - - /// - [UnmanagedCallersOnly] - public static HRESULT SetResourceTextureManager8Impl(IUnknown* effect, byte* data, uint dataSize) - { - return ((PixelShaderEffect*)effect)->SetResourceTextureManagerAtIndex(8, data, dataSize); - } - - /// - [UnmanagedCallersOnly] - public static HRESULT GetResourceTextureManager9Impl(IUnknown* effect, byte* data, uint dataSize, uint* actualSize) - { - return ((PixelShaderEffect*)effect)->GetResourceTextureManagerAtIndex(9, data, dataSize, actualSize); - } - - /// - [UnmanagedCallersOnly] - public static HRESULT SetResourceTextureManager9Impl(IUnknown* effect, byte* data, uint dataSize) - { - return ((PixelShaderEffect*)effect)->SetResourceTextureManagerAtIndex(9, data, dataSize); - } - - /// - [UnmanagedCallersOnly] - public static HRESULT GetResourceTextureManager10Impl(IUnknown* effect, byte* data, uint dataSize, uint* actualSize) - { - return ((PixelShaderEffect*)effect)->GetResourceTextureManagerAtIndex(10, data, dataSize, actualSize); - } - - /// - [UnmanagedCallersOnly] - public static HRESULT SetResourceTextureManager10Impl(IUnknown* effect, byte* data, uint dataSize) - { - return ((PixelShaderEffect*)effect)->SetResourceTextureManagerAtIndex(10, data, dataSize); - } - - /// - [UnmanagedCallersOnly] - public static HRESULT GetResourceTextureManager11Impl(IUnknown* effect, byte* data, uint dataSize, uint* actualSize) - { - return ((PixelShaderEffect*)effect)->GetResourceTextureManagerAtIndex(11, data, dataSize, actualSize); - } - - /// - [UnmanagedCallersOnly] - public static HRESULT SetResourceTextureManager11Impl(IUnknown* effect, byte* data, uint dataSize) - { - return ((PixelShaderEffect*)effect)->SetResourceTextureManagerAtIndex(11, data, dataSize); - } - - /// - [UnmanagedCallersOnly] - public static HRESULT GetResourceTextureManager12Impl(IUnknown* effect, byte* data, uint dataSize, uint* actualSize) - { - return ((PixelShaderEffect*)effect)->GetResourceTextureManagerAtIndex(12, data, dataSize, actualSize); - } - - /// - [UnmanagedCallersOnly] - public static HRESULT SetResourceTextureManager12Impl(IUnknown* effect, byte* data, uint dataSize) - { - return ((PixelShaderEffect*)effect)->SetResourceTextureManagerAtIndex(12, data, dataSize); - } - - /// - [UnmanagedCallersOnly] - public static HRESULT GetResourceTextureManager13Impl(IUnknown* effect, byte* data, uint dataSize, uint* actualSize) - { - return ((PixelShaderEffect*)effect)->GetResourceTextureManagerAtIndex(13, data, dataSize, actualSize); - } - - /// - [UnmanagedCallersOnly] - public static HRESULT SetResourceTextureManager13Impl(IUnknown* effect, byte* data, uint dataSize) - { - return ((PixelShaderEffect*)effect)->SetResourceTextureManagerAtIndex(13, data, dataSize); - } - - /// - [UnmanagedCallersOnly] - public static HRESULT GetResourceTextureManager14Impl(IUnknown* effect, byte* data, uint dataSize, uint* actualSize) - { - return ((PixelShaderEffect*)effect)->GetResourceTextureManagerAtIndex(14, data, dataSize, actualSize); - } - - /// - [UnmanagedCallersOnly] - public static HRESULT SetResourceTextureManager14Impl(IUnknown* effect, byte* data, uint dataSize) - { - return ((PixelShaderEffect*)effect)->SetResourceTextureManagerAtIndex(14, data, dataSize); - } - - /// - [UnmanagedCallersOnly] - public static HRESULT GetResourceTextureManager15Impl(IUnknown* effect, byte* data, uint dataSize, uint* actualSize) - { - return ((PixelShaderEffect*)effect)->GetResourceTextureManagerAtIndex(15, data, dataSize, actualSize); - } - - /// - [UnmanagedCallersOnly] - public static HRESULT SetResourceTextureManager15Impl(IUnknown* effect, byte* data, uint dataSize) - { - return ((PixelShaderEffect*)effect)->SetResourceTextureManagerAtIndex(15, data, dataSize); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.Properties.tt b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.Properties.tt deleted file mode 100644 index 92694b23..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.Properties.tt +++ /dev/null @@ -1,38 +0,0 @@ -<#@ template debug="false" hostspecific="false" language="C#" #> -<#@ assembly name="System.Core" #> -<#@ output extension=".g.cs"#> -using System.Runtime.InteropServices; -using ComputeSharp.Win32; - -namespace ComputeSharp.D2D1.Interop.Effects; - -/// -unsafe partial struct PixelShaderEffect -{ -<# -for (int i = 0; i < 16; i++) -{ - // Ensure all methods are properly spaced - if (i > 0) - { - WriteLine(""); - } - -#> - /// - [UnmanagedCallersOnly] - public static HRESULT GetResourceTextureManager<#=i#>Impl(IUnknown* effect, byte* data, uint dataSize, uint* actualSize) - { - return ((PixelShaderEffect*)effect)->GetResourceTextureManagerAtIndex(<#=i#>, data, dataSize, actualSize); - } - - /// - [UnmanagedCallersOnly] - public static HRESULT SetResourceTextureManager<#=i#>Impl(IUnknown* effect, byte* data, uint dataSize) - { - return ((PixelShaderEffect*)effect)->SetResourceTextureManagerAtIndex(<#=i#>, data, dataSize); - } -<# -} -#> -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.ResourceTextureManagerBuffer.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.ResourceTextureManagerBuffer.cs deleted file mode 100644 index 1525ac58..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.ResourceTextureManagerBuffer.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Runtime.CompilerServices; -using ComputeSharp.D2D1.Shaders.Interop.Effects.ResourceManagers; -using ComputeSharp.Win32; - -#pragma warning disable IDE0051 - -namespace ComputeSharp.D2D1.Interop.Effects; - -/// -partial struct PixelShaderEffect -{ - /// - /// A buffer of 16 objects. - /// - [InlineArray(16)] - private unsafe struct ResourceTextureManagerBuffer - { - /// - /// The instance at index 0. - /// - private ComPtr resourceTextureManager0; - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.cs deleted file mode 100644 index c39259db..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/PixelShaderEffect.cs +++ /dev/null @@ -1,227 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Threading; -using ComputeSharp.D2D1.Shaders.Interop.Effects.ResourceManagers; -using ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers; -using ComputeSharp.Win32; - -namespace ComputeSharp.D2D1.Interop.Effects; - -/// -/// A simple and implementation for a given pixel shader. -/// -internal unsafe partial struct PixelShaderEffect -{ - /// - /// The shared vtable pointer for instance, for . - /// - private static readonly void** VtblForID2D1EffectImpl = InitVtblForID2D1EffectImplAndID2D1DrawTransform(); - - /// - /// The shared vtable pointer for instance, for . - /// - private static readonly void** VtblForID2D1DrawTransform = &VtblForID2D1EffectImpl[6]; - - /// - /// Initializes the combined vtable for and . - /// - /// The combined vtable for and . - private static void** InitVtblForID2D1EffectImplAndID2D1DrawTransform() - { - void** lpVtbl = (void**)D2D1AssemblyAssociatedMemory.Allocate(sizeof(void*) * 14); - - // ID2D1EffectImpl - lpVtbl[0] = (delegate* unmanaged[MemberFunction])&ID2D1EffectImplMethods.QueryInterface; - lpVtbl[1] = (delegate* unmanaged[MemberFunction])&ID2D1EffectImplMethods.AddRef; - lpVtbl[2] = (delegate* unmanaged[MemberFunction])&ID2D1EffectImplMethods.Release; - lpVtbl[3] = (delegate* unmanaged[MemberFunction])&ID2D1EffectImplMethods.Initialize; - lpVtbl[4] = (delegate* unmanaged[MemberFunction])&ID2D1EffectImplMethods.PrepareForRender; - lpVtbl[5] = (delegate* unmanaged[MemberFunction])&ID2D1EffectImplMethods.SetGraph; - - // ID2D1DrawTransform - lpVtbl[6 + 0] = (delegate* unmanaged[MemberFunction])&ID2D1DrawTransformMethods.QueryInterface; - lpVtbl[6 + 1] = (delegate* unmanaged[MemberFunction])&ID2D1DrawTransformMethods.AddRef; - lpVtbl[6 + 2] = (delegate* unmanaged[MemberFunction])&ID2D1DrawTransformMethods.Release; - lpVtbl[6 + 3] = (delegate* unmanaged[MemberFunction])&ID2D1DrawTransformMethods.GetInputCount; - lpVtbl[6 + 4] = (delegate* unmanaged[MemberFunction])&ID2D1DrawTransformMethods.MapOutputRectToInputRects; - lpVtbl[6 + 5] = (delegate* unmanaged[MemberFunction])&ID2D1DrawTransformMethods.MapInputRectsToOutputRect; - lpVtbl[6 + 6] = (delegate* unmanaged[MemberFunction])&ID2D1DrawTransformMethods.MapInvalidRect; - lpVtbl[6 + 7] = (delegate* unmanaged[MemberFunction])&ID2D1DrawTransformMethods.SetDrawInfo; - - return lpVtbl; - } - - /// - /// The vtable pointer for the current instance, for . - /// - private void** lpVtblForID2D1EffectImpl; - - /// - /// The vtable pointer for the current instance, for . - /// - private void** lpVtblForID2D1DrawTransform; - - /// - /// The current reference count for the object (from IUnknown). - /// - private volatile int referenceCount; - - /// - /// The for the instance in use. - /// - private GCHandle globalsHandle; - - /// - /// The constant buffer data, if set. - /// - private byte* constantBuffer; - - /// - /// The instance to use, if any. - /// - private ComPtr d2D1TransformMapper; - - /// - /// The instance currently in use. - /// - private ComPtr d2D1DrawInfo; - - /// - /// The instance currently in use. - /// - private ComPtr d2D1EffectContext; - - /// - /// The resource texture managers for the current instance. - /// - private ResourceTextureManagerBuffer resourceTextureManagerBuffer; - - /// - /// The factory method for . - /// - /// The instance to use. - /// The resulting effect instance. - /// The for the operation. - public static int Factory(Globals globals, IUnknown** effectImpl) - { - PixelShaderEffect* @this = null; - GCHandle globalsHandle = default; - - try - { - @this = (PixelShaderEffect*)NativeMemory.Alloc((nuint)sizeof(PixelShaderEffect)); - globalsHandle = GCHandle.Alloc(globals); - - @this->lpVtblForID2D1EffectImpl = VtblForID2D1EffectImpl; - @this->lpVtblForID2D1DrawTransform = VtblForID2D1DrawTransform; - @this->referenceCount = 1; - @this->globalsHandle = globalsHandle; - @this->constantBuffer = null; - @this->d2D1TransformMapper = default; - @this->d2D1DrawInfo = default; - @this->d2D1EffectContext = default; - @this->resourceTextureManagerBuffer = default; - - *effectImpl = (IUnknown*)@this; - - return S.S_OK; - } - catch (Exception e) - { - // Free the effect, if we have one - NativeMemory.Free(@this); - - // Free the handle, if we have one - if (globalsHandle.IsAllocated) - { - globalsHandle.Free(); - } - - *effectImpl = null; - - return Marshal.GetHRForException(e); - } - } - - /// - private int QueryInterface(Guid* riid, void** ppvObject) - { - if (ppvObject is null) - { - return E.E_POINTER; - } - - // ID2D1EffectImpl - if (riid->Equals(Windows.__uuidof()) || - riid->Equals(Windows.__uuidof())) - { - _ = Interlocked.Increment(ref this.referenceCount); - - *ppvObject = Unsafe.AsPointer(ref this); - - return S.S_OK; - } - - // ID2D1DrawTransform - if (riid->Equals(Windows.__uuidof()) || - riid->Equals(Windows.__uuidof()) || - riid->Equals(Windows.__uuidof())) - { - _ = Interlocked.Increment(ref this.referenceCount); - - *ppvObject = (void**)Unsafe.AsPointer(ref this) + 1; - - return S.S_OK; - } - - *ppvObject = null; - - return E.E_NOINTERFACE; - } - - /// - private uint AddRef() - { - return (uint)Interlocked.Increment(ref this.referenceCount); - } - - /// - private uint Release() - { - uint referenceCount = (uint)Interlocked.Decrement(ref this.referenceCount); - - if (referenceCount == 0) - { - this.globalsHandle.Free(); - - NativeMemory.Free(this.constantBuffer); - - this.d2D1TransformMapper.Dispose(); - this.d2D1DrawInfo.Dispose(); - this.d2D1EffectContext.Dispose(); - - // Retrieve all possible resource texture managers in use and release the ones that had been - // assigned (from one of the property bindings). We just try to dispose all of them here and - // don't access the globals, as technically invoking APIs on it might throw an exception. - foreach (ref ComPtr resourceTextureManager in (Span>)this.resourceTextureManagerBuffer) - { - resourceTextureManager.Dispose(); - } - - NativeMemory.Free(Unsafe.AsPointer(ref this)); - } - - return referenceCount; - } - - /// - /// Gets the instance for the current effect. - /// - /// The instance for the current effect. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - private Globals GetGlobals() - { - return Unsafe.As(this.globalsHandle.Target!); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/ResourceManagers/D2D1ResourceTextureManagerImpl.ID2D1ResourceTextureManager.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/ResourceManagers/D2D1ResourceTextureManagerImpl.ID2D1ResourceTextureManager.cs deleted file mode 100644 index 976b6e65..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/ResourceManagers/D2D1ResourceTextureManagerImpl.ID2D1ResourceTextureManager.cs +++ /dev/null @@ -1,643 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ComputeSharp.Win32; - -namespace ComputeSharp.D2D1.Shaders.Interop.Effects.ResourceManagers; - -/// -unsafe partial struct D2D1ResourceTextureManagerImpl -{ - /// - public static int Initialize( - D2D1ResourceTextureManagerImpl* @this, - Guid* resourceId, - D2D1_RESOURCE_TEXTURE_PROPERTIES* resourceTextureProperties, - byte* data, - uint* strides, - uint dataSize) - { - lock (@this->lockHandle.Target!) - { - // If the method has already been called, fail - if (@this->d2D1ResourceTexture.Get() is not null || - @this->data is not null) - { - return E.E_NOT_VALID_STATE; - } - - // If the manager has been assigned to an effect and the dimensions are available, validate them. - // Check and ignore if the input properties are null (validation for that is done afterwards). - if (@this->expectedDimensions != 0 && - resourceTextureProperties is not null && - resourceTextureProperties->dimensions != @this->expectedDimensions) - { - return E.E_INVALIDARG; - } - - // If the method has already been called, just forward the call - if (@this->d2D1EffectContext.Get() is not null) - { - @this->d2D1Multithread.Get()->Enter(); - - // Create the resource after taking a D2D lock - int hresult = @this->d2D1EffectContext.Get()->CreateResourceTexture( - resourceId: resourceId, - resourceTextureProperties: resourceTextureProperties, - data: data, - strides: strides, - dataSize: dataSize, - resourceTexture: @this->d2D1ResourceTexture.GetAddressOf()); - - @this->d2D1Multithread.Get()->Leave(); - - return hresult; - } - - // Initialize into a staging buffer - return ID2D1ResourceTextureManagerMethods.InitializeWithStagingBuffer( - @this: @this, - resourceId: resourceId, - resourceTextureProperties: resourceTextureProperties, - data: data, - strides: strides, - dataSize: dataSize); - } - } - - /// - public static int Update( - D2D1ResourceTextureManagerImpl* @this, - uint* minimumExtents, - uint* maximimumExtents, - uint* strides, - uint dimensions, - byte* data, - uint dataCount) - { - lock (@this->lockHandle.Target!) - { - if (@this->d2D1ResourceTexture.Get() is null && - @this->data is null) - { - return E.E_NOT_VALID_STATE; - } - - // If no resource texture already exists, update the staging buffer - if (@this->d2D1ResourceTexture.Get() is null) - { - return ID2D1ResourceTextureManagerMethods.UpdateWithStagingBuffer( - @this: @this, - minimumExtents: minimumExtents, - maximimumExtents: maximimumExtents, - strides: strides, - dimensions: dimensions, - data: data, - dataCount: dataCount); - } - } - - // If we got to this point, it means we have a D2D1 resource texture already - // initialized. This means we can be sure no other thread is concurrently - // touching any other local state, as the initialization (potentially from the - // staging buffer has already been completely if this is the case, since we also - // checked for this while taking the instance lock). So we can now take the D2D - // lock and update the texture directly. We need to take this when we're not also - // taking the instance lock, or we might trigger an AB/BA deadlock across threads. - @this->d2D1Multithread.Get()->Enter(); - - // Take a D2D lock here too to ensure thread safety - int hresult = @this->d2D1ResourceTexture.Get()->Update( - minimumExtents: minimumExtents, - maximimumExtents: maximimumExtents, - strides: strides, - dimensions: dimensions, - data: data, - dataCount: dataCount); - - @this->d2D1Multithread.Get()->Leave(); - - return hresult; - } - - /// - /// The implementation for . - /// - private static class ID2D1ResourceTextureManagerMethods - { - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static int QueryInterface(D2D1ResourceTextureManagerImpl* @this, Guid* riid, void** ppvObject) - { - return @this->QueryInterface(riid, ppvObject); - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static uint AddRef(D2D1ResourceTextureManagerImpl* @this) - { - return @this->AddRef(); - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static uint Release(D2D1ResourceTextureManagerImpl* @this) - { - return @this->Release(); - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static int Initialize( - D2D1ResourceTextureManagerImpl* @this, - Guid* resourceId, - D2D1_RESOURCE_TEXTURE_PROPERTIES* resourceTextureProperties, - byte* data, - uint* strides, - uint dataSize) - { - return D2D1ResourceTextureManagerImpl.Initialize( - @this, - resourceId, - resourceTextureProperties, - data, - strides, - dataSize); - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static int Update( - D2D1ResourceTextureManagerImpl* @this, - uint* minimumExtents, - uint* maximimumExtents, - uint* strides, - uint dimensions, - byte* data, - uint dataCount) - { - return D2D1ResourceTextureManagerImpl.Update( - @this, - minimumExtents, - maximimumExtents, - strides, - dimensions, - data, - dataCount); - } - - /// - public static int InitializeWithStagingBuffer( - D2D1ResourceTextureManagerImpl* @this, - Guid* resourceId, - D2D1_RESOURCE_TEXTURE_PROPERTIES* resourceTextureProperties, - byte* data, - uint* strides, - uint dataSize) - { - // Return E_POINTER if any input pointer is null. In particular, the data pointer - // must not be null if the data size is not 0, and the strides pointer must not be - // null if some data is supplied, and the number of dimensions is greater than 1. - if (resourceTextureProperties is null || - (dataSize > 0 && data is null) || - resourceTextureProperties->extents is null || - resourceTextureProperties->extendModes is null || - (resourceTextureProperties->dimensions > 1 && dataSize > 0 && strides is null)) - { - return E.E_POINTER; - } - - // Textures can only have between 1 and 3 dimensions - if (resourceTextureProperties->dimensions is 0 or > 3) - { - return E.E_INVALIDARG; - } - - // No extent can be 0 - foreach (uint extent in new ReadOnlySpan(resourceTextureProperties->extents, (int)resourceTextureProperties->dimensions)) - { - if (extent == 0) - { - return E.E_INVALIDARG; - } - } - - // The buffer precision can't be unknown, and the channel depth must be explicit - if (resourceTextureProperties->bufferPrecision == D2D1_BUFFER_PRECISION.D2D1_BUFFER_PRECISION_UNKNOWN || - resourceTextureProperties->channelDepth == D2D1_CHANNEL_DEPTH.D2D1_CHANNEL_DEPTH_DEFAULT) - { - return E.E_INVALIDARG; - } - - // Validate the data size - if (dataSize > 0) - { - uint elementSizeInBytes = GetElementSizeInBytes( - resourceTextureProperties->bufferPrecision, - resourceTextureProperties->channelDepth); - - int hresult = ValidateDataAndStrides( - elementSizeInBytes, - resourceTextureProperties->extents, - resourceTextureProperties->dimensions, - strides, - dataSize); - - if (hresult != S.S_OK) - { - return hresult; - } - } - - // Allocate a buffer for the resource id, if there is one - if (resourceId is not null) - { - try - { - @this->resourceId = (Guid*)NativeMemory.Alloc((nuint)sizeof(Guid)); - } - catch (OutOfMemoryException) - { - return E.E_OUTOFMEMORY; - } - - *@this->resourceId = *resourceId; - } - - uint* extents; - - // Allocate a buffer for the extents (one per dimension) - try - { - extents = (uint*)NativeMemory.Alloc(sizeof(uint) * resourceTextureProperties->dimensions); - } - catch (OutOfMemoryException) - { - return E.E_OUTOFMEMORY; - } - - D2D1_EXTEND_MODE* extendModes; - - // Allocate a buffer for the extend modes (one per dimension) - try - { - extendModes = (D2D1_EXTEND_MODE*)NativeMemory.Alloc(sizeof(D2D1_EXTEND_MODE) * resourceTextureProperties->dimensions); - } - catch (OutOfMemoryException) - { - return E.E_OUTOFMEMORY; - } - - // Copy the extents into the buffer - Buffer.MemoryCopy( - source: resourceTextureProperties->extents, - destination: extents, - destinationSizeInBytes: sizeof(uint) * resourceTextureProperties->dimensions, - sourceBytesToCopy: sizeof(uint) * resourceTextureProperties->dimensions); - - // Copy the extend modes into the buffer - Buffer.MemoryCopy( - source: resourceTextureProperties->extendModes, - destination: extendModes, - destinationSizeInBytes: sizeof(D2D1_EXTEND_MODE) * resourceTextureProperties->dimensions, - sourceBytesToCopy: sizeof(D2D1_EXTEND_MODE) * resourceTextureProperties->dimensions); - - // Initialize the other resource texture properties - @this->resourceTextureProperties.extents = extents; - @this->resourceTextureProperties.dimensions = resourceTextureProperties->dimensions; - @this->resourceTextureProperties.bufferPrecision = resourceTextureProperties->bufferPrecision; - @this->resourceTextureProperties.channelDepth = resourceTextureProperties->channelDepth; - @this->resourceTextureProperties.filter = resourceTextureProperties->filter; - @this->resourceTextureProperties.extendModes = extendModes; - - // Initialize the staging buffer and optional strides - return InitializeStagingBufferAndStrides( - @this: @this, - dimensions: resourceTextureProperties->dimensions, - data: data, - strides: strides, - dataSize: dataSize); - } - - /// - public static int UpdateWithStagingBuffer( - D2D1ResourceTextureManagerImpl* @this, - uint* minimumExtents, - uint* maximimumExtents, - uint* strides, - uint dimensions, - byte* data, - uint dataCount) - { - // Either both extents are available, or none is, and the other values must not be null - if ((minimumExtents is null && maximimumExtents is not null) || - (minimumExtents is not null && maximimumExtents is null) || - (dimensions > 1 && strides is null) || - data is null) - { - return E.E_POINTER; - } - - // The dimensions must match the currently stored texture data - if (dimensions != @this->resourceTextureProperties.dimensions) - { - return E.E_INVALIDARG; - } - - // If the update extents are specified, check that the targets are all greater than the starting extents. - if (minimumExtents is not null) - { - for (int i = 0; i < (int)dimensions; i++) - { - if (maximimumExtents[i] <= minimumExtents[i]) - { - return E.E_INVALIDARG; - } - } - } - - uint elementSizeInBytes = GetElementSizeInBytes( - @this->resourceTextureProperties.bufferPrecision, - @this->resourceTextureProperties.channelDepth); - - // Calculate the extents of the buffer, based on the delta between the input extents. - // If no extents range is provided, it means that the entire resource texture is updated. - uint* updateExtents = stackalloc uint[3]; - - if (minimumExtents is not null) - { - updateExtents[0] = maximimumExtents[0] - minimumExtents[0]; - updateExtents[1] = dimensions > 1 ? (maximimumExtents[1] - minimumExtents[1]) : 1; - updateExtents[2] = dimensions > 2 ? (maximimumExtents[2] - minimumExtents[2]) : 1; - - // Validate that the requested extent is not greater than the corresponding dimension - for (int i = 0; i < (int)dimensions; i++) - { - if (updateExtents[i] > @this->resourceTextureProperties.extents[i]) - { - return E.E_INVALIDARG; - } - } - } - else - { - Buffer.MemoryCopy( - source: @this->resourceTextureProperties.extents, - destination: updateExtents, - destinationSizeInBytes: dimensions * sizeof(uint), - sourceBytesToCopy: dimensions * sizeof(uint)); - } - - // Validate that the provided buffer is valid for the update range - int hresult = ValidateDataAndStrides( - elementSizeInBytes, - updateExtents, - dimensions, - strides, - dataCount); - - if (hresult != S.S_OK) - { - return hresult; - } - - // If the texture hasn't been allocated yet, do that now. This is only - // valid if the whole texture is being updated (as it's being initialized). - if (@this->data is null) - { - if (minimumExtents is not null) - { - // If explicit extents are passed, they must match the resource texture size - for (int i = 0; i < (int)dimensions; i++) - { - if (updateExtents[i] != @this->resourceTextureProperties.extents[i]) - { - return E.E_INVALIDARG; - } - } - } - - // This is a full update with no existing resource, so just initialize the buffer from scratch - return InitializeStagingBufferAndStrides( - @this: @this, - dimensions: dimensions, - data: data, - strides: strides, - dataSize: dataCount); - } - - // Precalculate the byte size of each row update - uint rowUpdateSizeInBytes = updateExtents[0] * elementSizeInBytes; - - for (int z = 0; z < updateExtents[2]; z++) - { - // Calculate the starting position in the source and destination buffers. - // - The source advances by the 2D slice stride for each iteration. - // - The destination does the same, but it also starts at the given initial offset. - // This pointer is aligned to the start of a row in the offset 2D plane after this. - byte* sourceDataPlane = - data + - (dimensions > 2 ? z * strides[1] : 0); - byte* destinationDataPlane = - @this->data + - (dimensions > 2 ? (minimumExtents[2] * @this->strides[1]) + (z * @this->strides[1]) : 0) + - (dimensions > 1 ? minimumExtents[1] * @this->strides[0] : 0); - - for (int y = 0; y < updateExtents[1]; y++) - { - // Shift the source ahead to get to the start of the current row. The destination - // is also shifted ahead by the current row, plus the target initial element offset. - byte* sourceDataRow = sourceDataPlane + (dimensions > 1 ? y * strides[0] : 0); - byte* destinationDataRow = - destinationDataPlane + - (dimensions > 1 ? y * @this->strides[0] : 0) + - (minimumExtents[0] * elementSizeInBytes); - - Buffer.MemoryCopy( - source: sourceDataRow, - destination: destinationDataRow, - destinationSizeInBytes: rowUpdateSizeInBytes, - sourceBytesToCopy: rowUpdateSizeInBytes); - } - } - - return S.S_OK; - } - - /// - /// Gets the element size of each item in the resource texture, in bytes. - /// - /// The precision of the resource texture. - /// The number of channels in the resource texture. - /// Tthe element size of each item in the resource texture, in bytes. - private static uint GetElementSizeInBytes(D2D1_BUFFER_PRECISION bufferPrecision, D2D1_CHANNEL_DEPTH channelDepth) - { - uint channelSizeInBytes = bufferPrecision switch - { - D2D1_BUFFER_PRECISION.D2D1_BUFFER_PRECISION_8BPC_UNORM => 1, - D2D1_BUFFER_PRECISION.D2D1_BUFFER_PRECISION_8BPC_UNORM_SRGB => 1, - D2D1_BUFFER_PRECISION.D2D1_BUFFER_PRECISION_16BPC_UNORM => 2, - D2D1_BUFFER_PRECISION.D2D1_BUFFER_PRECISION_16BPC_FLOAT => 2, - D2D1_BUFFER_PRECISION.D2D1_BUFFER_PRECISION_32BPC_FLOAT => 4, - _ => 0 - }; - - return channelDepth switch - { - D2D1_CHANNEL_DEPTH.D2D1_CHANNEL_DEPTH_1 => channelSizeInBytes, - D2D1_CHANNEL_DEPTH.D2D1_CHANNEL_DEPTH_4 => channelSizeInBytes * 4, - _ => 0 - }; - } - - /// - /// Validates the data and strides for a call to or . - /// - /// The element size in bytes. - /// The extents of the resource table in each dimension. - /// The number of dimensions in the resource texture. - /// The stride to advance through the input data, according to dimension. - /// The size of the data buffer to be used to update the resource texture. - /// The for the validation. - private static int ValidateDataAndStrides( - uint elementSizeInBytes, - uint* extents, - uint dimensions, - uint* strides, - uint dataSize) - { - uint extent0SizeInBytes; - - try - { - extent0SizeInBytes = checked(extents[0] * elementSizeInBytes); - } - catch (OverflowException) - { - return E.E_INVALIDARG; - } - - // For 1D textures, the row byte size must match the data size (no strides to consider) - if (dimensions == 1) - { - if (extent0SizeInBytes != dataSize) - { - return E.E_NOT_SUFFICIENT_BUFFER; - } - } - else - { - // Validate the 0th stride is not smaller than the byte size of each row - if (extent0SizeInBytes > strides[0]) - { - return E.E_INVALIDARG; - } - - uint extent01SizeInBytes; - - try - { - extent01SizeInBytes = checked(((extents[1] - 1) * strides[0]) + extent0SizeInBytes); - } - catch (OverflowException) - { - return E.E_INVALIDARG; - } - - // For 2D textures, the size must match the rows * stride, plus the byte size of the last row (no trailing padding) - if (dimensions == 2) - { - if (extent01SizeInBytes != dataSize) - { - return E.E_NOT_SUFFICIENT_BUFFER; - } - } - else - { - // Validate the 1th stride is not smaller than the byte size of a 2D slice, with padding - if (extent01SizeInBytes > strides[1]) - { - return E.E_INVALIDARG; - } - - uint extent012SizeInBytes; - - try - { - extent012SizeInBytes = ((extents[2] - 1) * strides[1]) + extent01SizeInBytes; - } - catch (OverflowException) - { - return E.E_INVALIDARG; - } - - if (extent012SizeInBytes != dataSize) - { - return E.E_NOT_SUFFICIENT_BUFFER; - } - } - } - - return S.S_OK; - } - - /// - /// Initializes the staging buffer and optional strides with pre-validated data. - /// - /// The current object. - /// The number of dimensions in the resource texture. This must match the number used to load the texture. - /// The data to be placed into the resource texture. - /// The stride to advance through the input data, according to dimension. - /// The size of the data buffer to be used to update the resource texture. - /// The for the operation. - /// - /// This method is invoked with pre-validated data and doesn't check the input arguments. - /// This method is invoked either when initializing the texture, or when doing a full update with no existing texture. - /// - private static int InitializeStagingBufferAndStrides( - D2D1ResourceTextureManagerImpl* @this, - uint dimensions, - byte* data, - uint* strides, - uint dataSize) - { - // Allocate the data buffer (this is the one most likely to potentially throw) - if (dataSize > 0) - { - try - { - @this->data = (byte*)NativeMemory.Alloc(dataSize); - } - catch (OutOfMemoryException) - { - return E.E_OUTOFMEMORY; - } - - Buffer.MemoryCopy(data, @this->data, dataSize, dataSize); - - @this->dataSize = dataSize; - } - - // If there are strides (ie. the texture has dimension greater than 1), initialize them as well - if (strides is not null) - { - try - { - @this->strides = (uint*)NativeMemory.Alloc(sizeof(uint) * (dimensions - 1)); - } - catch (OutOfMemoryException) - { - return E.E_OUTOFMEMORY; - } - - Buffer.MemoryCopy( - source: strides, - destination: @this->strides, - destinationSizeInBytes: sizeof(uint) * (dimensions - 1), - sourceBytesToCopy: sizeof(uint) * (dimensions - 1)); - } - - return S.S_OK; - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/ResourceManagers/D2D1ResourceTextureManagerImpl.ID2D1ResourceTextureManagerInternal.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/ResourceManagers/D2D1ResourceTextureManagerImpl.ID2D1ResourceTextureManagerInternal.cs deleted file mode 100644 index 9c720156..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/ResourceManagers/D2D1ResourceTextureManagerImpl.ID2D1ResourceTextureManagerInternal.cs +++ /dev/null @@ -1,179 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ComputeSharp.D2D1.Extensions; -using ComputeSharp.D2D1.Shaders.Interop.Extensions; -using ComputeSharp.Win32; - -namespace ComputeSharp.D2D1.Shaders.Interop.Effects.ResourceManagers; - -/// -partial struct D2D1ResourceTextureManagerImpl -{ - /// - /// The implementation for . - /// - private static unsafe class ID2D1ResourceTextureManagerInternalMethods - { - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static int QueryInterface(D2D1ResourceTextureManagerImpl* @this, Guid* riid, void** ppvObject) - { - @this = (D2D1ResourceTextureManagerImpl*)&((void**)@this)[-1]; - - return @this->QueryInterface(riid, ppvObject); - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static uint AddRef(D2D1ResourceTextureManagerImpl* @this) - { - @this = (D2D1ResourceTextureManagerImpl*)&((void**)@this)[-1]; - - return @this->AddRef(); - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static uint Release(D2D1ResourceTextureManagerImpl* @this) - { - @this = (D2D1ResourceTextureManagerImpl*)&((void**)@this)[-1]; - - return @this->Release(); - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static int Initialize(D2D1ResourceTextureManagerImpl* @this, ID2D1EffectContext* effectContext, uint* dimensions) - { - @this = (D2D1ResourceTextureManagerImpl*)&((void**)@this)[-1]; - - if (effectContext is null) - { - return E.E_POINTER; - } - - lock (@this->lockHandle.Target!) - { - // If the dimensions are available, validate them - if (dimensions is not null) - { - uint expectedDimensions = *dimensions; - - if (@this->resourceTextureProperties.extents is not null && - @this->resourceTextureProperties.dimensions != expectedDimensions) - { - return E.E_INVALIDARG; - } - - @this->expectedDimensions = expectedDimensions; - } - - // If this is the first time the method is called, just store the context. - // Before doing so, get an ID2D1Multithread instance, to ensure thread safety. - // For additional info, see docs on ID2D1EffectFactoryExtensions.GetD2D1Multithread. - if (@this->d2D1EffectContext.Get() is null) - { - using ComPtr d2D1Multithread = default; - - HRESULT hresult = effectContext->GetD2D1Multithread(d2D1Multithread.GetAddressOf()); - - // If an ID2D1Multithread object is available, we can safely store the context. That - // is, under the condition that the required multithread support is also available. - if (Windows.SUCCEEDED(hresult)) - { - if (@this->requiresMultithread > d2D1Multithread.Get()->GetMultithreadProtected()) - { - return E.E_INVALIDARG; - } - - // Now, the effect context can actually be stored safely while holding the lock. - // This is guaranteed to be the case here, as this method is only called (as per - // contact of the COM interface) from ID2D1EffectImpl, which holds the D2D lock. - // Also store the actual multithread object after storing the effect context. - @this->d2D1EffectContext.Attach(new ComPtr(effectContext).Get()); - @this->d2D1Multithread.Attach(d2D1Multithread.Detach()); - } - - return hresult; - } - - // Otherwise, just do nothing and return S_FALSE. This allows an existing resource texture - // manager to be shared across effects. If the resource cannot be shared, it will just - // return an error when effect is actually set, with ID2D1DrawInfo::SetResourceTexture. - return S.S_FALSE; - } - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static int GetResourceTexture(D2D1ResourceTextureManagerImpl* @this, ID2D1ResourceTexture** resourceTexture) - { - @this = (D2D1ResourceTextureManagerImpl*)&((void**)@this)[-1]; - - if (*resourceTexture is not null) - { - return E.E_POINTER; - } - - lock (@this->lockHandle.Target!) - { - // If the effect context is null, it means Initialize has not been called yet - if (@this->d2D1EffectContext.Get() is null) - { - return E.E_NOT_VALID_STATE; - } - - // If the texture has already been created, just return it - if (@this->d2D1ResourceTexture.Get() is not null) - { - @this->d2D1ResourceTexture.CopyTo(resourceTexture).Assert(); - - return S.S_OK; - } - - // If the data is null at this point, it means CreateResourceTexture has not been called yet - if (@this->data is null) - { - return E.E_NOT_VALID_STATE; - } - - using ComPtr d2D1ResourceTexture = default; - - // Create the resource now, as it hasn't been created yet - int result = @this->d2D1EffectContext.Get()->CreateResourceTexture( - resourceId: @this->resourceId, - resourceTextureProperties: &@this->resourceTextureProperties, - data: @this->data, - strides: @this->strides, - dataSize: @this->dataSize, - resourceTexture: d2D1ResourceTexture.GetAddressOf()); - - // If creation was successful, release the buffered data. Going forwards, - // the resource texture will be used directly for all updates requested. - if (result == S.S_OK) - { - // Store the resource texture for later - _ = d2D1ResourceTexture.CopyTo(&@this->d2D1ResourceTexture); - - // Also return it to callers - _ = d2D1ResourceTexture.CopyTo(resourceTexture); - - // Free the staging buffers - NativeMemory.Free(@this->resourceTextureProperties.extents); - NativeMemory.Free(@this->resourceTextureProperties.extendModes); - NativeMemory.Free(@this->data); - NativeMemory.Free(@this->strides); - - // Reset the stored pointers to avoid double frees from Release() - @this->resourceTextureProperties.extents = null; - @this->resourceTextureProperties.extendModes = null; - @this->data = null; - @this->strides = null; - } - - return result; - } - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/ResourceManagers/D2D1ResourceTextureManagerImpl.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/ResourceManagers/D2D1ResourceTextureManagerImpl.cs deleted file mode 100644 index cd302088..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/ResourceManagers/D2D1ResourceTextureManagerImpl.cs +++ /dev/null @@ -1,246 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Threading; -using ComputeSharp.D2D1.Interop; -using ComputeSharp.Win32; - -namespace ComputeSharp.D2D1.Shaders.Interop.Effects.ResourceManagers; - -/// -/// An implementation of the and interfaces. -/// -internal unsafe partial struct D2D1ResourceTextureManagerImpl -{ - /// - /// The shared vtable pointer for instance, for . - /// - private static readonly void** VtblForID2D1ResourceTextureManager = InitVtblForID2D1ResourceTextureManagerAndID2D1ResourceTextureManagerInternal(); - - /// - /// The shared vtable pointer for instance, for . - /// - private static readonly void** VtblForID2D1ResourceTextureManagerInternal = &VtblForID2D1ResourceTextureManager[5]; - - /// - /// Initializes the combined vtable for and . - /// - /// The combined vtable for and . - private static void** InitVtblForID2D1ResourceTextureManagerAndID2D1ResourceTextureManagerInternal() - { - void** lpVtbl = (void**)D2D1AssemblyAssociatedMemory.Allocate(sizeof(void*) * 10); - - // ID2D1ResourceTextureManager - lpVtbl[0] = (delegate* unmanaged[MemberFunction])&ID2D1ResourceTextureManagerMethods.QueryInterface; - lpVtbl[1] = (delegate* unmanaged[MemberFunction])&ID2D1ResourceTextureManagerMethods.AddRef; - lpVtbl[2] = (delegate* unmanaged[MemberFunction])&ID2D1ResourceTextureManagerMethods.Release; - lpVtbl[3] = (delegate* unmanaged[MemberFunction])&ID2D1ResourceTextureManagerMethods.Initialize; - lpVtbl[4] = (delegate* unmanaged[MemberFunction])&ID2D1ResourceTextureManagerMethods.Update; - - // ID2D1ResourceTextureManagerInternal - lpVtbl[5 + 0] = (delegate* unmanaged[MemberFunction])&ID2D1ResourceTextureManagerInternalMethods.QueryInterface; - lpVtbl[5 + 1] = (delegate* unmanaged[MemberFunction])&ID2D1ResourceTextureManagerInternalMethods.AddRef; - lpVtbl[5 + 2] = (delegate* unmanaged[MemberFunction])&ID2D1ResourceTextureManagerInternalMethods.Release; - lpVtbl[5 + 3] = (delegate* unmanaged[MemberFunction])&ID2D1ResourceTextureManagerInternalMethods.Initialize; - lpVtbl[5 + 4] = (delegate* unmanaged[MemberFunction])&ID2D1ResourceTextureManagerInternalMethods.GetResourceTexture; - - return lpVtbl; - } - - /// - /// The vtable pointer for the current instance, for . - /// - private void** lpVtblForID2D1ResourceTextureManager; - - /// - /// The vtable pointer for the current instance, for . - /// - private void** lpVtblForID2D1ResourceTextureManagerInternal; - - /// - /// The current reference count for the object (from ). - /// - private volatile int referenceCount; - - /// - /// Indicates whether the current instance requires multithread support to work safely. - /// - /// - /// This is used when the object is wrapped in a RCW with a finalizer, which could run at any time. - /// In that case, multithread support is required, and using a single thread factory is an error. - /// - private int requiresMultithread; - - /// - /// The object currently wrapped by the current instance. - /// - private ComPtr d2D1EffectContext; - - /// - /// The instance used to lock accesses to and . - /// - private ComPtr d2D1Multithread; - - /// - /// The object, if one was created already. - /// - private ComPtr d2D1ResourceTexture; - - /// - /// The to identify the resource, if available. - /// - private Guid* resourceId; - - /// - /// The for the resource texture. - /// - /// - /// If is , it has not been set. - /// - private D2D1_RESOURCE_TEXTURE_PROPERTIES resourceTextureProperties; - - /// - /// The texture data, if available. - /// - /// - /// Once the texture has been created, this will no longer be necessary. - /// - private byte* data; - - /// - /// An optional pointer to the stride to advance through the resource texture, according to dimension. - /// - private uint* strides; - - /// - /// The size, in bytes, of the data. - /// - private uint dataSize; - - /// - /// A to a dummy to use for locking. - /// - private GCHandle lockHandle; - - /// - /// The expected dimensions for the slot the manager has been assigned to in an effect. - /// - /// If 0, it has not been set, so it can be ignored. - private uint expectedDimensions; - - /// - /// The factory method for instances. - /// - /// The resulting resource texture manager instance. - /// Indicates whether the current instance requires multithread support to work safely. - public static void Factory(D2D1ResourceTextureManagerImpl** resourceTextureManager, bool requiresMultithread) - { - D2D1ResourceTextureManagerImpl* @this = (D2D1ResourceTextureManagerImpl*)NativeMemory.Alloc((nuint)sizeof(D2D1ResourceTextureManagerImpl)); - - *@this = default; - - @this->lpVtblForID2D1ResourceTextureManager = VtblForID2D1ResourceTextureManager; - @this->lpVtblForID2D1ResourceTextureManagerInternal = VtblForID2D1ResourceTextureManagerInternal; - @this->referenceCount = 1; - @this->d2D1EffectContext = default; - @this->d2D1Multithread = default; - @this->d2D1ResourceTexture = default; - @this->requiresMultithread = requiresMultithread ? 1 : 0; - @this->resourceId = null; - @this->resourceTextureProperties = default; - @this->data = null; - @this->strides = null; - @this->dataSize = 0; - @this->lockHandle = GCHandle.Alloc(new object()); - @this->expectedDimensions = 0; - - *resourceTextureManager = @this; - } - - /// - public int QueryInterface(Guid* riid, void** ppvObject) - { - if (ppvObject is null) - { - return E.E_POINTER; - } - - // ID2D1ResourceTextureManager - if (riid->Equals(Windows.__uuidof()) || - riid->Equals(Windows.__uuidof())) - { - _ = Interlocked.Increment(ref this.referenceCount); - - *ppvObject = Unsafe.AsPointer(ref this); - - return S.S_OK; - } - - // ID2D1ResourceTextureManagerInternal - if (riid->Equals(Windows.__uuidof())) - { - _ = Interlocked.Increment(ref this.referenceCount); - - *ppvObject = (void**)Unsafe.AsPointer(ref this) + 1; - - return S.S_OK; - } - - *ppvObject = null; - - return E.E_NOINTERFACE; - } - - /// - public uint AddRef() - { - return (uint)Interlocked.Increment(ref this.referenceCount); - } - - /// - public uint Release() - { - uint referenceCount = (uint)Interlocked.Decrement(ref this.referenceCount); - - if (referenceCount == 0) - { - // Note: if this object is being destroyed, it means that no other caller can exist. As such, there - // is no need to take the instance lock, as it's impossible for this logic to be racing against other - // threads referencing this object. If someone else was doing this, this would be falling apart anyway. - // As such, we can simply free this GC handle and run the rest of the logic without the additional lock. - this.lockHandle.Free(); - - // Synchronize on the ID2D1Multithread instance before touching D2D objects - if (this.d2D1Multithread.Get() is not null) - { - // Enter the lock, and then free the effect context. That is guaranteed to - // not be null here, as it is only ever set if ID2D1Multithread is retrieved. - this.d2D1Multithread.Get()->Enter(); - - // Release the resource too if it has been created - this.d2D1ResourceTexture.Dispose(); - - // Now that the resource, if any, has been released, the effect context can also - // be released. This must be done only after any associated resource textures have - // been released. Releasing an effect context first, in case it was the last reference - // to it, will otherwise cause the Release() call on the resource texture to explode. - this.d2D1EffectContext.Dispose(); - - this.d2D1Multithread.Get()->Leave(); - - // Finally release the multithread object after exiting the lock and releasing all other D2D objects - this.d2D1Multithread.Dispose(); - } - - NativeMemory.Free(this.resourceId); - NativeMemory.Free(this.resourceTextureProperties.extents); - NativeMemory.Free(this.resourceTextureProperties.extendModes); - NativeMemory.Free(this.data); - NativeMemory.Free(this.strides); - - NativeMemory.Free(Unsafe.AsPointer(ref this)); - } - - return referenceCount; - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/ResourceManagers/ID2D1ResourceTextureManager.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/ResourceManagers/ID2D1ResourceTextureManager.cs deleted file mode 100644 index ac7211a7..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/ResourceManagers/ID2D1ResourceTextureManager.cs +++ /dev/null @@ -1,99 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ComputeSharp.Win32; - -#pragma warning disable CS0649, IDE0055 - -namespace ComputeSharp.D2D1.Shaders.Interop.Effects.ResourceManagers; - -/// -/// The resource texture manager type to use with built-in effects. -/// -internal unsafe struct ID2D1ResourceTextureManager : IComObject -{ - /// - static Guid* IComObject.IID - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - ReadOnlySpan data = - [ - 0xE4, 0xC7, 0x4F, 0x3C, - 0x19, 0xA4, - 0xCA, 0x46, - 0xB5, 0xF6, - 0x66, - 0xEB, - 0x4F, - 0xF1, - 0x8D, - 0x64 - ]; - - return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data)); - } - } - - /// - /// The vtable for the current instance. - /// - private readonly void** lpVtbl; - - /// - /// Creates or finds the given resource texture, depending on whether a resource id is specified. - /// It also optionally initializes the texture with the specified data. - /// - /// An optional pointer to the unique id that identifies the resource texture. - /// The properties used to create the resource texture. - /// The optional data to be loaded into the resource texture. - /// An optional pointer to the stride to advance through the resource texture, according to dimension. - /// The size, in bytes, of the data. - /// An for the operation. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public HRESULT Initialize( - Guid* resourceId, - D2D1_RESOURCE_TEXTURE_PROPERTIES* resourceTextureProperties, - byte* data, - uint* strides, - uint dataSize) - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[3])( - (ID2D1ResourceTextureManager*)Unsafe.AsPointer(ref this), - resourceId, - resourceTextureProperties, - data, - strides, - dataSize); - } - - /// - /// Updates the specific resource texture inside the specific range or box using the supplied data. - /// - /// The "left" extent of the updates if specified. If , the entire texture is updated. - /// The "right" extent of the updates if specified. If , the entire texture is updated. - /// The stride to advance through the input data, according to dimension. - /// The number of dimensions in the resource texture. This must match the number used to load the texture. - /// The data to be placed into the resource texture. - /// The size of the data buffer to be used to update the resource texture. - /// An for the operation. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public HRESULT Update( - uint* minimumExtents, - uint* maximimumExtents, - uint* strides, - uint dimensions, - byte* data, - uint dataCount) - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[4])( - (ID2D1ResourceTextureManager*)Unsafe.AsPointer(ref this), - minimumExtents, - maximimumExtents, - strides, - dimensions, - data, - dataCount); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/ResourceManagers/ID2D1ResourceTextureManagerInternal.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/ResourceManagers/ID2D1ResourceTextureManagerInternal.cs deleted file mode 100644 index a343cfc4..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/ResourceManagers/ID2D1ResourceTextureManagerInternal.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ComputeSharp.Win32; - -#pragma warning disable CS0649, IDE0055 - -namespace ComputeSharp.D2D1.Shaders.Interop.Effects.ResourceManagers; - -/// -/// The internal resource texture manager type to use with built-in effects. -/// -internal unsafe struct ID2D1ResourceTextureManagerInternal : IComObject -{ - /// - static Guid* IComObject.IID - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - ReadOnlySpan data = - [ - 0x24, 0x10, 0xBB, 0x5C, - 0xA1, 0x8E, - 0x89, 0x46, - 0x81, 0xBF, - 0x8A, - 0xD1, - 0x90, - 0xB5, - 0xEF, - 0x5D - ]; - - return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data)); - } - } - - /// - /// The vtable for the current instance. - /// - private readonly void** lpVtbl; - - /// - /// Sets the for the current instance. - /// - /// The input for the manager. - /// A pointer to an optional amount of dimensions for the target resource texture, for validation. - /// An for the operation. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public HRESULT Initialize(ID2D1EffectContext* effectContext, uint* dimensions) - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[3])( - (ID2D1ResourceTextureManagerInternal*)Unsafe.AsPointer(ref this), - effectContext, - dimensions); - } - - /// - /// Gets the instance held by the manager. - /// - /// The resulting instance. - /// An for the operation. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public HRESULT GetResourceTexture(ID2D1ResourceTexture** resourceTexture) - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[4])( - (ID2D1ResourceTextureManagerInternal*)Unsafe.AsPointer(ref this), - resourceTexture); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawInfoUpdateContextImpl.ID2D1DrawInfoUpdateContex.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawInfoUpdateContextImpl.ID2D1DrawInfoUpdateContex.cs deleted file mode 100644 index 11c8757b..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawInfoUpdateContextImpl.ID2D1DrawInfoUpdateContex.cs +++ /dev/null @@ -1,120 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ComputeSharp.Win32; - -namespace ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers; - -/// -partial struct D2D1DrawInfoUpdateContextImpl -{ - /// - /// The implementation for . - /// - private static unsafe class ID2D1DrawInfoUpdateContextMethods - { - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static int QueryInterface(D2D1DrawInfoUpdateContextImpl* @this, Guid* riid, void** ppvObject) - { - return @this->QueryInterface(riid, ppvObject); - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static uint AddRef(D2D1DrawInfoUpdateContextImpl* @this) - { - return @this->AddRef(); - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static uint Release(D2D1DrawInfoUpdateContextImpl* @this) - { - return @this->Release(); - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static int GetConstantBufferSize(D2D1DrawInfoUpdateContextImpl* @this, uint* size) - { - if (size is null) - { - return E.E_POINTER; - } - - if (@this->d2D1DrawInfo.Get() is null) - { - return RO.RO_E_CLOSED; - } - - *size = (uint)@this->constantBufferSize; - - return S.S_OK; - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static int GetConstantBuffer(D2D1DrawInfoUpdateContextImpl* @this, byte* buffer, uint bufferCount) - { - if (buffer is null) - { - return E.E_POINTER; - } - - if (bufferCount < @this->constantBufferSize) - { - return E.E_NOT_SUFFICIENT_BUFFER; - } - - if (@this->constantBuffer is null) - { - return E.E_NOT_VALID_STATE; - } - - if (@this->d2D1DrawInfo.Get() is null) - { - return RO.RO_E_CLOSED; - } - - if (@this->constantBufferSize > 0) - { - Buffer.MemoryCopy(@this->constantBuffer, buffer, bufferCount, @this->constantBufferSize); - } - - return S.S_OK; - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static int SetConstantBuffer(D2D1DrawInfoUpdateContextImpl* @this, byte* buffer, uint bufferCount) - { - if (buffer is null) - { - return E.E_POINTER; - } - - if (bufferCount != (uint)@this->constantBufferSize) - { - return E.E_INVALIDARG; - } - - if (@this->d2D1DrawInfo.Get() is null) - { - return RO.RO_E_CLOSED; - } - - // If the buffer is empty, just do nothing - if (bufferCount == 0) - { - return S.S_OK; - } - - // Copy the buffer to the backing store, so the effect can also access it later - Buffer.MemoryCopy(buffer, @this->constantBuffer, bufferCount, bufferCount); - - // Propagate it to the ID2D1DrawInfo object in use as well - return @this->d2D1DrawInfo.Get()->SetPixelShaderConstantBuffer(buffer, bufferCount); - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawInfoUpdateContextImpl.ID2D1DrawInfoUpdateContexInternal.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawInfoUpdateContextImpl.ID2D1DrawInfoUpdateContexInternal.cs deleted file mode 100644 index 7bd14d01..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawInfoUpdateContextImpl.ID2D1DrawInfoUpdateContexInternal.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ComputeSharp.Win32; - -namespace ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers; - -/// -unsafe partial struct D2D1DrawInfoUpdateContextImpl -{ - /// - public int Close() - { - // No need to call Release on the ID2D1DrawInfo object (see notes in the Factory method) - this.d2D1DrawInfo = default; - - return S.S_OK; - } - - /// - /// The implementation for . - /// - private static class ID2D1DrawInfoUpdateContextInternalMethods - { - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static int QueryInterface(D2D1DrawInfoUpdateContextImpl* @this, Guid* riid, void** ppvObject) - { - @this = (D2D1DrawInfoUpdateContextImpl*)&((void**)@this)[-1]; - - return @this->QueryInterface(riid, ppvObject); - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static uint AddRef(D2D1DrawInfoUpdateContextImpl* @this) - { - @this = (D2D1DrawInfoUpdateContextImpl*)&((void**)@this)[-1]; - - return @this->AddRef(); - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static uint Release(D2D1DrawInfoUpdateContextImpl* @this) - { - @this = (D2D1DrawInfoUpdateContextImpl*)&((void**)@this)[-1]; - - return @this->Release(); - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static int Close(D2D1DrawInfoUpdateContextImpl* @this) - { - @this = (D2D1DrawInfoUpdateContextImpl*)&((void**)@this)[-1]; - - return @this->Close(); - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawInfoUpdateContextImpl.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawInfoUpdateContextImpl.cs deleted file mode 100644 index 9de0751c..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawInfoUpdateContextImpl.cs +++ /dev/null @@ -1,177 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Threading; -using ComputeSharp.D2D1.Interop; -using ComputeSharp.Win32; - -namespace ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers; - -/// -/// An implementation of the and interfaces. -/// -internal unsafe partial struct D2D1DrawInfoUpdateContextImpl -{ - /// - /// The shared vtable pointer for instance, for . - /// - private static readonly void** VtblForID2D1DrawInfoUpdateContext = InitVtblForID2D1DrawInfoUpdateContextAndID2D1DrawInfoUpdateContextInternal(); - - /// - /// The shared vtable pointer for instance, for . - /// - private static readonly void** VtblForID2D1DrawInfoUpdateContextInternal = &VtblForID2D1DrawInfoUpdateContext[5]; - - /// - /// Initializes the combined vtable for and . - /// - /// The combined vtable for and . - private static void** InitVtblForID2D1DrawInfoUpdateContextAndID2D1DrawInfoUpdateContextInternal() - { - void** lpVtbl = (void**)D2D1AssemblyAssociatedMemory.Allocate(sizeof(void*) * 10); - - // ID2D1ResourceTextureManager - lpVtbl[0] = (delegate* unmanaged[MemberFunction])&ID2D1DrawInfoUpdateContextMethods.QueryInterface; - lpVtbl[1] = (delegate* unmanaged[MemberFunction])&ID2D1DrawInfoUpdateContextMethods.AddRef; - lpVtbl[2] = (delegate* unmanaged[MemberFunction])&ID2D1DrawInfoUpdateContextMethods.Release; - lpVtbl[3] = (delegate* unmanaged[MemberFunction])&ID2D1DrawInfoUpdateContextMethods.GetConstantBufferSize; - lpVtbl[4] = (delegate* unmanaged[MemberFunction])&ID2D1DrawInfoUpdateContextMethods.GetConstantBuffer; - lpVtbl[5] = (delegate* unmanaged[MemberFunction])&ID2D1DrawInfoUpdateContextMethods.SetConstantBuffer; - - // ID2D1ResourceTextureManagerInternal - lpVtbl[6 + 0] = (delegate* unmanaged[MemberFunction])&ID2D1DrawInfoUpdateContextInternalMethods.QueryInterface; - lpVtbl[6 + 1] = (delegate* unmanaged[MemberFunction])&ID2D1DrawInfoUpdateContextInternalMethods.AddRef; - lpVtbl[6 + 2] = (delegate* unmanaged[MemberFunction])&ID2D1DrawInfoUpdateContextInternalMethods.Release; - lpVtbl[6 + 3] = (delegate* unmanaged[MemberFunction])&ID2D1DrawInfoUpdateContextInternalMethods.Close; - - return lpVtbl; - } - - /// - /// The vtable pointer for the current instance, for . - /// - private void** lpVtblForID2D1DrawInfoUpdateContext; - - /// - /// The vtable pointer for the current instance, for . - /// - private void** lpVtblForID2D1DrawInfoUpdateContextInternal; - - /// - /// The current reference count for the object (from ). - /// - private volatile int referenceCount; - - /// - /// The constant buffer data, if set. - /// - private byte* constantBuffer; - - /// - /// The size of . - /// - private int constantBufferSize; - - /// - /// The instance currently in use. - /// - private ComPtr d2D1DrawInfo; - - /// - /// The factory method for instances. - /// - /// The resulting draw info update context instance. - /// The constant buffer data, if set. - /// The size of . - /// The instance currently in use. - /// This always returns 0. - public static HRESULT Factory( - D2D1DrawInfoUpdateContextImpl** drawInfoUpdateContext, - byte* constantBuffer, - int constantBufferSize, - ID2D1DrawInfo* d2D1DrawInfo) - { - D2D1DrawInfoUpdateContextImpl* @this; - - try - { - @this = (D2D1DrawInfoUpdateContextImpl*)NativeMemory.Alloc((nuint)sizeof(D2D1DrawInfoUpdateContextImpl)); - } - catch (OutOfMemoryException) - { - *drawInfoUpdateContext = null; - - return E.E_OUTOFMEMORY; - } - - @this->lpVtblForID2D1DrawInfoUpdateContext = VtblForID2D1DrawInfoUpdateContext; - @this->lpVtblForID2D1DrawInfoUpdateContextInternal = VtblForID2D1DrawInfoUpdateContextInternal; - @this->referenceCount = 1; - @this->constantBuffer = constantBuffer; - @this->constantBufferSize = constantBufferSize; - - // This ID2D1DrawInfo manager instance is short lived, and the contract guarantees that it will not remain - // alive after the underlying ID2D1DrawInfo instance has been invalidated. As such, we can optimize the - // initialization by skipping the AddRef/Release calls on the ID2D1DrawInfo object, and simply storing the - // pointer to the object. When this instance is closed, that will just be set to null again. - @this->d2D1DrawInfo = default; - @this->d2D1DrawInfo.Attach(d2D1DrawInfo); - - *drawInfoUpdateContext = @this; - - return S.S_OK; - } - - /// - public int QueryInterface(Guid* riid, void** ppvObject) - { - if (ppvObject is null) - { - return E.E_POINTER; - } - - // ID2D1DrawInfoUpdateContext - if (riid->Equals(Windows.__uuidof()) || - riid->Equals(Windows.__uuidof())) - { - _ = Interlocked.Increment(ref this.referenceCount); - - *ppvObject = Unsafe.AsPointer(ref this); - - return S.S_OK; - } - - // ID2D1DrawInfoUpdateContextInternal - if (riid->Equals(Windows.__uuidof())) - { - _ = Interlocked.Increment(ref this.referenceCount); - - *ppvObject = (void**)Unsafe.AsPointer(ref this) + 1; - - return S.S_OK; - } - - *ppvObject = null; - - return E.E_NOINTERFACE; - } - - /// - public uint AddRef() - { - return (uint)Interlocked.Increment(ref this.referenceCount); - } - - /// - public uint Release() - { - uint referenceCount = (uint)Interlocked.Decrement(ref this.referenceCount); - - if (referenceCount == 0) - { - NativeMemory.Free(Unsafe.AsPointer(ref this)); - } - - return referenceCount; - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawTransformMapperImpl.ID2D1DrawTransformMapper.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawTransformMapperImpl.ID2D1DrawTransformMapper.cs deleted file mode 100644 index 019a711f..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawTransformMapperImpl.ID2D1DrawTransformMapper.cs +++ /dev/null @@ -1,143 +0,0 @@ -using System; -using System.Drawing; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ComputeSharp.D2D1.Extensions; -using ComputeSharp.Win32; - -namespace ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers; - -/// -unsafe partial struct D2D1DrawTransformMapperImpl -{ - /// - /// The implementation for . - /// - private static class ID2D1DrawTransformMapperMethods - { - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static int QueryInterface(D2D1DrawTransformMapperImpl* @this, Guid* riid, void** ppvObject) - { - return @this->QueryInterface(riid, ppvObject); - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static uint AddRef(D2D1DrawTransformMapperImpl* @this) - { - return @this->AddRef(); - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static uint Release(D2D1DrawTransformMapperImpl* @this) - { - return @this->Release(); - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static int MapInputRectsToOutputRect( - D2D1DrawTransformMapperImpl* @this, - ID2D1DrawInfoUpdateContext* d2D1DrawInfoUpdateContext, - RECT* inputRects, - RECT* inputOpaqueSubRects, - uint inputRectCount, - RECT* outputRect, - RECT* outputOpaqueSubRect) - { - Span inputs = stackalloc Rectangle[8].Slice(0, (int)inputRectCount); - Span opaqueInputs = stackalloc Rectangle[8].Slice(0, (int)inputRectCount); - - for (int i = 0; i < (int)inputRectCount; i++) - { - inputs[i] = inputRects[i].ToRectangle(); - opaqueInputs[i] = inputOpaqueSubRects[i].ToRectangle(); - } - - Rectangle output; - Rectangle opaqueOutput; - - // Invoke MapInputsToOutput and handle exceptions so they don't cross the ABI boundary - try - { - Unsafe.As(@this->transformMapperHandle.Target!).MapInputsToOutput( - d2D1DrawInfoUpdateContext, - inputs, - opaqueInputs, - out output, - out opaqueOutput); - } - catch (Exception e) - { - return Marshal.GetHRForException(e); - } - - *outputRect = output.ToRECT(); - *outputOpaqueSubRect = opaqueOutput.ToRECT(); - - return S.S_OK; - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static int MapOutputRectToInputRects( - D2D1DrawTransformMapperImpl* @this, - RECT* outputRect, - RECT* inputRects, - uint inputRectsCount) - { - Rectangle output = outputRect->ToRectangle(); - Span inputs = stackalloc Rectangle[8].Slice(0, (int)inputRectsCount); - - for (int i = 0; i < (int)inputRectsCount; i++) - { - inputs[i] = inputRects[i].ToRectangle(); - } - - // Handle exceptions, as mentioned above - try - { - Unsafe.As(@this->transformMapperHandle.Target!).MapOutputToInputs(in output, inputs); - } - catch (Exception e) - { - return Marshal.GetHRForException(e); - } - - for (int i = 0; i < (int)inputRectsCount; i++) - { - inputRects[i] = inputs[i].ToRECT(); - } - - return S.S_OK; - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static int MapInvalidRect( - D2D1DrawTransformMapperImpl* @this, - uint inputIndex, - RECT invalidInputRect, - RECT* invalidOutputRect) - { - Rectangle invalidInput = invalidInputRect.ToRectangle(); - Rectangle invalidOutput; - - // Handle exceptions once again - try - { - Unsafe.As(@this->transformMapperHandle.Target!).MapInvalidOutput((int)inputIndex, invalidInput, out invalidOutput); - } - catch (Exception e) - { - return Marshal.GetHRForException(e); - } - - *invalidOutputRect = invalidOutput.ToRECT(); - - return S.S_OK; - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawTransformMapperImpl.ID2D1DrawTransformMapperInternal.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawTransformMapperImpl.ID2D1DrawTransformMapperInternal.cs deleted file mode 100644 index 00e54b00..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawTransformMapperImpl.ID2D1DrawTransformMapperInternal.cs +++ /dev/null @@ -1,59 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ComputeSharp.Win32; - -namespace ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers; - -/// -unsafe partial struct D2D1DrawTransformMapperImpl -{ - /// - /// The implementation for . - /// - private static class ID2D1DrawTransformMapperInternalMethods - { - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static int QueryInterface(D2D1DrawTransformMapperImpl* @this, Guid* riid, void** ppvObject) - { - @this = (D2D1DrawTransformMapperImpl*)&((void**)@this)[-1]; - - return @this->QueryInterface(riid, ppvObject); - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static uint AddRef(D2D1DrawTransformMapperImpl* @this) - { - @this = (D2D1DrawTransformMapperImpl*)&((void**)@this)[-1]; - - return @this->AddRef(); - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static uint Release(D2D1DrawTransformMapperImpl* @this) - { - @this = (D2D1DrawTransformMapperImpl*)&((void**)@this)[-1]; - - return @this->Release(); - } - - /// - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] - public static int GetManagedWrapperHandle(D2D1DrawTransformMapperImpl* @this, void** ppvHandle) - { - @this = (D2D1DrawTransformMapperImpl*)&((void**)@this)[-1]; - - if (ppvHandle is null) - { - return E.E_POINTER; - } - - *ppvHandle = (void*)GCHandle.ToIntPtr(@this->transformMapperHandle); - - return S.S_OK; - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawTransformMapperImpl.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawTransformMapperImpl.cs deleted file mode 100644 index dba74a5d..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/D2D1DrawTransformMapperImpl.cs +++ /dev/null @@ -1,240 +0,0 @@ -using System; -using System.Diagnostics.CodeAnalysis; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Threading; -using ComputeSharp.D2D1.Interop; -using ComputeSharp.Win32; - -namespace ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers; - -/// -/// An implementation of the interface wrapping . -/// -internal unsafe partial struct D2D1DrawTransformMapperImpl -{ - /// - /// The shared vtable pointer for instance, for . - /// - private static readonly void** VtblForID2D1DrawTransformMapper = InitVtblForID2D1DrawTransformMapperAndID2D1DrawTransformMapperInternal(); - - /// - /// The shared vtable pointer for instance, for . - /// - private static readonly void** VtblForID2D1DrawTransformMapperInternal = &VtblForID2D1DrawTransformMapper[6]; - - /// - /// Initializes the combined vtable for and . - /// - /// The combined vtable for and . - private static void** InitVtblForID2D1DrawTransformMapperAndID2D1DrawTransformMapperInternal() - { - void** lpVtbl = (void**)D2D1AssemblyAssociatedMemory.Allocate(sizeof(void*) * 10); - - // ID2D1ResourceTextureManager - lpVtbl[0] = (delegate* unmanaged[MemberFunction])&ID2D1DrawTransformMapperMethods.QueryInterface; - lpVtbl[1] = (delegate* unmanaged[MemberFunction])&ID2D1DrawTransformMapperMethods.AddRef; - lpVtbl[2] = (delegate* unmanaged[MemberFunction])&ID2D1DrawTransformMapperMethods.Release; - lpVtbl[3] = (delegate* unmanaged[MemberFunction])&ID2D1DrawTransformMapperMethods.MapInputRectsToOutputRect; - lpVtbl[4] = (delegate* unmanaged[MemberFunction])&ID2D1DrawTransformMapperMethods.MapOutputRectToInputRects; - lpVtbl[5] = (delegate* unmanaged[MemberFunction])&ID2D1DrawTransformMapperMethods.MapInvalidRect; - - // ID2D1DrawTransformMapperInternal - lpVtbl[6 + 0] = (delegate* unmanaged[MemberFunction])&ID2D1DrawTransformMapperInternalMethods.QueryInterface; - lpVtbl[6 + 1] = (delegate* unmanaged[MemberFunction])&ID2D1DrawTransformMapperInternalMethods.AddRef; - lpVtbl[6 + 2] = (delegate* unmanaged[MemberFunction])&ID2D1DrawTransformMapperInternalMethods.Release; - lpVtbl[6 + 3] = (delegate* unmanaged[MemberFunction])&ID2D1DrawTransformMapperInternalMethods.GetManagedWrapperHandle; - - return lpVtbl; - } - - /// - /// The vtable pointer for the current instance, for . - /// - private void** lpVtblForID2D1DrawTransformMapper; - - /// - /// The vtable pointer for the current instance, for . - /// - private void** lpVtblForID2D1DrawTransformMapperInternal; - - /// - /// The current reference count for the object (from ). - /// - private volatile int referenceCount; - - /// - /// A to the wrapped instance. - /// - private GCHandle transformMapperHandle; - - /// - /// The instance to synchronize accesses to this instance. - /// - private SpinLock spinLock; - - /// - /// The factory method for instances. - /// - /// The input instance to wrap. - /// The resulting instance. - public static void Factory( - ID2D1DrawTransformMapperInterop transformMapper, - D2D1DrawTransformMapperImpl** d2D1TransformMapperProxy) - { - D2D1DrawTransformMapperImpl* @this = (D2D1DrawTransformMapperImpl*)NativeMemory.Alloc((nuint)sizeof(D2D1DrawTransformMapperImpl)); - - @this->lpVtblForID2D1DrawTransformMapper = VtblForID2D1DrawTransformMapper; - @this->lpVtblForID2D1DrawTransformMapperInternal = VtblForID2D1DrawTransformMapperInternal; - @this->referenceCount = 1; - @this->transformMapperHandle = GCHandle.Alloc(transformMapper); - @this->spinLock = new SpinLock(enableThreadOwnerTracking: false); - - *d2D1TransformMapperProxy = @this; - } - - /// - /// Gets a reference to the instance used to synchronize reference counts. - /// - [UnscopedRef] - public ref SpinLock SpinLock => ref this.spinLock; - - /// - /// Ensures the target of the current CCW is tracked and is keeping it alive. - /// - /// The associated object to track. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void EnsureTargetIsTracked(ID2D1DrawTransformMapperInterop target) - { - this.transformMapperHandle.Target = target; - } - - /// - /// Copies the current object onto a target pointer. - /// - /// The target pointer. - /// The for the operation. - /// This method must only be called if the caller has taken a lock on already. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public void CopyToWithNoLock(ID2D1DrawTransformMapper** transformMapper) - { - this.referenceCount++; - - *transformMapper = (ID2D1DrawTransformMapper*)Unsafe.AsPointer(ref this); - } - - /// - /// - /// This method is the same as but skips locks. - /// This method must only be called if the caller has taken a lock on already. - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public int QueryInterfaceWithNoLock(Guid* riid, void** ppvObject) - { - if (ppvObject is null) - { - return E.E_POINTER; - } - - // ID2D1DrawTransformMapper - if (riid->Equals(Windows.__uuidof()) || - riid->Equals(Windows.__uuidof())) - { - this.referenceCount++; - - *ppvObject = Unsafe.AsPointer(ref this); - - return S.S_OK; - } - - // ID2D1DrawTransformMapperInternal - if (riid->Equals(Windows.__uuidof())) - { - this.referenceCount++; - - *ppvObject = (void**)Unsafe.AsPointer(ref this) + 1; - - return S.S_OK; - } - - *ppvObject = null; - - return E.E_NOINTERFACE; - } - - /// - private int QueryInterface(Guid* riid, void** ppvObject) - { - bool lockTaken = false; - - this.spinLock.Enter(ref lockTaken); - - try - { - return QueryInterfaceWithNoLock(riid, ppvObject); - } - finally - { - this.spinLock.Exit(); - } - } - - /// - private uint AddRef() - { - bool lockTaken = false; - - this.spinLock.Enter(ref lockTaken); - - try - { - return (uint)++this.referenceCount; - } - finally - { - this.spinLock.Exit(); - } - } - - /// - private uint Release() - { - bool lockTaken = false; - - this.spinLock.Enter(ref lockTaken); - - uint referenceCount; - - try - { - referenceCount = (uint)--this.referenceCount; - - // There are two special cases to consider here: - // - If the reference count is 1, it means that the D2D1TransformMapper object is the only - // thing keeping this CCW alive. In that case, we can reset the GC handle pointing back to it, - // so that it can be collected if nobody else is referencing it. This breaks the reference cycle - // between the two object, which would have otherwise caused them to remain alive forever. - // - If the reference count is 0, the object is simply being destroyed. This is moved outside of - // this try/finally block, as otherwise accessing the lock from the finally block would write to - // out of bounds memory (as the field is in native memory that has just been freed). - if (referenceCount == 1) - { - this.transformMapperHandle.Target = null; - } - } - finally - { - this.spinLock.Exit(); - } - - // Destroy the object if this was the last reference left (see notes above as to why this is here) - if (referenceCount == 0) - { - this.transformMapperHandle.Free(); - - NativeMemory.Free(Unsafe.AsPointer(ref this)); - } - - return referenceCount; - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1DrawInfoUpdateContext.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1DrawInfoUpdateContext.cs deleted file mode 100644 index 5bb6029b..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1DrawInfoUpdateContext.cs +++ /dev/null @@ -1,86 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ComputeSharp.Win32; - -#pragma warning disable CS0649, IDE0055 - -namespace ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers; - -/// -/// The updater for type to use with built-in effects. -/// -internal unsafe struct ID2D1DrawInfoUpdateContext : IComObject -{ - /// - static Guid* IComObject.IID - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - ReadOnlySpan data = - [ - 0x40, 0x5B, 0x0C, 0x43, - 0x16, 0xAE, - 0x5F, 0x48, - 0x90, 0xE6, - 0x4F, - 0xA4, - 0x91, - 0x51, - 0x44, - 0xB6 - ]; - - return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data)); - } - } - - /// - /// The vtable for the current instance. - /// - private readonly void** lpVtbl; - - /// - /// Retrieves the size of the constant buffer for the current effect. - /// - /// The resulting size of the constant buffer. - /// An for the operation. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public HRESULT GetConstantBufferSize(uint* size) - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[3])( - (ID2D1DrawInfoUpdateContext*)Unsafe.AsPointer(ref this), - size); - } - - /// - /// Retrieves the constant buffer data for the current effect. - /// - /// A pointer to the buffer to fill with the constant buffer data. - /// The size of the buffer provided through . - /// An for the operation. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public HRESULT GetConstantBuffer(byte* buffer, uint bufferCount) - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[4])( - (ID2D1DrawInfoUpdateContext*)Unsafe.AsPointer(ref this), - buffer, - bufferCount); - } - - /// - /// Sets the constant buffer data for the current effect. - /// - /// A pointer to the constant buffer data to use to update the effect. - /// The size of the buffer provided through . - /// An for the operation. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public HRESULT SetConstantBuffer(byte* buffer, uint bufferCount) - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[5])( - (ID2D1DrawInfoUpdateContext*)Unsafe.AsPointer(ref this), - buffer, - bufferCount); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1DrawInfoUpdateContextInternal.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1DrawInfoUpdateContextInternal.cs deleted file mode 100644 index 61357236..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1DrawInfoUpdateContextInternal.cs +++ /dev/null @@ -1,53 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ComputeSharp.Win32; - -#pragma warning disable CS0649, IDE0055 - -namespace ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers; - -/// -/// An internal version of that supports being closed, to manage lifetime scopes. -/// -internal unsafe struct ID2D1DrawInfoUpdateContextInternal : IComObject -{ - /// - static Guid* IComObject.IID - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - ReadOnlySpan data = - [ - 0xB0, 0x5B, 0x2F, 0xCF, - 0x5E, 0x3F, - 0x6E, 0x4D, - 0x8F, 0xF1, - 0xD9, - 0xA7, - 0xEB, - 0x6C, - 0x02, - 0x50 - ]; - - return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data)); - } - } - - /// - /// The vtable for the current instance. - /// - private readonly void** lpVtbl; - - /// - /// Closes the current instance. - /// - /// An for the operation. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public HRESULT Close() - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[3])((ID2D1DrawInfoUpdateContext*)Unsafe.AsPointer(ref this)); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1DrawTransformMapper.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1DrawTransformMapper.cs deleted file mode 100644 index caa5a9e7..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1DrawTransformMapper.cs +++ /dev/null @@ -1,112 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ComputeSharp.Win32; - -#pragma warning disable CS0649, IDE0055 - -namespace ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers; - -/// -/// The transform mapper manager type to use with built-in effects. -/// -internal unsafe struct ID2D1DrawTransformMapper : IComObject -{ - /// - static Guid* IComObject.IID - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - ReadOnlySpan data = - [ - 0x8D, 0xD4, 0xE6, 0x02, - 0x92, 0xB8, - 0xBC, 0x4F, - 0xAA, 0x54, - 0x11, - 0x92, - 0x03, - 0xBA, - 0xB8, - 0x02 - ]; - - return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data)); - } - } - - /// - /// The vtable for the current instance. - /// - private readonly void** lpVtbl; - - /// - /// Performs the inverse mapping to . - /// - /// The input instance. - /// An array of input rectangles to be mapped to the output rectangle. - /// An array of input rectangles to be mapped to the opaque output rectangle. - /// The number of inputs specified. - /// The output rectangle that maps to the corresponding input rectangle. - /// The output rectangle that maps to the corresponding opaque input rectangle. - /// An for the operation. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public HRESULT MapInputRectsToOutputRect( - ID2D1DrawInfoUpdateContext* updateContext, - RECT* inputRects, - RECT* inputOpaqueSubRects, - uint inputRectCount, - RECT* outputRect, - RECT* outputOpaqueSubRect) - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[3])( - (ID2D1DrawTransformMapper*)Unsafe.AsPointer(ref this), - updateContext, - inputRects, - inputOpaqueSubRects, - inputRectCount, - outputRect, - outputOpaqueSubRect); - } - - /// - /// Allows a transform to state how it would map a rectangle requested on its output to a set of sample rectangles on its input. - /// - /// The output rectangle from which the inputs must be mapped. - /// The corresponding set of inputs. The inputs will directly correspond to the transform inputs. - /// The number of inputs specified. - /// An for the operation. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public HRESULT MapOutputRectToInputRects( - RECT* outputRect, - RECT* inputRects, - uint inputRectsCount) - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[4])( - (ID2D1DrawTransformMapper*)Unsafe.AsPointer(ref this), - outputRect, - inputRects, - inputRectsCount); - } - - /// - /// Sets the input rectangles for this rendering pass into the transform. - /// - /// The index of the input rectangle. - /// The invalid input rectangle. - /// The output rectangle to which the input rectangle must be mapped. - /// An for the operation. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public HRESULT MapInvalidRect( - uint inputIndex, - RECT invalidInputRect, - RECT* invalidOutputRect) - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[5])( - (ID2D1DrawTransformMapper*)Unsafe.AsPointer(ref this), - inputIndex, - invalidInputRect, - invalidOutputRect); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1DrawTransformMapperInternal.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1DrawTransformMapperInternal.cs deleted file mode 100644 index 1f072660..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1DrawTransformMapperInternal.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ComputeSharp.Win32; - -#pragma warning disable CS0649, IDE0055 - -namespace ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers; - -/// -/// The internal transform mapper manager interface. -/// -internal unsafe struct ID2D1DrawTransformMapperInternal : IComObject -{ - /// - static Guid* IComObject.IID - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - ReadOnlySpan data = - [ - 0x65, 0xFC, 0xD8, 0xC5, - 0x86, 0xFB, - 0x2D, 0x4C, - 0x9E, 0xF5, - 0x95, - 0xAE, - 0xC6, - 0x39, - 0xC9, - 0x52 - ]; - - return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data)); - } - } - - /// - /// The vtable for the current instance. - /// - private readonly void** lpVtbl; - - /// - /// Gets a value for the managed wrapper associated with this CCW. - /// - /// The value for the managed wrapper associated with this CCW. - /// An for the operation. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public HRESULT GetManagedWrapperHandle(void** ppvHandle) - { - return ((delegate* unmanaged[MemberFunction])this.lpVtbl[3])( - (ID2D1DrawTransformMapperInternal*)Unsafe.AsPointer(ref this), - ppvHandle); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1DrawTransformMapperInterop.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1DrawTransformMapperInterop.cs deleted file mode 100644 index a7d520a2..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Effects/TransformMappers/ID2D1DrawTransformMapperInterop.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Drawing; -using ComputeSharp.D2D1.Interop; - -namespace ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers; - -/// -/// A base type to support non-generic uses. -/// -internal unsafe interface ID2D1DrawTransformMapperInterop -{ - /// - /// The instance associated with the current effect. - /// The input rectangles to be mapped to the output rectangle. This parameter is always equal to the input bounds. - /// The input rectangles to be mapped to the opaque output rectangle. - /// The output rectangle that maps to the corresponding input rectangle. - /// The output rectangle that maps to the corresponding opaque input rectangle. - void MapInputsToOutput( - ID2D1DrawInfoUpdateContext* d2D1DrawInfoUpdateContext, - ReadOnlySpan inputs, - ReadOnlySpan opaqueInputs, - out Rectangle output, - out Rectangle opaqueOutput); - - /// - void MapOutputToInputs(in Rectangle output, Span inputs); - - /// - void MapInvalidOutput(int inputIndex, in Rectangle invalidInput, out Rectangle invalidOutput); -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Extensions/ID2D1EffectContextExtensions.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Extensions/ID2D1EffectContextExtensions.cs deleted file mode 100644 index be97567c..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Extensions/ID2D1EffectContextExtensions.cs +++ /dev/null @@ -1,150 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using ComputeSharp.Win32; - -namespace ComputeSharp.D2D1.Shaders.Interop.Extensions; - -/// -/// Extensions for the type. -/// -internal static unsafe class ID2D1EffectContextExtensions -{ - /// - /// Gets an from an input object. - /// - /// The input instance. - /// The resulting object. - /// The for the operation - /// - /// - /// The object is not thread-safe, so it cannot be used concurrently - /// when outside of a scenario where D2D has explicitly called into user code (eg. in the public APIs - /// from . To avoid issues, it is necessary to lock with the same lock - /// used by D2D when using any public API on from other callsites. - /// The same goes for any type out of d2d1effectauthor.h, such as . - /// - /// - /// To lock, the object can be used. To retrieve this, a - /// instance is needed. This cannot be retrieved directly from an , but this - /// can be used to create any instance (such as a flood effect, which is fairly cheap). - /// From that, can be used to get an object. - /// The fact implements this interface is mentioned in the docs, - /// see . - /// - /// - /// From the , an can be retrieved. Finally, this can - /// be cast to , which can then be kept and used to synchronize later calls. - /// - /// - public static HRESULT GetD2D1Multithread(this ref ID2D1EffectContext effectContext, ID2D1Multithread** multithread) - { - using ComPtr floodEffect = default; - - HRESULT hresult = effectContext.CreateEffect( - effectId: (Guid*)Unsafe.AsPointer(ref Unsafe.AsRef(in CLSID.CLSID_D2D1Flood)), - effect: (void**)floodEffect.GetAddressOf()); - - if (Windows.SUCCEEDED(hresult)) - { - using ComPtr d2D1Image = default; - - hresult = floodEffect.CopyTo(d2D1Image.GetAddressOf()); - - if (Windows.SUCCEEDED(hresult)) - { - using ComPtr d2D1Factory = default; - - d2D1Image.Get()->GetFactory(d2D1Factory.GetAddressOf()); - - hresult = d2D1Factory.CopyTo(multithread); - } - } - - return hresult; - } - - /// - /// Checks whether the input shader is supported by the target instance. - /// - /// The input instance. - /// The shader bytecode. - /// The size of . - /// - /// The for the operation: - /// - /// : the shader is supported. - /// : the shader is not supported. - /// Any other : an error occurred while checking the shader support. - /// - /// - /// If any calls needed to check support fail, the method will also return . - public static HRESULT IsShaderSupported(this ref ID2D1EffectContext effectContext, byte* bytecode, int bytecodeSize) - { - using ComPtr d3D11ShaderReflection = default; - - // Create the reflection instance to extract the shader info - HRESULT hresult = DirectX.D3DReflect( - pSrcData: bytecode, - SrcDataSize: (uint)bytecodeSize, - pInterface: Windows.__uuidof(), - ppReflector: (void**)d3D11ShaderReflection.GetAddressOf()); - - if (!Windows.SUCCEEDED(hresult)) - { - return hresult; - } - - D3D_FEATURE_LEVEL d3DMinFeatureLevel; - - // Get the minimum feature level for the shader - hresult = d3D11ShaderReflection.Get()->GetMinFeatureLevel(&d3DMinFeatureLevel); - - if (!Windows.SUCCEEDED(hresult)) - { - return hresult; - } - - D3D_FEATURE_LEVEL d3DMaxFeatureLevel; - - // Check whether the current context supports the minimum feature level - hresult = effectContext.GetMaximumSupportedFeatureLevel( - featureLevels: &d3DMinFeatureLevel, - featureLevelsCount: 1, - maximumSupportedFeatureLevel: &d3DMaxFeatureLevel); - - // If the context doesn't match the required feature level, return that as an error - if (hresult == D2DERR.D2DERR_INSUFFICIENT_DEVICE_CAPABILITIES) - { - return S.S_FALSE; - } - - // If the call failed for any other reason, stop here like before - if (!Windows.SUCCEEDED(hresult)) - { - return hresult; - } - - D2D1_FEATURE_DATA_DOUBLES d2D1FeatureDataDoubles = default; - - // Check the feature support for the effect context in use - hresult = effectContext.CheckFeatureSupport(D2D1_FEATURE.D2D1_FEATURE_DOUBLES, &d2D1FeatureDataDoubles, (uint)sizeof(D2D1_FEATURE_DATA_DOUBLES)); - - if (!Windows.SUCCEEDED(hresult)) - { - return hresult; - } - - // If the context does not support double precision values, check whether the shader requested them - if (d2D1FeatureDataDoubles.doublePrecisionFloatShaderOps == 0) - { - // If the shader requires double precision support, the shader is not supported - if ((d3D11ShaderReflection.Get()->GetRequiresFlags() & (D3D.D3D_SHADER_REQUIRES_DOUBLES | D3D.D3D_SHADER_REQUIRES_11_1_DOUBLE_EXTENSIONS)) != 0) - { - return S.S_FALSE; - } - } - - // All calls succeeded and no unsupported feature was detected, so assume the shader is supported - return S.S_OK; - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Factories/Abstract/D2D1TransformMapper{T,TParameters}.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Factories/Abstract/D2D1TransformMapper{T,TParameters}.cs deleted file mode 100644 index d0af4b72..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Factories/Abstract/D2D1TransformMapper{T,TParameters}.cs +++ /dev/null @@ -1,97 +0,0 @@ -using System; -using System.Drawing; -using System.Runtime.CompilerServices; -using ComputeSharp.D2D1.Descriptors; -using ComputeSharp.D2D1.Interop; -using ComputeSharp.D2D1.Shaders.Interop.Helpers; - -namespace ComputeSharp.D2D1.Shaders.Interop.Factories.Abstract; - -/// -/// A base type for a transform mapper to be used in a D2D1 pixel shader effect. -/// -/// The type of D2D1 pixel shader associated to the transform mapper. -/// The type of parameters that the transform mapper will use. -internal abstract class D2D1DrawTransformMapper : D2D1DrawTransformMapper - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - where TParameters : unmanaged -{ - /// - /// The parameters to use in this transform mapper. - /// - private TParameters parameters; - - /// - public sealed override void MapInputsToOutput( - D2D1DrawInfoUpdateContext drawInfoUpdateContext, - ReadOnlySpan inputs, - ReadOnlySpan opaqueInputs, - out Rectangle output, - out Rectangle opaqueOutput) - { - this.parameters = GetParameters(drawInfoUpdateContext); - - if (inputs.IsEmpty) - { - Unsafe.SkipInit(out output); - - output.ToD2D1Infinite(); - - opaqueOutput = Rectangle.Empty; - } - else - { - Rectangle64 output64 = Rectangle64.Empty; - - foreach (ref readonly Rectangle input in inputs) - { - output64.Union(Rectangle64.FromRectangle(input)); - } - - TransformInputToOutput(in this.parameters, ref output64); - - output = output64.ToRectangleWithD2D1LogicallyInfiniteClamping(); - opaqueOutput = Rectangle.Empty; - } - } - - /// - public sealed override void MapOutputToInputs(in Rectangle output, Span inputs) - { - Rectangle64 output64 = Rectangle64.FromRectangle(output); - - TransformOutputToInput(in this.parameters, ref output64); - - inputs.Fill(output64.ToRectangleWithD2D1LogicallyInfiniteClamping()); - } - - /// - public sealed override void MapInvalidOutput(int inputIndex, in Rectangle invalidInput, out Rectangle invalidOutput) - { - Rectangle64 output64 = Rectangle64.FromRectangle(invalidInput); - - TransformInputToOutput(in this.parameters, ref output64); - - invalidOutput = output64.ToRectangleWithD2D1LogicallyInfiniteClamping(); - } - - /// - /// Gets the values for the current transform mapper. - /// - /// The input value, which can be used to access and modify shader data. - protected abstract TParameters GetParameters(D2D1DrawInfoUpdateContext drawInfoUpdateContext); - - /// - /// Transforms an input rectangle to an output rectangle. - /// - /// The parameters to be used to inform the transformation. - /// The input rectangle to transform to output. - protected abstract void TransformInputToOutput(in TParameters parameters, ref Rectangle64 rectangle); - - /// - /// Transforms an output rectangle to an input rectangle. - /// - /// The parameters to be used to inform the transformation. - /// The output rectangle to transform to input. - protected abstract void TransformOutputToInput(in TParameters parameters, ref Rectangle64 rectangle); -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Factories/D2D1AffineTransformMapper{T}.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Factories/D2D1AffineTransformMapper{T}.cs deleted file mode 100644 index 4105fd9e..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Factories/D2D1AffineTransformMapper{T}.cs +++ /dev/null @@ -1,143 +0,0 @@ -using System; -using System.Numerics; -using System.Runtime.CompilerServices; -using ComputeSharp.D2D1.Descriptors; -using ComputeSharp.D2D1.Interop; -using ComputeSharp.D2D1.Shaders.Interop.Factories.Abstract; -using ComputeSharp.D2D1.Shaders.Interop.Helpers; - -namespace ComputeSharp.D2D1.Shaders.Interop.Factories; - -/// -/// Shared helpers for . -/// -/// -/// This non-generic type is used so that and are not recompiled for each generic type instantiation. -/// -file static class D2D1AffineTransformMapper -{ - /// - /// Transforms a target rectangle using a given transform matrix. - /// - /// The transform matrix to use. - /// The rectangle to transform. - public static void Transform(in Matrix3x2 matrix, ref Rectangle64 rectangle) - { - // Get the rectangle corners - Point64 topLeft = new(rectangle.Left, rectangle.Top); - Point64 topRight = new(rectangle.Right, rectangle.Top); - Point64 bottomLeft = new(rectangle.Left, rectangle.Bottom); - Point64 bottomRight = new(rectangle.Right, rectangle.Bottom); - - // Transform them with the current matrix - (double X, double Y) transformedTopLeft = topLeft.Transform(in matrix); - (double X, double Y) transformedTopRight = topRight.Transform(in matrix); - (double X, double Y) transformedBottomLeft = bottomLeft.Transform(in matrix); - (double X, double Y) transformedBottomRight = bottomRight.Transform(in matrix); - - // Calculate the bounding box of the transformed points - double transformedLeft = Math.Min(Math.Min(transformedTopLeft.X, transformedTopRight.X), Math.Min(transformedBottomLeft.X, transformedBottomRight.X)); - double transformedTop = Math.Min(Math.Min(transformedTopLeft.Y, transformedTopRight.Y), Math.Min(transformedBottomLeft.Y, transformedBottomRight.Y)); - double transformedRight = Math.Max(Math.Max(transformedTopLeft.X, transformedTopRight.X), Math.Max(transformedBottomLeft.X, transformedBottomRight.X)); - double transformedBottom = Math.Max(Math.Max(transformedTopLeft.Y, transformedTopRight.Y), Math.Max(transformedBottomLeft.Y, transformedBottomRight.Y)); - - // Round each coordinate as needed and compute the rectangle bounds - long left = (long)Math.Floor(Math.Max(transformedLeft, long.MinValue)); - long top = (long)Math.Floor(Math.Max(transformedTop, long.MinValue)); - long right = (long)Math.Ceiling(Math.Min(transformedRight, long.MaxValue)); - long bottom = (long)Math.Ceiling(Math.Min(transformedBottom, long.MaxValue)); - - // Calculate the width and height, with clamping in case of overflows - long width = SubtractAndClampToMaxIfOverflow(right, left); - long height = SubtractAndClampToMaxIfOverflow(bottom, top); - - rectangle = new(left, top, width, height); - } - - /// - /// Subtracts two values and clamps to if there is an overflow. - /// - /// The first value. - /// The value to subtract. - /// The result of the subtraction, clamped to . - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static long SubtractAndClampToMaxIfOverflow(long x, long y) - { - long z = unchecked(x - y); - - // Overflow in (x - y) with carry occurs if and only if x and y have opposite signs - // and the sign of (x - y) with carry is opposite of x (or equivalently same as y). - if (((x ^ y) & (z ^ x)) < 0) - { - return long.MaxValue; - } - - return z; - } -} - -/// -/// A custom implementation for an affine transform. -/// -/// The type of D2D1 pixel shader associated to the transform mapper. -internal abstract class D2D1AffineTransformMapper : D2D1DrawTransformMapper - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor -{ - /// - protected sealed override void TransformInputToOutput(in Matrix3x2 parameters, ref Rectangle64 rectangle) - { - D2D1AffineTransformMapper.Transform(in parameters, ref rectangle); - } - - /// - protected sealed override void TransformOutputToInput(in Matrix3x2 parameters, ref Rectangle64 rectangle) - { - if (!Matrix3x2.Invert(parameters, out Matrix3x2 matrix)) - { - static void Throw() - { - // The parameter name is "matrix" and it's passed by users from D2D1TransformMapperFactory.Transform. - // Additionally, we explicitly don't use a throw helper here to avoid loading the two string literals. - throw new ArgumentException("The input transform matrix can't be inverted, so it can't be used for a transform mapper.", "matrix"); - } - - Throw(); - } - - D2D1AffineTransformMapper.Transform(in matrix, ref rectangle); - } - - /// - /// A implementation for a constant affine transform matrix. - /// - public sealed class ConstantMatrix : D2D1AffineTransformMapper - { - /// - /// Gets the fixed affine transform matrix. - /// - public required Matrix3x2 Amount { get; init; } - - /// - protected override Matrix3x2 GetParameters(D2D1DrawInfoUpdateContext drawInfoUpdateContext) - { - return Amount; - } - } - - /// - /// A implementation for a dynamic affine transform matrix. - /// - public sealed class DynamicMatrix : D2D1AffineTransformMapper - { - /// - /// Gets the instance to get the dynamic affine transform matrix. - /// - public required Accessor Accessor { get; init; } - - /// - protected override Matrix3x2 GetParameters(D2D1DrawInfoUpdateContext drawInfoUpdateContext) - { - return Accessor(drawInfoUpdateContext.GetConstantBuffer()); - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Factories/D2D1InflateTransformMapper{T}.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Factories/D2D1InflateTransformMapper{T}.cs deleted file mode 100644 index 63f7e925..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Factories/D2D1InflateTransformMapper{T}.cs +++ /dev/null @@ -1,111 +0,0 @@ -using ComputeSharp.D2D1.Descriptors; -using ComputeSharp.D2D1.Interop; -using ComputeSharp.D2D1.Shaders.Interop.Factories.Abstract; -using ComputeSharp.D2D1.Shaders.Interop.Helpers; - -namespace ComputeSharp.D2D1.Shaders.Interop.Factories; - -/// -/// A custom implementation for an inflate transform. -/// -/// The type of D2D1 pixel shader associated to the transform mapper. -internal abstract class D2D1InflateTransformMapper : D2D1DrawTransformMapper - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor -{ - /// - protected sealed override void TransformInputToOutput(in (int Left, int Top, int Right, int Bottom) parameters, ref Rectangle64 rectangle) - { - rectangle.Inflate(parameters.Left, parameters.Top, parameters.Right, parameters.Bottom); - } - - /// - protected sealed override void TransformOutputToInput(in (int Left, int Top, int Right, int Bottom) parameters, ref Rectangle64 rectangle) - { - rectangle.Inflate(parameters.Left, parameters.Top, parameters.Right, parameters.Bottom); - } - - /// - /// A implementation for a constant inflate amount. - /// - public sealed class ConstantAmount : D2D1InflateTransformMapper - { - /// - /// Gets the fixed inflate amount. - /// - public required int Amount { get; init; } - - /// - protected override (int Left, int Top, int Right, int Bottom) GetParameters(D2D1DrawInfoUpdateContext drawInfoUpdateContext) - { - return (Amount, Amount, Amount, Amount); - } - } - - /// - /// A implementation for a constant inflate LTRB amount. - /// - public sealed class ConstantLeftTopRightBottomAmount : D2D1InflateTransformMapper - { - /// - /// The constant left inflate amount. - /// - public required int Left { get; init; } - - /// - /// The constant top inflate amount. - /// - public required int Top { get; init; } - - /// - /// The constant right inflate amount. - /// - public required int Right { get; init; } - - /// - /// The constant bottom inflate amount. - /// - public required int Bottom { get; init; } - - /// - protected override (int Left, int Top, int Right, int Bottom) GetParameters(D2D1DrawInfoUpdateContext drawInfoUpdateContext) - { - return (Left, Top, Right, Bottom); - } - } - - /// - /// A implementation for a dynamic inflate amount. - /// - public sealed class DynamicAmount : D2D1InflateTransformMapper - { - /// - /// Gets the instance to get the dynamic inflate amount. - /// - public required Accessor Accessor { get; init; } - - /// - protected override (int Left, int Top, int Right, int Bottom) GetParameters(D2D1DrawInfoUpdateContext drawInfoUpdateContext) - { - int amount = Accessor(drawInfoUpdateContext.GetConstantBuffer()); - - return (amount, amount, amount, amount); - } - } - - /// - /// A implementation for a dynamic inflate LTRB amount. - /// - public sealed class DynamicLeftTopRightBottomAmount : D2D1InflateTransformMapper - { - /// - /// Gets the instance to get the dynamic inflate LTRB amount. - /// - public required Accessor<(int, int, int, int)> Accessor { get; init; } - - /// - protected override (int Left, int Top, int Right, int Bottom) GetParameters(D2D1DrawInfoUpdateContext drawInfoUpdateContext) - { - return Accessor(drawInfoUpdateContext.GetConstantBuffer()); - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Helpers/D2D1AssemblyAssociatedMemory.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Helpers/D2D1AssemblyAssociatedMemory.cs deleted file mode 100644 index c0e87818..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Helpers/D2D1AssemblyAssociatedMemory.cs +++ /dev/null @@ -1,35 +0,0 @@ -#if SOURCE_GENERATOR -using System.Runtime.InteropServices; -#else -using System.Runtime.CompilerServices; -#endif - -namespace ComputeSharp.D2D1.Interop; - -/// -/// A helper type to allocate memory that's associated with the current assembly. -/// -internal static unsafe class D2D1AssemblyAssociatedMemory -{ - /// - /// Allocate memory that is associated with the current assembly, and it will be freed if and when it is unloaded. - /// - /// The amount of memory in bytes to allocate. - /// The allocated memory. - public static unsafe void* Allocate(int size) - { - // This is a size optimization specifically for AOT scenarios. The RuntimeHelpers.AllocateTypeAssociatedMemory API - // requires a Type instance being passed to it, and doing typeof(T) ends up rooting a fair amount of extra metadata - // and code for those types. This is especially the case for value types, as the reflection stack assumea that the - // type T might be boxed, and therefore allocates code to handle equality on boxed instances, which also causes - // implemented interfaces (eg. IEquatable) to be rooted, if present. This method works around this issue by - // only invoking this API on an empty type, which minimizes the codegen increase. This is still safe, as types are - // not unloaded one by one. Rather, the entire assembly they belong to is unloaded. So given all uses of this API - // are from within this same assembly, there is no functional difference than associating memory to the various types. -#if SOURCE_GENERATOR - return (void*)Marshal.AllocHGlobal(size); -#else - return (void*)RuntimeHelpers.AllocateTypeAssociatedMemory(typeof(D2D1AssemblyAssociatedMemory), size); -#endif - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Helpers/D2D1EffectXmlFactory.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Helpers/D2D1EffectXmlFactory.cs deleted file mode 100644 index 912c7553..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Helpers/D2D1EffectXmlFactory.cs +++ /dev/null @@ -1,144 +0,0 @@ -using System; -using System.Buffers; -using System.Text; -using ComputeSharp.D2D1.Descriptors; - -#pragma warning disable CS0618 - -namespace ComputeSharp.D2D1.Interop; - -/// -/// A factory type to produce effect registration XML blobs. -/// -internal static unsafe class D2D1EffectXmlFactory -{ - /// - /// The shared instance to use to build effect registration XML blobs. - /// - private static readonly StringBuilder XmlBuilder = new(4096); - - /// - /// Gets a instance with the effect registration XML blob for a given shader type. - /// - /// The type of shader type to build the XML for. - /// The instance with the effect registration XML blob. - public static EffectXml GetXmlBuffer() - where T : unmanaged, ID2D1PixelShader, ID2D1PixelShaderDescriptor - { - // Compute all necessary values first, outside of the lock - string? displayName = T.EffectDisplayName; - string? description = T.EffectDescription; - string? category = T.EffectCategory; - string? author = T.EffectAuthor; - int inputCount = T.InputCount; - int resourceTextureCount = T.ResourceTextureCount; - - StringBuilder builder = XmlBuilder; - - // We use a simple caching schema here with a single StringBuilder instance shared across all threads. - // It is only used to write the effect XML blob and copy it, which is extremely fast. The lock itself - // is not taken during the actual effect registration, but only to build the effect XML text. The builder - // is initialized with a size of 4096, which should be more than enough to hold pretty much all XML values. - lock (builder) - { - _ = builder.Clear(); - - // Write the metadata properties for the effect - _ = builder.Append($""" - - - - - - - - """); - - // Add the input nodes, if any - for (int i = 0; i < inputCount; i++) - { - _ = builder.Append('\n'); - _ = builder.Append($" "); - } - - // Close the inputs tag and add the always available properties - _ = builder.Append('\n'); - _ = builder.Append(""" - - - - - - - - """); - - // Add the resource texture manager nodes, if any - for (int i = 0; i < resourceTextureCount; i++) - { - _ = builder.Append('\n'); - _ = builder.Append($""" - - - - """); - } - - // Close the effect tag - _ = builder.Append('\n'); - _ = builder.Append(""); - - // Null terminator for the text - _ = builder.Append('\0'); - - return new(builder); - } - } - - /// - /// A simple buffer for an effect XML blob. - /// - public readonly ref struct EffectXml - { - /// - /// The buffer with the effect XML blob. - /// - private readonly char[] buffer; - - /// - /// The length of the effect XML blob. - /// - private readonly int length; - - /// - /// Creates a new value with the specified parameters. - /// - /// The instance with the effect XML. - [Obsolete($"This should only be used by {nameof(D2D1EffectXmlFactory)}.")] - public EffectXml(StringBuilder builder) - { - // Rent a buffer from the pool with the current builder size - this.buffer = ArrayPool.Shared.Rent(builder.Length); - this.length = builder.Length; - - // Copy the current builder content with the effect XML blob into the - // rented buffer. This allows the builder to be reused for other effects. - builder.CopyTo(0, this.buffer, 0, builder.Length); - } - - /// - /// Gets a for the effect XML blob. - /// - /// The value with the effect XML blob. - public ReadOnlySpan GetBuffer() - { - return this.buffer.AsSpan(0, this.length); - } - - /// - public void Dispose() - { - ArrayPool.Shared.Return(this.buffer); - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Helpers/Point64.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Helpers/Point64.cs deleted file mode 100644 index a71978bc..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Helpers/Point64.cs +++ /dev/null @@ -1,64 +0,0 @@ -using System; -using System.Drawing; -using System.Numerics; -using System.Runtime.CompilerServices; - -namespace ComputeSharp.D2D1.Shaders.Interop.Helpers; - -/// -/// A 64-bit version of the type. -/// -/// The horizontal coordinate of the point. -/// The vertical coordinate of the point. -internal readonly struct Point64(long x, long y) -{ - /// - /// Gets the horizontal coordinate of the current point. - /// - public readonly long X - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => x; - } - - /// - /// Gets the vertical coordinate of the current point. - /// - public readonly long Y - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => y; - } - - /// - /// Transforms the current point using an input matrix. - /// - /// The transformation matrix to use. - /// The transformed points, with no rounding. - public (double X, double Y) Transform(in Matrix3x2 matrix) - { - // A 3x2 transformation matrix can be thought of a 2x2 matrix with an extra - // 1x2 row representing absolute offsets. As such, these do not compute into - // the actual cross product with the point (which would not be doable otherwise). - // - // Consider a 3x2 matrix as follows: - // - // [ M11 , M12 ] - // [ M21 , M22 ] - // [ OffsetX (M31), OffsetY (M32) ] - // - // We first transform the point by doint the cross product with the 2x2 sub-matrix: - // - // [ M11, M12 ] - // [ x, y] [ M21, M22 ] = [ x * M11 + y * M21, x * M12 + y * M22] - // - // Then we sum the absolute offsets, which results in the following formula: - // - // [ M11, M12 ] - // [ M21, M22 ] - // [ x, y] [ M31, M32 ] = [ x * M11 + y * M21 + M31, x * M12 + y * M22 + m32] - return ( - Math.Round(((double)x * matrix.M11) + ((double)y * matrix.M21) + matrix.M31), - Math.Round(((double)x * matrix.M12) + ((double)y * matrix.M22) + matrix.M32)); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Interop/Helpers/Rectangle64.cs b/src/ComputeSharp.D2D1/Shaders/Interop/Helpers/Rectangle64.cs deleted file mode 100644 index 6c5af07e..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Interop/Helpers/Rectangle64.cs +++ /dev/null @@ -1,144 +0,0 @@ -using System; -using System.Drawing; -using System.Runtime.CompilerServices; - -namespace ComputeSharp.D2D1.Shaders.Interop.Helpers; - -/// -/// A 64-bit version of the type. -/// -/// The left coordinate of the rectangle. -/// The top coordinate of the rectangle. -/// The width of the rectangle. -/// The height of the rectangle. -internal struct Rectangle64(long x, long y, long width, long height) -{ - /// - /// The left coordinate of the current rectangle. - /// - private long x = x; - - /// - /// The top coordinate of the current rectangle. - /// - private long y = y; - - /// - /// Gets the left coordinate of the current rectangle. - /// - public readonly long Left - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => this.x; - } - - /// - /// Gets the top coordinate of the current rectangle. - /// - public readonly long Top - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => this.y; - } - - /// - /// Gets the right coordinate of the current rectangle. - /// - public readonly long Right - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => this.x + width; - } - - /// - /// Gets the bottom coordinate of the current rectangle. - /// - public readonly long Bottom - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => this.y + height; - } - - /// - /// Gets a instance representing an empty rectangle. - /// - /// - /// The returned instance is such that computing the union of it with any other rectangle yields the other - /// rectangle, and computing the intersection of it with any other rectangle yields the empty rectangle. - /// - public static Rectangle64 Empty => new(long.MaxValue, long.MaxValue, long.MinValue, long.MinValue); - - /// - /// Updates the current rectangle to be the union of itself and a given input rectangle. - /// - /// The input instance to compute the union with. - public void Union(Rectangle64 rectangle) - { - long left = Math.Min(Left, rectangle.Left); - long top = Math.Min(Top, rectangle.Top); - long right = Math.Max(Right, rectangle.Right); - long bottom = Math.Max(Bottom, rectangle.Bottom); - - this.x = left; - this.y = top; - - width = right - left; - height = bottom - top; - } - - /// - /// Updates the current rectangle to be the intersection of itself and a given input rectangle. - /// - /// The input instance to compute the intersection with. - public void Intersect(Rectangle64 rectangle) - { - long left = Math.Max(this.x, rectangle.x); - long top = Math.Max(this.y, rectangle.y); - long right = Math.Min(Right, rectangle.Right); - long bottom = Math.Min(Bottom, rectangle.Bottom); - - this.x = left; - this.y = top; - - width = Math.Max(right - left, 0); - height = Math.Max(bottom - top, 0); - } - - /// - /// Inflates the current rectangle by a specified amount. - /// - /// The amount fo use to inflate the left edge. - /// - /// - /// - public void Inflate(long left, long top, long right, long bottom) - { - this.x -= left; - this.y -= top; - - width += left + right; - height += top + bottom; - } - - /// - /// Creates a new from the current instance, clamping to a D2D1 logically infinite rectangle. - /// - /// The equivalent of the current instance. - public Rectangle ToRectangleWithD2D1LogicallyInfiniteClamping() - { - Intersect(new Rectangle64(int.MinValue / 2, int.MinValue / 2, int.MaxValue, int.MaxValue)); - - return new((int)this.x, (int)this.y, (int)width, (int)height); - } - - /// - /// Creates a new instance from an input value. - /// - /// The input value. - /// The resulting instance representing . - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static Rectangle64 FromRectangle(Rectangle rectangle) - { - return new(rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Loaders/D2D1ByteArrayConstantBufferLoader.cs b/src/ComputeSharp.D2D1/Shaders/Loaders/D2D1ByteArrayConstantBufferLoader.cs deleted file mode 100644 index 526b8249..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Loaders/D2D1ByteArrayConstantBufferLoader.cs +++ /dev/null @@ -1,33 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using ComputeSharp.D2D1.Descriptors; -using ComputeSharp.Win32; - -namespace ComputeSharp.D2D1.Shaders.Loaders; - -/// -/// A data loader for D2D1 pixel shaders dispatched via . -/// -internal struct D2D1ByteArrayConstantBufferLoader : ID2D1ConstantBufferLoader -{ - /// - /// The resulting array with the constant buffer to use. - /// - private byte[]? data; - - /// - /// Gets the resulting pixel shader constant buffer. - /// - /// A array with the constant buffer for the current shader. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly byte[] GetResultingDispatchData() - { - return this.data!; - } - - /// - void ID2D1ConstantBufferLoader.LoadConstantBuffer(ReadOnlySpan data) - { - this.data = data.ToArray(); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Loaders/D2D1ByteBufferConstantBufferLoader.cs b/src/ComputeSharp.D2D1/Shaders/Loaders/D2D1ByteBufferConstantBufferLoader.cs deleted file mode 100644 index a5119bcd..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Loaders/D2D1ByteBufferConstantBufferLoader.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using ComputeSharp.D2D1.Descriptors; -using ComputeSharp.Win32; - -namespace ComputeSharp.D2D1.Shaders.Loaders; - -/// -/// A data loader for D2D1 pixel shaders dispatched via . -/// -internal unsafe struct D2D1ByteBufferConstantBufferLoader : ID2D1ConstantBufferLoader -{ - /// - /// The target buffer to write data to. - /// - private readonly byte* buffer; - - /// - /// The length of the buffer pointed to by . - /// - private readonly int length; - - /// - /// The number of written bytes. - /// - private int writtenBytes; - - /// - /// Creates a new instance. - /// - /// The target buffer to write data to. - /// The length of the buffer pointed to by . - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal D2D1ByteBufferConstantBufferLoader(byte* buffer, int length) - { - this.buffer = buffer; - this.length = length; - this.writtenBytes = -1; - } - - /// - /// Gets the number of written bytes, or 0 in case of failure. - /// - /// The number of written bytes, of 0 in case of failure. - /// Whether or not the constant buffer was retrieved successfully. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public readonly bool TryGetWrittenBytes(out int writtenBytes) - { - // If the -1 marker is present, it means copying to the target span failed. - // In this case, the returned number of written bytes is still reported as 0. - // But, the actual load operation is marked as failed. This allows the data loader - // to both handle calls with a destination too short and with an empty source buffer. - if (this.writtenBytes == -1) - { - writtenBytes = 0; - - return false; - } - - writtenBytes = this.writtenBytes; - - return true; - } - - /// - void ID2D1ConstantBufferLoader.LoadConstantBuffer(ReadOnlySpan data) - { - if (data.TryCopyTo(new Span(this.buffer, this.length))) - { - this.writtenBytes = data.Length; - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Loaders/D2D1DrawInfoConstantBufferLoader.cs b/src/ComputeSharp.D2D1/Shaders/Loaders/D2D1DrawInfoConstantBufferLoader.cs deleted file mode 100644 index 68cff552..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Loaders/D2D1DrawInfoConstantBufferLoader.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ComputeSharp.D2D1.Descriptors; -using ComputeSharp.D2D1.Extensions; -using ComputeSharp.Win32; - -namespace ComputeSharp.D2D1.Shaders.Loaders; - -/// -/// A data loader for D2D1 pixel shaders dispatched via . -/// -internal readonly unsafe struct D2D1DrawInfoConstantBufferLoader : ID2D1ConstantBufferLoader -{ - /// - /// The object in use. - /// - private readonly ID2D1DrawInfo* d2D1DrawInfo; - - /// - /// Creates a new instance. - /// - /// The object to use. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal D2D1DrawInfoConstantBufferLoader(ID2D1DrawInfo* d2D1DrawInfo) - { - this.d2D1DrawInfo = d2D1DrawInfo; - } - - /// - void ID2D1ConstantBufferLoader.LoadConstantBuffer(ReadOnlySpan data) - { - this.d2D1DrawInfo->SetPixelShaderConstantBuffer( - buffer: (byte*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data)), - bufferCount: (uint)data.Length).Assert(); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Loaders/D2D1DrawInfoUpdateContextConstantBufferLoader.cs b/src/ComputeSharp.D2D1/Shaders/Loaders/D2D1DrawInfoUpdateContextConstantBufferLoader.cs deleted file mode 100644 index 7a746016..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Loaders/D2D1DrawInfoUpdateContextConstantBufferLoader.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ComputeSharp.D2D1.Descriptors; -using ComputeSharp.D2D1.Extensions; -using ComputeSharp.D2D1.Shaders.Interop.Effects.TransformMappers; - -namespace ComputeSharp.D2D1.Shaders.Loaders; - -/// -/// A data loader for D2D1 pixel shaders to be passed onto an object. -/// -internal readonly unsafe struct D2D1DrawInfoUpdateContextConstantBufferLoader : ID2D1ConstantBufferLoader -{ - /// - /// The object in use. - /// - private readonly ID2D1DrawInfoUpdateContext* d2D1DrawInfoUpdateContext; - - /// - /// Creates a new instance. - /// - /// The object to use. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal D2D1DrawInfoUpdateContextConstantBufferLoader(ID2D1DrawInfoUpdateContext* d2D1DrawInfoUpdateContext) - { - this.d2D1DrawInfoUpdateContext = d2D1DrawInfoUpdateContext; - } - - /// - void ID2D1ConstantBufferLoader.LoadConstantBuffer(ReadOnlySpan data) - { - this.d2D1DrawInfoUpdateContext->SetConstantBuffer( - buffer: (byte*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data)), - bufferCount: (uint)data.Length).Assert(); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Loaders/D2D1EffectConstantBufferLoader.cs b/src/ComputeSharp.D2D1/Shaders/Loaders/D2D1EffectConstantBufferLoader.cs deleted file mode 100644 index 7699c406..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Loaders/D2D1EffectConstantBufferLoader.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ComputeSharp.D2D1.Descriptors; -using ComputeSharp.D2D1.Extensions; -using ComputeSharp.Win32; - -namespace ComputeSharp.D2D1.Shaders.Loaders; - -/// -/// A data loader for D2D1 pixel shaders dispatched via . -/// -internal readonly unsafe struct D2D1EffectConstantBufferLoader : ID2D1ConstantBufferLoader -{ - /// - /// The object in use. - /// - private readonly ID2D1Effect* d2D1Effect; - - /// - /// Creates a new instance. - /// - /// The object to use. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - internal D2D1EffectConstantBufferLoader(ID2D1Effect* d2D1Effect) - { - this.d2D1Effect = d2D1Effect; - } - - /// - void ID2D1ConstantBufferLoader.LoadConstantBuffer(ReadOnlySpan data) - { - if (data.IsEmpty) - { - return; - } - - this.d2D1Effect->SetValue( - index: 0, - type: D2D1_PROPERTY_TYPE.D2D1_PROPERTY_TYPE_BLOB, - data: (byte*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data)), - dataSize: (uint)data.Length).Assert(); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Translation/ASCII.cs b/src/ComputeSharp.D2D1/Shaders/Translation/ASCII.cs deleted file mode 100644 index 6059f08a..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Translation/ASCII.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System; - -namespace ComputeSharp.D2D1.Shaders.Translation; - -/// -/// A container for ASCII encoded, null-terminated constant strings. -/// -internal static class ASCII -{ - /// - /// Gets a with the "D2D_FUNCTION" ASCII text. - /// - public static ReadOnlySpan D2D_FUNCTION => "D2D_FUNCTION"u8; - - /// - /// Gets a with the "D2D_FULL_SHADER" ASCII text. - /// - public static ReadOnlySpan D2D_FULL_SHADER => "D2D_FULL_SHADER"u8; - - /// - /// Gets a with the '\0' ASCII character. - /// - public static ReadOnlySpan NullTerminator => ""u8; - - /// - /// Gets a with the "D2D_ENTRY" ASCII text. - /// - public static ReadOnlySpan D2D_ENTRY => "D2D_ENTRY"u8; - - /// - /// Gets a with the "Execute" ASCII text. - /// - public static ReadOnlySpan Execute => "Execute"u8; - - /// - /// Gets a for a given shader profile, for a library. - /// - /// The input shaader profile to use. - /// A for a given shader profile, for a library. - public static ReadOnlySpan GetLibraryProfile(D2D1ShaderProfile shaderProfile) - { - return shaderProfile switch - { - D2D1ShaderProfile.PixelShader40Level91 => "lib_4_0_level_9_1"u8, - D2D1ShaderProfile.PixelShader40Level93 => "lib_4_0_level_9_3"u8, - D2D1ShaderProfile.PixelShader40 => "lib_4_0"u8, - D2D1ShaderProfile.PixelShader41 => "lib_4_1"u8, - _ => "lib_5_0"u8 - }; - } - - /// - /// Gets a for a given shader profile, for a full shader. - /// - /// The input shaader profile to use. - /// A for a given shader profile, for a full shader. - public static ReadOnlySpan GetPixelShaderProfile(D2D1ShaderProfile shaderProfile) - { - return shaderProfile switch - { - D2D1ShaderProfile.PixelShader40Level91 => "ps_4_0_level_9_1"u8, - D2D1ShaderProfile.PixelShader40Level93 => "ps_4_0_level_9_3"u8, - D2D1ShaderProfile.PixelShader40 => "ps_4_0"u8, - D2D1ShaderProfile.PixelShader41 => "ps_4_1"u8, - _ => "ps_5_0"u8 - }; - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Translation/D3DCompiler.ID3DInclude.cs b/src/ComputeSharp.D2D1/Shaders/Translation/D3DCompiler.ID3DInclude.cs deleted file mode 100644 index 41fc5c75..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Translation/D3DCompiler.ID3DInclude.cs +++ /dev/null @@ -1,122 +0,0 @@ -#if !SOURCE_GENERATOR -using System; -#endif -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using ComputeSharp.D2D1.Interop; -#if SOURCE_GENERATOR -using Windows.Win32.Graphics.Direct3D; -using static Windows.Win32.Foundation.HRESULT; -#else -using ComputeSharp.Win32; -using static ComputeSharp.Win32.S; -#endif - -namespace ComputeSharp.D2D1.Shaders.Translation; - -/// -partial class D3DCompiler -{ - /// - /// A custom fallback implementation to use on systems with no support for it. - /// - private unsafe struct ID3DIncludeForD2DHelpers - { -#if SOURCE_GENERATOR - /// - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate int OpenDelegate(ID3DIncludeForD2DHelpers* @this, D3D_INCLUDE_TYPE IncludeType, sbyte* pFileName, void* pParentData, void** ppData, uint* pBytes); - - /// - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate int CloseDelegate(ID3DIncludeForD2DHelpers* @this, void* pData); - - /// - /// A cached instance wrapping . - /// - private static readonly OpenDelegate OpenWrapper = Open; - - /// - /// A cached instance wrapping . - /// - private static readonly CloseDelegate CloseWrapper = Close; -#endif - - /// - /// The shared method table pointer for all instances. - /// - private static readonly void** Vtbl = InitVtbl(); - - /// - /// Builds the custom method table pointer for . - /// - /// The method table pointer for . - private static void** InitVtbl() - { - void** lpVtbl = (void**)D2D1AssemblyAssociatedMemory.Allocate(sizeof(void*) * 2); - -#if SOURCE_GENERATOR - lpVtbl[0] = (void*)Marshal.GetFunctionPointerForDelegate(OpenWrapper); - lpVtbl[1] = (void*)Marshal.GetFunctionPointerForDelegate(CloseWrapper); -#else - lpVtbl[0] = (delegate* unmanaged[MemberFunction])&Open; - lpVtbl[1] = (delegate* unmanaged[MemberFunction])&Close; -#endif - - return lpVtbl; - } - - /// - /// The method table pointer for the current instance. - /// - private void** lpVtbl; - - /// - /// Creates and initializes a new instance. - /// - /// A pointer to a new instance. - public static ID3DInclude* Create() - { - ID3DIncludeForD2DHelpers* @this = -#if SOURCE_GENERATOR - (ID3DIncludeForD2DHelpers*)Marshal.AllocHGlobal(sizeof(ID3DIncludeForD2DHelpers)); -#else - (ID3DIncludeForD2DHelpers*)NativeMemory.Alloc((nuint)sizeof(ID3DIncludeForD2DHelpers)); -#endif - - @this->lpVtbl = Vtbl; - - return (ID3DInclude*)@this; - } - - /// -#if !SOURCE_GENERATOR - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] -#endif - public static int Open(ID3DIncludeForD2DHelpers* @this, D3D_INCLUDE_TYPE IncludeType, sbyte* pFileName, void* pParentData, void** ppData, uint* pBytes) - { -#if SOURCE_GENERATOR - if (new string(pFileName) == "d2d1effecthelpers.hlsli") -#else - if (MemoryMarshal.CreateReadOnlySpanFromNullTerminated((byte*)pFileName).SequenceEqual("d2d1effecthelpers.hlsli"u8)) -#endif - { - *ppData = (byte*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(D2D1EffectHelpers.TextUtf8)); - *pBytes = (uint)D2D1EffectHelpers.TextUtf8.Length; - - return S_OK; - } - - return S_FALSE; - } - - /// -#if !SOURCE_GENERATOR - [UnmanagedCallersOnly(CallConvs = [typeof(CallConvMemberFunction)])] -#endif - public static int Close(ID3DIncludeForD2DHelpers* @this, void* pData) - { - return S_OK; - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Translation/D3DCompiler.cs b/src/ComputeSharp.D2D1/Shaders/Translation/D3DCompiler.cs deleted file mode 100644 index 5a615899..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Translation/D3DCompiler.cs +++ /dev/null @@ -1,316 +0,0 @@ -using System; -using System.Buffers; -using System.Diagnostics.CodeAnalysis; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Text; -#if SOURCE_GENERATOR -using System.Threading; -using Windows.Win32; -using Windows.Win32.Foundation; -using Windows.Win32.Graphics.Direct3D; -using Windows.Win32.Graphics.Direct3D.Fxc; -using DirectX = Windows.Win32.PInvoke; -#else -using ComputeSharp.D2D1.Extensions; -using ComputeSharp.Win32; -#endif - -namespace ComputeSharp.D2D1.Shaders.Translation; - -/// -/// A that uses the FXC APIs to compile D2D1 pixel shaders. -/// -internal static unsafe partial class D3DCompiler -{ - /// - /// The instance to load d2d1effecthelpers.hlsli. - /// - private static readonly ID3DInclude* D3DIncludeForD2D1EffectHelpers = ID3DIncludeForD2DHelpers.Create(); - - /// - /// Compiles a new HLSL shader from the input source code. - /// - /// The HLSL source code to compile. - /// The shader profile to use to compile the shader. - /// The options to use to compile the shader. - /// The bytecode for the compiled shader. - public static ComPtr Compile( - ReadOnlySpan source, - D2D1ShaderProfile shaderProfile, -#if SOURCE_GENERATOR -#pragma warning disable CS1573 - D2D1CompileOptions options, - CancellationToken token) // The cancellation token used to cancel the operation. -#pragma warning restore CS1573 -#else - D2D1CompileOptions options) -#endif - { - // Transcode the input HLSL source from Unicode to ASCII encoding - int maxLength = Encoding.ASCII.GetMaxByteCount(source.Length); - byte[] buffer = ArrayPool.Shared.Rent(maxLength); - int writtenBytes = Encoding.ASCII.GetBytes(source, buffer); - ReadOnlySpan sourceAscii = new(buffer, 0, writtenBytes); - - bool enableLinking = (options & D2D1CompileOptions.EnableLinking) == D2D1CompileOptions.EnableLinking; - bool stripReflectionData = (options & D2D1CompileOptions.StripReflectionData) == D2D1CompileOptions.StripReflectionData; - - options &= ~D2D1CompileOptions.EnableLinking; - options &= ~D2D1CompileOptions.StripReflectionData; - - try - { -#if SOURCE_GENERATOR - token.ThrowIfCancellationRequested(); -#endif - - // Compile the standalone D2D1 full shader - using ComPtr d3DBlobFullShader = Compile( - source: sourceAscii, - macro: ASCII.D2D_FULL_SHADER, - d2DEntry: ASCII.Execute, - entryPoint: ASCII.Execute, - target: ASCII.GetPixelShaderProfile(shaderProfile), - flags: (uint)options, - stripReflectionData: stripReflectionData); - - if (!enableLinking) - { - return d3DBlobFullShader.Move(); - } - -#if SOURCE_GENERATOR - token.ThrowIfCancellationRequested(); -#endif - - // Compile the export function - using ComPtr d3DBlobFunction = Compile( - source: sourceAscii, - macro: ASCII.D2D_FUNCTION, - d2DEntry: ASCII.Execute, - entryPoint: default, - target: ASCII.GetLibraryProfile(shaderProfile), - flags: (uint)options, - stripReflectionData: stripReflectionData); - - // Embed it as private data if requested - using ComPtr d3DBlobLinked = SetD3DPrivateData(d3DBlobFullShader.Get(), d3DBlobFunction.Get()); - - return d3DBlobLinked.Move(); - } - finally - { - ArrayPool.Shared.Return(buffer); - } - } - - /// - /// Compiles an HLSL shader with the specified parameters. - /// - /// The HLSL source code to compile (in ASCII). - /// The target macro to define for the shader (either D2D_FULL_SHADER or D2D_FUNCTION). - /// The D2D entry to specify when compiling the shader. - /// The entry point for the shader. - /// The shader target to use to compile the input source. - /// The compilationm flag to use. - /// Whether to strip reflection data from the shader bytecode. - /// The bytecode for the compiled shader. - /// Thrown if the compilation fails. - public static ComPtr Compile( - ReadOnlySpan source, - ReadOnlySpan macro, - ReadOnlySpan d2DEntry, - ReadOnlySpan entryPoint, - ReadOnlySpan target, - uint flags, - bool stripReflectionData) - { - using ComPtr d3DBlobBytecode = default; - using ComPtr d3DBlobErrors = default; - - HRESULT hResult; - - fixed (byte* sourcePtr = source) - fixed (byte* macroPtr = macro) - fixed (byte* d2DEntryPtr = d2DEntry) - fixed (byte* entryPointPtr = entryPoint) - fixed (byte* targetPtr = target) - { - // Prepare the macros for full shader compilation: - // - // -D - // -D D2D_ENTRY= - // - D3D_SHADER_MACRO* macros = stackalloc D3D_SHADER_MACRO[] - { - new() - { -#if SOURCE_GENERATOR - Name = new PCSTR(macroPtr), - Definition = new PCSTR((byte*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(ASCII.NullTerminator))) -#else - Name = (sbyte*)macroPtr, - Definition = (sbyte*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(ASCII.NullTerminator)) -#endif - }, - new() - { -#if SOURCE_GENERATOR - Name = new PCSTR((byte*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(ASCII.D2D_ENTRY))), - Definition = new PCSTR(d2DEntryPtr) -#else - Name = (sbyte*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(ASCII.D2D_ENTRY)), - Definition = (sbyte*)d2DEntryPtr -#endif - }, - new() - }; - - // Compile the shader - hResult = DirectX.D3DCompile( - pSrcData: sourcePtr, - SrcDataSize: (nuint)source.Length, -#if SOURCE_GENERATOR - pSourceName: (PCSTR)null, - pDefines: macros, - pInclude: D3DIncludeForD2D1EffectHelpers, - pEntrypoint: new PCSTR(entryPointPtr), - pTarget: new PCSTR(targetPtr), -#else - pSourceName: null, - pDefines: macros, - pInclude: D3DIncludeForD2D1EffectHelpers, - pEntrypoint: (sbyte*)entryPointPtr, - pTarget: (sbyte*)targetPtr, -#endif - Flags1: flags, - Flags2: 0, - ppCode: d3DBlobBytecode.GetAddressOf(), - ppErrorMsgs: d3DBlobErrors.GetAddressOf()); - } - - // Throw an exception with the input messages, if the compilation fails. - // If compilation succeeds with warnings, we just ignore the messages. - if (hResult.Value < 0 && d3DBlobErrors.Get() is not null) - { - ThrowHslsCompilationException(d3DBlobErrors.Get()); - } - - // Also just assert the HRESULT in general after checking messages. Not entirely - // clear if this is reachable in case the compilation fails (one would assume - // there would always be a message), but better safe than sorry. - hResult.Assert(); - - // If requested, strip the reflection data and return that bytecode blob - if (stripReflectionData) - { - using ComPtr d3DBlobBytecodeNoReflection = default; - - DirectX.D3DStripShader( - pShaderBytecode: d3DBlobBytecode.Get()->GetBufferPointer(), - BytecodeLength: d3DBlobBytecode.Get()->GetBufferSize(), - uStripFlags: (uint)D3DCOMPILER_STRIP_FLAGS.D3DCOMPILER_STRIP_REFLECTION_DATA, - ppStrippedBlob: d3DBlobBytecodeNoReflection.GetAddressOf()).Assert(); - - return d3DBlobBytecodeNoReflection.Move(); - } - - return d3DBlobBytecode.Move(); - } - - /// - /// Embeds the bytecode for an exported shader as private data into another shader bytecode. - /// - /// The bytecode for the full shader. - /// The bytecode for the shader function to export. - /// An instance with the combined data of and . - public static ComPtr SetD3DPrivateData(ID3DBlob* shaderBlob, ID3DBlob* exportBlob) - { - void* shaderPtr = shaderBlob->GetBufferPointer(); - nuint shaderSize = shaderBlob->GetBufferSize(); - - void* exportPtr = exportBlob->GetBufferPointer(); - nuint exportSize = exportBlob->GetBufferSize(); - - using ComPtr resultBlob = default; - - DirectX.D3DSetBlobPart( - pSrcData: shaderPtr, - SrcDataSize: shaderSize, - Part: D3D_BLOB_PART.D3D_BLOB_PRIVATE_DATA, - Flags: 0, - pPart: exportPtr, - PartSize: exportSize, - ppNewShader: resultBlob.GetAddressOf()).Assert(); - - return resultBlob.Move(); - } - - /// - /// Returns a "prettified" version of an FXC error message. - /// - /// The input error message. - /// The "prettified" error message. - public static string PrettifyFxcErrorMessage(string message) - { - // The error message will be in a format like this: - // "C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Current\Bin\Roslyn\Shader@0x0000019AD1B4BA70(22,32-35): error X3004: undeclared identifier 'this'" - // This regex tries to match the unnecessary header and remove it, if present. This doesn't need to be bulletproof, and this regex should match all cases anyway. - // - // We cannot use Regex (this method was originally using Regex.Replace(message, @"^[A-Z]:\\[^:]+: (\w+ \w+:)", ...)), because that - // causes significant binary size increase, as it's the only thing rooting all the Regex stack across the whole library. So this - // code reimplements equivalent logic in a simple way. Because this is a throw helper, allocating a little bit of garbage is fine. - string[] lines = message.Split(['\n', '\r'], StringSplitOptions.RemoveEmptyEntries); - - // Go over each (non empty) line and look for the leading file path to trim away - foreach (ref string line in lines.AsSpan()) - { - ReadOnlySpan span = line.AsSpan().Trim(); - - // Check whether the trimmed line starts with a drive letter path (eg. 'C:\') and get the rest - if (span is [>= 'A' and <= 'Z', ':', '\\', .. { Length: > 0 } tail]) - { - int indexOfColon = tail.IndexOf(':'); - - // We're looking for the color at the end of the file path. If we find it, and the line - // has at least another character (ie. there's content after that, which should always - // be the case), then we take that slice, trim its start to skip the leading whitespace, - // and finally allocate a string to replace the current line. - if (indexOfColon != -1 && - tail.Length > indexOfColon) - { - ReadOnlySpan trimmedLine = tail.Slice(indexOfColon + 1).TrimStart(); - - line = trimmedLine.ToString(); - } - } - } - - // Merge the message again with normalized newlines - string updatedMessage = string.Join("\r\n", lines); - - // Add a trailing '.' if not present - if (updatedMessage is not [.., '.']) - { - updatedMessage += '.'; - } - - return updatedMessage; - } - - /// - /// Throws an exception when a shader compilation fails. - /// - /// The input (faulting) operation. - /// This method always throws and never actually returs. - [DoesNotReturn] - [MethodImpl(MethodImplOptions.NoInlining)] - private static void ThrowHslsCompilationException(ID3DBlob* d3DOperationResult) - { - string message = new((sbyte*)d3DOperationResult->GetBufferPointer()); - string updatedMessage = PrettifyFxcErrorMessage(message); - - throw new FxcCompilationException(updatedMessage); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.D2D1/Shaders/Translation/Headers/D2D1EffectHelpers.cs b/src/ComputeSharp.D2D1/Shaders/Translation/Headers/D2D1EffectHelpers.cs deleted file mode 100644 index c1dc408d..00000000 --- a/src/ComputeSharp.D2D1/Shaders/Translation/Headers/D2D1EffectHelpers.cs +++ /dev/null @@ -1,339 +0,0 @@ -using System; - -#pragma warning disable IDE0025 - -namespace ComputeSharp.D2D1.Shaders.Translation; - -/// -/// A helper class with the contents of the d2d1effecthelpers.hlsli header. -/// -internal static class D2D1EffectHelpers -{ - /// - /// Gets the contents of the d2d1effecthelpers.hlsli header, as UTF8 text. - /// - public static ReadOnlySpan TextUtf8 - { - get - { - return """ - //--------------------------------------------------------------------------- - // Copyright (c) Microsoft Corporation. All rights reserved. - // - // This file is automatically generated. Please do not edit it directly. - // - //--------------------------------------------------------------------------- - - // File contents: - // - Helpers methods for authoring D2D Effect shader code. - // These are located at the end of the file (D2DGetInput, etc.). - // - The top portion contains definitions and initialization required by the helpers. - // These elements are prefaced with "__D2D" and can be safely ignored. - // - // To use these helpers, the following values must be defined before inclusion: - // D2D_INPUT_COUNT - The number of texture inputs to the effect. - // D2D_INPUT[N]_SIMPLE or D2D_INPUT[N]_COMPLEX - How the effect will sample each input. (If unspecificed, defaults to _COMPLEX.) - // D2D_ENTRY - The name of the entry point being compiled. This will usually be defined on the command line at compilation time. - // - // The following values can be optionally defined: - // D2D_FUNCTION - Compile the entry point as an export function. This will usually be defined on the command line at compilation time. - // D2D_FULL_SHADER - Compile the entry point as a full shader. This will usually be defined on the command line at compilation time. - // D2D_FULL_SHADER_ONLY - Only compile the in-scope entry points to full shaders, never to export functions. - // - - #define __D2D_DEFINE_PS_GLOBALS(inputIndex) \ - Texture2D InputTexture##inputIndex : register(t##inputIndex); \ - SamplerState InputSampler##inputIndex : register(s##inputIndex); \ - - // Define a texture and sampler pair for each D2D effect input. - #if (D2D_INPUT_COUNT >= 1) - __D2D_DEFINE_PS_GLOBALS(0) - #endif - #if (D2D_INPUT_COUNT >= 2) - __D2D_DEFINE_PS_GLOBALS(1) - #endif - #if (D2D_INPUT_COUNT >= 3) - __D2D_DEFINE_PS_GLOBALS(2) - #endif - #if (D2D_INPUT_COUNT >= 4) - __D2D_DEFINE_PS_GLOBALS(3) - #endif - #if (D2D_INPUT_COUNT >= 5) - __D2D_DEFINE_PS_GLOBALS(4) - #endif - #if (D2D_INPUT_COUNT >= 6) - __D2D_DEFINE_PS_GLOBALS(5) - #endif - #if (D2D_INPUT_COUNT >= 7) - __D2D_DEFINE_PS_GLOBALS(6) - #endif - #if (D2D_INPUT_COUNT >= 8) - __D2D_DEFINE_PS_GLOBALS(7) - #endif - - #define __D2D_MAXIMUM_INPUT_COUNT 8 - - // Validate that all required shader information has been defined. - #ifndef D2D_INPUT_COUNT - #error D2D_INPUT_COUNT is undefined. - #endif - - #if (D2D_INPUT_COUNT > __D2D_MAXIMUM_INPUT_COUNT) - #error D2D_INPUT_COUNT exceeds the maximum input count. - #endif - - // Define global statics to hold the values needed by intrinsic methods. - // These values are initialized by the entry point wrapper before calling into the - // effect's shader implementation. - #if !defined(D2D_FUNCTION) || defined(D2D_REQUIRES_SCENE_POSITION) - static float4 __d2dstatic_scenePos = float4(0, 0, 0, 0); - #endif - - #define __D2D_DEFINE_INPUT_STATICS(inputIndex) \ - static float4 __d2dstatic_input##inputIndex = float4(0, 0, 0, 0); \ - static float4 __d2dstatic_uv##inputIndex = float4(0, 0, 0, 0); \ - - #if (D2D_INPUT_COUNT >= 1) - __D2D_DEFINE_INPUT_STATICS(0) - #endif - #if (D2D_INPUT_COUNT >= 2) - __D2D_DEFINE_INPUT_STATICS(1) - #endif - #if (D2D_INPUT_COUNT >= 3) - __D2D_DEFINE_INPUT_STATICS(2) - #endif - #if (D2D_INPUT_COUNT >= 4) - __D2D_DEFINE_INPUT_STATICS(3) - #endif - #if (D2D_INPUT_COUNT >= 5) - __D2D_DEFINE_INPUT_STATICS(4) - #endif - #if (D2D_INPUT_COUNT >= 6) - __D2D_DEFINE_INPUT_STATICS(5) - #endif - #if (D2D_INPUT_COUNT >= 7) - __D2D_DEFINE_INPUT_STATICS(6) - #endif - #if (D2D_INPUT_COUNT >= 8) - __D2D_DEFINE_INPUT_STATICS(7) - #endif - - // Define the scene position parameter according to whether the shader requires it, - // and whether it is the only parameter. - // The scene position input always needs to be defined for full shaders. - #if (!defined(D2D_FUNCTION) || defined(D2D_REQUIRES_SCENE_POSITION)) - #if (D2D_INPUT_COUNT == 0) - #define __D2D_SCENE_POS float4 __d2dinput_scenePos : SCENE_POSITION - #define __D2D_INIT_STATIC_SCENE_POS __d2dstatic_scenePos = __d2dinput_scenePos - #else - #define __D2D_SCENE_POS float4 __d2dinput_scenePos : SCENE_POSITION, - #define __D2D_INIT_STATIC_SCENE_POS __d2dstatic_scenePos = __d2dinput_scenePos; - #endif - #else - #define __D2D_SCENE_POS - #define __D2D_INIT_STATIC_SCENE_POS - #endif - - // When compiling a function version, simple and complex inputs have different definitions. - // When compiling a full shader, they have the same definition. - // Access to input parameters also differs between functions and full shaders. - #if defined(D2D_FUNCTION) - #define __D2D_SIMPLE_INPUT(index) float4 __d2dinput_color##index : INPUT##index - #define __D2D_INIT_SIMPLE_STATIC(index) __d2dstatic_input##index = __d2dinput_color##index - #else - #define __D2D_SIMPLE_INPUT(index) float4 __d2dinput_uv##index : TEXCOORD##index - #define __D2D_INIT_SIMPLE_STATIC(index) __d2dstatic_uv##index = __d2dinput_uv##index - #endif - - #define __D2D_COMPLEX_INPUT(index) float4 __d2dinput_uv##index : TEXCOORD##index - #define __D2D_INIT_COMPLEX_STATIC(index) __d2dstatic_uv##index = __d2dinput_uv##index - - #define __D2D_SAMPLE_INPUT(index) InputTexture##index.Sample(InputSampler##index, __d2dstatic_uv##index.xy) - - // Define each input as either simple or complex. - #if defined(D2D_INPUT0_SIMPLE) - #define __D2D_INPUT0 __D2D_SIMPLE_INPUT(0) - #define __D2D_INIT_STATIC0 __D2D_INIT_SIMPLE_STATIC(0) - #define __D2D_GET_INPUT0 __d2dstatic_input0 - #else - #define __D2D_INPUT0 __D2D_COMPLEX_INPUT(0) - #define __D2D_INIT_STATIC0 __D2D_INIT_COMPLEX_STATIC(0) - #define __D2D_GET_INPUT0 __D2D_SAMPLE_INPUT(0) - #endif - #if defined(D2D_INPUT1_SIMPLE) - #define __D2D_INPUT1 __D2D_SIMPLE_INPUT(1) - #define __D2D_INIT_STATIC1 __D2D_INIT_SIMPLE_STATIC(1) - #define __D2D_GET_INPUT1 __d2dstatic_input1 - #else - #define __D2D_INPUT1 __D2D_COMPLEX_INPUT(1) - #define __D2D_INIT_STATIC1 __D2D_INIT_COMPLEX_STATIC(1) - #define __D2D_GET_INPUT1 __D2D_SAMPLE_INPUT(1) - #endif - #if defined(D2D_INPUT2_SIMPLE) - #define __D2D_INPUT2 __D2D_SIMPLE_INPUT(2) - #define __D2D_INIT_STATIC2 __D2D_INIT_SIMPLE_STATIC(2) - #define __D2D_GET_INPUT2 __d2dstatic_input2 - #else - #define __D2D_INPUT2 __D2D_COMPLEX_INPUT(2) - #define __D2D_INIT_STATIC2 __D2D_INIT_COMPLEX_STATIC(2) - #define __D2D_GET_INPUT2 __D2D_SAMPLE_INPUT(2) - #endif - #if defined(D2D_INPUT3_SIMPLE) - #define __D2D_INPUT3 __D2D_SIMPLE_INPUT(3) - #define __D2D_INIT_STATIC3 __D2D_INIT_SIMPLE_STATIC(3) - #define __D2D_GET_INPUT3 __d2dstatic_input3 - #else - #define __D2D_INPUT3 __D2D_COMPLEX_INPUT(3) - #define __D2D_INIT_STATIC3 __D2D_INIT_COMPLEX_STATIC(3) - #define __D2D_GET_INPUT3 __D2D_SAMPLE_INPUT(3) - #endif - #if defined(D2D_INPUT4_SIMPLE) - #define __D2D_INPUT4 __D2D_SIMPLE_INPUT(4) - #define __D2D_INIT_STATIC4 __D2D_INIT_SIMPLE_STATIC(4) - #define __D2D_GET_INPUT4 __d2dstatic_input4 - #else - #define __D2D_INPUT4 __D2D_COMPLEX_INPUT(4) - #define __D2D_INIT_STATIC4 __D2D_INIT_COMPLEX_STATIC(4) - #define __D2D_GET_INPUT4 __D2D_SAMPLE_INPUT(4) - #endif - #if defined(D2D_INPUT5_SIMPLE) - #define __D2D_INPUT5 __D2D_SIMPLE_INPUT(5) - #define __D2D_INIT_STATIC5 __D2D_INIT_SIMPLE_STATIC(5) - #define __D2D_GET_INPUT5 __d2dstatic_input5 - #else - #define __D2D_INPUT5 __D2D_COMPLEX_INPUT(5) - #define __D2D_INIT_STATIC5 __D2D_INIT_COMPLEX_STATIC(5) - #define __D2D_GET_INPUT5 __D2D_SAMPLE_INPUT(5) - #endif - #if defined(D2D_INPUT6_SIMPLE) - #define __D2D_INPUT6 __D2D_SIMPLE_INPUT(6) - #define __D2D_INIT_STATIC6 __D2D_INIT_SIMPLE_STATIC(6) - #define __D2D_GET_INPUT6 __d2dstatic_input6 - #else - #define __D2D_INPUT6 __D2D_COMPLEX_INPUT(6) - #define __D2D_INIT_STATIC6 __D2D_INIT_COMPLEX_STATIC(6) - #define __D2D_GET_INPUT6 __D2D_SAMPLE_INPUT(6) - #endif - #if defined(D2D_INPUT7_SIMPLE) - #define __D2D_INPUT7 __D2D_SIMPLE_INPUT(7) - #define __D2D_INIT_STATIC7 __D2D_INIT_SIMPLE_STATIC(7) - #define __D2D_GET_INPUT7 __d2dstatic_input7 - #else - #define __D2D_INPUT7 __D2D_COMPLEX_INPUT(7) - #define __D2D_INIT_STATIC7 __D2D_INIT_COMPLEX_STATIC(7) - #define __D2D_GET_INPUT7 __D2D_SAMPLE_INPUT(7) - #endif - #if defined(D2D_INPUT8_SIMPLE) - #define __D2D_INPUT8 __D2D_SIMPLE_INPUT(8) - #define __D2D_INIT_STATIC8 __D2D_INIT_SIMPLE_STATIC(8) - #define __D2D_GET_INPUT8 __d2dstatic_input8 - #else - #define __D2D_INPUT8 __D2D_COMPLEX_INPUT(8) - #define __D2D_INIT_STATIC8 __D2D_INIT_COMPLEX_STATIC(8) - #define __D2D_GET_INPUT8 __D2D_SAMPLE_INPUT(8) - #endif - - // Define the export function inputs based on the defined input count and types. - #if (D2D_INPUT_COUNT == 0) - #define __D2D_FUNCTION_INPUTS __D2D_SCENE_POS - #define __D2D_INIT_STATICS __D2D_INIT_STATIC_SCENE_POS - #elif (D2D_INPUT_COUNT == 1) - #define __D2D_FUNCTION_INPUTS __D2D_SCENE_POS __D2D_INPUT0 - #define __D2D_INIT_STATICS __D2D_INIT_STATIC_SCENE_POS __D2D_INIT_STATIC0 - #elif (D2D_INPUT_COUNT == 2) - #define __D2D_FUNCTION_INPUTS __D2D_SCENE_POS __D2D_INPUT0, __D2D_INPUT1 - #define __D2D_INIT_STATICS __D2D_INIT_STATIC_SCENE_POS __D2D_INIT_STATIC0; __D2D_INIT_STATIC1 - #elif (D2D_INPUT_COUNT == 3) - #define __D2D_FUNCTION_INPUTS __D2D_SCENE_POS __D2D_INPUT0, __D2D_INPUT1, __D2D_INPUT2 - #define __D2D_INIT_STATICS __D2D_INIT_STATIC_SCENE_POS __D2D_INIT_STATIC0; __D2D_INIT_STATIC1; __D2D_INIT_STATIC2 - #elif (D2D_INPUT_COUNT == 4) - #define __D2D_FUNCTION_INPUTS __D2D_SCENE_POS __D2D_INPUT0, __D2D_INPUT1, __D2D_INPUT2, __D2D_INPUT3 - #define __D2D_INIT_STATICS __D2D_INIT_STATIC_SCENE_POS __D2D_INIT_STATIC0; __D2D_INIT_STATIC1; __D2D_INIT_STATIC2; __D2D_INIT_STATIC3 - #elif (D2D_INPUT_COUNT == 5) - #define __D2D_FUNCTION_INPUTS __D2D_SCENE_POS __D2D_INPUT0, __D2D_INPUT1, __D2D_INPUT2, __D2D_INPUT3, __D2D_INPUT4 - #define __D2D_INIT_STATICS __D2D_INIT_STATIC_SCENE_POS __D2D_INIT_STATIC0; __D2D_INIT_STATIC1; __D2D_INIT_STATIC2; __D2D_INIT_STATIC3; __D2D_INIT_STATIC4 - #elif (D2D_INPUT_COUNT == 6) - #define __D2D_FUNCTION_INPUTS __D2D_SCENE_POS __D2D_INPUT0, __D2D_INPUT1, __D2D_INPUT2, __D2D_INPUT3, __D2D_INPUT4, __D2D_INPUT5 - #define __D2D_INIT_STATICS __D2D_INIT_STATIC_SCENE_POS __D2D_INIT_STATIC0; __D2D_INIT_STATIC1; __D2D_INIT_STATIC2; __D2D_INIT_STATIC3; __D2D_INIT_STATIC4; __D2D_INIT_STATIC5 - #elif (D2D_INPUT_COUNT == 7) - #define __D2D_FUNCTION_INPUTS __D2D_SCENE_POS __D2D_INPUT0, __D2D_INPUT1, __D2D_INPUT2, __D2D_INPUT3, __D2D_INPUT4, __D2D_INPUT5, __D2D_INPUT6 - #define __D2D_INIT_STATICS __D2D_INIT_STATIC_SCENE_POS __D2D_INIT_STATIC0; __D2D_INIT_STATIC1; __D2D_INIT_STATIC2; __D2D_INIT_STATIC3; __D2D_INIT_STATIC4; __D2D_INIT_STATIC5; __D2D_INIT_STATIC6 - #elif (D2D_INPUT_COUNT == 8) - #define __D2D_FUNCTION_INPUTS __D2D_SCENE_POS __D2D_INPUT0, __D2D_INPUT1, __D2D_INPUT2, __D2D_INPUT3, __D2D_INPUT4, __D2D_INPUT5, __D2D_INPUT6, __D2D_INPUT7 - #define __D2D_INIT_STATICS __D2D_INIT_STATIC_SCENE_POS __D2D_INIT_STATIC0; __D2D_INIT_STATIC1; __D2D_INIT_STATIC2; __D2D_INIT_STATIC3; __D2D_INIT_STATIC4; __D2D_INIT_STATIC5; __D2D_INIT_STATIC6; __D2D_INIT_STATIC7 - #endif - - #if !defined(CONCAT) - #define CONCAT(str1, str2) str1##str2 - #endif - - // Rename the entry point target function so that the actual entry point can use the name. - // This expansion is the same for both full shaders and functions. - #define D2D_PS_ENTRY(name) float4 CONCAT(name, _Impl)() - - // If neither D2D_FUNCTION or D2D_FULL_SHADER is defined, behave as if D2D_FULL_SHADER is defined. - #if defined(D2D_FUNCTION) && !defined(D2D_FULL_SHADER_ONLY) - - // Replaces simple samples with either static variable or an actual sample, - // depending on whether the input is declared as simple or complex. - #define D2DGetInput(index) __D2D_GET_INPUT##index - - #if !defined(D2D_CUSTOM_ENTRY) - // Declare function prototype for the target function so that it can be referenced before definition. - // D2D_ENTRY is a macro whose actual name resolves to the effect's target "entry point" function. - float4 CONCAT(D2D_ENTRY, _Impl)(); - - // This is the actual entry point definition, which forwards the call to the target function. - export float4 D2D_func_entry(__D2D_FUNCTION_INPUTS) - { - __D2D_INIT_STATICS; - return CONCAT(D2D_ENTRY, _Impl)(); - } - - #endif - - #else // !defined(D2D_FUNCTION) - - // Replaces simple samples with actual samples. - #define D2DGetInput(index) __D2D_SAMPLE_INPUT(index) - - #if !defined(D2D_CUSTOM_ENTRY) - // Declare function prototype for the target function so that it can be referenced before definition. - // D2D_ENTRY is a macro whose actual name resolves to the effect's target "entry point" function. - float4 CONCAT(D2D_ENTRY, _Impl)(); - - // This is the actual entry point definition, which forwards the call to the target function. - float4 D2D_ENTRY (float4 pos : SV_POSITION, __D2D_FUNCTION_INPUTS) : SV_TARGET - { - __D2D_INIT_STATICS; - return CONCAT(D2D_ENTRY, _Impl)(); - } - - #endif - - #endif // D2D_FUNCTION - - //=============================================================== - // Along with D2DGetInput defined above, the following macros and - // methods define D2D intrinsics for use in effect shader code. - //=============================================================== - - #if !defined(D2D_FUNCTION) || defined(D2D_REQUIRES_SCENE_POSITION) - inline float4 D2DGetScenePosition() - { - return __d2dstatic_scenePos; - } - #endif - - #define D2DGetInputCoordinate(index) __d2dstatic_uv##index - - #define D2DSampleInput(index, position) InputTexture##index.Sample(InputSampler##index, position) - - #define D2DSampleInputAtOffset(index, offset) InputTexture##index.Sample(InputSampler##index, __d2dstatic_uv##index.xy + offset * __d2dstatic_uv##index.zw) - - #define D2DSampleInputAtPosition(index, pos) InputTexture##index.Sample(InputSampler##index, __d2dstatic_uv##index.xy + __d2dstatic_uv##index.zw * (pos - __d2dstatic_scenePos.xy)) - - """u8; - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.Pix/ComputeContextExtensions.cs b/src/ComputeSharp.Pix/ComputeContextExtensions.cs deleted file mode 100644 index f719447c..00000000 --- a/src/ComputeSharp.Pix/ComputeContextExtensions.cs +++ /dev/null @@ -1,281 +0,0 @@ -using System; -using System.Diagnostics; -using System.Drawing; -using ComputeSharp.Graphics.Commands; -using ComputeSharp.Interop; - -namespace ComputeSharp; - -/// -/// A that contains extension methods using PIX APIs for the type. -/// -public static class ComputeContextExtensions -{ - /// - /// Starts a PIX event on a target object. - /// - /// The to use to start the PIX event. - /// The color to use for the event (the alpha channel will be ignored). - /// The message to use for the event. - [Conditional("USE_PIX")] - public static unsafe void BeginEvent(this ref readonly ComputeContext context, Color color, string message) - { - ref CommandList commandList = ref context.GetCommandList(pipelineState: null); - - int argb = color.ToArgb(); - uint pixColor = Pix.PIX_COLOR((byte)((argb & 0x00FF0000) >> 16), (byte)((argb & 0x0000FF00) >> 8), (byte)(argb & 0x000000FF)); - - commandList.D3D12GraphicsCommandList->BeginEvent(pixColor, message); - } - - /// - /// Starts a PIX event on a target object. - /// - /// The to use to start the PIX event. - /// The index to identify the group this event belongs to (PIX will choose a color to represent all entries in the group). - /// The message to use for the event. - [Conditional("USE_PIX")] - public static unsafe void BeginEvent(this ref readonly ComputeContext context, byte index, string message) - { - ref CommandList commandList = ref context.GetCommandList(pipelineState: null); - - uint pixColor = Pix.PIX_COLOR_INDEX(index); - - commandList.D3D12GraphicsCommandList->BeginEvent(pixColor, message); - } - - /// - /// Starts a PIX event on a target object. - /// - /// The to use to start the PIX event. - /// The message to use for the event. - [Conditional("USE_PIX")] - public static unsafe void BeginEvent(this ref readonly ComputeContext context, string message) - { - ref CommandList commandList = ref context.GetCommandList(pipelineState: null); - - commandList.D3D12GraphicsCommandList->BeginEvent(0, message); - } - - /// - /// Starts a PIX event on a target object. - /// - /// The to use to start the PIX event. - /// The color to use for the event (the alpha channel will be ignored). - /// The message to use for the event (it's assumed to be a -terminated ANSI characters sequence). - /// - /// - /// The parameter is not checked to ensure it has a -terminator. This allows callers - /// to pass an UTF8 string literal containing only ASCII characters (as the byte contents would be a valid ANSI sequence in that case). - /// The compiler will automatically insert a terminator right past the end of the returned when doing so. - /// - /// - /// This method offers greatly reduced overhead compared to the overlods taking a , as there is no need to create the - /// instance nor to execute the transcoding at runtime. The behavior when the input is invalid though is undefined. - /// Callers must take extra care to ensure the input message is in fact -terminated when invoking this API. - /// - /// - [Conditional("USE_PIX")] - public static unsafe void BeginEventUnsafe(this ref readonly ComputeContext context, Color color, ReadOnlySpan message) - { - ref CommandList commandList = ref context.GetCommandList(pipelineState: null); - - int argb = color.ToArgb(); - uint pixColor = Pix.PIX_COLOR((byte)((argb & 0x00FF0000) >> 16), (byte)((argb & 0x0000FF00) >> 8), (byte)(argb & 0x000000FF)); - - commandList.D3D12GraphicsCommandList->BeginEventUnsafe(pixColor, message); - } - - /// - /// Starts a PIX event on a target object. - /// - /// The to use to start the PIX event. - /// The index to identify the group this event belongs to (PIX will choose a color to represent all entries in the group). - /// The message to use for the event (it's assumed to be a -terminated ANSI characters sequence). - /// - /// - /// The parameter is not checked to ensure it has a -terminator. This allows callers - /// to pass an UTF8 string literal containing only ASCII characters (as the byte contents would be a valid ANSI sequence in that case). - /// The compiler will automatically insert a terminator right past the end of the returned when doing so. - /// - /// - /// This method offers greatly reduced overhead compared to the overlods taking a , as there is no need to create the - /// instance nor to execute the transcoding at runtime. The behavior when the input is invalid though is undefined. - /// Callers must take extra care to ensure the input message is in fact -terminated when invoking this API. - /// - /// - [Conditional("USE_PIX")] - public static unsafe void BeginEventUnsafe(this ref readonly ComputeContext context, byte index, ReadOnlySpan message) - { - ref CommandList commandList = ref context.GetCommandList(pipelineState: null); - - uint pixColor = Pix.PIX_COLOR_INDEX(index); - - commandList.D3D12GraphicsCommandList->BeginEventUnsafe(pixColor, message); - } - - /// - /// Starts a PIX event on a target object. - /// - /// The to use to start the PIX event. - /// The message to use for the event (it's assumed to be a -terminated ANSI characters sequence). - /// - /// - /// The parameter is not checked to ensure it has a -terminator. This allows callers - /// to pass an UTF8 string literal containing only ASCII characters (as the byte contents would be a valid ANSI sequence in that case). - /// The compiler will automatically insert a terminator right past the end of the returned when doing so. - /// - /// - /// This method offers greatly reduced overhead compared to the overlods taking a , as there is no need to create the - /// instance nor to execute the transcoding at runtime. The behavior when the input is invalid though is undefined. - /// Callers must take extra care to ensure the input message is in fact -terminated when invoking this API. - /// - /// - [Conditional("USE_PIX")] - public static unsafe void BeginEventUnsafe(this ref readonly ComputeContext context, ReadOnlySpan message) - { - ref CommandList commandList = ref context.GetCommandList(pipelineState: null); - - commandList.D3D12GraphicsCommandList->BeginEventUnsafe(0, message); - } - - /// - /// Ends a PIX event on a target object. - /// - /// The to use to end the PIX event. - [Conditional("USE_PIX")] - public static unsafe void EndEvent(this ref readonly ComputeContext context) - { - ref CommandList commandList = ref context.GetCommandList(pipelineState: null); - - Pix.PIXEndEventOnCommandList(commandList.D3D12GraphicsCommandList); - } - - /// - /// Sets a PIX marker on a target object. - /// - /// The to use to insert the PIX marker. - /// The color to use for the log (the alpha channel will be ignored). - /// The message to use for the marker. - [Conditional("USE_PIX")] - public static unsafe void Log(this ref readonly ComputeContext context, Color color, string message) - { - ref CommandList commandList = ref context.GetCommandList(pipelineState: null); - - int argb = color.ToArgb(); - uint pixColor = Pix.PIX_COLOR((byte)((argb & 0x00FF0000) >> 16), (byte)((argb & 0x0000FF00) >> 8), (byte)(argb & 0x000000FF)); - - commandList.D3D12GraphicsCommandList->SetPixMarker(pixColor, message); - } - - /// - /// Sets a PIX marker on a target object. - /// - /// The to use to insert the PIX marker. - /// The index to identify the group this log belongs to (PIX will choose a color to represent all entries in the group). - /// The message to use for the marker. - [Conditional("USE_PIX")] - public static unsafe void Log(this ref readonly ComputeContext context, byte index, string message) - { - ref CommandList commandList = ref context.GetCommandList(pipelineState: null); - - uint pixColor = Pix.PIX_COLOR_INDEX(index); - - commandList.D3D12GraphicsCommandList->SetPixMarker(pixColor, message); - } - - /// - /// Sets a PIX marker on a target object. - /// - /// The to use to insert the PIX marker. - /// The message to use for the marker. - [Conditional("USE_PIX")] - public static unsafe void Log(this ref readonly ComputeContext context, string message) - { - ref CommandList commandList = ref context.GetCommandList(pipelineState: null); - - commandList.D3D12GraphicsCommandList->SetPixMarker(0, message); - } - - /// - /// Sets a PIX marker on a target object. - /// - /// The to use to insert the PIX marker. - /// The color to use for the log (the alpha channel will be ignored). - /// The message to use for the marker (it's assumed to be a -terminated ANSI characters sequence). - /// - /// - /// The parameter is not checked to ensure it has a -terminator. This allows callers - /// to pass an UTF8 string literal containing only ASCII characters (as the byte contents would be a valid ANSI sequence in that case). - /// The compiler will automatically insert a terminator right past the end of the returned when doing so. - /// - /// - /// This method offers greatly reduced overhead compared to the overlods taking a , as there is no need to create the - /// instance nor to execute the transcoding at runtime. The behavior when the input is invalid though is undefined. - /// Callers must take extra care to ensure the input message is in fact -terminated when invoking this API. - /// - /// - [Conditional("USE_PIX")] - public static unsafe void LogUnsafe(this ref readonly ComputeContext context, Color color, ReadOnlySpan message) - { - ref CommandList commandList = ref context.GetCommandList(pipelineState: null); - - int argb = color.ToArgb(); - uint pixColor = Pix.PIX_COLOR((byte)((argb & 0x00FF0000) >> 16), (byte)((argb & 0x0000FF00) >> 8), (byte)(argb & 0x000000FF)); - - commandList.D3D12GraphicsCommandList->SetPixMarkerUnsafe(pixColor, message); - } - - /// - /// Sets a PIX marker on a target object. - /// - /// The to use to insert the PIX marker. - /// The index to identify the group this log belongs to (PIX will choose a color to represent all entries in the group). - /// The message to use for the marker (it's assumed to be a -terminated ANSI characters sequence). - /// - /// - /// The parameter is not checked to ensure it has a -terminator. This allows callers - /// to pass an UTF8 string literal containing only ASCII characters (as the byte contents would be a valid ANSI sequence in that case). - /// The compiler will automatically insert a terminator right past the end of the returned when doing so. - /// - /// - /// This method offers greatly reduced overhead compared to the overlods taking a , as there is no need to create the - /// instance nor to execute the transcoding at runtime. The behavior when the input is invalid though is undefined. - /// Callers must take extra care to ensure the input message is in fact -terminated when invoking this API. - /// - /// - [Conditional("USE_PIX")] - public static unsafe void LogUnsafe(this ref readonly ComputeContext context, byte index, ReadOnlySpan message) - { - ref CommandList commandList = ref context.GetCommandList(pipelineState: null); - - uint pixColor = Pix.PIX_COLOR_INDEX(index); - - commandList.D3D12GraphicsCommandList->SetPixMarkerUnsafe(pixColor, message); - } - - /// - /// Sets a PIX marker on a target object. - /// - /// The to use to insert the PIX marker. - /// The message to use for the marker (it's assumed to be a -terminated ANSI characters sequence). - /// - /// - /// The parameter is not checked to ensure it has a -terminator. This allows callers - /// to pass an UTF8 string literal containing only ASCII characters (as the byte contents would be a valid ANSI sequence in that case). - /// The compiler will automatically insert a terminator right past the end of the returned when doing so. - /// - /// - /// This method offers greatly reduced overhead compared to the overlods taking a , as there is no need to create the - /// instance nor to execute the transcoding at runtime. The behavior when the input is invalid though is undefined. - /// Callers must take extra care to ensure the input message is in fact -terminated when invoking this API. - /// - /// - [Conditional("USE_PIX")] - public static unsafe void LogUnsafe(this ref readonly ComputeContext context, ReadOnlySpan message) - { - ref CommandList commandList = ref context.GetCommandList(pipelineState: null); - - commandList.D3D12GraphicsCommandList->SetPixMarkerUnsafe(0, message); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.Pix/ComputeSharp.Pix.csproj b/src/ComputeSharp.Pix/ComputeSharp.Pix.csproj deleted file mode 100644 index 1eeb360d..00000000 --- a/src/ComputeSharp.Pix/ComputeSharp.Pix.csproj +++ /dev/null @@ -1,77 +0,0 @@ - - - net8.0 - AnyCPU;x64;ARM64 - 6.2 - - - - - - - - - - - - - - - - - - - - - - - - - winpixeventruntime.1.0.231030001 - - - $(NoWarn);NU5100 - - - - - - - - - - diff --git a/src/ComputeSharp.Pix/ComputeSharp.Pix.targets b/src/ComputeSharp.Pix/ComputeSharp.Pix.targets deleted file mode 100644 index 50773565..00000000 --- a/src/ComputeSharp.Pix/ComputeSharp.Pix.targets +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - - - winpixeventruntime.1.0.231030001 - - - false - true - - - false - true - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/ComputeSharp.Pix/Interop/ID3D12GraphicsCommandListExtensions.cs b/src/ComputeSharp.Pix/Interop/ID3D12GraphicsCommandListExtensions.cs deleted file mode 100644 index c9243b71..00000000 --- a/src/ComputeSharp.Pix/Interop/ID3D12GraphicsCommandListExtensions.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System; -using System.Buffers; -using System.Runtime.CompilerServices; -using System.Text; -using ComputeSharp.Win32; - -namespace ComputeSharp.Interop; - -/// -/// A with extensions for the type. -/// -internal static class ID3D12GraphicsCommandListExtensions -{ - /// - /// Begins a PIX event on a target object. - /// - /// The target object. - /// The color to use for the event. - /// The message to use for the event. - public static unsafe void BeginEvent(this ref ID3D12GraphicsCommandList d3D12GraphicsCommandList, uint color, string message) - { - // Rent a byte buffer with space for the null-terminator too - int maxByteLength = Encoding.ASCII.GetMaxByteCount(message.Length) + 1; - byte[] buffer = ArrayPool.Shared.Rent(maxByteLength); - int bytesWritten; - - fixed (byte* bufferPtr = buffer) - { - // Transcode from unicode to ASCII - fixed (char* messagePtr = message) - { - bytesWritten = Encoding.ASCII.GetBytes(messagePtr, message.Length, bufferPtr, buffer.Length); - } - - // Add the null terminator - buffer[bytesWritten] = 0; - - // Write the marker with the null-terminated ANSI message - Pix.PIXBeginEventOnCommandList((ID3D12GraphicsCommandList*)Unsafe.AsPointer(ref d3D12GraphicsCommandList), color, (sbyte*)bufferPtr); - } - - // Return the buffer (if an exception is thrown, it's fine to not do so) - ArrayPool.Shared.Return(buffer); - } - - /// - /// Begins a PIX event on a target object. - /// - /// The target object. - /// The color to use for the event. - /// The message to use for the event (it's assumed to be a -terminated ANSI characters sequence). - public static unsafe void BeginEventUnsafe(this ref ID3D12GraphicsCommandList d3D12GraphicsCommandList, uint color, ReadOnlySpan message) - { - fixed (byte* messagePtr = message) - { - Pix.PIXBeginEventOnCommandList((ID3D12GraphicsCommandList*)Unsafe.AsPointer(ref d3D12GraphicsCommandList), color, (sbyte*)messagePtr); - } - } - - /// - /// Sets a PIX marker on a target object. - /// - /// The target object. - /// The color to use for the marker. - /// The message to use for the marker. - public static unsafe void SetPixMarker(this ref ID3D12GraphicsCommandList d3D12GraphicsCommandList, uint color, string message) - { - // Rent a byte buffer with space for the null-terminator too - int maxByteLength = Encoding.ASCII.GetMaxByteCount(message.Length) + 1; - byte[] buffer = ArrayPool.Shared.Rent(maxByteLength); - int bytesWritten; - - fixed (byte* bufferPtr = buffer) - { - // Transcode from unicode to ASCII - fixed (char* messagePtr = message) - { - bytesWritten = Encoding.ASCII.GetBytes(messagePtr, message.Length, bufferPtr, buffer.Length); - } - - // Add the null terminator - buffer[bytesWritten] = 0; - - // Write the marker with the null-terminated ANSI message - Pix.PIXSetMarkerOnCommandList((ID3D12GraphicsCommandList*)Unsafe.AsPointer(ref d3D12GraphicsCommandList), color, (sbyte*)bufferPtr); - } - - // Return the buffer (if an exception is thrown, it's fine to not do so) - ArrayPool.Shared.Return(buffer); - } - - /// - /// Sets a PIX marker on a target object. - /// - /// The target object. - /// The color to use for the marker. - /// The message to use for the event (it's assumed to be a -terminated ANSI characters sequence). - public static unsafe void SetPixMarkerUnsafe(this ref ID3D12GraphicsCommandList d3D12GraphicsCommandList, uint color, ReadOnlySpan message) - { - fixed (byte* messagePtr = message) - { - Pix.PIXSetMarkerOnCommandList((ID3D12GraphicsCommandList*)Unsafe.AsPointer(ref d3D12GraphicsCommandList), color, (sbyte*)messagePtr); - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.Pix/Interop/Pix.cs b/src/ComputeSharp.Pix/Interop/Pix.cs deleted file mode 100644 index 4b46aa51..00000000 --- a/src/ComputeSharp.Pix/Interop/Pix.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System.Runtime.InteropServices; -using ComputeSharp.Win32; - -namespace ComputeSharp.Interop; - -/// -/// A collection of native bindings for PIX APIs (see ). -/// -internal static unsafe partial class Pix -{ - /// - /// Starts a PIX event on a target object. - /// - /// C export: typedef void(WINAPI* BeginEventOnCommandList)(ID3D12GraphicsCommandList* commandList, UINT64 color, _In_ PCSTR formatString). - /// - /// - /// The target object. - /// The color to use for the event. - /// The format string to use for the event (in ANSI format, -terminated). - [DllImport("WinPixEventRuntime", ExactSpelling = true, CallingConvention = CallingConvention.Winapi)] - public static extern void PIXBeginEventOnCommandList(ID3D12GraphicsCommandList* commandList, ulong color, sbyte* formatString); - - /// - /// Ends a PIX event on a target object. - /// - /// C export: typedef void(WINAPI* EndEventOnCommandList)(ID3D12GraphicsCommandList* commandList). - /// - /// - /// The target object. - [DllImport("WinPixEventRuntime", ExactSpelling = true, CallingConvention = CallingConvention.Winapi)] - public static extern void PIXEndEventOnCommandList(ID3D12GraphicsCommandList* commandList); - - /// - /// Sets a PIX marker on a target object. - /// - /// C export: typedef void(WINAPI* SetMarkerOnCommandList)(ID3D12GraphicsCommandList* commandList, UINT64 color, _In_ PCSTR formatString). - /// - /// - /// The target object. - /// The color to use for the marker. - /// The format string to use for the marker (in ANSI format, -terminated). - [DllImport("WinPixEventRuntime", ExactSpelling = true, CallingConvention = CallingConvention.Winapi)] - public static extern void PIXSetMarkerOnCommandList(ID3D12GraphicsCommandList* commandList, ulong color, sbyte* formatString); -} \ No newline at end of file diff --git a/src/ComputeSharp.Pix/Interop/Pix.h.cs b/src/ComputeSharp.Pix/Interop/Pix.h.cs deleted file mode 100644 index caad7784..00000000 --- a/src/ComputeSharp.Pix/Interop/Pix.h.cs +++ /dev/null @@ -1,43 +0,0 @@ -/*==========================================================================; - * - * Copyright (C) Microsoft Corporation. All Rights Reserved. - * - * File: pix3.h - * Content: PIX include file - * - ****************************************************************************/ - -// The following methods in this file have been ported from the -// pix3.h file in the winpixeventruntime.1.0.220124001 package. - -using System.Runtime.CompilerServices; - -namespace ComputeSharp.Interop; - -/// -partial class Pix -{ - /// - /// Gets a value representing a color for a PIX event. - /// - /// The red channel value for the color. - /// The green channel value for the color. - /// The blue channel value for the color. - /// A value representing a color for a PIX event. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static uint PIX_COLOR(byte r, byte g, byte b) - { - return 0xFF000000 | ((uint)r << 16) | ((uint)g << 8) | b; - } - - /// - /// Gets a value representing an indexed color for a PIX event. - /// - /// The index of the event to get the color for. - /// A value representing an indexed color for a PIX event. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - public static uint PIX_COLOR_INDEX(byte i) - { - return i; - } -} \ No newline at end of file diff --git a/src/ComputeSharp.Pix/LICENSE.txt b/src/ComputeSharp.Pix/LICENSE.txt deleted file mode 100644 index 4d156eab..00000000 --- a/src/ComputeSharp.Pix/LICENSE.txt +++ /dev/null @@ -1,106 +0,0 @@ -MIT License - -Copyright (c) 2024 Sergio Pedri - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - -This project incorporates components from PIX on Windows (https://devblogs.microsoft.com/pix/winpixeventruntime/). - -%% PIX on Windows NOTICES AND INFORMATION BEGIN HERE -========================================= -MICROSOFT SOFTWARE LICENSE TERMS - -PIX EVENT RUNTIME FOR WINDOWS - -IF YOU LIVE IN (OR ARE A BUSINESS WITH A PRINCIPAL PLACE OF BUSINESS IN) THE UNITED STATES, PLEASE READ THE “BINDING ARBITRATION AND CLASS ACTION WAIVER” SECTION BELOW. IT AFFECTS HOW DISPUTES ARE RESOLVED. - -These license terms are an agreement between you and Microsoft Corporation (or one of its affiliates). They apply to the software named above and any Microsoft services or software updates (except to the extent such services or updates are accompanied by new or additional terms, in which case those different terms apply prospectively and do not alter your or Microsoft’s rights relating to pre-updated software or services). IF YOU COMPLY WITH THESE LICENSE TERMS, YOU HAVE THE RIGHTS BELOW. BY USING THE SOFTWARE, YOU ACCEPT THESE TERMS. - -1. INSTALLATION AND USE RIGHTS. - a. General. You may install and use any number of copies of the software to design, develop and test your Microsoft Windows programs. - b. Third Party Software. The software may include third party applications that are licensed to you under this agreement or under their own terms. License terms, notices, and acknowledgements, if any, for the third party applications may be accessible online at http://aka.ms/thirdpartynotices or in an accompanying notices file. Even if such applications are governed by other agreements, the disclaimer, limitations on, and exclusions of damages below also apply to the extent allowed by applicable law. - -2. DISTRIBUTABLE CODE. - a. Distributable Code. The software is comprised of Distributable Code. “Distributable Code” is code that you are permitted to distribute in programs you develop if you comply with the terms below. - (i) Right to Use and Distribute. - * You may copy and distribute the object code form of the software. - * Third Party Distribution. You may permit distributors of your programs to copy and distribute the Distributable Code as part of those programs. - (ii) Distribution Requirements. For any Distributable Code you distribute, you must - * add significant primary functionality to it in your programs; - * require distributors and external end users to agree to terms that protect it at least as much as this agreement; - * display your valid copyright notice on your programs; and - * indemnify, defend, and hold harmless Microsoft from any claims, including attorneys’ fees, related to the distribution or use of your programs. - (iii) Distribution Restrictions. You may not - * alter any copyright, trademark or patent notice in the Distributable Code; - * use Microsoft’s trademarks in your programs’ names or in a way that suggests your programs come from or are endorsed by Microsoft; - * distribute Distributable Code to run on a platform other than a Windows platform; - * include Distributable Code in malicious, deceptive or unlawful programs; or - * modify or distribute the source code of any Distributable Code so that any part of it becomes subject to an Excluded License. An Excluded License is one that requires, as a condition of use, modification or distribution, that - * the code be disclosed or distributed in source code form; or - * others have the right to modify it. - -3. SCOPE OF LICENSE. The software is licensed, not sold. Microsoft reserves all other rights. Unless applicable law gives you more rights despite this limitation, you will not (and have no right to): - a. work around any technical limitations in the software that only allow you to use it in certain ways; - b. reverse engineer, decompile or disassemble the software; - c. remove, minimize, block, or modify any notices of Microsoft or its suppliers in the software; - d. use the software in any way that is against the law or to create or propagate malware; or - e. share, publish, distribute, or lend the software, provide the software as a stand-alone hosted solution for others to use, or transfer the software or this agreement to any third party. - -4. EXPORT RESTRICTIONS. You must comply with all domestic and international export laws and regulations that apply to the software, which include restrictions on destinations, end users, and end use. For further information on export restrictions, visit http://aka.ms/exporting. - -5. SUPPORT SERVICES. Microsoft is not obligated under this agreement to provide any support services for the software. Any support provided is “as is”, “with all faults”, and without warranty of any kind. - -6. BINDING ARBITRATION AND CLASS ACTION WAIVER. This Section applies if you live in (or, if a business, your principal place of business is in) the United States. If you and Microsoft have a dispute, you and Microsoft agree to try for 60 days to resolve it informally. If you and Microsoft can’t, you and Microsoft agree to binding individual arbitration before the American Arbitration Association under the Federal Arbitration Act (“FAA”), and not to sue in court in front of a judge or jury. Instead, a neutral arbitrator will decide. Class action lawsuits, class-wide arbitrations, private attorney-general actions, and any other proceeding where someone acts in a representative capacity are not allowed; nor is combining individual proceedings without the consent of all parties. The complete Arbitration Agreement contains more terms and is at http://aka.ms/arb-agreement-1. You and Microsoft agree to these terms. - -7. ENTIRE AGREEMENT. This agreement, and any other terms Microsoft may provide for supplements, updates, or third-party applications, is the entire agreement for the software. - -8. APPLICABLE LAW AND PLACE TO RESOLVE DISPUTES. If you acquired the software in the United States or Canada, the laws of the state or province where you live (or, if a business, where your principal place of business is located) govern the interpretation of this agreement, claims for its breach, and all other claims (including consumer protection, unfair competition, and tort claims), regardless of conflict of laws principles, except that the FAA governs everything related to arbitration. If you acquired the software in any other country, its laws apply, except that the FAA governs everything related to arbitration. If U.S. federal jurisdiction exists, you and Microsoft consent to exclusive jurisdiction and venue in the federal court in King County, Washington for all disputes heard in court (excluding arbitration). If not, you and Microsoft consent to exclusive jurisdiction and venue in the Superior Court of King County, Washington for all disputes heard in court (excluding arbitration). - -9. CONSUMER RIGHTS; REGIONAL VARIATIONS. This agreement describes certain legal rights. You may have other rights, including consumer rights, under the laws of your state, province, or country. Separate and apart from your relationship with Microsoft, you may also have rights with respect to the party from which you acquired the software. This agreement does not change those other rights if the laws of your state, province, or country do not permit it to do so. For example, if you acquired the software in one of the below regions, or mandatory country law applies, then the following provisions apply to you: - a. Australia. You have statutory guarantees under the Australian Consumer Law and nothing in this agreement is intended to affect those rights. - b. Canada. If you acquired this software in Canada, you may stop receiving updates by turning off the automatic update feature, disconnecting your device from the Internet (if and when you re-connect to the Internet, however, the software will resume checking for and installing updates), or uninstalling the software. The product documentation, if any, may also specify how to turn off updates for your specific device or software. - c. Germany and Austria. - (i) Warranty. The properly licensed software will perform substantially as described in any Microsoft materials that accompany the software. However, Microsoft gives no contractual guarantee in relation to the licensed software. - (ii) Limitation of Liability. In case of intentional conduct, gross negligence, claims based on the Product Liability Act, as well as, in case of death or personal or physical injury, Microsoft is liable according to the statutory law. - Subject to the foregoing clause (ii), Microsoft will only be liable for slight negligence if Microsoft is in breach of such material contractual obligations, the fulfillment of which facilitate the due performance of this agreement, the breach of which would endanger the purpose of this agreement and the compliance with which a party may constantly trust in (so-called "cardinal obligations"). In other cases of slight negligence, Microsoft will not be liable for slight negligence. - -10. DISCLAIMER OF WARRANTY. THE SOFTWARE IS LICENSED “AS IS.” YOU BEAR THE RISK OF USING IT. MICROSOFT GIVES NO EXPRESS WARRANTIES, GUARANTEES, OR CONDITIONS. TO THE EXTENT PERMITTED UNDER APPLICABLE LAWS, MICROSOFT EXCLUDES ALL IMPLIED WARRANTIES, INCLUDING MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT. - -11. LIMITATION ON AND EXCLUSION OF DAMAGES. IF YOU HAVE ANY BASIS FOR RECOVERING DAMAGES DESPITE THE PRECEDING DISCLAIMER OF WARRANTY, YOU CAN RECOVER FROM MICROSOFT AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP TO U.S. $5.00. YOU CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL, LOST PROFITS, SPECIAL, INDIRECT OR INCIDENTAL DAMAGES. -This limitation applies to (a) anything related to the software, services, content (including code) on third party Internet sites, or third party applications; and (b) claims for breach of contract, warranty, guarantee, or condition; strict liability, negligence, or other tort; or any other claim; in each case to the extent permitted by applicable law. -It also applies even if Microsoft knew or should have known about the possibility of the damages. The above limitation or exclusion may not apply to you because your state, province, or country may not allow the exclusion or limitation of incidental, consequential, or other damages. - - -[Please note: As this software is distributed in Canada, some of the clauses in this agreement are provided below in French. - -Remarque: Ce logiciel étant distribué au Canada, certaines des clauses dans ce contrat sont fournies ci-dessous en français. - -EXONÉRATION DE GARANTIE. Le logiciel visé par une licence est offert « tel quel ». Toute utilisation de ce logiciel est à votre seule risque et péril. Microsoft n’accorde aucune autre garantie expresse. Vous pouvez bénéficier de droits additionnels en vertu du droit local sur la protection des consommateurs, que ce contrat ne peut modifier. La ou elles sont permises par le droit locale, les garanties implicites de qualité marchande, d’adéquation à un usage particulier et d’absence de contrefaçon sont exclues. - -LIMITATION DES DOMMAGES-INTÉRÊTS ET EXCLUSION DE RESPONSABILITÉ POUR LES DOMMAGES. Vous pouvez obtenir de Microsoft et de ses fournisseurs une indemnisation en cas de dommages directs uniquement à hauteur de 5,00 $ US. Vous ne pouvez prétendre à aucune indemnisation pour les autres dommages, y compris les dommages spéciaux, indirects ou accessoires et pertes de bénéfices. - -Cette limitation concerne: - * tout ce qui est relié au logiciel, aux services ou au contenu (y compris le code) figurant sur des sites Internet tiers ou dans des programmes tiers; et - * les réclamations au titre de violation de contrat ou de garantie, ou au titre de responsabilité stricte, de négligence ou d’une autre faute dans la limite autorisée par la loi en vigueur. - -Elle s’applique également, même si Microsoft connaissait ou devrait connaître l’éventualité d’un tel dommage. Si votre pays n’autorise pas l’exclusion ou la limitation de responsabilité pour les dommages indirects, accessoires ou de quelque nature que ce soit, il se peut que la limitation ou l’exclusion ci-dessus ne s’appliquera pas à votre égard. - -EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous pourriez avoir d’autres droits prévus par les lois de votre pays. Le présent contrat ne modifie pas les droits que vous confèrent les lois de votre pays si celles-ci ne le permettent pas.] -========================================= -END OF PIX on Windows NOTICES AND INFORMATION \ No newline at end of file diff --git a/src/ComputeSharp.Pix/README.md b/src/ComputeSharp.Pix/README.md deleted file mode 100644 index 433baea0..00000000 --- a/src/ComputeSharp.Pix/README.md +++ /dev/null @@ -1,9 +0,0 @@ -![ComputeSharp cover image](https://user-images.githubusercontent.com/10199417/108635546-3512ea00-7480-11eb-8172-99bc59f4eb6f.png) - -# Overview 📖 - -**ComputeSharp.Pix** is an extension library for **ComputeSharp** to enable [PIX](https://devblogs.microsoft.com/pix/introduction/]) support to produce debugging information. - -# There's more! - -For a complete list of all features available in **ComputeSharp**, check the documentation in the [GitHub repo](https://github.com/Sergio0694/ComputeSharp). \ No newline at end of file diff --git a/src/ComputeSharp.UI/ComputeSharp.UI.projitems b/src/ComputeSharp.UI/ComputeSharp.UI.projitems deleted file mode 100644 index 5d500adc..00000000 --- a/src/ComputeSharp.UI/ComputeSharp.UI.projitems +++ /dev/null @@ -1,27 +0,0 @@ - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - true - 1cd1d9c5-7e00-43fb-a8c3-cfe98a885d3b - - - ComputeSharp.UI - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/ComputeSharp.UI/ComputeSharp.UI.shproj b/src/ComputeSharp.UI/ComputeSharp.UI.shproj deleted file mode 100644 index 496f98ee..00000000 --- a/src/ComputeSharp.UI/ComputeSharp.UI.shproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - 1cd1d9c5-7e00-43fb-a8c3-cfe98a885d3b - 14.0 - - - - - - - - diff --git a/src/ComputeSharp.UI/Controls/AnimatedComputeShaderPanel.Properties.cs b/src/ComputeSharp.UI/Controls/AnimatedComputeShaderPanel.Properties.cs deleted file mode 100644 index 0b10bab9..00000000 --- a/src/ComputeSharp.UI/Controls/AnimatedComputeShaderPanel.Properties.cs +++ /dev/null @@ -1,210 +0,0 @@ -using System; -#if !WINDOWS_UWP -using Microsoft.UI.Xaml; -#endif -using Windows.Foundation; -#if WINDOWS_UWP -using Windows.UI.Xaml; -#endif - -#if WINDOWS_UWP -namespace ComputeSharp.Uwp; -#else -namespace ComputeSharp.WinUI; -#endif - -/// -partial class AnimatedComputeShaderPanel -{ - /// - /// Raised whenever rendering starts. - /// - public event TypedEventHandler? RenderingStarted - { - add => this.swapChainManager.RenderingStarted += value; - remove => this.swapChainManager.RenderingStarted -= value; - } - - /// - /// Raised whenever rendering stops. - /// - public event TypedEventHandler? RenderingStopped - { - add => this.swapChainManager.RenderingStopped += value; - remove => this.swapChainManager.RenderingStopped -= value; - } - - /// - /// Raised whenever rendering fails. - /// - public event TypedEventHandler? RenderingFailed - { - add => this.swapChainManager.RenderingFailed += value; - remove => this.swapChainManager.RenderingFailed -= value; - } - - /// - /// Raised whenever the control is disposed and all underlying resources are released. - /// - public event TypedEventHandler? Disposed - { - add => this.swapChainManager.Disposed += value; - remove => this.swapChainManager.Disposed -= value; - } - - /// - /// Gets or sets the instance to use to render content. - /// - public IShaderRunner? ShaderRunner - { - get => (IShaderRunner?)GetValue(ShaderRunnerProperty); - set => SetValue(ShaderRunnerProperty, value); - } - - /// - /// The backing . - /// - public static readonly DependencyProperty ShaderRunnerProperty = DependencyProperty.Register( - nameof(ShaderRunner), - typeof(IShaderRunner), - typeof(AnimatedComputeShaderPanel), - new PropertyMetadata(null, OnShaderRunnerPropertyChanged)); - - /// - private static void OnShaderRunnerPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - AnimatedComputeShaderPanel @this = (AnimatedComputeShaderPanel)d; - - if (@this.IsLoaded && - !@this.IsPaused && - e.NewValue is IShaderRunner shaderRunner) - { - @this.swapChainManager.StartRenderLoop(null, shaderRunner); - } - else - { - @this.swapChainManager.StopRenderLoop(); - } - } - - /// - /// Gets or sets the resolution scale to be used to render frames. - /// This can help achieve higher framerates with more complex shaders. - /// - /// The accepted range is [0.1 and 1] (default is 1, exceeding values will be clamped). - public double ResolutionScale - { - get => (double)GetValue(ResolutionScaleProperty); - set => SetValue(ResolutionScaleProperty, Math.Clamp(value, 0.1, 1.0)); - } - - /// - /// The backing . - /// - public static readonly DependencyProperty ResolutionScaleProperty = DependencyProperty.Register( - nameof(ResolutionScale), - typeof(double), - typeof(AnimatedComputeShaderPanel), - new PropertyMetadata(1.0, OnResolutionScalePropertyChanged)); - - /// - private static void OnResolutionScalePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - AnimatedComputeShaderPanel @this = (AnimatedComputeShaderPanel)d; - double resolutionScale = (double)e.NewValue; - - @this.swapChainManager.QueueResolutionScaleChange(resolutionScale); - } - - /// - /// Gets or sets whether dynamic resolution is enabled. If it is, the internal render - /// resolution of the shader being run will be automatically adjusted to reach 60fps. - /// The default value for this property is . - /// - public bool IsDynamicResolutionEnabled - { - get => (bool)GetValue(IsDynamicResolutionEnabledProperty); - set => SetValue(IsDynamicResolutionEnabledProperty, value); - } - - /// - /// The backing . - /// - public static readonly DependencyProperty IsDynamicResolutionEnabledProperty = DependencyProperty.Register( - nameof(IsDynamicResolutionEnabled), - typeof(bool), - typeof(AnimatedComputeShaderPanel), - new PropertyMetadata(true, OnIsDynamicResolutionEnabledPropertyChanged)); - - /// - private static void OnIsDynamicResolutionEnabledPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - AnimatedComputeShaderPanel @this = (AnimatedComputeShaderPanel)d; - bool isDynamicResolutionEnabled = (bool)e.NewValue; - - @this.swapChainManager.QueueDynamicResolutionModeChange(isDynamicResolutionEnabled); - } - - /// - /// Gets or sets whether vertical sync is enabled. - /// The default value for this property is . - /// - public bool IsVerticalSyncEnabled - { - get => (bool)GetValue(IsVerticalSyncEnabledProperty); - set => SetValue(IsVerticalSyncEnabledProperty, value); - } - - /// - /// The backing . - /// - public static readonly DependencyProperty IsVerticalSyncEnabledProperty = DependencyProperty.Register( - nameof(IsVerticalSyncEnabled), - typeof(bool), - typeof(AnimatedComputeShaderPanel), - new PropertyMetadata(true, OnIsVerticalSyncEnabledPropertyChanged)); - - /// - private static void OnIsVerticalSyncEnabledPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - AnimatedComputeShaderPanel @this = (AnimatedComputeShaderPanel)d; - bool isVerticalSyncEnabled = (bool)e.NewValue; - - @this.swapChainManager.QueueVerticalSyncModeChange(isVerticalSyncEnabled); - } - - /// - /// Gets or sets whether or not the rendering is paused. - /// - public bool IsPaused - { - get => (bool)GetValue(IsPausedProperty); - set => SetValue(IsPausedProperty, value); - } - - /// - /// The backing . - /// - public static readonly DependencyProperty IsPausedProperty = DependencyProperty.Register( - nameof(IsPaused), - typeof(bool), - typeof(AnimatedComputeShaderPanel), - new PropertyMetadata(false, OnIsPausedPropertyChanged)); - - /// - private static void OnIsPausedPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - AnimatedComputeShaderPanel @this = (AnimatedComputeShaderPanel)d; - - if (@this.IsLoaded && - !(bool)e.NewValue && - @this.ShaderRunner is IShaderRunner shaderRunner) - { - @this.swapChainManager.StartRenderLoop(null, shaderRunner); - } - else - { - @this.swapChainManager.StopRenderLoop(); - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.UI/Controls/AnimatedComputeShaderPanel.cs b/src/ComputeSharp.UI/Controls/AnimatedComputeShaderPanel.cs deleted file mode 100644 index d486235a..00000000 --- a/src/ComputeSharp.UI/Controls/AnimatedComputeShaderPanel.cs +++ /dev/null @@ -1,101 +0,0 @@ -using System; -#if WINDOWS_UWP -using ComputeSharp.Uwp.Helpers; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -#else -using ComputeSharp.WinUI.Helpers; -using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Controls; -#endif - -#if WINDOWS_UWP -namespace ComputeSharp.Uwp; -#else -namespace ComputeSharp.WinUI; -#endif - -/// -/// -/// A custom that can be used to render animated backgrounds. -/// It is powered by ComputeSharp and leverages compute shaders to create frames to display. -/// -/// -/// This panel will always render new frames at the current display refresh rate, automatically. -/// -/// -public sealed partial class AnimatedComputeShaderPanel : SwapChainPanel, IDisposable -{ - /// - /// The instance handling rendering. - /// - private readonly SwapChainManager swapChainManager; - - /// - /// Creates a new instance. - /// - public AnimatedComputeShaderPanel() - : this(GraphicsDevice.GetDefault()) - { - } - - /// - /// Creates a new instance. - /// - /// The instance to use to render frames. - public AnimatedComputeShaderPanel(GraphicsDevice device) - { - this.swapChainManager = new SwapChainManager(this, device); - - Loaded += AnimatedComputeShaderPanel_Loaded; - Unloaded += AnimatedComputeShaderPanel_Unloaded; - SizeChanged += AnimatedComputeShaderPanel_SizeChanged; - CompositionScaleChanged += AnimatedComputeShaderPanel_CompositionScaleChanged; - } - - // Initializes the swap chain and starts the render thread - private void AnimatedComputeShaderPanel_Loaded(object sender, RoutedEventArgs e) - { - this.swapChainManager.QueueResize(ActualWidth, ActualHeight); - this.swapChainManager.QueueCompositionScaleChange(CompositionScaleX, CompositionScaleY); - this.swapChainManager.QueueResolutionScaleChange(ResolutionScale); - this.swapChainManager.QueueDynamicResolutionModeChange(IsDynamicResolutionEnabled); - this.swapChainManager.QueueVerticalSyncModeChange(IsVerticalSyncEnabled); - - if (!IsPaused && - ShaderRunner is IShaderRunner shaderRunner) - { - this.swapChainManager.StartRenderLoop(null, shaderRunner); - } - } - - // Requests a cancellation for the render thread - private void AnimatedComputeShaderPanel_Unloaded(object sender, RoutedEventArgs e) - { - this.swapChainManager.StopRenderLoop(); - } - - // Updates the background store for the frame size factors used by the render thread - private void AnimatedComputeShaderPanel_SizeChanged(object sender, SizeChangedEventArgs e) - { - this.swapChainManager.QueueResize(e.NewSize.Width, e.NewSize.Height); - } - - // Updates the background store for the composition scale factors used by the render thread - private void AnimatedComputeShaderPanel_CompositionScaleChanged(SwapChainPanel sender, object args) - { - this.swapChainManager.QueueCompositionScaleChange(CompositionScaleX, CompositionScaleY); - } - - /// - public void Dispose() - { - // Also request the render loop to stop before disposing. This ensures that in case there's - // a render thread already ongoing that is using a custom frame request queue, it might have - // the ability to stop rendering immediately and safely, instead of causing the panel to remain - // alive and then just throwing an exception the next time a frame is requested in case the - // device ot other resources have also been disposed. - this.swapChainManager.StopRenderLoop(); - this.swapChainManager.Dispose(); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.UI/Controls/ComputeShaderPanel.Properties.cs b/src/ComputeSharp.UI/Controls/ComputeShaderPanel.Properties.cs deleted file mode 100644 index 1b57b967..00000000 --- a/src/ComputeSharp.UI/Controls/ComputeShaderPanel.Properties.cs +++ /dev/null @@ -1,210 +0,0 @@ -using System; -#if !WINDOWS_UWP -using Microsoft.UI.Xaml; -#endif -using Windows.Foundation; -#if WINDOWS_UWP -using Windows.UI.Xaml; -#endif - -#if WINDOWS_UWP -namespace ComputeSharp.Uwp; -#else -namespace ComputeSharp.WinUI; -#endif - -/// -partial class ComputeShaderPanel -{ - /// - /// Raised whenever rendering starts. - /// - public event TypedEventHandler? RenderingStarted - { - add => this.swapChainManager.RenderingStarted += value; - remove => this.swapChainManager.RenderingStarted -= value; - } - - /// - /// Raised whenever rendering stops. - /// - public event TypedEventHandler? RenderingStopped - { - add => this.swapChainManager.RenderingStopped += value; - remove => this.swapChainManager.RenderingStopped -= value; - } - - /// - /// Raised whenever rendering fails. - /// - public event TypedEventHandler? RenderingFailed - { - add => this.swapChainManager.RenderingFailed += value; - remove => this.swapChainManager.RenderingFailed -= value; - } - - /// - /// Raised whenever the control is disposed and all underlying resources are released. - /// - public event TypedEventHandler? Disposed - { - add => this.swapChainManager.Disposed += value; - remove => this.swapChainManager.Disposed -= value; - } - - /// - /// Gets or sets the instance to use to request new frames. - /// - public IFrameRequestQueue? FrameRequestQueue - { - get => (IFrameRequestQueue)GetValue(FrameRequestQueueProperty); - set => SetValue(FrameRequestQueueProperty, value); - } - - /// - /// The backing . - /// - public static readonly DependencyProperty FrameRequestQueueProperty = DependencyProperty.Register( - nameof(FrameRequestQueue), - typeof(IFrameRequestQueue), - typeof(ComputeShaderPanel), - new PropertyMetadata(null, OnFrameRequestQueueChanged)); - - /// - private static void OnFrameRequestQueueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - ComputeShaderPanel @this = (ComputeShaderPanel)d; - - if (@this.IsLoaded && - e.NewValue is IFrameRequestQueue frameRequestQueue && - @this.ShaderRunner is IShaderRunner shaderRunner) - { - @this.swapChainManager.StartRenderLoop(frameRequestQueue, shaderRunner); - } - else - { - @this.swapChainManager.StopRenderLoop(); - } - } - - /// - /// Gets or sets the instance to use to render content. - /// - public IShaderRunner? ShaderRunner - { - get => (IShaderRunner?)GetValue(ShaderRunnerProperty); - set => SetValue(ShaderRunnerProperty, value); - } - - /// - /// The backing . - /// - public static readonly DependencyProperty ShaderRunnerProperty = DependencyProperty.Register( - nameof(ShaderRunner), - typeof(IShaderRunner), - typeof(ComputeShaderPanel), - new PropertyMetadata(null, OnShaderRunnerPropertyChanged)); - - /// - private static void OnShaderRunnerPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - ComputeShaderPanel @this = (ComputeShaderPanel)d; - - if (@this.IsLoaded && - @this.FrameRequestQueue is IFrameRequestQueue frameRequestQueue && - e.NewValue is IShaderRunner shaderRunner) - { - @this.swapChainManager.StartRenderLoop(frameRequestQueue, shaderRunner); - } - else - { - @this.swapChainManager.StopRenderLoop(); - } - } - - /// - /// Gets or sets the resolution scale to be used to render frames. - /// This can help achieve higher framerates with more complex shaders. - /// - /// The accepted range is [0.1 and 1] (default is 1, exceeding values will be clamped). - public double ResolutionScale - { - get => (double)GetValue(ResolutionScaleProperty); - set => SetValue(ResolutionScaleProperty, Math.Clamp(value, 0.1, 1.0)); - } - - /// - /// The backing . - /// - public static readonly DependencyProperty ResolutionScaleProperty = DependencyProperty.Register( - nameof(ResolutionScale), - typeof(double), - typeof(ComputeShaderPanel), - new PropertyMetadata(1.0, OnResolutionScalePropertyChanged)); - - /// - private static void OnResolutionScalePropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - ComputeShaderPanel @this = (ComputeShaderPanel)d; - double resolutionScale = (double)e.NewValue; - - @this.swapChainManager.QueueResolutionScaleChange(resolutionScale); - } - - /// - /// Gets or sets whether dynamic resolution is enabled. If it is, the internal render - /// resolution of the shader being run will be automatically adjusted to reach 60fps. - /// The default value for this property is . - /// - public bool IsDynamicResolutionEnabled - { - get => (bool)GetValue(IsDynamicResolutionEnabledProperty); - set => SetValue(IsDynamicResolutionEnabledProperty, value); - } - - /// - /// The backing . - /// - public static readonly DependencyProperty IsDynamicResolutionEnabledProperty = DependencyProperty.Register( - nameof(IsDynamicResolutionEnabled), - typeof(bool), - typeof(ComputeShaderPanel), - new PropertyMetadata(true, OnIsDynamicResolutionEnabledPropertyChanged)); - - /// - private static void OnIsDynamicResolutionEnabledPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - ComputeShaderPanel @this = (ComputeShaderPanel)d; - bool isDynamicResolutionEnabled = (bool)e.NewValue; - - @this.swapChainManager.QueueDynamicResolutionModeChange(isDynamicResolutionEnabled); - } - - /// - /// Gets or sets whether vertical sync is enabled. - /// The default value for this property is . - /// - public bool IsVerticalSyncEnabled - { - get => (bool)GetValue(IsVerticalSyncEnabledProperty); - set => SetValue(IsVerticalSyncEnabledProperty, value); - } - - /// - /// The backing . - /// - public static readonly DependencyProperty IsVerticalSyncEnabledProperty = DependencyProperty.Register( - nameof(IsVerticalSyncEnabled), - typeof(bool), - typeof(ComputeShaderPanel), - new PropertyMetadata(true, OnIsVerticalSyncEnabledPropertyChanged)); - - /// - private static void OnIsVerticalSyncEnabledPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) - { - ComputeShaderPanel @this = (ComputeShaderPanel)d; - bool isVerticalSyncEnabled = (bool)e.NewValue; - - @this.swapChainManager.QueueVerticalSyncModeChange(isVerticalSyncEnabled); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.UI/Controls/ComputeShaderPanel.cs b/src/ComputeSharp.UI/Controls/ComputeShaderPanel.cs deleted file mode 100644 index dfeb8554..00000000 --- a/src/ComputeSharp.UI/Controls/ComputeShaderPanel.cs +++ /dev/null @@ -1,95 +0,0 @@ -using System; -#if WINDOWS_UWP -using ComputeSharp.Uwp.Helpers; -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -#else -using ComputeSharp.WinUI.Helpers; -using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Controls; -#endif - -#if WINDOWS_UWP -namespace ComputeSharp.Uwp; -#else -namespace ComputeSharp.WinUI; -#endif - -/// -/// -/// A custom that can be used to render animated backgrounds. -/// It is powered by ComputeSharp and leverages compute shaders to create frames to display. -/// -/// -/// This panel accepts a custom instance to customize frame requests. -/// -/// -public sealed partial class ComputeShaderPanel : SwapChainPanel, IDisposable -{ - /// - /// The instance handling rendering. - /// - private readonly SwapChainManager swapChainManager; - - /// - /// Creates a new instance. - /// - public ComputeShaderPanel() - : this(GraphicsDevice.GetDefault()) - { - } - - /// - /// Creates a new instance. - /// - /// The instance to use to render frames. - public ComputeShaderPanel(GraphicsDevice device) - { - this.swapChainManager = new SwapChainManager(this, device); - - Loaded += ComputeShaderPanel_Loaded; - Unloaded += ComputeShaderPanel_Unloaded; - SizeChanged += ComputeShaderPanel_SizeChanged; - CompositionScaleChanged += ComputeShaderPanel_CompositionScaleChanged; - } - - // Initializes the swap chain and starts the render thread - private void ComputeShaderPanel_Loaded(object sender, RoutedEventArgs e) - { - this.swapChainManager.QueueResize(ActualWidth, ActualHeight); - this.swapChainManager.QueueCompositionScaleChange(CompositionScaleX, CompositionScaleY); - this.swapChainManager.QueueResolutionScaleChange(ResolutionScale); - this.swapChainManager.QueueDynamicResolutionModeChange(IsDynamicResolutionEnabled); - this.swapChainManager.QueueVerticalSyncModeChange(IsVerticalSyncEnabled); - - if (FrameRequestQueue is IFrameRequestQueue frameRequestQueue && - ShaderRunner is IShaderRunner shaderRunner) - { - this.swapChainManager.StartRenderLoop(frameRequestQueue, shaderRunner); - } - } - - // Requests a cancellation for the render thread - private void ComputeShaderPanel_Unloaded(object sender, RoutedEventArgs e) - { - this.swapChainManager.StopRenderLoop(); - } - - // Updates the background store for the frame size factors used by the render thread - private void ComputeShaderPanel_SizeChanged(object sender, SizeChangedEventArgs e) - { - this.swapChainManager.QueueResize(e.NewSize.Width, e.NewSize.Height); - } - - // Updates the background store for the composition scale factors used by the render thread - private void ComputeShaderPanel_CompositionScaleChanged(SwapChainPanel sender, object args) - { - this.swapChainManager.QueueCompositionScaleChange(CompositionScaleX, CompositionScaleY); - } - - /// - public void Dispose() - { - this.swapChainManager.Dispose(); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.UI/Controls/RenderingFailedEventArgs.cs b/src/ComputeSharp.UI/Controls/RenderingFailedEventArgs.cs deleted file mode 100644 index c65ee832..00000000 --- a/src/ComputeSharp.UI/Controls/RenderingFailedEventArgs.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; - -#if WINDOWS_UWP -namespace ComputeSharp.Uwp; -#else -namespace ComputeSharp.WinUI; -#endif - -/// -/// The arguments for the and events. -/// -public sealed class RenderingFailedEventArgs : EventArgs -{ - /// - /// Creates a new instance with the specified arguments. - /// - /// The that caused the rendering to fail. - internal RenderingFailedEventArgs(Exception exception) - { - Exception = exception; - } - - /// - /// Gets the that caused the rendering to fail. - /// - public Exception Exception { get; } -} \ No newline at end of file diff --git a/src/ComputeSharp.UI/Extensions/IDXGIAdapterExtensions.cs b/src/ComputeSharp.UI/Extensions/IDXGIAdapterExtensions.cs deleted file mode 100644 index 10574ef4..00000000 --- a/src/ComputeSharp.UI/Extensions/IDXGIAdapterExtensions.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using ComputeSharp.Core.Extensions; -using ComputeSharp.Graphics.Helpers; -using ComputeSharp.Win32; - -#if WINDOWS_UWP -namespace ComputeSharp.Uwp.Extensions; -#else -namespace ComputeSharp.WinUI.Extensions; -#endif - -/// -/// A with extensions for the type. -/// -internal static unsafe class IDXGIAdapterExtensions -{ - /// - /// Calculates the refresh rate for a given adapter. - /// - /// The input adapter to query. - /// The in use to render content. - /// The current composition refresh rate. - public static int GetCompositionRefreshRate(this ref IDXGIAdapter dxgiAdapter, DXGI_FORMAT dxgiFormat) - { - using ComPtr dxgiAdapter1 = default; - - dxgiAdapter.QueryInterface(Win32.Windows.__uuidof(), (void**)dxgiAdapter1.GetAddressOf()).Assert(); - - using ComPtr dxgiOutput = default; - - // Get the first output for the adapter (this will match the compositor output) - HRESULT hresult = dxgiAdapter1.Get()->EnumOutputs(0, dxgiOutput.GetAddressOf()); - - // There is a corner case to handle in case the WARP device is used (which will happen if running on a device - // that doesn't have a dedicated GPU matching the minimum requirements for ComputeSharp, or if no dedicated - // GPU is available at all). For WARP devices, there will never be any outputs being reported, so the call - // above will fail with DXGI_ERROR_NOT_FOUND. In this case, instead of throwing, we can simply default to - // a standard framerate of 60fps, and use that to still allow the execution to continue without crashing. - if (hresult == DXGI.DXGI_ERROR_NOT_FOUND) - { - DXGI_ADAPTER_DESC dxgiDescription; - - // Get the adapter description, to verify the device is in fact the WARP device - dxgiAdapter.GetDesc(&dxgiDescription).Assert(); - - // Just default to 60fps if the WARP device is used - if (dxgiDescription.VendorId == DeviceHelper.MicrosoftVendorId && - dxgiDescription.DeviceId == DeviceHelper.WarpDeviceId) - { - return 60; - } - } - - hresult.Assert(); - - using ComPtr dxgiOutput1 = default; - - dxgiOutput.CopyTo(dxgiOutput1.GetAddressOf()).Assert(); - - DXGI_MODE_DESC1 dxgiModeDescIn = default; - - dxgiModeDescIn.Format = dxgiFormat; - - DXGI_MODE_DESC1 dxgiModeDescOut = default; - - dxgiOutput1.Get()->FindClosestMatchingMode1(&dxgiModeDescIn, &dxgiModeDescOut, null).Assert(); - - // Calculates the best target framerate based on monitor refresh rate. Even with v-sync disabled, the target framerate - // should always match the refresh rate in use, instead of being capped to 60fps (as users could have a 120Hz screen - // and disabled v-sync). Here the refresh rate is retrieved, then the target framerate is calculated as being the - // rounding up of this value to the next integer, and then clamped between 30 and 360fps. - double refreshRateInHz = dxgiModeDescOut.RefreshRate.Numerator / (double)dxgiModeDescOut.RefreshRate.Denominator; - int refreshRate = Math.Clamp((int)Math.Ceiling(refreshRateInHz), 30, 360); - - return refreshRate; - } -} \ No newline at end of file diff --git a/src/ComputeSharp.UI/Extensions/SemaphoreSlimExtensions.cs b/src/ComputeSharp.UI/Extensions/SemaphoreSlimExtensions.cs deleted file mode 100644 index 1a68f70d..00000000 --- a/src/ComputeSharp.UI/Extensions/SemaphoreSlimExtensions.cs +++ /dev/null @@ -1,56 +0,0 @@ -using System; -using System.ComponentModel; -using System.Threading; -using System.Threading.Tasks; - -#pragma warning disable CS0618, IDE0290 - -#if WINDOWS_UWP -namespace ComputeSharp.Uwp.Extensions; -#else -namespace ComputeSharp.WinUI.Extensions; -#endif - -/// -/// A helper type for . -/// -internal static class SemaphoreSlimExtensions -{ - /// - /// Acquires a lock for the current instance, that is automatically released outside the block. - /// - public static async ValueTask LockAsync(this SemaphoreSlim semaphore) - { - await semaphore.WaitAsync().ConfigureAwait(false); - - return new(semaphore); - } - - /// - /// Private class that implements the automatic release of the semaphore - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public readonly struct Lock : IDisposable - { - /// - /// The underlying semaphore used by this instance. - /// - private readonly SemaphoreSlim semaphore; - - /// - /// Creates a new instance. - /// - /// The instance to wrap. - [Obsolete("Use AsyncMutex.LockAsync instead.")] - public Lock(SemaphoreSlim semaphore) - { - this.semaphore = semaphore; - } - - /// - public void Dispose() - { - _ = this.semaphore.Release(); - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.UI/Helpers/DynamicResolutionManager.cs b/src/ComputeSharp.UI/Helpers/DynamicResolutionManager.cs deleted file mode 100644 index fc7d0e55..00000000 --- a/src/ComputeSharp.UI/Helpers/DynamicResolutionManager.cs +++ /dev/null @@ -1,139 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -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. -/// -internal unsafe ref struct DynamicResolutionManager -{ - /// - /// The size of the sliding frame time window to monitor frame times. - /// - private const int SlidingFrameTimeWindowLength = 32; - - /// - /// The threshold for scale factor updates. - /// - private const float ScaleFactorDeltaThreshold = 0.005f; - - /// - /// The constant multiplicative factor for the scale factor. - /// - private const float ScaleFactorDeltaK = 0.8f; - - /// - /// The target frame time in ticks. - /// - private readonly long targetFrameTimeInTicks; - - /// - /// The upper frame time threshold in ticks. - /// - private readonly long upperFrameTimeThresholdInTicks; - - /// - /// The lower frame time threshold in ticks. - /// - private readonly long lowerFrameTimeThresholdInTicks; - - /// - /// The window of registered frame times for previous frames. - /// - private fixed long frameTimesInTicks[SlidingFrameTimeWindowLength]; - - /// - /// The current index into . - /// - /// - /// This will have a value of -1 when a scale factor update has just been applied, indicating - /// that the following frame update should not be tracked to contribute towards the next dynamic resolution - /// check. This is done to avoid having the swap chain resize cost influence the moving average of frame times. - /// - private int frameTimeOffset; - - /// - /// The current sum of values within . - /// - private long slidingFrameTimeWindowSum; - - /// - /// Initializes a new instance. - /// - /// The target framerate to use. - public DynamicResolutionManager(int targetFramerate) - { - long targetFrameTimeInTicks = TimeSpan.FromSeconds(1).Ticks / targetFramerate; - long upperFrameTimeThresholdInTicks = TimeSpan.FromSeconds(1).Ticks / (targetFramerate - 2); - long lowerFrameTimeThresholdInTicks = TimeSpan.FromSeconds(1).Ticks / (targetFramerate + 2); - - this.frameTimeOffset = 0; - this.targetFrameTimeInTicks = targetFrameTimeInTicks; - this.upperFrameTimeThresholdInTicks = upperFrameTimeThresholdInTicks; - this.lowerFrameTimeThresholdInTicks = lowerFrameTimeThresholdInTicks; - this.slidingFrameTimeWindowSum = targetFrameTimeInTicks * SlidingFrameTimeWindowLength; - - new Span(Unsafe.AsPointer(ref this.frameTimesInTicks[0]), SlidingFrameTimeWindowLength).Fill(targetFrameTimeInTicks); - } - - /// - /// Advances one frame and updates the scale factor, if needed. - /// - /// The frame time in ticks for the last rendered frame. - /// The current scale factor value being used to render frames. - /// Whether or not has been updated and a resize is needed. - public bool Advance(long frameTimeInTicks, ref float scaleFactor) - { - // Ignore the current frame if a resize has just happened - if (this.frameTimeOffset == -1) - { - this.frameTimeOffset = 0; - - return false; - } - - ref long previousFrameTimeInTicks = ref this.frameTimesInTicks[this.frameTimeOffset]; - - this.slidingFrameTimeWindowSum -= previousFrameTimeInTicks; - this.slidingFrameTimeWindowSum += frameTimeInTicks; - - previousFrameTimeInTicks = frameTimeInTicks; - - this.frameTimeOffset = (int)(((uint)this.frameTimeOffset + 1) % SlidingFrameTimeWindowLength); - - // Check for a dynamic resolution update if the end of the sliding window has been reached. - // This is not done every frame to reduce the overhead and amortize for render time fluctuations. - if (this.frameTimeOffset == 0) - { - // This formula is adapted from https://software.intel.com/content/www/us/en/develop/articles/dynamic-resolution-rendering-article.html. - long averageFrameTimeInTicks = this.slidingFrameTimeWindowSum / SlidingFrameTimeWindowLength; - - if (averageFrameTimeInTicks < this.lowerFrameTimeThresholdInTicks || - averageFrameTimeInTicks > this.upperFrameTimeThresholdInTicks) - { - float frameTimeDelta = (this.targetFrameTimeInTicks - averageFrameTimeInTicks) / (float)averageFrameTimeInTicks; - float scaleFactorDelta = scaleFactor * frameTimeDelta * ScaleFactorDeltaK; - float updatedScaleFactor = Math.Clamp(scaleFactor + scaleFactorDelta, 0.10f, 1.0f); - - // Apply the scale factor update if the target scale has changed enough. This helps to avoid - // too frequence resolution changes if the scale factor only changes very little every time. - if (Math.Abs(scaleFactor - updatedScaleFactor) >= ScaleFactorDeltaThreshold) - { - Volatile.Write(ref scaleFactor, updatedScaleFactor); - - this.frameTimeOffset = -1; - - return true; - } - } - } - - return false; - } -} \ No newline at end of file diff --git a/src/ComputeSharp.UI/Helpers/SwapChainManager.Rendering.cs b/src/ComputeSharp.UI/Helpers/SwapChainManager.Rendering.cs deleted file mode 100644 index d35d92b4..00000000 --- a/src/ComputeSharp.UI/Helpers/SwapChainManager.Rendering.cs +++ /dev/null @@ -1,444 +0,0 @@ -using System; -using System.Diagnostics; -using System.Runtime.CompilerServices; -using System.Threading; -using ComputeSharp.Interop; -#if WINDOWS_UWP -using ComputeSharp.Uwp.Extensions; -#else -using ComputeSharp.WinUI.Extensions; -#endif - -#if WINDOWS_UWP -namespace ComputeSharp.Uwp.Helpers; -#else -namespace ComputeSharp.WinUI.Helpers; -#endif - -#pragma warning disable CS0420 - -/// -partial class SwapChainManager -{ - /// - /// Starts the current render loop. - /// - /// The instance to use, if available. - /// The instance to use to render frames. - public async void StartRenderLoop(IFrameRequestQueue? frameRequestQueue, IShaderRunner shaderRunner) - { - default(ArgumentNullException).ThrowIfNull(shaderRunner); - - using (await this.setupSemaphore.LockAsync()) - { - // Here and in the calls below, only get a reference tracking lease when starting a render thread. - // This avoids crashes when the panel has been disposed but some code (eg. event handlers) still - // ends up calling into any of the APIs in this file, which is not intended but should not crash. - using ReferenceTracker.Lease _0 = GetReferenceTracker().GetLease(); - - this.renderCancellationTokenSource?.Cancel(); - - await this.renderSemaphore.WaitAsync(); - - Thread newRenderThread = new(static args => ((SwapChainManager)args!).SwitchAndStartRenderLoop()); - - this.frameRequestQueue = frameRequestQueue; - this.shaderRunner = shaderRunner; - this.renderCancellationTokenSource = new CancellationTokenSource(); - this.renderThread = newRenderThread; - this.renderSemaphore = new SemaphoreSlim(0, 1); - this.isResizePending = true; - - newRenderThread.Start(this); - } - } - - /// - /// Stops the current render loop, if one is running. - /// - public async void StopRenderLoop() - { - // Stopping the render loop doesn't use a reference tracking lease on purpose. - // This is to allow callers to stop the render loop even after disposing without - // the method throwing an exception. Stopping a loop doesn't actually access any - // native objects anyway, as it's just cancelling the cancellation token source. - using (await this.setupSemaphore.LockAsync()) - { - this.renderCancellationTokenSource?.Cancel(); - } - } - - /// - /// Queues a change in the dynamic resolution mode. - /// - /// Whether or not to use dynamic resolution. - public async void QueueDynamicResolutionModeChange(bool isDynamicResolutionEnabled) - { - using (await this.setupSemaphore.LockAsync()) - { - // If there is a render thread currently running, stop it and restart it - if (this.renderCancellationTokenSource?.IsCancellationRequested == false) - { - using ReferenceTracker.Lease _0 = GetReferenceTracker().GetLease(); - - this.renderCancellationTokenSource?.Cancel(); - - await this.renderSemaphore.WaitAsync(); - - Thread newRenderThread = new(static args => ((SwapChainManager)args!).SwitchAndStartRenderLoop()); - - this.renderCancellationTokenSource = new CancellationTokenSource(); - this.renderThread = newRenderThread; - this.renderSemaphore = new SemaphoreSlim(0, 1); - this.isDynamicResolutionEnabled = isDynamicResolutionEnabled; - this.isResizePending = true; - - newRenderThread.Start(this); - } - else - { - this.isDynamicResolutionEnabled = isDynamicResolutionEnabled; - } - } - } - - /// - /// Queues a change in the vertical sync mode. - /// - /// Whether or not to use vertical sync. - public async void QueueVerticalSyncModeChange(bool isVerticalSyncEnabled) - { - using (await this.setupSemaphore.LockAsync()) - { - // The v-sync option can be toggled on the fly when not using dynamic resolution - if (this.renderCancellationTokenSource?.IsCancellationRequested == false && - this.isDynamicResolutionEnabled) - { - using ReferenceTracker.Lease _0 = GetReferenceTracker().GetLease(); - - this.renderCancellationTokenSource?.Cancel(); - - await this.renderSemaphore.WaitAsync(); - - Thread newRenderThread = new(static args => ((SwapChainManager)args!).SwitchAndStartRenderLoop()); - - this.renderCancellationTokenSource = new CancellationTokenSource(); - this.renderThread = newRenderThread; - this.renderSemaphore = new SemaphoreSlim(0, 1); - this.syncInterval = isVerticalSyncEnabled ? 1u : 0u; - - newRenderThread.Start(this); - } - else - { - this.syncInterval = isVerticalSyncEnabled ? 1u : 0u; - } - } - } - - /// - /// Queues a resize operation. - /// - /// The width of the render resolution. - /// The height of the render resolution. - public void QueueResize(double width, double height) - { - this.width = (float)width; - this.height = (float)height; - - this.isResizePending = true; - } - - /// - /// Queues a change in the composition scale factors. - /// - /// The composition scale on the X axis. - /// The composition scale on the Y axis - public void QueueCompositionScaleChange(double compositionScaleX, double compositionScaleY) - { - this.compositionScaleX = (float)compositionScaleX; - this.compositionScaleY = (float)compositionScaleY; - - this.isResizePending = true; - } - - /// - /// Queues a change in the resolution scale factor. - /// - /// The resolution scale factor to use. - public void QueueResolutionScaleChange(double resolutionScale) - { - this.resolutionScale = (float)resolutionScale; - - this.isResizePending = true; - } - - /// - /// Selects the right render loop to start. - /// - private void SwitchAndStartRenderLoop() - { - try - { - OnRenderingStarted(); - - if (this.isDynamicResolutionEnabled) - { - this.dynamicResolutionScale = this.resolutionScale; - - // These two leases are needed to ensure the manager isn't disposed while rendering is running - using ReferenceTracker.Lease _0 = GetReferenceTracker().GetLease(); - - RenderLoopWithDynamicResolution(); - } - else - { - using ReferenceTracker.Lease _0 = GetReferenceTracker().GetLease(); - - RenderLoop(); - } - - this.renderStopwatch?.Stop(); - - OnRenderingStopped(); - } - catch (Exception e) - { - this.renderStopwatch?.Stop(); - - OnRenderingFailed(e); - } - finally - { - _ = this.renderSemaphore.Release(); - } - } - - /// - /// The core render loop. - /// - [MethodImpl(MethodImplOptions.NoInlining)] - private void RenderLoop() - { - Stopwatch renderStopwatch = this.renderStopwatch ??= new(); - CancellationToken cancellationToken = this.renderCancellationTokenSource!.Token; - - if (!OnFrameRequest(out object? parameter, cancellationToken)) - { - return; - } - - OnResize(); - - // Start the initial frame separately, before the timer starts. This ensures that - // resuming after a pause correctly renders the first frame at the right time. - if (OnUpdate(renderStopwatch.Elapsed, parameter)) - { - OnWaitForPresent(); - OnPresent(); - } - - renderStopwatch.Start(); - - // Main render loop, until cancellation is requested - while (!cancellationToken.IsCancellationRequested) - { - if (!OnFrameRequest(out parameter, cancellationToken)) - { - return; - } - - OnResize(); - - if (OnUpdate(renderStopwatch.Elapsed, parameter)) - { - OnWaitForPresent(); - OnPresent(); - } - } - } - - /// - /// Gets the instance to use in . - /// - /// The instance to use. - private unsafe partial void OnGetDynamicResolutionManager(out DynamicResolutionManager resolutionManager); - - /// - /// The core render loop with dynamic resolution. - /// - [MethodImpl(MethodImplOptions.NoInlining)] - private unsafe void RenderLoopWithDynamicResolution() - { - Stopwatch renderStopwatch = this.renderStopwatch ??= new(); - Stopwatch frameStopwatch = new(); - CancellationToken cancellationToken = this.renderCancellationTokenSource!.Token; - - OnGetDynamicResolutionManager(out DynamicResolutionManager resolutionManager); - - if (!OnFrameRequest(out object? parameter, cancellationToken)) - { - return; - } - - OnResize(); - - if (OnUpdate(renderStopwatch.Elapsed, parameter)) - { - OnWaitForPresent(); - OnPresent(); - } - - renderStopwatch.Start(); - - while (!cancellationToken.IsCancellationRequested) - { - if (!OnFrameRequest(out parameter, cancellationToken)) - { - return; - } - - OnResize(); - - frameStopwatch.Restart(); - - if (OnUpdate(renderStopwatch.Elapsed, parameter)) - { - frameStopwatch.Stop(); - - // The time spent waiting for present isn't included in the frame time, as when v-sync is - // enabled it corresponds to the time spent waiting for the v-blank. If it was included, - // then the actual framerate would never exceed the target one, meaning that if dynamic - // resolution is enabled, the resolution scale could only keep decreasing without ever - // being able to be increased again, as the framerate would never exceed the target. - // Simply not counting the time spent waiting for that works around the issue. - OnWaitForPresent(); - - frameStopwatch.Start(); - - OnPresent(); - - // Evaluate the dynamic resolution frame time step - if (resolutionManager.Advance(frameStopwatch.ElapsedTicks, ref this.dynamicResolutionScale)) - { - this.isResizePending = true; - } - } - } - } - - /// - /// Waits for a new frame request and retrieves its parameter. - /// - /// The input parameter for the frame to render. - /// A token to cancel waiting for a new frame. - /// Whether the operation was canceled. - private bool OnFrameRequest(out object? parameter, CancellationToken token) - { - if (this.frameRequestQueue is IFrameRequestQueue frameRequestQueue) - { - [MethodImpl(MethodImplOptions.NoInlining)] - static bool WaitForFrameRequest(IFrameRequestQueue frameRequestQueue, out object? parameter, CancellationToken token) - { - try - { - // Wait for a new frame request - frameRequestQueue.Dequeue(out parameter, token); - - return true; - } - catch (OperationCanceledException) - { - parameter = null; - - return false; - } - } - - return WaitForFrameRequest(frameRequestQueue, out parameter, token); - } - - parameter = null; - - return true; - } - - /// - /// Resizes the current application, if needed. - /// - private void OnResize() - { - if (this.isResizePending) - { - ApplyResize(); - - this.isResizePending = false; - } - } - - /// - /// Updates the render resolution, if needed, and renders a new frame. - /// - /// The current time since the start of the application. - /// The input parameter for the frame being rendered. - /// Whether or not to present the resulting frame. - private bool OnUpdate(TimeSpan time, object? parameter) - { - return this.shaderRunner!.TryExecute(this.texture!, time, parameter); - } - - /// - /// Waits for the panel to be ready to present a new frame for the current application. - /// - private unsafe partial void OnWaitForPresent(); - - /// - /// Presents the last rendered frame for the current application. - /// - private unsafe partial void OnPresent(); - - /// - /// Raises . - /// - private void OnRenderingStarted() - { - _ = this.dispatcherQueue.TryEnqueue(() => RenderingStarted?.Invoke(this.owner, EventArgs.Empty)); - } - - /// - /// Raises . - /// - private void OnRenderingStopped() - { - _ = this.dispatcherQueue.TryEnqueue(() => RenderingStopped?.Invoke(this.owner, EventArgs.Empty)); - } - - /// - /// Raises . - /// - /// The being thrown that caused rendering to stop. - private void OnRenderingFailed(Exception e) - { - _ = this.dispatcherQueue.TryEnqueue(() => RenderingFailed?.Invoke(this.owner, new RenderingFailedEventArgs(e))); - } - - /// - /// Raises . - /// - private void OnDisposed() - { - _ = this.dispatcherQueue.TryEnqueue(() => Disposed?.Invoke(this.owner, EventArgs.Empty)); - } - - /// - /// Stops the current render loop, if one is running, and waits for it. - /// - /// This method doesn't check for disposal. - private void UnsafeStopRenderLoopAndWait() - { - this.setupSemaphore.Wait(); - - this.renderCancellationTokenSource?.Cancel(); - this.renderSemaphore.Wait(); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.UI/Helpers/SwapChainManager.cs b/src/ComputeSharp.UI/Helpers/SwapChainManager.cs deleted file mode 100644 index c999eebd..00000000 --- a/src/ComputeSharp.UI/Helpers/SwapChainManager.cs +++ /dev/null @@ -1,582 +0,0 @@ -using System; -using System.Diagnostics; -using System.Runtime.CompilerServices; -using System.Threading; -using ComputeSharp.Core.Extensions; -using ComputeSharp.Graphics.Helpers; -using ComputeSharp.Interop; -#if WINDOWS_UWP -using ComputeSharp.Uwp.Extensions; -#else -using ComputeSharp.WinUI.Extensions; -#endif -using ComputeSharp.Win32; -#if !WINDOWS_UWP -using Microsoft.UI.Dispatching; -using Microsoft.UI.Xaml.Controls; -#endif -using Windows.Foundation; -#if WINDOWS_UWP -using Windows.System; -using Windows.UI.Xaml.Controls; -#endif - -#if WINDOWS_UWP -namespace ComputeSharp.Uwp.Helpers; -#else -namespace ComputeSharp.WinUI.Helpers; -#endif - -/// -/// A type managing rendering on a target swap chain object. -/// -/// The type of the owner instance. -internal sealed unsafe partial class SwapChainManager : ReferenceTrackedObject - where TOwner : SwapChainPanel -{ - /// - /// The owning instance. - /// - private readonly TOwner owner; - - /// - /// The instance in use. - /// - private readonly GraphicsDevice device; - - /// - /// The captured for the current instance. - /// - private readonly DispatcherQueue dispatcherQueue = DispatcherQueue.GetForCurrentThread(); - - /// - /// An object for the render loop management. - /// - private readonly SemaphoreSlim setupSemaphore = new(1, 1); - - /// - /// The pointer for the device currently in use. - /// - private ComPtr d3D12Device; - - /// - /// The instance to use for graphics operations. - /// - private ComPtr d3D12CommandQueue; - - /// - /// The instance used for graphics operations. - /// - private ComPtr d3D12Fence; - - /// - /// The next fence value for graphics operations using . - /// - private ulong nextD3D12FenceValue; - - /// - /// The object to create command lists. - /// - private ComPtr d3D12CommandAllocator; - - /// - /// The instance used to copy data to the back buffers. - /// - private ComPtr d3D12GraphicsCommandList; - - /// - /// The instance for the underlying object wrapped by the target control. - /// - /// - /// This is needed to call with - /// when the panel is destroyed, so the additional implicit references to the swap chain an native device can be released. - /// - private ComPtr swapChainPanelNative; - - /// - /// The instance used to display content onto the target window. - /// - private ComPtr dxgiSwapChain3; - - /// - /// The awaitable object for calls. - /// - private readonly HANDLE frameLatencyWaitableObject; - - /// - /// The first buffer within . - /// - private ComPtr d3D12Resource0; - - /// - /// The second buffer within . - /// - private ComPtr d3D12Resource1; - - /// - /// The index of the next buffer that can be used to present content. - /// - private volatile uint currentBufferIndex; - - /// - /// The render thread in use, if any. - /// - private volatile Thread? renderThread; - - /// - /// The used to wait for render threads to complete. - /// - private volatile SemaphoreSlim renderSemaphore = new(1, 1); - - /// - /// The to use for . - /// - private volatile CancellationTokenSource? renderCancellationTokenSource; - - /// - /// The instance used to get frame requests and parameters. - /// - private volatile IFrameRequestQueue? frameRequestQueue; - - /// - /// The instance used to create shaders to run. - /// - private volatile IShaderRunner? shaderRunner; - - /// - /// The instance used to prepare frames to display. - /// - private volatile ReadWriteTexture2D? texture; - - /// - /// Whether or not the window has been resized and requires the buffers to be updated. - /// - private volatile bool isResizePending; - - /// - /// The backing store for the actual width for the render thread. - /// - private volatile float width; - - /// - /// The backing store for the actual height for the render thread. - /// - private volatile float height; - - /// - /// The backing store for the current composition scale on the X axis for the render thread. - /// - private volatile float compositionScaleX; - - /// - /// The backing store for the current composition scale on the Y axis for the render thread. - /// - private volatile float compositionScaleY; - - /// - /// The resolution scale used to render frames when explicitly controlled by the user. - /// - private volatile float resolutionScale; - - /// - /// The dynamic resolution scale used to render frames. - /// - private volatile float dynamicResolutionScale; - - /// - /// Whether dynamic resolution is currently enabled. - /// - private volatile bool isDynamicResolutionEnabled; - - /// - /// The flags to enable or disable vertical sync. - /// - private volatile uint syncInterval; - - /// - /// The instance tracking time since the first rendered frame. - /// - private volatile Stopwatch? renderStopwatch; - - /// - /// Raised whenever rendering starts. - /// - public event TypedEventHandler? RenderingStarted; - - /// - /// Raised whenever rendering stops. - /// - public event TypedEventHandler? RenderingStopped; - - /// - /// Raised whenever rendering fails. - /// - public event TypedEventHandler? RenderingFailed; - - /// - /// Raised whenever the parent control is disposed and all underlying resources are released. - /// - public event TypedEventHandler? Disposed; - - /// - /// Initializes a new instance of the type. - /// - /// The input swap chain instance being used. - /// The instance to use to render frames. - public SwapChainManager(TOwner owner, GraphicsDevice device) - { - this.owner = owner; - this.device = device; - - // Extract the ISwapChainPanelNative reference from the current panel, then query the - // IDXGISwapChain reference just created and set that as the swap chain panel to use. - fixed (ISwapChainPanelNative** swapChainPanelNative = this.swapChainPanelNative) - { - SwapChainPanelNativeMarshaller.GetNativeObject(owner, swapChainPanelNative); - } - - // Get the underlying ID3D12Device in use - fixed (ID3D12Device** d3D12Device = this.d3D12Device) - { - this.device.D3D12Device->QueryInterface(Win32.Windows.__uuidof(), (void**)d3D12Device).Assert(); - } - - // Create the direct command queue to use - fixed (ID3D12CommandQueue** d3D12CommandQueue = this.d3D12CommandQueue) - { - D3D12_COMMAND_QUEUE_DESC d3D12CommandQueueDesc; - d3D12CommandQueueDesc.Type = D3D12_COMMAND_LIST_TYPE.D3D12_COMMAND_LIST_TYPE_DIRECT; - d3D12CommandQueueDesc.Priority = (int)D3D12_COMMAND_QUEUE_PRIORITY.D3D12_COMMAND_QUEUE_PRIORITY_NORMAL; - d3D12CommandQueueDesc.Flags = D3D12_COMMAND_QUEUE_FLAGS.D3D12_COMMAND_QUEUE_FLAG_NONE; - d3D12CommandQueueDesc.NodeMask = 0; - - this.d3D12Device.Get()->CreateCommandQueue( - &d3D12CommandQueueDesc, - Win32.Windows.__uuidof(), - (void**)d3D12CommandQueue).Assert(); - } - - // Create the direct fence - fixed (ID3D12Fence** d3D12Fence = this.d3D12Fence) - { - this.d3D12Device.Get()->CreateFence( - 0, - D3D12_FENCE_FLAGS.D3D12_FENCE_FLAG_NONE, - Win32.Windows.__uuidof(), - (void**)d3D12Fence).Assert(); - } - - // Create the swap chain to display frames - using (ComPtr dxgiFactory6 = default) - { - DeviceHelper.CreateDXGIFactory6(dxgiFactory6.GetAddressOf()); - - DXGI_SWAP_CHAIN_DESC1 dxgiSwapChainDesc1 = default; - dxgiSwapChainDesc1.AlphaMode = DXGI_ALPHA_MODE.DXGI_ALPHA_MODE_IGNORE; - dxgiSwapChainDesc1.BufferCount = 2; - dxgiSwapChainDesc1.Flags = (uint)DXGI_SWAP_CHAIN_FLAG.DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT; - dxgiSwapChainDesc1.Format = DXGI_FORMAT.DXGI_FORMAT_R8G8B8A8_UNORM; - dxgiSwapChainDesc1.Width = 1; - dxgiSwapChainDesc1.Height = 1; - dxgiSwapChainDesc1.SampleDesc = new DXGI_SAMPLE_DESC(count: 1, quality: 0); - dxgiSwapChainDesc1.Scaling = DXGI_SCALING.DXGI_SCALING_STRETCH; - dxgiSwapChainDesc1.Stereo = 0; - dxgiSwapChainDesc1.SwapEffect = DXGI_SWAP_EFFECT.DXGI_SWAP_EFFECT_FLIP_SEQUENTIAL; - dxgiSwapChainDesc1.BufferUsage = DXGI.DXGI_USAGE_RENDER_TARGET_OUTPUT; - - using ComPtr dxgiSwapChain1 = default; - - dxgiFactory6.Get()->CreateSwapChainForComposition( - (IUnknown*)this.d3D12CommandQueue.Get(), - &dxgiSwapChainDesc1, - null, - (IDXGISwapChain1**)&dxgiSwapChain1).Assert(); - - fixed (IDXGISwapChain3** dxgiSwapChain3 = this.dxgiSwapChain3) - { - dxgiSwapChain1.CopyTo(dxgiSwapChain3).Assert(); - } - } - - // Get the awaitable object to synchronizize present calls - this.frameLatencyWaitableObject = this.dxgiSwapChain3.Get()->GetFrameLatencyWaitableObject(); - - // Create the command allocator to use - fixed (ID3D12CommandAllocator** d3D12CommandAllocator = this.d3D12CommandAllocator) - { - this.d3D12Device.Get()->CreateCommandAllocator( - D3D12_COMMAND_LIST_TYPE.D3D12_COMMAND_LIST_TYPE_DIRECT, - Win32.Windows.__uuidof(), - (void**)d3D12CommandAllocator).Assert(); - } - - // Create the reusable command list to copy data to the back buffers - fixed (ID3D12GraphicsCommandList** d3D12GraphicsCommandList = this.d3D12GraphicsCommandList) - { - this.d3D12Device.Get()->CreateCommandList( - 0, - D3D12_COMMAND_LIST_TYPE.D3D12_COMMAND_LIST_TYPE_DIRECT, - this.d3D12CommandAllocator.Get(), - null, - Win32.Windows.__uuidof(), - (void**)d3D12GraphicsCommandList).Assert(); - } - - // Close the command list to prepare it for future use - this.d3D12GraphicsCommandList.Get()->Close().Assert(); - - using (ComPtr idxgiSwapChain = default) - { - this.dxgiSwapChain3.CopyTo(idxgiSwapChain.GetAddressOf()).Assert(); - - this.swapChainPanelNative.Get()->SetSwapChain(idxgiSwapChain.Get()).Assert(); - } - - GC.KeepAlive(this); - } - - /// - /// Applies the actual resize logic that was scheduled from , if needed. - /// - private unsafe void ApplyResize() - { - // The target resolution scale is either the dynamic resolution scale, being updated by the render thread, - // or the fixed resolution scale set by the user. If dynamic resolution is enabled, the latter is ignored. - float targetResolutionScale = this.isDynamicResolutionEnabled - ? this.dynamicResolutionScale - : this.resolutionScale; - - uint resizedWidth = (uint)Math.Max(Math.Ceiling(this.width * this.compositionScaleX * targetResolutionScale), 1.0f); - uint resizeHeight = (uint)Math.Max(Math.Ceiling(this.height * this.compositionScaleY * targetResolutionScale), 1.0f); - - // Make sure not to exceed the maximum allowed size for textures. This might happen - // when the control is inside a ScrollView control that's zommed in to a very high - // amount, or when trying to manually set an invalid size to the control manually. - if (resizedWidth > D3D12.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION || - resizeHeight > D3D12.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION) - { - // Make sure to scale down by preserving the aspect ratio - if (resizedWidth >= resizeHeight) - { - resizeHeight = (uint)Math.Max(resizeHeight * D3D12.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION / (float)resizedWidth, 1.0f); - resizedWidth = D3D12.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION; - } - else - { - resizedWidth = (uint)Math.Max(resizedWidth * D3D12.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION / (float)resizeHeight, 1.0f); - resizeHeight = D3D12.D3D12_REQ_TEXTURE2D_U_OR_V_DIMENSION; - } - } - - if (this.texture is null || - this.texture.Width != resizedWidth || - this.texture.Height != resizeHeight) - { - ulong updatedFenceValue = ++this.nextD3D12FenceValue; - - this.d3D12CommandQueue.Get()->Signal(this.d3D12Fence.Get(), updatedFenceValue).Assert(); - - // Wait for the fence again to ensure there are no pending operations - this.d3D12Fence.Get()->SetEventOnCompletion(updatedFenceValue, default).Assert(); - - // Dispose the old buffers before resizing the buffer - this.d3D12Resource0.Dispose(); - this.d3D12Resource1.Dispose(); - - // Resize the swap chain buffers - this.dxgiSwapChain3.Get()->ResizeBuffers( - 2, - resizedWidth, - resizeHeight, - DXGI_FORMAT.DXGI_FORMAT_UNKNOWN, - (uint)DXGI_SWAP_CHAIN_FLAG.DXGI_SWAP_CHAIN_FLAG_FRAME_LATENCY_WAITABLE_OBJECT).Assert(); - - // Apply the necessary scale transform - DXGI_MATRIX_3X2_F transformMatrix = default; - transformMatrix._11 = 1 / this.compositionScaleX * (1 / targetResolutionScale); - transformMatrix._22 = 1 / this.compositionScaleY * (1 / targetResolutionScale); - - this.dxgiSwapChain3.Get()->SetMatrixTransform(&transformMatrix).Assert(); - - // Retrieve the back buffers for the swap chain - fixed (ID3D12Resource** d3D12Resource0 = this.d3D12Resource0) - fixed (ID3D12Resource** d3D12Resource1 = this.d3D12Resource1) - { - this.dxgiSwapChain3.Get()->GetBuffer(0, Win32.Windows.__uuidof(), (void**)d3D12Resource0).Assert(); - this.dxgiSwapChain3.Get()->GetBuffer(1, Win32.Windows.__uuidof(), (void**)d3D12Resource1).Assert(); - } - - // Get the index of the initial back buffer - this.currentBufferIndex = this.dxgiSwapChain3.Get()->GetCurrentBackBufferIndex(); - - // Dispose the previous texture, if present, and create the new 2D texture to use to generate frames to display - this.texture?.Dispose(); - - this.texture = this.device.AllocateReadWriteTexture2D((int)resizedWidth, (int)resizeHeight); - } - } - - /// - private unsafe partial void OnWaitForPresent() - { - _ = Win32.Windows.WaitForSingleObjectEx(this.frameLatencyWaitableObject, Win32.Windows.INFINITE, true); - } - - /// - private unsafe partial void OnPresent() - { - using ComPtr d3D12Resource = default; - - // Get the underlying ID3D12Resource pointer for the texture - this.texture!.D3D12Resource->QueryInterface(Win32.Windows.__uuidof(), (void**)d3D12Resource.GetAddressOf()).Assert(); - - // Get the target back buffer to update - ID3D12Resource* d3D12ResourceBackBuffer = this.currentBufferIndex switch - { - 0 => this.d3D12Resource0.Get(), - 1 => this.d3D12Resource1.Get(), - _ => null - }; - - this.currentBufferIndex ^= 1; - - // Reset the command list and command allocator - this.d3D12CommandAllocator.Get()->Reset().Assert(); - this.d3D12GraphicsCommandList.Get()->Reset(this.d3D12CommandAllocator.Get(), null).Assert(); - - D3D12_RESOURCE_BARRIER* d3D12ResourceBarriers = stackalloc D3D12_RESOURCE_BARRIER[] - { - D3D12_RESOURCE_BARRIER.InitTransition( - d3D12Resource.Get(), - D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_UNORDERED_ACCESS, - D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COPY_SOURCE), - D3D12_RESOURCE_BARRIER.InitTransition( - d3D12ResourceBackBuffer, - D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COMMON, - D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COPY_DEST) - }; - - // Transition the resources to COPY_DEST and COPY_SOURCE respectively - this.d3D12GraphicsCommandList.Get()->ResourceBarrier(2, d3D12ResourceBarriers); - - // Copy the generated frame to the target back buffer - this.d3D12GraphicsCommandList.Get()->CopyResource(d3D12ResourceBackBuffer, d3D12Resource.Get()); - - d3D12ResourceBarriers[0] = D3D12_RESOURCE_BARRIER.InitTransition( - d3D12Resource.Get(), - D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COPY_SOURCE, - D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_UNORDERED_ACCESS); - - d3D12ResourceBarriers[1] = D3D12_RESOURCE_BARRIER.InitTransition( - d3D12ResourceBackBuffer, - D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COPY_DEST, - D3D12_RESOURCE_STATES.D3D12_RESOURCE_STATE_COMMON); - - // Transition the resources back to COMMON and UNORDERED_ACCESS respectively - this.d3D12GraphicsCommandList.Get()->ResourceBarrier(2, d3D12ResourceBarriers); - - this.d3D12GraphicsCommandList.Get()->Close().Assert(); - - // Execute the command list to perform the copy - fixed (ID3D12GraphicsCommandList** d3D12GraphicsCommandList = this.d3D12GraphicsCommandList) - { - this.d3D12CommandQueue.Get()->ExecuteCommandLists(1, (ID3D12CommandList**)d3D12GraphicsCommandList); - } - - // Increment the fence value and signal the fence. Just like with normal dispatches, - // the increment must be done after executing the command list and before signaling. - ulong updatedFenceValue = ++this.nextD3D12FenceValue; - - this.d3D12CommandQueue.Get()->Signal(this.d3D12Fence.Get(), updatedFenceValue).Assert(); - - // Present the new frame - this.dxgiSwapChain3.Get()->Present(SyncInterval: this.syncInterval, 0).Assert(); - - if (updatedFenceValue > this.d3D12Fence.Get()->GetCompletedValue()) - { - this.d3D12Fence.Get()->SetEventOnCompletion(updatedFenceValue, default).Assert(); - } - } - - /// - private unsafe partial void OnGetDynamicResolutionManager(out DynamicResolutionManager resolutionManager) - { - using ComPtr dxgiFactory6 = default; - - DeviceHelper.CreateDXGIFactory6(dxgiFactory6.GetAddressOf()); - - using ComPtr dxgiAdapter = default; - - dxgiFactory6.Get()->EnumAdapters(0, dxgiAdapter.GetAddressOf()).Assert(); - - int targetFramerate = dxgiAdapter.Get()->GetCompositionRefreshRate(DXGI_FORMAT.DXGI_FORMAT_R8G8B8A8_UNORM); - - resolutionManager = new DynamicResolutionManager(targetFramerate); - } - - /// - protected override void DangerousOnDispose() - { - static void OnDisposeOnDispatcherQueueThread(SwapChainManager @this) - { - // Even while rendering is still running, we need to properly release all implicit references - // that have been added when connecting the swap chain panel that was used. To do that, the - // same ISwapChainPanelNative::SetSwapChain API has to be called, but passing null as the - // target swap chain. This is handled correctly in the implementation, and all the additional - // references to the swap chain we passed during initialization will be dropped. Once that - // is done, we can then dispose our reference to the underlying swap chain panel for the control. - // This API has to be called on the UI thread, and it can be called just fine even if rendering - // is still running, so we can just call it immediately before moving to a thread to stop rendering. - @this.swapChainPanelNative.Get()->SetSwapChain(null).Assert(); - @this.swapChainPanelNative.Dispose(); - - _ = ThreadPool.UnsafeQueueUserWorkItem(static state => - { - SwapChainManager @this = (SwapChainManager)state!; - - @this.UnsafeStopRenderLoopAndWait(); - - ulong updatedFenceValue = @this.nextD3D12FenceValue + 1; - - @this.d3D12CommandQueue.Get()->Signal(@this.d3D12Fence.Get(), updatedFenceValue).Assert(); - - // Just like in the resize logic, signal and wait to make sure no operations are pending. This - // is needed to avoid a crash when disposing resources when disposing after stopping rendering. - @this.d3D12Fence.Get()->SetEventOnCompletion(updatedFenceValue, default).Assert(); - - _ = Win32.Windows.CloseHandle(@this.frameLatencyWaitableObject); - - @this.d3D12Device.Dispose(); - @this.d3D12CommandQueue.Dispose(); - @this.d3D12Fence.Dispose(); - @this.d3D12CommandAllocator.Dispose(); - @this.d3D12GraphicsCommandList.Dispose(); - @this.dxgiSwapChain3.Dispose(); - @this.d3D12Resource0.Dispose(); - @this.d3D12Resource1.Dispose(); - @this.texture?.Dispose(); - - @this.OnDisposed(); - }, @this); - } - - // Check whether the current thread is the one associated with the dispatcher queue. If so, the dispose - // logic can be called directly, otherwise an extra dispatch is needed. This is because the start of - // the dispose logic requires UI thread access to interact with the swap chain panel. - if (this.dispatcherQueue.HasThreadAccess) - { - OnDisposeOnDispatcherQueueThread(this); - } - else - { - [MethodImpl(MethodImplOptions.NoInlining)] - static void OnDisposeOnThreadPoolThread(SwapChainManager @this) - { - _ = @this.dispatcherQueue.TryEnqueue(() => OnDisposeOnDispatcherQueueThread(@this)); - } - - // Move to a separate queue to skip the closure when lowering this method, if not needed - OnDisposeOnThreadPoolThread(this); - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.UI/Helpers/SwapChainPanelNativeMarshaller.cs b/src/ComputeSharp.UI/Helpers/SwapChainPanelNativeMarshaller.cs deleted file mode 100644 index 12315dc8..00000000 --- a/src/ComputeSharp.UI/Helpers/SwapChainPanelNativeMarshaller.cs +++ /dev/null @@ -1,68 +0,0 @@ -using System; -using System.Runtime.CompilerServices; -using ComputeSharp.Core.Extensions; -using ComputeSharp.Win32; -#if !WINDOWS_UWP -using Microsoft.UI.Xaml.Controls; -#endif -using System.Runtime.InteropServices; -#if WINDOWS_UWP -using Windows.UI.Xaml.Controls; -#endif -using WinRT; - -#if WINDOWS_UWP -namespace ComputeSharp.Uwp.Helpers; -#else -namespace ComputeSharp.WinUI.Helpers; -#endif - -/// -/// A helper type to handle marshalling objects for native interop. -/// -internal static unsafe class SwapChainPanelNativeMarshaller -{ - /// - /// Retrieves the underlying object for an input instance. - /// - /// The input instance to unwrap. - /// A pointer to the resulting object to retrieve. - public static void GetNativeObject(SwapChainPanel managedObject, ISwapChainPanelNative** nativeObject) - { -#if WINDOWS_UWP - ReadOnlySpan data = - [ - 0xD2, 0x19, 0x2F, 0xF9, - 0xDE, 0x3A, - 0xA6, 0x45, - 0xA2, - 0x0C, - 0xF6, - 0xF1, - 0xEA, - 0x90, - 0x55, - 0x4B - ]; -#else - ReadOnlySpan data = - [ - 0xB8, 0xD0, 0xAA, 0x63, - 0x24, 0x7C, - 0xFF, 0x40, - 0x85, - 0xA8, - 0x64, - 0x0D, - 0x94, - 0x4C, - 0xC3, - 0x25 - ]; -#endif - // Unwrap and get the 'ISwapChainPanelNative' interface with the right IID depending on the UI framework - ((IWinRTObject)managedObject).NativeObject.TryAs( - iid: Unsafe.As(ref MemoryMarshal.GetReference(data)), - ppv: out *(nint*)nativeObject).Assert(); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.UI/IFrameRequestQueue.cs b/src/ComputeSharp.UI/IFrameRequestQueue.cs deleted file mode 100644 index 59d0ebd6..00000000 --- a/src/ComputeSharp.UI/IFrameRequestQueue.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System.Threading; - -#if WINDOWS_UWP -namespace ComputeSharp.Uwp; -#else -namespace ComputeSharp.WinUI; -#endif - -/// -/// An interface for a shader runner to be used with . -/// -public interface IFrameRequestQueue -{ - /// - /// Waits for a new frame request to be available, retrieving its parameter, if any. - /// - /// The input parameter for the frame to render. - /// A token to cancel waiting for a new frame. - /// - /// - /// This method should block synchronously until a new frame is available, returning its - /// parameters if any. The parameter should be used to cancel a - /// blocking operation and return immediately, as it's cancelled when rendering is stopped. - /// - /// - /// For instance, if the implementation is internally using a - /// queue and calling - /// to block and wait for - /// a new frame parameter, the - /// overload should be used instead, to enable canceling the operation early if needed. - /// - /// - /// If the runner throws an , this will just be recognized by the - /// in use and result in rendering simply being stopped. If any other exceptions are thrown - /// instead, they will be interpreted as a failure, and will be raised. - /// - /// - void Dequeue(out object? parameter, CancellationToken token); -} \ No newline at end of file diff --git a/src/ComputeSharp.UI/IShaderRunner.cs b/src/ComputeSharp.UI/IShaderRunner.cs deleted file mode 100644 index 23e7d337..00000000 --- a/src/ComputeSharp.UI/IShaderRunner.cs +++ /dev/null @@ -1,26 +0,0 @@ -using System; - -#if WINDOWS_UWP -namespace ComputeSharp.Uwp; -#else -namespace ComputeSharp.WinUI; -#endif - -/// -/// An interface for a shader runner to be used with or . -/// -public interface IShaderRunner -{ - /// - /// Tries to render a single frame to a texture, optionally skipping the frame if needed. - /// - /// The target texture to render the frame to. - /// The timespan for the current frame. - /// The input parameter for the frame being rendered. - /// Whether or not to present the current frame. If , the frame will be skipped. - /// - /// Any exceptions thrown by the runner will result in - /// or to be raised. - /// - bool TryExecute(IReadWriteNormalizedTexture2D texture, TimeSpan timespan, object? parameter); -} \ No newline at end of file diff --git a/src/ComputeSharp.UI/ShaderRunner{T}.cs b/src/ComputeSharp.UI/ShaderRunner{T}.cs deleted file mode 100644 index 04924671..00000000 --- a/src/ComputeSharp.UI/ShaderRunner{T}.cs +++ /dev/null @@ -1,73 +0,0 @@ -using System; -using ComputeSharp.Descriptors; - -#if WINDOWS_UWP -namespace ComputeSharp.Uwp; -#else -namespace ComputeSharp.WinUI; -#endif - -/// -/// A simple implementation powered by a supplied shader type. -/// All rendered frames produced by this type will always be presented. -/// -/// The type of shader to use to render frames. -public sealed class ShaderRunner : IShaderRunner - where T : struct, IComputeShader, IComputeShaderDescriptor -{ - /// - /// The instance used to create shaders to run. - /// - private readonly Func? shaderFactory; - - /// - /// The instance used to create shaders to run. - /// - private readonly Func? statefulShaderFactory; - - /// - /// Creates a new instance that will create shader instances with - /// the default constructor. Only use this constructor if the shader doesn't require any additional - /// resources or other parameters being initialized before being dispatched on the GPU. - /// - public ShaderRunner() - { - } - - /// - /// Creates a new instance. - /// - /// The instance used to create shaders to run. - public ShaderRunner(Func shaderFactory) - { - default(ArgumentNullException).ThrowIfNull(shaderFactory); - - this.shaderFactory = shaderFactory; - } - - /// - /// Creates a new instance. - /// - /// The instance used to create shaders to run. - public ShaderRunner(Func shaderFactory) - { - default(ArgumentNullException).ThrowIfNull(shaderFactory); - - this.statefulShaderFactory = shaderFactory; - } - - /// - public bool TryExecute(IReadWriteNormalizedTexture2D texture, TimeSpan time, object? parameter) - { - if (this.shaderFactory is Func shaderFactory) - { - texture.GraphicsDevice.ForEach(texture, this.shaderFactory(time)); - } - else - { - texture.GraphicsDevice.ForEach(texture, this.statefulShaderFactory!(time, parameter)); - } - - return true; - } -} \ No newline at end of file diff --git a/src/ComputeSharp.Uwp/ComputeSharp.Uwp.csproj b/src/ComputeSharp.Uwp/ComputeSharp.Uwp.csproj deleted file mode 100644 index 656d3477..00000000 --- a/src/ComputeSharp.Uwp/ComputeSharp.Uwp.csproj +++ /dev/null @@ -1,18 +0,0 @@ - - - net8.0-windows10.0.22621.0 - 10.0.18362.0 - true - x64;ARM64 - win-x64;win-arm64 - en-US - $(DefineConstants);WINDOWS_UWP - false - - - - - - - - diff --git a/src/ComputeSharp.Uwp/README.md b/src/ComputeSharp.Uwp/README.md deleted file mode 100644 index ed57f5dc..00000000 --- a/src/ComputeSharp.Uwp/README.md +++ /dev/null @@ -1,9 +0,0 @@ -![ComputeSharp cover image](https://user-images.githubusercontent.com/10199417/108635546-3512ea00-7480-11eb-8172-99bc59f4eb6f.png) - -# Overview 📖 - -**ComputeSharp.Uwp** is a UWP library with controls to render DX12 shaders powered by **ComputeSharp**. - -# There's more! - -For a complete list of all features available in **ComputeSharp**, check the documentation in the [GitHub repo](https://github.com/Sergio0694/ComputeSharp). diff --git a/src/ComputeSharp.Win32.D2D1/.editorconfig b/src/ComputeSharp.Win32.D2D1/.editorconfig deleted file mode 100644 index a04efa9a..00000000 --- a/src/ComputeSharp.Win32.D2D1/.editorconfig +++ /dev/null @@ -1,46 +0,0 @@ -# Disable all rules from above directories -root = true - -# All files -[*] - -# Encoding -charset = utf-8 - -# Indentation and spacing -tab_width = 4 -indent_size = 4 -indent_style = space - -# New line preferences -end_of_line = lf -insert_final_newline = false -trim_trailing_whitespace = true - -# C# files -[*.cs] - -# Code-block preferences -csharp_style_namespace_declarations = file_scoped:warning - -dotnet_diagnostic.IDE0004.severity = none -dotnet_diagnostic.IDE0007.severity = none -dotnet_diagnostic.IDE0008.severity = none -dotnet_diagnostic.IDE0022.severity = none -dotnet_diagnostic.IDE0023.severity = none -dotnet_diagnostic.IDE0024.severity = none -dotnet_diagnostic.IDE0027.severity = none -dotnet_diagnostic.IDE0032.severity = none -dotnet_diagnostic.IDE0045.severity = none -dotnet_diagnostic.IDE0046.severity = none -dotnet_diagnostic.IDE0047.severity = none -dotnet_diagnostic.IDE0055.severity = none -dotnet_diagnostic.IDE0060.severity = none -dotnet_diagnostic.IDE0090.severity = none -dotnet_diagnostic.IDE0160.severity = none -dotnet_diagnostic.IDE0180.severity = none -dotnet_diagnostic.IDE0290.severity = none -dotnet_diagnostic.IDE1006.severity = none -# .NET 10 SDK で新規追加された規則。上流(TerraFX)由来のバインディングを一致させて保守するため抑制する。 -dotnet_diagnostic.IDE0370.severity = none -dotnet_diagnostic.IDE0380.severity = none \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/ComputeSharp.Win32.D2D1.projitems b/src/ComputeSharp.Win32.D2D1/ComputeSharp.Win32.D2D1.projitems deleted file mode 100644 index ee329928..00000000 --- a/src/ComputeSharp.Win32.D2D1/ComputeSharp.Win32.D2D1.projitems +++ /dev/null @@ -1,79 +0,0 @@ - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - true - 9da1da9f-f8b2-4b25-be80-c21f773029e3 - - - ComputeSharp.Win32.D2D1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/ComputeSharp.Win32.D2D1.shproj b/src/ComputeSharp.Win32.D2D1/ComputeSharp.Win32.D2D1.shproj deleted file mode 100644 index c5b7a02c..00000000 --- a/src/ComputeSharp.Win32.D2D1/ComputeSharp.Win32.D2D1.shproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - 9da1da9f-f8b2-4b25-be80-c21f773029e3 - 14.0 - - - - - - - diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/headers/d3dcommon/D3D_FEATURE_LEVEL.cs b/src/ComputeSharp.Win32.D2D1/DirectX/headers/d3dcommon/D3D_FEATURE_LEVEL.cs deleted file mode 100644 index 253f51ae..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/headers/d3dcommon/D3D_FEATURE_LEVEL.cs +++ /dev/null @@ -1,21 +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 d3dcommon.h in microsoft/DirectX-Headers tag v1.606.4 -// Original source is Copyright © Microsoft. Licensed under the MIT license - -namespace ComputeSharp.Win32; - -internal enum D3D_FEATURE_LEVEL -{ - D3D_FEATURE_LEVEL_1_0_CORE = 0x1000, - D3D_FEATURE_LEVEL_9_1 = 0x9100, - D3D_FEATURE_LEVEL_9_2 = 0x9200, - D3D_FEATURE_LEVEL_9_3 = 0x9300, - D3D_FEATURE_LEVEL_10_0 = 0xa000, - D3D_FEATURE_LEVEL_10_1 = 0xa100, - D3D_FEATURE_LEVEL_11_0 = 0xb000, - D3D_FEATURE_LEVEL_11_1 = 0xb100, - D3D_FEATURE_LEVEL_12_0 = 0xc000, - D3D_FEATURE_LEVEL_12_1 = 0xc100, - D3D_FEATURE_LEVEL_12_2 = 0xc200 -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1/D2D1_EXTEND_MODE.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1/D2D1_EXTEND_MODE.cs deleted file mode 100644 index fd20c76c..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1/D2D1_EXTEND_MODE.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 um/d2d1.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -namespace ComputeSharp.Win32; - -internal enum D2D1_EXTEND_MODE : uint -{ - D2D1_EXTEND_MODE_CLAMP = 0, - D2D1_EXTEND_MODE_WRAP = 1, - D2D1_EXTEND_MODE_MIRROR = 2, - D2D1_EXTEND_MODE_FORCE_DWORD = 0xffffffff, -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1/ID2D1Factory.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1/ID2D1Factory.cs deleted file mode 100644 index e974ed92..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1/ID2D1Factory.cs +++ /dev/null @@ -1,13 +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 um/d2d1.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -namespace ComputeSharp.Win32; - -[NativeTypeName("struct ID2D1Factory : IUnknown")] -[NativeInheritance("IUnknown")] -internal unsafe partial struct ID2D1Factory -{ - public void** lpVtbl; -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1/ID2D1Image.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1/ID2D1Image.cs deleted file mode 100644 index 244561a7..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1/ID2D1Image.cs +++ /dev/null @@ -1,75 +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 um/d2d1.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace ComputeSharp.Win32; - -[NativeTypeName("struct ID2D1Image : ID2D1Resource")] -[NativeInheritance("ID2D1Resource")] -internal unsafe partial struct ID2D1Image : IComObject -{ - /// - static Guid* IComObject.IID - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - ReadOnlySpan data = - [ - 0x75, 0x9F, 0x01, 0x65, - 0xA2, 0x8D, - 0x7C, 0x49, - 0xB3, - 0x2C, - 0xDF, - 0xA3, - 0x4E, - 0x48, - 0xED, - 0xE6 - ]; - - return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data)); - } - } - - public void** lpVtbl; - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(0)] - public HRESULT QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[0]))((ID2D1Image*)Unsafe.AsPointer(ref this), riid, ppvObject); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(1)] - [return: NativeTypeName("ULONG")] - public uint AddRef() - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[1]))((ID2D1Image*)Unsafe.AsPointer(ref this)); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(2)] - [return: NativeTypeName("ULONG")] - public uint Release() - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[2]))((ID2D1Image*)Unsafe.AsPointer(ref this)); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(3)] - public void GetFactory(ID2D1Factory** factory) - { - ((delegate* unmanaged[MemberFunction])(lpVtbl[3]))((ID2D1Image*)Unsafe.AsPointer(ref this), factory); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/D2D1_BUFFER_PRECISION.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/D2D1_BUFFER_PRECISION.cs deleted file mode 100644 index e77acab6..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/D2D1_BUFFER_PRECISION.cs +++ /dev/null @@ -1,17 +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 um/d2d1_1.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -namespace ComputeSharp.Win32; - -internal enum D2D1_BUFFER_PRECISION : uint -{ - D2D1_BUFFER_PRECISION_UNKNOWN = 0, - D2D1_BUFFER_PRECISION_8BPC_UNORM = 1, - D2D1_BUFFER_PRECISION_8BPC_UNORM_SRGB = 2, - D2D1_BUFFER_PRECISION_16BPC_UNORM = 3, - D2D1_BUFFER_PRECISION_16BPC_FLOAT = 4, - D2D1_BUFFER_PRECISION_32BPC_FLOAT = 5, - D2D1_BUFFER_PRECISION_FORCE_DWORD = 0xffffffff -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/D2D1_CHANNEL_DEPTH.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/D2D1_CHANNEL_DEPTH.cs deleted file mode 100644 index 076f5955..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/D2D1_CHANNEL_DEPTH.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 um/d2d1_1.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -namespace ComputeSharp.Win32; - -internal enum D2D1_CHANNEL_DEPTH : uint -{ - D2D1_CHANNEL_DEPTH_DEFAULT = 0, - D2D1_CHANNEL_DEPTH_1 = 1, - D2D1_CHANNEL_DEPTH_4 = 4, - D2D1_CHANNEL_DEPTH_FORCE_DWORD = 0xffffffff -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/D2D1_PROPERTY.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/D2D1_PROPERTY.cs deleted file mode 100644 index 6fe11263..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/D2D1_PROPERTY.cs +++ /dev/null @@ -1,21 +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 um/d2d1_1.h in the Windows SDK for Windows 10.0.22621.0 -// Original source is Copyright © Microsoft. All rights reserved. - -namespace ComputeSharp.Win32; - -internal enum D2D1_PROPERTY : uint -{ - D2D1_PROPERTY_CLSID = 0x80000000, - D2D1_PROPERTY_DISPLAYNAME = 0x80000001, - D2D1_PROPERTY_AUTHOR = 0x80000002, - D2D1_PROPERTY_CATEGORY = 0x80000003, - D2D1_PROPERTY_DESCRIPTION = 0x80000004, - D2D1_PROPERTY_INPUTS = 0x80000005, - D2D1_PROPERTY_CACHED = 0x80000006, - D2D1_PROPERTY_PRECISION = 0x80000007, - D2D1_PROPERTY_MIN_INPUTS = 0x80000008, - D2D1_PROPERTY_MAX_INPUTS = 0x80000009, - D2D1_PROPERTY_FORCE_DWORD = 0xffffffff -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/D2D1_PROPERTY_TYPE.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/D2D1_PROPERTY_TYPE.cs deleted file mode 100644 index 7c727b61..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/D2D1_PROPERTY_TYPE.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 um/d2d1_1.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -namespace ComputeSharp.Win32; - -internal enum D2D1_PROPERTY_TYPE : uint -{ - D2D1_PROPERTY_TYPE_UNKNOWN = 0, - D2D1_PROPERTY_TYPE_BOOL = 2, - D2D1_PROPERTY_TYPE_BLOB = 9, - D2D1_PROPERTY_TYPE_IUNKNOWN = 10 -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/ID2D1CommandList.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/ID2D1CommandList.cs deleted file mode 100644 index 77932eef..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/ID2D1CommandList.cs +++ /dev/null @@ -1,42 +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 um/d2d1_1.h in the Windows SDK for Windows 10.0.22621.0 -// Original source is Copyright © Microsoft. All rights reserved. - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace ComputeSharp.Win32; - -[NativeTypeName("struct ID2D1CommandList : ID2D1Image")] -[NativeInheritance("ID2D1Image")] -internal unsafe partial struct ID2D1CommandList : IComObject -{ - /// - static Guid* IComObject.IID - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - ReadOnlySpan data = - [ - 0x19, 0x4A, 0xF3, 0xB4, - 0x83, 0x23, - 0x76, 0x4D, - 0x94, - 0xF6, - 0xEC, - 0x34, - 0x36, - 0x57, - 0xC3, - 0xDC - ]; - - return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data)); - } - } - - public void** lpVtbl; -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/ID2D1DeviceContext.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/ID2D1DeviceContext.cs deleted file mode 100644 index 367ec1db..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/ID2D1DeviceContext.cs +++ /dev/null @@ -1,44 +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 um/d2d1_1.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -using System; -using System.Runtime.CompilerServices; - -namespace ComputeSharp.Win32; - -[NativeTypeName("struct ID2D1DeviceContext : ID2D1RenderTarget")] -[NativeInheritance("ID2D1RenderTarget")] -internal unsafe partial struct ID2D1DeviceContext -{ - public void** lpVtbl; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(3)] - public void GetFactory(ID2D1Factory** factory) - { - ((delegate* unmanaged[MemberFunction])(lpVtbl[3]))((ID2D1DeviceContext*)Unsafe.AsPointer(ref this), factory); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(52)] - public void GetDpi(float* dpiX, float* dpiY) - { - ((delegate* unmanaged[MemberFunction])(lpVtbl[52]))((ID2D1DeviceContext*)Unsafe.AsPointer(ref this), dpiX, dpiY); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(63)] - public HRESULT CreateEffect([NativeTypeName("const IID &")] Guid* effectId, ID2D1Effect** effect) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[63]))((ID2D1DeviceContext*)Unsafe.AsPointer(ref this), effectId, effect); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(75)] - public void GetTarget(ID2D1Image** image) - { - ((delegate* unmanaged[MemberFunction])(lpVtbl[75]))((ID2D1DeviceContext*)Unsafe.AsPointer(ref this), image); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/ID2D1Effect.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/ID2D1Effect.cs deleted file mode 100644 index 29dc9fb1..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/ID2D1Effect.cs +++ /dev/null @@ -1,43 +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 um/d2d1_1.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -using System.Runtime.CompilerServices; - -namespace ComputeSharp.Win32; - -[NativeTypeName("struct ID2D1Effect : ID2D1Properties")] -[NativeInheritance("ID2D1Properties")] -internal unsafe partial struct ID2D1Effect -{ - public void** lpVtbl; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(9)] - public HRESULT SetValue([NativeTypeName("UINT32")] uint index, D2D1_PROPERTY_TYPE type, [NativeTypeName("const BYTE *")] byte* data, [NativeTypeName("UINT32")] uint dataSize) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[9]))((ID2D1Effect*)Unsafe.AsPointer(ref this), index, type, data, dataSize); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(11)] - public HRESULT GetValue([NativeTypeName("UINT32")] uint index, D2D1_PROPERTY_TYPE type, byte* data, [NativeTypeName("UINT32")] uint dataSize) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[11]))((ID2D1Effect*)Unsafe.AsPointer(ref this), index, type, data, dataSize); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(14)] - public void SetInput([NativeTypeName("UINT32")] uint index, ID2D1Image* input, [NativeTypeName("BOOL")] int invalidate = 1) - { - ((delegate* unmanaged[MemberFunction])(lpVtbl[14]))((ID2D1Effect*)Unsafe.AsPointer(ref this), index, input, invalidate); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(16)] - public void GetInput([NativeTypeName("UINT32")] uint index, ID2D1Image** input) - { - ((delegate* unmanaged[MemberFunction])(lpVtbl[16]))((ID2D1Effect*)Unsafe.AsPointer(ref this), index, input); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/ID2D1Factory1.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/ID2D1Factory1.cs deleted file mode 100644 index b8b0b22d..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/ID2D1Factory1.cs +++ /dev/null @@ -1,49 +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 um/d2d1_1.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace ComputeSharp.Win32; - -[NativeTypeName("struct ID2D1Factory1 : ID2D1Factory")] -[NativeInheritance("ID2D1Factory")] -internal unsafe partial struct ID2D1Factory1 : IComObject -{ - /// - static Guid* IComObject.IID - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - ReadOnlySpan data = - [ - 0x62, 0xD3, 0x12, 0xBB, - 0xEE, 0xDA, - 0x9A, 0x4B, - 0xAA, - 0x1D, - 0x14, - 0xBA, - 0x40, - 0x1C, - 0xFA, - 0x1F - ]; - - return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data)); - } - } - - public void** lpVtbl; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(23)] - public HRESULT RegisterEffectFromString([NativeTypeName("const IID &")] Guid* classId, [NativeTypeName("PCWSTR")] ushort* propertyXml, [NativeTypeName("const D2D1_PROPERTY_BINDING *")] D2D1_PROPERTY_BINDING* bindings, [NativeTypeName("UINT32")] uint bindingsCount, [NativeTypeName("const PD2D1_EFFECT_FACTORY")] delegate* unmanaged effectFactory) - { - return ((delegate* unmanaged[MemberFunction], int>)(lpVtbl[23]))((ID2D1Factory1*)Unsafe.AsPointer(ref this), classId, propertyXml, bindings, bindingsCount, effectFactory); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/ID2D1Multithread.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/ID2D1Multithread.cs deleted file mode 100644 index db877d5e..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_1/ID2D1Multithread.cs +++ /dev/null @@ -1,89 +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 um/d2d1_1.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace ComputeSharp.Win32; - -[NativeTypeName("struct ID2D1Multithread : IUnknown")] -[NativeInheritance("IUnknown")] -internal unsafe partial struct ID2D1Multithread : IComObject -{ - /// - static Guid* IComObject.IID - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - ReadOnlySpan data = - [ - 0xBC, 0xE7, 0xE6, 0x31, - 0xFF, 0xE0, - 0x46, 0x4D, - 0x8C, - 0x64, - 0xA0, - 0xA8, - 0xC4, - 0x1C, - 0x15, - 0xD3 - ]; - - return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data)); - } - } - - public void** lpVtbl; - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(0)] - public HRESULT QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[0]))((ID2D1Multithread*)Unsafe.AsPointer(ref this), riid, ppvObject); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(1)] - [return: NativeTypeName("ULONG")] - public uint AddRef() - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[1]))((ID2D1Multithread*)Unsafe.AsPointer(ref this)); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(2)] - [return: NativeTypeName("ULONG")] - public uint Release() - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[2]))((ID2D1Multithread*)Unsafe.AsPointer(ref this)); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(3)] - public int GetMultithreadProtected() - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[3]))((ID2D1Multithread*)Unsafe.AsPointer(ref this)); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(4)] - public void Enter() - { - ((delegate* unmanaged[MemberFunction])(lpVtbl[4]))((ID2D1Multithread*)Unsafe.AsPointer(ref this)); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(5)] - public void Leave() - { - ((delegate* unmanaged[MemberFunction])(lpVtbl[5]))((ID2D1Multithread*)Unsafe.AsPointer(ref this)); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_2/ID2D1Device1.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_2/ID2D1Device1.cs deleted file mode 100644 index 1954877e..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1_2/ID2D1Device1.cs +++ /dev/null @@ -1,75 +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 um/d2d1_2.h in the Windows SDK for Windows 10.0.22621.0 -// Original source is Copyright © Microsoft. All rights reserved. - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace ComputeSharp.Win32; - -[NativeTypeName("struct ID2D1Device1 : ID2D1Device")] -[NativeInheritance("ID2D1Device")] -internal unsafe partial struct ID2D1Device1 : IComObject -{ - /// - static Guid* IComObject.IID - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - ReadOnlySpan data = - [ - 0xE1, 0x68, 0x17, 0xD2, - 0xA4, 0x23, - 0x23, 0x48, - 0xA1, - 0x4B, - 0x7C, - 0x3E, - 0xBA, - 0x85, - 0xD6, - 0x58 - ]; - - return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data)); - } - } - - public void** lpVtbl; - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(0)] - public HRESULT QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[0]))((ID2D1Device1*)Unsafe.AsPointer(ref this), riid, ppvObject); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(1)] - [return: NativeTypeName("ULONG")] - public uint AddRef() - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[1]))((ID2D1Device1*)Unsafe.AsPointer(ref this)); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(2)] - [return: NativeTypeName("ULONG")] - public uint Release() - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[2]))((ID2D1Device1*)Unsafe.AsPointer(ref this)); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(3)] - public void GetFactory(ID2D1Factory** factory) - { - ((delegate* unmanaged[MemberFunction])(lpVtbl[3]))((ID2D1Device1*)Unsafe.AsPointer(ref this), factory); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/D2D1_CHANGE_TYPE.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/D2D1_CHANGE_TYPE.cs deleted file mode 100644 index fc2416fe..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/D2D1_CHANGE_TYPE.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 um/d2d1effectauthor.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -using System; - -namespace ComputeSharp.Win32; - -[Flags] -internal enum D2D1_CHANGE_TYPE : uint -{ - D2D1_CHANGE_TYPE_NONE = 0, - D2D1_CHANGE_TYPE_PROPERTIES = 1, - D2D1_CHANGE_TYPE_CONTEXT = 2, - D2D1_CHANGE_TYPE_GRAPH = 3, - D2D1_CHANGE_TYPE_FORCE_DWORD = 0xffffffff, -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/D2D1_FEATURE.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/D2D1_FEATURE.cs deleted file mode 100644 index 9d92117a..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/D2D1_FEATURE.cs +++ /dev/null @@ -1,13 +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 um/d2d1effectauthor.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -namespace ComputeSharp.Win32; - -internal enum D2D1_FEATURE : uint -{ - D2D1_FEATURE_DOUBLES = 0, - D2D1_FEATURE_D3D10_X_HARDWARE_OPTIONS = 1, - D2D1_FEATURE_FORCE_DWORD = 0xffffffff -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/D2D1_FEATURE_DATA_DOUBLES.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/D2D1_FEATURE_DATA_DOUBLES.cs deleted file mode 100644 index 1de0cb63..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/D2D1_FEATURE_DATA_DOUBLES.cs +++ /dev/null @@ -1,11 +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 um/d2d1effectauthor.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -namespace ComputeSharp.Win32; - -internal partial struct D2D1_FEATURE_DATA_DOUBLES -{ - public int doublePrecisionFloatShaderOps; -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/D2D1_FILTER.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/D2D1_FILTER.cs deleted file mode 100644 index 18b9f3a5..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/D2D1_FILTER.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 um/d2d1effectauthor.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -namespace ComputeSharp.Win32; - -internal enum D2D1_FILTER : uint -{ - D2D1_FILTER_MIN_MAG_MIP_POINT = 0x00, - D2D1_FILTER_MIN_MAG_POINT_MIP_LINEAR = 0x01, - D2D1_FILTER_MIN_POINT_MAG_LINEAR_MIP_POINT = 0x04, - D2D1_FILTER_MIN_POINT_MAG_MIP_LINEAR = 0x05, - D2D1_FILTER_MIN_LINEAR_MAG_MIP_POINT = 0x10, - D2D1_FILTER_MIN_LINEAR_MAG_POINT_MIP_LINEAR = 0x11, - D2D1_FILTER_MIN_MAG_LINEAR_MIP_POINT = 0x14, - D2D1_FILTER_MIN_MAG_MIP_LINEAR = 0x15, - D2D1_FILTER_ANISOTROPIC = 0x55, - D2D1_FILTER_FORCE_DWORD = 0xffffffff -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/D2D1_INPUT_DESCRIPTION.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/D2D1_INPUT_DESCRIPTION.cs deleted file mode 100644 index 52b5b97a..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/D2D1_INPUT_DESCRIPTION.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 um/d2d1effectauthor.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -namespace ComputeSharp.Win32; - -internal partial struct D2D1_INPUT_DESCRIPTION -{ - public D2D1_FILTER filter; - - [NativeTypeName("UINT32")] - public uint levelOfDetailCount; -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/D2D1_PIXEL_OPTIONS.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/D2D1_PIXEL_OPTIONS.cs deleted file mode 100644 index c2e2677c..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/D2D1_PIXEL_OPTIONS.cs +++ /dev/null @@ -1,16 +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 um/d2d1effectauthor.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -using System; - -namespace ComputeSharp.Win32; - -[Flags] -internal enum D2D1_PIXEL_OPTIONS : uint -{ - D2D1_PIXEL_OPTIONS_NONE = 0, - D2D1_PIXEL_OPTIONS_TRIVIAL_SAMPLING = 1, - D2D1_PIXEL_OPTIONS_FORCE_DWORD = 0xffffffff, -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/D2D1_PROPERTY_BINDING.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/D2D1_PROPERTY_BINDING.cs deleted file mode 100644 index 0db6630d..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/D2D1_PROPERTY_BINDING.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 um/d2d1effectauthor.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -namespace ComputeSharp.Win32; - -internal unsafe partial struct D2D1_PROPERTY_BINDING -{ - [NativeTypeName("PCWSTR")] - public ushort* propertyName; - - [NativeTypeName("PD2D1_PROPERTY_SET_FUNCTION")] - public delegate* unmanaged setFunction; - - [NativeTypeName("PD2D1_PROPERTY_GET_FUNCTION")] - public delegate* unmanaged getFunction; -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/D2D1_RESOURCE_TEXTURE_PROPERTIES.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/D2D1_RESOURCE_TEXTURE_PROPERTIES.cs deleted file mode 100644 index 088fc58e..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/D2D1_RESOURCE_TEXTURE_PROPERTIES.cs +++ /dev/null @@ -1,24 +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 um/d2d1effectauthor.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -namespace ComputeSharp.Win32; - -internal unsafe partial struct D2D1_RESOURCE_TEXTURE_PROPERTIES -{ - [NativeTypeName("const UINT32 *")] - public uint* extents; - - [NativeTypeName("UINT32")] - public uint dimensions; - - public D2D1_BUFFER_PRECISION bufferPrecision; - - public D2D1_CHANNEL_DEPTH channelDepth; - - public D2D1_FILTER filter; - - [NativeTypeName("const D2D1_EXTEND_MODE *")] - public D2D1_EXTEND_MODE* extendModes; -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/ID2D1DrawInfo.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/ID2D1DrawInfo.cs deleted file mode 100644 index 8c2c0dd2..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/ID2D1DrawInfo.cs +++ /dev/null @@ -1,68 +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 um/d2d1effectauthor.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -using System; -using System.Runtime.CompilerServices; -using static ComputeSharp.Win32.D2D1_PIXEL_OPTIONS; - -namespace ComputeSharp.Win32; - -[NativeTypeName("struct ID2D1DrawInfo : ID2D1RenderInfo")] -[NativeInheritance("ID2D1RenderInfo")] -internal unsafe partial struct ID2D1DrawInfo -{ - public void** lpVtbl; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(1)] - [return: NativeTypeName("ULONG")] - public uint AddRef() - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[1]))((IUnknown*)Unsafe.AsPointer(ref this)); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(2)] - [return: NativeTypeName("ULONG")] - public uint Release() - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[2]))((IUnknown*)Unsafe.AsPointer(ref this)); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(3)] - public HRESULT SetInputDescription([NativeTypeName("UINT32")] uint inputIndex, D2D1_INPUT_DESCRIPTION inputDescription) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[3]))((ID2D1DrawInfo*)Unsafe.AsPointer(ref this), inputIndex, inputDescription); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(4)] - public HRESULT SetOutputBuffer(D2D1_BUFFER_PRECISION bufferPrecision, D2D1_CHANNEL_DEPTH channelDepth) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[4]))((ID2D1DrawInfo*)Unsafe.AsPointer(ref this), bufferPrecision, channelDepth); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(7)] - public HRESULT SetPixelShaderConstantBuffer([NativeTypeName("const BYTE *")] byte* buffer, [NativeTypeName("UINT32")] uint bufferCount) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[7]))((ID2D1DrawInfo*)Unsafe.AsPointer(ref this), buffer, bufferCount); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(8)] - public HRESULT SetResourceTexture([NativeTypeName("UINT32")] uint textureIndex, ID2D1ResourceTexture* resourceTexture) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[8]))((ID2D1DrawInfo*)Unsafe.AsPointer(ref this), textureIndex, resourceTexture); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(10)] - public HRESULT SetPixelShader([NativeTypeName("const GUID &")] Guid* shaderId, D2D1_PIXEL_OPTIONS pixelOptions = D2D1_PIXEL_OPTIONS_NONE) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[10]))((ID2D1DrawInfo*)Unsafe.AsPointer(ref this), shaderId, pixelOptions); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/ID2D1DrawTransform.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/ID2D1DrawTransform.cs deleted file mode 100644 index dd7b6e8c..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/ID2D1DrawTransform.cs +++ /dev/null @@ -1,101 +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 um/d2d1effectauthor.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace ComputeSharp.Win32; - -[NativeTypeName("struct ID2D1DrawTransform : ID2D1Transform")] -[NativeInheritance("ID2D1Transform")] -internal unsafe partial struct ID2D1DrawTransform : IComObject -{ - /// - static Guid* IComObject.IID - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - ReadOnlySpan data = - [ - 0xB6, 0xDC, 0xBF, 0x36, - 0x39, 0x97, - 0x5D, 0x43, - 0xA3, - 0x0D, - 0xA6, - 0x53, - 0xBE, - 0xFF, - 0x6A, - 0x6F - ]; - - return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data)); - } - } - - public void** lpVtbl; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(0)] - public HRESULT QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[0]))((ID2D1DrawTransform*)Unsafe.AsPointer(ref this), riid, ppvObject); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(1)] - [return: NativeTypeName("ULONG")] - public uint AddRef() - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[1]))((ID2D1DrawTransform*)Unsafe.AsPointer(ref this)); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(2)] - [return: NativeTypeName("ULONG")] - public uint Release() - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[2]))((ID2D1DrawTransform*)Unsafe.AsPointer(ref this)); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(3)] - [return: NativeTypeName("UINT32")] - public uint GetInputCount() - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[3]))((ID2D1DrawTransform*)Unsafe.AsPointer(ref this)); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(4)] - public HRESULT MapOutputRectToInputRects([NativeTypeName("const D2D1_RECT_L *")] RECT* outputRect, [NativeTypeName("D2D1_RECT_L *")] RECT* inputRects, [NativeTypeName("UINT32")] uint inputRectsCount) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[4]))((ID2D1DrawTransform*)Unsafe.AsPointer(ref this), outputRect, inputRects, inputRectsCount); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(5)] - public HRESULT MapInputRectsToOutputRect([NativeTypeName("const D2D1_RECT_L *")] RECT* inputRects, [NativeTypeName("const D2D1_RECT_L *")] RECT* inputOpaqueSubRects, [NativeTypeName("UINT32")] uint inputRectCount, [NativeTypeName("D2D1_RECT_L *")] RECT* outputRect, [NativeTypeName("D2D1_RECT_L *")] RECT* outputOpaqueSubRect) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[5]))((ID2D1DrawTransform*)Unsafe.AsPointer(ref this), inputRects, inputOpaqueSubRects, inputRectCount, outputRect, outputOpaqueSubRect); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(6)] - public HRESULT MapInvalidRect([NativeTypeName("UINT32")] uint inputIndex, [NativeTypeName("D2D1_RECT_L")] RECT invalidInputRect, [NativeTypeName("D2D1_RECT_L *")] RECT* invalidOutputRect) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[6]))((ID2D1DrawTransform*)Unsafe.AsPointer(ref this), inputIndex, invalidInputRect, invalidOutputRect); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(7)] - public HRESULT SetDrawInfo(ID2D1DrawInfo* drawInfo) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[7]))((ID2D1DrawTransform*)Unsafe.AsPointer(ref this), drawInfo); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/ID2D1EffectContext.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/ID2D1EffectContext.cs deleted file mode 100644 index 459d39ba..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/ID2D1EffectContext.cs +++ /dev/null @@ -1,81 +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 um/d2d1effectauthor.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -using System; -using System.Runtime.CompilerServices; - -namespace ComputeSharp.Win32; - -[NativeTypeName("struct ID2D1EffectContext : IUnknown")] -[NativeInheritance("IUnknown")] -internal unsafe partial struct ID2D1EffectContext -{ - public void** lpVtbl; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(0)] - public HRESULT QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[0]))((IUnknown*)Unsafe.AsPointer(ref this), riid, ppvObject); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(1)] - [return: NativeTypeName("ULONG")] - public uint AddRef() - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[1]))((IUnknown*)Unsafe.AsPointer(ref this)); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(2)] - [return: NativeTypeName("ULONG")] - public uint Release() - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[2]))((IUnknown*)Unsafe.AsPointer(ref this)); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(4)] - public HRESULT CreateEffect([NativeTypeName("const IID &")] Guid* effectId, void** effect) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[4]))((ID2D1EffectContext*)Unsafe.AsPointer(ref this), effectId, effect); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(5)] - public HRESULT GetMaximumSupportedFeatureLevel([NativeTypeName("const D3D_FEATURE_LEVEL *")] D3D_FEATURE_LEVEL* featureLevels, [NativeTypeName("UINT32")] uint featureLevelsCount, D3D_FEATURE_LEVEL* maximumSupportedFeatureLevel) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[5]))((ID2D1EffectContext*)Unsafe.AsPointer(ref this), featureLevels, featureLevelsCount, maximumSupportedFeatureLevel); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(11)] - public HRESULT LoadPixelShader([NativeTypeName("const GUID &")] Guid* shaderId, [NativeTypeName("const BYTE *")] byte* shaderBuffer, [NativeTypeName("UINT32")] uint shaderBufferCount) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[11]))((ID2D1EffectContext*)Unsafe.AsPointer(ref this), shaderId, shaderBuffer, shaderBufferCount); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(14)] - public int IsShaderLoaded([NativeTypeName("const GUID &")] Guid* shaderId) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[14]))((ID2D1EffectContext*)Unsafe.AsPointer(ref this), shaderId); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(15)] - public HRESULT CreateResourceTexture([NativeTypeName("const GUID *")] Guid* resourceId, [NativeTypeName("const D2D1_RESOURCE_TEXTURE_PROPERTIES *")] D2D1_RESOURCE_TEXTURE_PROPERTIES* resourceTextureProperties, [NativeTypeName("const BYTE *")] byte* data, [NativeTypeName("const UINT32 *")] uint* strides, [NativeTypeName("UINT32")] uint dataSize, ID2D1ResourceTexture** resourceTexture) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[15]))((ID2D1EffectContext*)Unsafe.AsPointer(ref this), resourceId, resourceTextureProperties, data, strides, dataSize, resourceTexture); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(22)] - public HRESULT CheckFeatureSupport(D2D1_FEATURE feature, void* featureSupportData, [NativeTypeName("UINT32")] uint featureSupportDataSize) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[22]))((ID2D1EffectContext*)Unsafe.AsPointer(ref this), feature, featureSupportData, featureSupportDataSize); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/ID2D1EffectImpl.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/ID2D1EffectImpl.cs deleted file mode 100644 index e75eb34e..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/ID2D1EffectImpl.cs +++ /dev/null @@ -1,86 +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 um/d2d1effectauthor.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace ComputeSharp.Win32; - -[NativeTypeName("struct ID2D1EffectImpl : IUnknown")] -[NativeInheritance("IUnknown")] -internal unsafe partial struct ID2D1EffectImpl : IComObject -{ - /// - static Guid* IComObject.IID - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - ReadOnlySpan data = - [ - 0x3F, 0xFD, 0x48, 0xA2, - 0x6C, 0x3E, - 0x63, 0x4E, - 0x9F, - 0x03, - 0x7F, - 0x68, - 0xEC, - 0xC9, - 0x1D, - 0xB9 - ]; - - return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data)); - } - } - - public void** lpVtbl; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(0)] - public HRESULT QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[0]))((ID2D1EffectImpl*)Unsafe.AsPointer(ref this), riid, ppvObject); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(1)] - [return: NativeTypeName("ULONG")] - public uint AddRef() - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[1]))((ID2D1EffectImpl*)Unsafe.AsPointer(ref this)); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(2)] - [return: NativeTypeName("ULONG")] - public uint Release() - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[2]))((ID2D1EffectImpl*)Unsafe.AsPointer(ref this)); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(3)] - public HRESULT Initialize(ID2D1EffectContext* effectContext, ID2D1TransformGraph* transformGraph) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[3]))((ID2D1EffectImpl*)Unsafe.AsPointer(ref this), effectContext, transformGraph); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(4)] - public HRESULT PrepareForRender(D2D1_CHANGE_TYPE changeType) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[4]))((ID2D1EffectImpl*)Unsafe.AsPointer(ref this), changeType); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(5)] - public HRESULT SetGraph(ID2D1TransformGraph* transformGraph) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[5]))((ID2D1EffectImpl*)Unsafe.AsPointer(ref this), transformGraph); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/ID2D1ResourceTexture.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/ID2D1ResourceTexture.cs deleted file mode 100644 index b7aaeec0..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/ID2D1ResourceTexture.cs +++ /dev/null @@ -1,49 +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 um/d2d1effectauthor.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -using System; -using System.Runtime.CompilerServices; - -namespace ComputeSharp.Win32; - -[NativeTypeName("struct ID2D1ResourceTexture : IUnknown")] -[NativeInheritance("IUnknown")] -internal unsafe partial struct ID2D1ResourceTexture -{ - public void** lpVtbl; - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(0)] - public HRESULT QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[0]))((ID2D1ResourceTexture*)Unsafe.AsPointer(ref this), riid, ppvObject); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(1)] - [return: NativeTypeName("ULONG")] - public uint AddRef() - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[1]))((ID2D1ResourceTexture*)Unsafe.AsPointer(ref this)); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(2)] - [return: NativeTypeName("ULONG")] - public uint Release() - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[2]))((ID2D1ResourceTexture*)Unsafe.AsPointer(ref this)); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(3)] - public HRESULT Update([NativeTypeName("const UINT32 *")] uint* minimumExtents, [NativeTypeName("const UINT32 *")] uint* maximimumExtents, [NativeTypeName("const UINT32 *")] uint* strides, [NativeTypeName("UINT32")] uint dimensions, [NativeTypeName("const BYTE *")] byte* data, [NativeTypeName("UINT32")] uint dataCount) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[3]))((ID2D1ResourceTexture*)Unsafe.AsPointer(ref this), minimumExtents, maximimumExtents, strides, dimensions, data, dataCount); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/ID2D1Transform.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/ID2D1Transform.cs deleted file mode 100644 index 991fb7b1..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/ID2D1Transform.cs +++ /dev/null @@ -1,42 +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 um/d2d1effectauthor.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace ComputeSharp.Win32; - -[NativeTypeName("struct ID2D1Transform : ID2D1TransformNode")] -[NativeInheritance("ID2D1TransformNode")] -internal unsafe partial struct ID2D1Transform : IComObject -{ - /// - static Guid* IComObject.IID - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - ReadOnlySpan data = - [ - 0x7D, 0x28, 0x1A, 0xEF, - 0x2A, 0x34, - 0x76, 0x4F, - 0x8F, - 0xDB, - 0xDA, - 0x0D, - 0x6E, - 0xA9, - 0xF9, - 0x2B - ]; - - return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data)); - } - } - - public void** lpVtbl; -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/ID2D1TransformGraph.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/ID2D1TransformGraph.cs deleted file mode 100644 index a1e50a18..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/ID2D1TransformGraph.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 um/d2d1effectauthor.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -using System.Runtime.CompilerServices; - -namespace ComputeSharp.Win32; - -[NativeTypeName("struct ID2D1TransformGraph : IUnknown")] -[NativeInheritance("IUnknown")] -internal unsafe partial struct ID2D1TransformGraph -{ - public void** lpVtbl; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(4)] - public HRESULT SetSingleTransformNode(ID2D1TransformNode* node) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[4]))((ID2D1TransformGraph*)Unsafe.AsPointer(ref this), node); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/ID2D1TransformNode.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/ID2D1TransformNode.cs deleted file mode 100644 index fc7ce887..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effectauthor/ID2D1TransformNode.cs +++ /dev/null @@ -1,42 +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 um/d2d1effectauthor.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace ComputeSharp.Win32; - -[NativeTypeName("struct ID2D1TransformNode : IUnknown")] -[NativeInheritance("IUnknown")] -internal unsafe partial struct ID2D1TransformNode : IComObject -{ - /// - static Guid* IComObject.IID - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - ReadOnlySpan data = - [ - 0xE7, 0xE1, 0xEF, 0xB2, - 0x9F, 0x72, - 0x02, 0x41, - 0x94, - 0x9F, - 0x50, - 0x5F, - 0xA2, - 0x1B, - 0xF6, - 0x66 - ]; - - return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data)); - } - } - - public void** lpVtbl; -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effects/CLSID.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effects/CLSID.cs deleted file mode 100644 index dad2dca8..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effects/CLSID.cs +++ /dev/null @@ -1,63 +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 um/d2d1effects.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace ComputeSharp.Win32; - -internal static partial class CLSID -{ - [NativeTypeName("const GUID")] - public static ref readonly Guid CLSID_D2D1Flood - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - ReadOnlySpan data = - [ - 0x20, 0x3C, 0xC2, 0x61, - 0x69, 0xAE, - 0x8E, 0x4D, - 0x94, - 0xCF, - 0x50, - 0x07, - 0x8D, - 0xF6, - 0x38, - 0xF2 - ]; - - return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); - } - } - - [NativeTypeName("const GUID")] - public static ref readonly Guid CLSID_D2D1DpiCompensation - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - ReadOnlySpan data = - [ - 0xC7, 0xC5, 0x26, 0x6C, - 0xE0, 0x34, - 0xFC, 0x46, - 0x9C, - 0xFD, - 0xE5, - 0x82, - 0x37, - 0x06, - 0xE2, - 0x28 - ]; - - return ref Unsafe.As(ref MemoryMarshal.GetReference(data)); - } - } -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effects/D2D1_BORDER_MODE.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effects/D2D1_BORDER_MODE.cs deleted file mode 100644 index e96e22a4..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effects/D2D1_BORDER_MODE.cs +++ /dev/null @@ -1,13 +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 um/d2d1effects.h in the Windows SDK for Windows 10.0.22621.0 -// Original source is Copyright © Microsoft. All rights reserved. - -namespace ComputeSharp.Win32; - -internal enum D2D1_BORDER_MODE : uint -{ - D2D1_BORDER_MODE_SOFT = 0, - D2D1_BORDER_MODE_HARD = 1, - D2D1_BORDER_MODE_FORCE_DWORD = 0xffffffff, -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effects/D2D1_DPICOMPENSATION_INTERPOLATION_MODE.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effects/D2D1_DPICOMPENSATION_INTERPOLATION_MODE.cs deleted file mode 100644 index f020bb49..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effects/D2D1_DPICOMPENSATION_INTERPOLATION_MODE.cs +++ /dev/null @@ -1,17 +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 um/d2d1effects.h in the Windows SDK for Windows 10.0.22621.0 -// Original source is Copyright © Microsoft. All rights reserved. - -namespace ComputeSharp.Win32; - -internal enum D2D1_DPICOMPENSATION_INTERPOLATION_MODE : uint -{ - D2D1_DPICOMPENSATION_INTERPOLATION_MODE_NEAREST_NEIGHBOR = 0, - D2D1_DPICOMPENSATION_INTERPOLATION_MODE_LINEAR = 1, - D2D1_DPICOMPENSATION_INTERPOLATION_MODE_CUBIC = 2, - D2D1_DPICOMPENSATION_INTERPOLATION_MODE_MULTI_SAMPLE_LINEAR = 3, - D2D1_DPICOMPENSATION_INTERPOLATION_MODE_ANISOTROPIC = 4, - D2D1_DPICOMPENSATION_INTERPOLATION_MODE_HIGH_QUALITY_CUBIC = 5, - D2D1_DPICOMPENSATION_INTERPOLATION_MODE_FORCE_DWORD = 0xffffffff, -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effects/D2D1_DPICOMPENSATION_PROP.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effects/D2D1_DPICOMPENSATION_PROP.cs deleted file mode 100644 index 5ba834e9..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d2d1effects/D2D1_DPICOMPENSATION_PROP.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 um/d2d1effects.h in the Windows SDK for Windows 10.0.22621.0 -// Original source is Copyright © Microsoft. All rights reserved. - -namespace ComputeSharp.Win32; - -internal enum D2D1_DPICOMPENSATION_PROP : uint -{ - D2D1_DPICOMPENSATION_PROP_INTERPOLATION_MODE = 0, - D2D1_DPICOMPENSATION_PROP_BORDER_MODE = 1, - D2D1_DPICOMPENSATION_PROP_INPUT_DPI = 2, - D2D1_DPICOMPENSATION_PROP_FORCE_DWORD = 0xffffffff, -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d3d11shader/D3D11_SHADER_DESC.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d3d11shader/D3D11_SHADER_DESC.cs deleted file mode 100644 index 5b24cd13..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d3d11shader/D3D11_SHADER_DESC.cs +++ /dev/null @@ -1,86 +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 um/d3d11shader.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -namespace ComputeSharp.Win32; - -internal unsafe partial struct D3D11_SHADER_DESC -{ - public uint Version; - - [NativeTypeName("LPCSTR")] - public sbyte* Creator; - - public uint Flags; - - public uint ConstantBuffers; - - public uint BoundResources; - - public uint InputParameters; - - public uint OutputParameters; - - public uint InstructionCount; - - public uint TempRegisterCount; - - public uint TempArrayCount; - - public uint DefCount; - - public uint DclCount; - - public uint TextureNormalInstructions; - - public uint TextureLoadInstructions; - - public uint TextureCompInstructions; - - public uint TextureBiasInstructions; - - public uint TextureGradientInstructions; - - public uint FloatInstructionCount; - - public uint IntInstructionCount; - - public uint UintInstructionCount; - - public uint StaticFlowControlCount; - - public uint DynamicFlowControlCount; - - public uint MacroInstructionCount; - - public uint ArrayInstructionCount; - - public uint CutInstructionCount; - - public uint EmitInstructionCount; - - public D3D_PRIMITIVE_TOPOLOGY GSOutputTopology; - - public uint GSMaxOutputVertexCount; - - public D3D_PRIMITIVE InputPrimitive; - - public uint PatchConstantParameters; - - public uint cGSInstanceCount; - - public uint cControlPoints; - - public D3D_TESSELLATOR_OUTPUT_PRIMITIVE HSOutputPrimitive; - - public D3D_TESSELLATOR_PARTITIONING HSPartitioning; - - public D3D_TESSELLATOR_DOMAIN TessellatorDomain; - - public uint cBarrierInstructions; - - public uint cInterlockedInstructions; - - public uint cTextureStoreInstructions; -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d3d11shader/ID3D11ShaderReflection.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d3d11shader/ID3D11ShaderReflection.cs deleted file mode 100644 index db36cffc..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d3d11shader/ID3D11ShaderReflection.cs +++ /dev/null @@ -1,139 +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 um/d3d11shader.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -using System; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -namespace ComputeSharp.Win32; - -[NativeTypeName("struct ID3D11ShaderReflection : IUnknown")] -[NativeInheritance("IUnknown")] -internal unsafe partial struct ID3D11ShaderReflection : IComObject -{ - /// - static Guid* IComObject.IID - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get - { - ReadOnlySpan data = - [ - 0xA1, 0x6C, 0x53, 0x8D, - 0xCA, 0x0C, - 0x56, 0x49, - 0xA8, - 0x37, - 0x78, - 0x69, - 0x63, - 0x75, - 0x55, - 0x84 - ]; - - return (Guid*)Unsafe.AsPointer(ref MemoryMarshal.GetReference(data)); - } - } - - public void** lpVtbl; - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(0)] - public HRESULT QueryInterface([NativeTypeName("const IID &")] Guid* riid, void** ppvObject) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[0]))((ID3D11ShaderReflection*)Unsafe.AsPointer(ref this), riid, ppvObject); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(1)] - [return: NativeTypeName("ULONG")] - public uint AddRef() - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[1]))((ID3D11ShaderReflection*)Unsafe.AsPointer(ref this)); - } - - /// - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(2)] - [return: NativeTypeName("ULONG")] - public uint Release() - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[2]))((ID3D11ShaderReflection*)Unsafe.AsPointer(ref this)); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(3)] - public HRESULT GetDesc(D3D11_SHADER_DESC* pDesc) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[3]))((ID3D11ShaderReflection*)Unsafe.AsPointer(ref this), pDesc); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(12)] - public uint GetMovInstructionCount() - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[12]))((ID3D11ShaderReflection*)Unsafe.AsPointer(ref this)); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(13)] - public uint GetMovcInstructionCount() - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[13]))((ID3D11ShaderReflection*)Unsafe.AsPointer(ref this)); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(14)] - public uint GetConversionInstructionCount() - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[14]))((ID3D11ShaderReflection*)Unsafe.AsPointer(ref this)); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(15)] - public uint GetBitwiseInstructionCount() - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[15]))((ID3D11ShaderReflection*)Unsafe.AsPointer(ref this)); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(16)] - public D3D_PRIMITIVE GetGSInputPrimitive() - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[16]))((ID3D11ShaderReflection*)Unsafe.AsPointer(ref this)); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(18)] - public uint GetNumInterfaceSlots() - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[18]))((ID3D11ShaderReflection*)Unsafe.AsPointer(ref this)); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(19)] - public HRESULT GetMinFeatureLevel([NativeTypeName("enum D3D_FEATURE_LEVEL *")] D3D_FEATURE_LEVEL* pLevel) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[19]))((ID3D11ShaderReflection*)Unsafe.AsPointer(ref this), pLevel); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(20)] - public uint GetThreadGroupSize(uint* pSizeX, uint* pSizeY, uint* pSizeZ) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[20]))((ID3D11ShaderReflection*)Unsafe.AsPointer(ref this), pSizeX, pSizeY, pSizeZ); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(21)] - [return: NativeTypeName("UINT64")] - public ulong GetRequiresFlags() - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[21]))((ID3D11ShaderReflection*)Unsafe.AsPointer(ref this)); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcommon/D3D_INCLUDE_TYPE.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcommon/D3D_INCLUDE_TYPE.cs deleted file mode 100644 index b7d51c2f..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcommon/D3D_INCLUDE_TYPE.cs +++ /dev/null @@ -1,15 +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 d3dcommon.h in Microsoft.Direct3D.D3D12 v1.600.10 -// Original source is Copyright © Microsoft. Licensed under the MIT license - -namespace ComputeSharp.Win32; - -internal enum D3D_INCLUDE_TYPE -{ - D3D_INCLUDE_LOCAL = 0, - D3D_INCLUDE_SYSTEM = (D3D_INCLUDE_LOCAL + 1), - D3D10_INCLUDE_LOCAL = D3D_INCLUDE_LOCAL, - D3D10_INCLUDE_SYSTEM = D3D_INCLUDE_SYSTEM, - D3D_INCLUDE_FORCE_DWORD = 0x7fffffff, -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcommon/D3D_SHADER_MACRO.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcommon/D3D_SHADER_MACRO.cs deleted file mode 100644 index 5693efae..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcommon/D3D_SHADER_MACRO.cs +++ /dev/null @@ -1,15 +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 d3dcommon.h in Microsoft.Direct3D.D3D12 v1.600.10 -// Original source is Copyright � Microsoft. Licensed under the MIT license - -namespace ComputeSharp.Win32; - -internal unsafe partial struct D3D_SHADER_MACRO -{ - [NativeTypeName("LPCSTR")] - public sbyte* Name; - - [NativeTypeName("LPCSTR")] - public sbyte* Definition; -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcommon/ID3DInclude.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcommon/ID3DInclude.cs deleted file mode 100644 index 845b5124..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcommon/ID3DInclude.cs +++ /dev/null @@ -1,27 +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 d3dcommon.h in Microsoft.Direct3D.D3D12 v1.600.10 -// Original source is Copyright © Microsoft. Licensed under the MIT license - -using System.Runtime.CompilerServices; - -namespace ComputeSharp.Win32; - -internal unsafe partial struct ID3DInclude -{ - public void** lpVtbl; - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(0)] - public HRESULT Open(D3D_INCLUDE_TYPE IncludeType, [NativeTypeName("LPCSTR")] sbyte* pFileName, [NativeTypeName("LPCVOID")] void* pParentData, [NativeTypeName("LPCVOID *")] void** ppData, uint* pBytes) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[0]))((ID3DInclude*)Unsafe.AsPointer(ref this), IncludeType, pFileName, pParentData, ppData, pBytes); - } - - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [VtblIndex(1)] - public HRESULT Close([NativeTypeName("LPCVOID")] void* pData) - { - return ((delegate* unmanaged[MemberFunction])(lpVtbl[1]))((ID3DInclude*)Unsafe.AsPointer(ref this), pData); - } -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcompiler/D3DCOMPILE.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcompiler/D3DCOMPILE.cs deleted file mode 100644 index b7464889..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcompiler/D3DCOMPILE.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 um/d3dcompiler.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -namespace ComputeSharp.Win32; - -internal static partial class D3DCOMPILE -{ - [NativeTypeName("#define D3DCOMPILE_DEBUG (1 << 0)")] - public const int D3DCOMPILE_DEBUG = (1 << 0); - - [NativeTypeName("#define D3DCOMPILE_SKIP_VALIDATION (1 << 1)")] - public const int D3DCOMPILE_SKIP_VALIDATION = (1 << 1); - - [NativeTypeName("#define D3DCOMPILE_SKIP_OPTIMIZATION (1 << 2)")] - public const int D3DCOMPILE_SKIP_OPTIMIZATION = (1 << 2); - - [NativeTypeName("#define D3DCOMPILE_PACK_MATRIX_ROW_MAJOR (1 << 3)")] - public const int D3DCOMPILE_PACK_MATRIX_ROW_MAJOR = (1 << 3); - - [NativeTypeName("#define D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR (1 << 4)")] - public const int D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR = (1 << 4); - - [NativeTypeName("#define D3DCOMPILE_PARTIAL_PRECISION (1 << 5)")] - public const int D3DCOMPILE_PARTIAL_PRECISION = (1 << 5); - - [NativeTypeName("#define D3DCOMPILE_FORCE_VS_SOFTWARE_NO_OPT (1 << 6)")] - public const int D3DCOMPILE_FORCE_VS_SOFTWARE_NO_OPT = (1 << 6); - - [NativeTypeName("#define D3DCOMPILE_FORCE_PS_SOFTWARE_NO_OPT (1 << 7)")] - public const int D3DCOMPILE_FORCE_PS_SOFTWARE_NO_OPT = (1 << 7); - - [NativeTypeName("#define D3DCOMPILE_NO_PRESHADER (1 << 8)")] - public const int D3DCOMPILE_NO_PRESHADER = (1 << 8); - - [NativeTypeName("#define D3DCOMPILE_AVOID_FLOW_CONTROL (1 << 9)")] - public const int D3DCOMPILE_AVOID_FLOW_CONTROL = (1 << 9); - - [NativeTypeName("#define D3DCOMPILE_PREFER_FLOW_CONTROL (1 << 10)")] - public const int D3DCOMPILE_PREFER_FLOW_CONTROL = (1 << 10); - - [NativeTypeName("#define D3DCOMPILE_ENABLE_STRICTNESS (1 << 11)")] - public const int D3DCOMPILE_ENABLE_STRICTNESS = (1 << 11); - - [NativeTypeName("#define D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY (1 << 12)")] - public const int D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY = (1 << 12); - - [NativeTypeName("#define D3DCOMPILE_IEEE_STRICTNESS (1 << 13)")] - public const int D3DCOMPILE_IEEE_STRICTNESS = (1 << 13); - - [NativeTypeName("#define D3DCOMPILE_OPTIMIZATION_LEVEL0 (1 << 14)")] - public const int D3DCOMPILE_OPTIMIZATION_LEVEL0 = (1 << 14); - - [NativeTypeName("#define D3DCOMPILE_OPTIMIZATION_LEVEL1 0")] - public const int D3DCOMPILE_OPTIMIZATION_LEVEL1 = 0; - - [NativeTypeName("#define D3DCOMPILE_OPTIMIZATION_LEVEL2 ((1 << 14) | (1 << 15))")] - public const int D3DCOMPILE_OPTIMIZATION_LEVEL2 = ((1 << 14) | (1 << 15)); - - [NativeTypeName("#define D3DCOMPILE_OPTIMIZATION_LEVEL3 (1 << 15)")] - public const int D3DCOMPILE_OPTIMIZATION_LEVEL3 = (1 << 15); - - [NativeTypeName("#define D3DCOMPILE_RESERVED16 (1 << 16)")] - public const int D3DCOMPILE_RESERVED16 = (1 << 16); - - [NativeTypeName("#define D3DCOMPILE_RESERVED17 (1 << 17)")] - public const int D3DCOMPILE_RESERVED17 = (1 << 17); - - [NativeTypeName("#define D3DCOMPILE_WARNINGS_ARE_ERRORS (1 << 18)")] - public const int D3DCOMPILE_WARNINGS_ARE_ERRORS = (1 << 18); - - [NativeTypeName("#define D3DCOMPILE_RESOURCES_MAY_ALIAS (1 << 19)")] - public const int D3DCOMPILE_RESOURCES_MAY_ALIAS = (1 << 19); - - [NativeTypeName("#define D3DCOMPILE_ENABLE_UNBOUNDED_DESCRIPTOR_TABLES (1 << 20)")] - public const int D3DCOMPILE_ENABLE_UNBOUNDED_DESCRIPTOR_TABLES = (1 << 20); - - [NativeTypeName("#define D3DCOMPILE_ALL_RESOURCES_BOUND (1 << 21)")] - public const int D3DCOMPILE_ALL_RESOURCES_BOUND = (1 << 21); - - [NativeTypeName("#define D3DCOMPILE_DEBUG_NAME_FOR_SOURCE (1 << 22)")] - public const int D3DCOMPILE_DEBUG_NAME_FOR_SOURCE = (1 << 22); - - [NativeTypeName("#define D3DCOMPILE_DEBUG_NAME_FOR_BINARY (1 << 23)")] - public const int D3DCOMPILE_DEBUG_NAME_FOR_BINARY = (1 << 23); - - [NativeTypeName("#define D3DCOMPILE_EFFECT_CHILD_EFFECT (1 << 0)")] - public const int D3DCOMPILE_EFFECT_CHILD_EFFECT = (1 << 0); - - [NativeTypeName("#define D3DCOMPILE_EFFECT_ALLOW_SLOW_OPS (1 << 1)")] - public const int D3DCOMPILE_EFFECT_ALLOW_SLOW_OPS = (1 << 1); - - [NativeTypeName("#define D3DCOMPILE_FLAGS2_FORCE_ROOT_SIGNATURE_LATEST 0")] - public const int D3DCOMPILE_FLAGS2_FORCE_ROOT_SIGNATURE_LATEST = 0; - - [NativeTypeName("#define D3DCOMPILE_FLAGS2_FORCE_ROOT_SIGNATURE_1_0 (1 << 4)")] - public const int D3DCOMPILE_FLAGS2_FORCE_ROOT_SIGNATURE_1_0 = (1 << 4); - - [NativeTypeName("#define D3DCOMPILE_FLAGS2_FORCE_ROOT_SIGNATURE_1_1 (1 << 5)")] - public const int D3DCOMPILE_FLAGS2_FORCE_ROOT_SIGNATURE_1_1 = (1 << 5); - - [NativeTypeName("#define D3DCOMPILE_SECDATA_MERGE_UAV_SLOTS 0x00000001")] - public const int D3DCOMPILE_SECDATA_MERGE_UAV_SLOTS = 0x00000001; - - [NativeTypeName("#define D3DCOMPILE_SECDATA_PRESERVE_TEMPLATE_SLOTS 0x00000002")] - public const int D3DCOMPILE_SECDATA_PRESERVE_TEMPLATE_SLOTS = 0x00000002; - - [NativeTypeName("#define D3DCOMPILE_SECDATA_REQUIRE_TEMPLATE_MATCH 0x00000004")] - public const int D3DCOMPILE_SECDATA_REQUIRE_TEMPLATE_MATCH = 0x00000004; -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcompiler/D3DCOMPILER_STRIP_FLAGS.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcompiler/D3DCOMPILER_STRIP_FLAGS.cs deleted file mode 100644 index 6402ffdd..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcompiler/D3DCOMPILER_STRIP_FLAGS.cs +++ /dev/null @@ -1,19 +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 um/d3dcompiler.h in the Windows SDK for Windows 10.0.22621.0 -// Original source is Copyright © Microsoft. All rights reserved. - -using System; - -namespace ComputeSharp.Win32; - -[Flags] -internal enum D3DCOMPILER_STRIP_FLAGS -{ - D3DCOMPILER_STRIP_REFLECTION_DATA = 0x00000001, - D3DCOMPILER_STRIP_DEBUG_INFO = 0x00000002, - D3DCOMPILER_STRIP_TEST_BLOBS = 0x00000004, - D3DCOMPILER_STRIP_PRIVATE_DATA = 0x00000008, - D3DCOMPILER_STRIP_ROOT_SIGNATURE = 0x00000010, - D3DCOMPILER_STRIP_FORCE_DWORD = 0x7fffffff, -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcompiler/D3D_BLOB_PART.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcompiler/D3D_BLOB_PART.cs deleted file mode 100644 index 37e2b2b8..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcompiler/D3D_BLOB_PART.cs +++ /dev/null @@ -1,27 +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 um/d3dcompiler.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -namespace ComputeSharp.Win32; - -internal enum D3D_BLOB_PART -{ - D3D_BLOB_INPUT_SIGNATURE_BLOB, - D3D_BLOB_OUTPUT_SIGNATURE_BLOB, - D3D_BLOB_INPUT_AND_OUTPUT_SIGNATURE_BLOB, - D3D_BLOB_PATCH_CONSTANT_SIGNATURE_BLOB, - D3D_BLOB_ALL_SIGNATURE_BLOB, - D3D_BLOB_DEBUG_INFO, - D3D_BLOB_LEGACY_SHADER, - D3D_BLOB_XNA_PREPASS_SHADER, - D3D_BLOB_XNA_SHADER, - D3D_BLOB_PDB, - D3D_BLOB_PRIVATE_DATA, - D3D_BLOB_ROOT_SIGNATURE, - D3D_BLOB_DEBUG_NAME, - D3D_BLOB_TEST_ALTERNATE_SHADER = 0x8000, - D3D_BLOB_TEST_COMPILE_DETAILS, - D3D_BLOB_TEST_COMPILE_PERF, - D3D_BLOB_TEST_COMPILE_REPORT, -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcompiler/DirectX.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcompiler/DirectX.cs deleted file mode 100644 index ed495995..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/d3dcompiler/DirectX.cs +++ /dev/null @@ -1,24 +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 um/d3dcompiler.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -using System; -using System.Runtime.InteropServices; - -namespace ComputeSharp.Win32; - -internal static unsafe partial class DirectX -{ - [DllImport("d3dcompiler_47", ExactSpelling = true)] - public static extern HRESULT D3DCompile([NativeTypeName("LPCVOID")] void* pSrcData, [NativeTypeName("SIZE_T")] nuint SrcDataSize, [NativeTypeName("LPCSTR")] sbyte* pSourceName, [NativeTypeName("const D3D_SHADER_MACRO *")] D3D_SHADER_MACRO* pDefines, [NativeTypeName("const ID3DInclude *")] void* pInclude, [NativeTypeName("LPCSTR")] sbyte* pEntrypoint, [NativeTypeName("LPCSTR")] sbyte* pTarget, uint Flags1, uint Flags2, ID3DBlob** ppCode, ID3DBlob** ppErrorMsgs); - - [DllImport("d3dcompiler_47", ExactSpelling = true)] - public static extern HRESULT D3DReflect([NativeTypeName("LPCVOID")] void* pSrcData, [NativeTypeName("SIZE_T")] nuint SrcDataSize, [NativeTypeName("const IID &")] Guid* pInterface, void** ppReflector); - - [DllImport("d3dcompiler_47", ExactSpelling = true)] - public static extern HRESULT D3DSetBlobPart([NativeTypeName("LPCVOID")] void* pSrcData, [NativeTypeName("SIZE_T")] nuint SrcDataSize, D3D_BLOB_PART Part, uint Flags, [NativeTypeName("LPCVOID")] void* pPart, [NativeTypeName("SIZE_T")] nuint PartSize, ID3DBlob** ppNewShader); - - [DllImport("d3dcompiler_47", ExactSpelling = true)] - public static extern HRESULT D3DStripShader([NativeTypeName("LPCVOID")] void* pShaderBytecode, [NativeTypeName("SIZE_T")] nuint BytecodeLength, uint uStripFlags, ID3DBlob** ppStrippedBlob); -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/DirectX/um/dcommon/D2D_VECTOR_2F.cs b/src/ComputeSharp.Win32.D2D1/DirectX/um/dcommon/D2D_VECTOR_2F.cs deleted file mode 100644 index 23a0831a..00000000 --- a/src/ComputeSharp.Win32.D2D1/DirectX/um/dcommon/D2D_VECTOR_2F.cs +++ /dev/null @@ -1,12 +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 um/dcommon.h in the Windows SDK for Windows 10.0.22621.0 -// Original source is Copyright © Microsoft. All rights reserved. - -namespace ComputeSharp.Win32; - -internal partial struct D2D_VECTOR_2F -{ - public float x; - public float y; -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/Windows/other/helper-types/HSTRING.cs b/src/ComputeSharp.Win32.D2D1/Windows/other/helper-types/HSTRING.cs deleted file mode 100644 index c8262771..00000000 --- a/src/ComputeSharp.Win32.D2D1/Windows/other/helper-types/HSTRING.cs +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. - -namespace ComputeSharp.Win32; - -internal readonly unsafe partial struct HSTRING -{ - public readonly void* Value; - - public HSTRING(void* value) - { - Value = value; - } -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/Windows/shared/windef/RECT.cs b/src/ComputeSharp.Win32.D2D1/Windows/shared/windef/RECT.cs deleted file mode 100644 index 1ef6c369..00000000 --- a/src/ComputeSharp.Win32.D2D1/Windows/shared/windef/RECT.cs +++ /dev/null @@ -1,21 +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/windef.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -namespace ComputeSharp.Win32; - -internal struct RECT -{ - [NativeTypeName("LONG")] - public int left; - - [NativeTypeName("LONG")] - public int top; - - [NativeTypeName("LONG")] - public int right; - - [NativeTypeName("LONG")] - public int bottom; -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/Windows/shared/winerror/D2DERR.cs b/src/ComputeSharp.Win32.D2D1/Windows/shared/winerror/D2DERR.cs deleted file mode 100644 index 0309c7be..00000000 --- a/src/ComputeSharp.Win32.D2D1/Windows/shared/winerror/D2DERR.cs +++ /dev/null @@ -1,21 +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/winerror.h in the Windows SDK for Windows 10.0.22000.0 -// Original source is Copyright © Microsoft. All rights reserved. - -namespace ComputeSharp.Win32; - -internal static partial class D2DERR -{ - [NativeTypeName("#define D2DERR_WRONG_FACTORY _HRESULT_TYPEDEF_(0x88990012L)")] - public const int D2DERR_WRONG_FACTORY = unchecked((int)(0x88990012)); - - [NativeTypeName("#define D2DERR_CYCLIC_GRAPH _HRESULT_TYPEDEF_(0x88990020L)")] - public const int D2DERR_CYCLIC_GRAPH = unchecked((int)(0x88990020)); - - [NativeTypeName("#define D2DERR_INSUFFICIENT_DEVICE_CAPABILITIES _HRESULT_TYPEDEF_(0x88990026L)")] - public const int D2DERR_INSUFFICIENT_DEVICE_CAPABILITIES = unchecked((int)(0x88990026)); - - [NativeTypeName("#define D2DERR_EFFECT_IS_NOT_REGISTERED _HRESULT_TYPEDEF_(0x88990028L)")] - public const int D2DERR_EFFECT_IS_NOT_REGISTERED = unchecked((int)(0x88990028)); -} \ No newline at end of file diff --git a/src/ComputeSharp.Win32.D2D1/Windows/shared/winerror/RO.cs b/src/ComputeSharp.Win32.D2D1/Windows/shared/winerror/RO.cs deleted file mode 100644 index 79468474..00000000 --- a/src/ComputeSharp.Win32.D2D1/Windows/shared/winerror/RO.cs +++ /dev/null @@ -1,12 +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/winerror.h in the Windows SDK for Windows 10.0.22621.0 -// Original source is Copyright © Microsoft. All rights reserved. - -namespace ComputeSharp.Win32; - -internal static partial class RO -{ - [NativeTypeName("#define RO_E_CLOSED _HRESULT_TYPEDEF_(0x80000013L)")] - public const int RO_E_CLOSED = unchecked((int)(0x80000013)); -} \ No newline at end of file diff --git a/src/ComputeSharp.WinUI/ComputeSharp.WinUI.csproj b/src/ComputeSharp.WinUI/ComputeSharp.WinUI.csproj deleted file mode 100644 index 0c3a8e7e..00000000 --- a/src/ComputeSharp.WinUI/ComputeSharp.WinUI.csproj +++ /dev/null @@ -1,26 +0,0 @@ - - - net8.0-windows10.0.22621.0 - 10.0.17763.0 - x64;ARM64 - win-x64;win-arm64 - - - - - - - - - - - - - - - diff --git a/src/ComputeSharp.WinUI/README.md b/src/ComputeSharp.WinUI/README.md deleted file mode 100644 index 730f34f6..00000000 --- a/src/ComputeSharp.WinUI/README.md +++ /dev/null @@ -1,9 +0,0 @@ -![ComputeSharp cover image](https://user-images.githubusercontent.com/10199417/108635546-3512ea00-7480-11eb-8172-99bc59f4eb6f.png) - -# Overview 📖 - -**ComputeSharp.WinUI** is a WinUI 3 library with controls to render DX12 shaders powered by **ComputeSharp**. - -# There's more! - -For a complete list of all features available in **ComputeSharp**, check the documentation in the [GitHub repo](https://github.com/Sergio0694/ComputeSharp). \ No newline at end of file diff --git a/src/ComputeSharp/ComputeSharp.csproj b/src/ComputeSharp/ComputeSharp.csproj index 1afa3a34..a4d3166e 100644 --- a/src/ComputeSharp/ComputeSharp.csproj +++ b/src/ComputeSharp/ComputeSharp.csproj @@ -7,9 +7,6 @@ - - - diff --git a/src/Directory.Build.props b/src/Directory.Build.props index a5f7dd27..7ffa4418 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -16,15 +16,6 @@ - - - - - - - - - @@ -32,20 +23,6 @@ - - - - - - - - - - - - $(PackageTags) d2d d2d1 direct2d pixel - $(PackageTags) uwp xaml winui winui2 - $(PackageTags) xaml winui winui3 winappsdk diff --git a/tests/ComputeSharp.D2D1.Tests.AssemblyLevelAttributes/ComputeSharp.D2D1.Tests.AssemblyLevelAttributes.csproj b/tests/ComputeSharp.D2D1.Tests.AssemblyLevelAttributes/ComputeSharp.D2D1.Tests.AssemblyLevelAttributes.csproj deleted file mode 100644 index 8d72d653..00000000 --- a/tests/ComputeSharp.D2D1.Tests.AssemblyLevelAttributes/ComputeSharp.D2D1.Tests.AssemblyLevelAttributes.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - net8.0 - - - - - - - - - - - - - diff --git a/tests/ComputeSharp.D2D1.Tests.AssemblyLevelAttributes/D2D1PixelShaderTests.cs b/tests/ComputeSharp.D2D1.Tests.AssemblyLevelAttributes/D2D1PixelShaderTests.cs deleted file mode 100644 index 1a04b338..00000000 --- a/tests/ComputeSharp.D2D1.Tests.AssemblyLevelAttributes/D2D1PixelShaderTests.cs +++ /dev/null @@ -1,193 +0,0 @@ -using System; -using System.Buffers; -using System.Runtime.InteropServices; -using ComputeSharp.D2D1.Interop; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace ComputeSharp.D2D1.Tests.AssemblyLevelAttributes; - -[TestClass] -public partial class D2D1PixelShaderTests -{ - [TestMethod] - public unsafe void ShaderWithAssemblyLevelAttributes() - { - ReadOnlyMemory bytecode = D2D1PixelShader.LoadBytecode(); - - // Verify the shader was precompiled - Assert.IsTrue(MemoryMarshal.TryGetMemoryManager(bytecode, out MemoryManager? manager)); - Assert.IsTrue(manager!.GetType().Name.Contains("HlslBytecodeMemoryManager")); - - // Compile with the same assembly level options - bytecode = D2D1PixelShader.LoadBytecode( - shaderProfile: D2D1ShaderProfile.PixelShader41, - compileOptions: D2D1CompileOptions.IeeeStrictness | D2D1CompileOptions.OptimizationLevel2 | D2D1CompileOptions.PartialPrecision); - - // Verify the same bytecode is returned - Assert.IsTrue(MemoryMarshal.TryGetMemoryManager(bytecode, out manager)); - Assert.IsTrue(manager!.GetType().Name.Contains("HlslBytecodeMemoryManager")); - - // Incorrect profile - bytecode = D2D1PixelShader.LoadBytecode(D2D1ShaderProfile.PixelShader50); - - Assert.IsFalse(MemoryMarshal.TryGetMemoryManager(bytecode, out MemoryManager? _)); - Assert.IsTrue(MemoryMarshal.TryGetArray(bytecode, out ArraySegment segment)); - Assert.AreEqual(0, segment.Offset); - Assert.IsTrue(segment.Count > 0); - - // Incorrect options - bytecode = D2D1PixelShader.LoadBytecode(D2D1CompileOptions.Default); - - Assert.IsFalse(MemoryMarshal.TryGetMemoryManager(bytecode, out MemoryManager? _)); - Assert.IsTrue(MemoryMarshal.TryGetArray(bytecode, out segment)); - Assert.AreEqual(0, segment.Offset); - Assert.IsTrue(segment.Count > 0); - } - - [D2DInputCount(3)] - [D2DInputSimple(0)] - [D2DInputSimple(1)] - [D2DInputSimple(2)] - [D2DGeneratedPixelShaderDescriptor] - internal readonly partial struct ShaderWithNoCompileAttributes : ID2D1PixelShader - { - public float4 Execute() - { - float4 dst = D2D.GetInput(0); - float4 src = D2D.GetInput(1); - float4 srcMask = D2D.GetInput(2); - float4 result = ((1 - srcMask) * dst) + (srcMask * src); - - return result; - } - } - - [TestMethod] - public unsafe void ShaderWithAssemblyLevelAttributesAndOverriddenProfile() - { - ReadOnlyMemory bytecode = D2D1PixelShader.LoadBytecode(); - - Assert.IsTrue(MemoryMarshal.TryGetMemoryManager(bytecode, out MemoryManager? manager)); - Assert.IsTrue(manager!.GetType().Name.Contains("HlslBytecodeMemoryManager")); - - // Try to recompile with the correct combined options - bytecode = D2D1PixelShader.LoadBytecode( - shaderProfile: D2D1ShaderProfile.PixelShader50, - compileOptions: D2D1CompileOptions.IeeeStrictness | D2D1CompileOptions.OptimizationLevel2 | D2D1CompileOptions.PartialPrecision); - - Assert.IsTrue(MemoryMarshal.TryGetMemoryManager(bytecode, out manager)); - Assert.IsTrue(manager!.GetType().Name.Contains("HlslBytecodeMemoryManager")); - - // Incorrect profile (overridden profile) - bytecode = D2D1PixelShader.LoadBytecode( - shaderProfile: D2D1ShaderProfile.PixelShader41, - compileOptions: D2D1CompileOptions.IeeeStrictness | D2D1CompileOptions.OptimizationLevel2 | D2D1CompileOptions.PartialPrecision); - - Assert.IsFalse(MemoryMarshal.TryGetMemoryManager(bytecode, out MemoryManager? _)); - Assert.IsTrue(MemoryMarshal.TryGetArray(bytecode, out ArraySegment segment)); - Assert.AreEqual(0, segment.Offset); - Assert.IsTrue(segment.Count > 0); - } - - [D2DInputCount(3)] - [D2DInputSimple(0)] - [D2DInputSimple(1)] - [D2DInputSimple(2)] - [D2DShaderProfile(D2D1ShaderProfile.PixelShader50)] - [D2DGeneratedPixelShaderDescriptor] - internal readonly partial struct ShaderWithOverriddenProfile : ID2D1PixelShader - { - public float4 Execute() - { - float4 dst = D2D.GetInput(0); - float4 src = D2D.GetInput(1); - float4 srcMask = D2D.GetInput(2); - float4 result = ((1 - srcMask) * dst) + (srcMask * src); - - return result; - } - } - - [TestMethod] - public unsafe void ShaderWithAssemblyLevelAttributesAndOverriddenOptions() - { - ReadOnlyMemory bytecode = D2D1PixelShader.LoadBytecode(); - - Assert.IsTrue(MemoryMarshal.TryGetMemoryManager(bytecode, out MemoryManager? manager)); - Assert.IsTrue(manager!.GetType().Name.Contains("HlslBytecodeMemoryManager")); - - // Try to recompile with the correct combined options - bytecode = D2D1PixelShader.LoadBytecode( - shaderProfile: D2D1ShaderProfile.PixelShader41, - compileOptions: D2D1CompileOptions.Debug | D2D1CompileOptions.AvoidFlowControl | D2D1CompileOptions.PartialPrecision); - - Assert.IsTrue(MemoryMarshal.TryGetMemoryManager(bytecode, out manager)); - Assert.IsTrue(manager!.GetType().Name.Contains("HlslBytecodeMemoryManager")); - - // Incorrect profile (overridden compile options) - bytecode = D2D1PixelShader.LoadBytecode( - shaderProfile: D2D1ShaderProfile.PixelShader41, - compileOptions: D2D1CompileOptions.Default); - - Assert.IsFalse(MemoryMarshal.TryGetMemoryManager(bytecode, out MemoryManager? _)); - Assert.IsTrue(MemoryMarshal.TryGetArray(bytecode, out ArraySegment segment)); - Assert.AreEqual(0, segment.Offset); - Assert.IsTrue(segment.Count > 0); - } - - [D2DInputCount(3)] - [D2DInputSimple(0)] - [D2DInputSimple(1)] - [D2DInputSimple(2)] - [D2DCompileOptions(D2D1CompileOptions.Debug | D2D1CompileOptions.AvoidFlowControl | D2D1CompileOptions.PartialPrecision)] - [D2DGeneratedPixelShaderDescriptor] - internal readonly partial struct ShaderWithOverriddenOptions : ID2D1PixelShader - { - public float4 Execute() - { - float4 dst = D2D.GetInput(0); - float4 src = D2D.GetInput(1); - float4 srcMask = D2D.GetInput(2); - float4 result = ((1 - srcMask) * dst) + (srcMask * src); - - return result; - } - } - - [TestMethod] - public unsafe void ShaderWithAssemblyLevelAttributesAndEverythingOverridden() - { - ReadOnlyMemory bytecode = D2D1PixelShader.LoadBytecode(); - - Assert.IsTrue(MemoryMarshal.TryGetMemoryManager(bytecode, out MemoryManager? manager)); - Assert.IsTrue(manager!.GetType().Name.Contains("HlslBytecodeMemoryManager")); - - // Try to get the new bytecode - bytecode = D2D1PixelShader.LoadBytecode( - shaderProfile: D2D1ShaderProfile.PixelShader50, - compileOptions: D2D1CompileOptions.Debug | D2D1CompileOptions.AvoidFlowControl | D2D1CompileOptions.PartialPrecision); - - Assert.IsTrue(MemoryMarshal.TryGetMemoryManager(bytecode, out manager)); - Assert.IsTrue(manager!.GetType().Name.Contains("HlslBytecodeMemoryManager")); - } - - [D2DInputCount(3)] - [D2DInputSimple(0)] - [D2DInputSimple(1)] - [D2DInputSimple(2)] - [D2DShaderProfile(D2D1ShaderProfile.PixelShader50)] - [D2DCompileOptions(D2D1CompileOptions.Debug | D2D1CompileOptions.AvoidFlowControl | D2D1CompileOptions.PartialPrecision)] - [D2DGeneratedPixelShaderDescriptor] - internal readonly partial struct ShaderWithOverriddenProfileAndOptions : ID2D1PixelShader - { - public float4 Execute() - { - float4 dst = D2D.GetInput(0); - float4 src = D2D.GetInput(1); - float4 srcMask = D2D.GetInput(2); - float4 result = ((1 - srcMask) * dst) + (srcMask * src); - - return result; - } - } -} \ No newline at end of file diff --git a/tests/ComputeSharp.D2D1.Tests.AssemblyLevelAttributes/Properties/AssemblyInfo.cs b/tests/ComputeSharp.D2D1.Tests.AssemblyLevelAttributes/Properties/AssemblyInfo.cs deleted file mode 100644 index 896d16dc..00000000 --- a/tests/ComputeSharp.D2D1.Tests.AssemblyLevelAttributes/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,4 +0,0 @@ -using ComputeSharp.D2D1; - -[assembly: D2DShaderProfile(D2D1ShaderProfile.PixelShader41)] -[assembly: D2DCompileOptions(D2D1CompileOptions.IeeeStrictness | D2D1CompileOptions.OptimizationLevel2 | D2D1CompileOptions.PartialPrecision)] \ No newline at end of file diff --git a/tests/ComputeSharp.D2D1.Tests.SourceGenerators/ComputeSharp.D2D1.Tests.SourceGenerators.csproj b/tests/ComputeSharp.D2D1.Tests.SourceGenerators/ComputeSharp.D2D1.Tests.SourceGenerators.csproj deleted file mode 100644 index 2b64e297..00000000 --- a/tests/ComputeSharp.D2D1.Tests.SourceGenerators/ComputeSharp.D2D1.Tests.SourceGenerators.csproj +++ /dev/null @@ -1,37 +0,0 @@ - - - net8.0 - $(DefineConstants);D2D1_TESTS - - - $(NoWarn);NU1903 - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tests/ComputeSharp.D2D1.Tests.SourceGenerators/Test_D2DPixelShaderDescriptorGenerator.cs b/tests/ComputeSharp.D2D1.Tests.SourceGenerators/Test_D2DPixelShaderDescriptorGenerator.cs deleted file mode 100644 index a0731c5f..00000000 --- a/tests/ComputeSharp.D2D1.Tests.SourceGenerators/Test_D2DPixelShaderDescriptorGenerator.cs +++ /dev/null @@ -1,1919 +0,0 @@ -using System.Threading.Tasks; -using ComputeSharp.D2D1.SourceGenerators; -using ComputeSharp.Tests.SourceGenerators.Helpers; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace ComputeSharp.D2D1.Tests.SourceGenerators; - -[TestClass] -public class Test_D2DPixelShaderDescriptorGenerator -{ - [TestMethod] - public async Task SimpleShader() - { - const string source = """ - using ComputeSharp; - using ComputeSharp.D2D1; - using int2 = global::ComputeSharp.Int2; - using float2 = global::ComputeSharp.Float2; - using float3 = global::ComputeSharp.Float3; - using float4 = global::ComputeSharp.Float4; - - [assembly: D2DEnableRuntimeCompilation] - - namespace MyNamespace; - - [D2DInputCount(0)] - [D2DRequiresScenePosition] - [D2DGeneratedPixelShaderDescriptor] - internal readonly partial struct MyShader : ID2D1PixelShader - { - private readonly float time; - private readonly int2 dispatchSize; - - public float4 Execute() - { - int2 xy = (int2)D2D.GetScenePosition().XY; - float2 uv = xy / (float2)this.dispatchSize; - float3 col = 0.5f + (0.5f * Hlsl.Cos(this.time + new float3(uv, uv.X) + new float3(0, 2, 4))); - return new(col, 1f); - } - } - """; - - const string result = """" - // - #pragma warning disable - - namespace MyNamespace - { - /// - partial struct MyShader : global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor - { - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static ref readonly global::System.Guid global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectId - { - [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - get - { - global::System.ReadOnlySpan bytes = - [ - 0xF4, 0xE8, 0x90, 0x26, - 0x36, 0xE8, - 0x71, 0x89, - 0x25, - 0x1F, - 0x69, - 0xE1, - 0x5F, - 0x27, - 0x60, - 0xBE - ]; - - return ref global::System.Runtime.CompilerServices.Unsafe.As(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(bytes)); - } - } - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static string? global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectDisplayName => null; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static string? global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectDescription => null; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static string? global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectCategory => null; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static string? global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectAuthor => null; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static unsafe nint global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectFactory - { - [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - get - { - [global::System.Runtime.InteropServices.UnmanagedCallersOnly(CallConvs = [typeof(global::System.Runtime.CompilerServices.CallConvStdcall)])] - static int EffectFactory(void** effectImpl) - { - return global::ComputeSharp.D2D1.Interop.D2D1PixelShaderEffect.CreateEffectUnsafe(effectImpl); - } - - return (nint)(delegate* unmanaged[Stdcall])&EffectFactory; - } - } - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static int global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.ConstantBufferSize => 12; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static int global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.InputCount => 0; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static int global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.ResourceTextureCount => 0; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static global::System.ReadOnlyMemory global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.InputTypes => default; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static global::System.ReadOnlyMemory global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.InputDescriptions => default; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static global::System.ReadOnlyMemory global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.ResourceTextureDescriptions => default; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static ComputeSharp.D2D1.D2D1PixelOptions global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.PixelOptions => global::ComputeSharp.D2D1.D2D1PixelOptions.None; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static ComputeSharp.D2D1.D2D1BufferPrecision global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.BufferPrecision => global::ComputeSharp.D2D1.D2D1BufferPrecision.Unknown; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static ComputeSharp.D2D1.D2D1ChannelDepth global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.ChannelDepth => global::ComputeSharp.D2D1.D2D1ChannelDepth.Default; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static ComputeSharp.D2D1.D2D1ShaderProfile global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.ShaderProfile => global::ComputeSharp.D2D1.D2D1ShaderProfile.PixelShader50; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static ComputeSharp.D2D1.D2D1CompileOptions global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.CompileOptions => global::ComputeSharp.D2D1.D2D1CompileOptions.Default; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static string global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.HlslSource => - """ - #define D2D_INPUT_COUNT 0 - #define D2D_REQUIRES_SCENE_POSITION - - #include "d2d1effecthelpers.hlsli" - - float time; - int2 dispatchSize; - - D2D_PS_ENTRY(Execute) - { - int2 xy = (int2)D2DGetScenePosition().xy; - float2 uv = xy / (float2)dispatchSize; - float3 col = asfloat(1056964608U) + (asfloat(1056964608U) * cos(time + float3(uv, uv.x) + float3(0, 2, 4))); - return float4(col, asfloat(1065353216U)); - } - """; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static global::System.ReadOnlyMemory global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.HlslBytecode => default; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - [global::System.Runtime.CompilerServices.SkipLocalsInit] - static MyShader global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.CreateFromConstantBuffer(global::System.ReadOnlySpan data) - { - ref readonly global::ComputeSharp.D2D1.Generated.ConstantBuffer buffer = ref global::System.Runtime.InteropServices.MemoryMarshal.AsRef(data); - - return global::ComputeSharp.D2D1.Generated.ConstantBufferMarshaller.ToManaged(in buffer); - } - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - [global::System.Runtime.CompilerServices.SkipLocalsInit] - static unsafe void global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.LoadConstantBuffer(in MyShader shader, ref TLoader loader) - { - global::System.Runtime.CompilerServices.Unsafe.SkipInit(out global::ComputeSharp.D2D1.Generated.ConstantBuffer buffer); - - global::System.Runtime.InteropServices.NativeMemory.Clear(&buffer, (uint)sizeof(global::ComputeSharp.D2D1.Generated.ConstantBuffer)); - - global::ComputeSharp.D2D1.Generated.ConstantBufferMarshaller.FromManaged(in shader, out buffer); - - loader.LoadConstantBuffer(new global::System.ReadOnlySpan(&buffer, sizeof(global::ComputeSharp.D2D1.Generated.ConstantBuffer))); - } - } - } - - namespace ComputeSharp.D2D1.Generated - { - using global::System.CodeDom.Compiler; - using global::System.Diagnostics; - using global::System.Diagnostics.CodeAnalysis; - using global::System.Runtime.CompilerServices; - using global::System.Runtime.InteropServices; - - /// - /// A type representing the constant buffer native layout for . - /// - [GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [DebuggerNonUserCode] - [ExcludeFromCodeCoverage] - [StructLayout(LayoutKind.Explicit, Size = 12)] - file struct ConstantBuffer - { - /// - [FieldOffset(0)] - public float time; - - /// - [FieldOffset(4)] - public int2 dispatchSize; - } - - /// - /// A type containing marshalling logic for the constant buffer in shaders of type . - /// - [GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [DebuggerNonUserCode] - [ExcludeFromCodeCoverage] - file static class ConstantBufferMarshaller - { - /// - /// Marshals managed instances to native constant buffer data. - /// - /// The input native constant buffer. - /// The marshalled instance. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [SkipLocalsInit] - public static void FromManaged(in global::MyNamespace.MyShader shader, out ConstantBuffer buffer) - { - buffer.time = shader.time(); - buffer.dispatchSize = shader.dispatchSize(); - } - - /// - /// Marshals native constant buffer data to managed instances. - /// - /// The input native constant buffer. - /// The marshalled instance. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [SkipLocalsInit] - public static global::MyNamespace.MyShader ToManaged(ref readonly ConstantBuffer buffer) - { - Unsafe.SkipInit(out global::MyNamespace.MyShader shader); - - shader.time() = buffer.time; - shader.dispatchSize() = buffer.dispatchSize; - - return shader; - } - - /// - /// The input value. - /// A mutable reference to . - [UnsafeAccessor(UnsafeAccessorKind.Field)] - private static extern ref float time(this ref readonly global::MyNamespace.MyShader value); - - /// - /// The input value. - /// A mutable reference to . - [UnsafeAccessor(UnsafeAccessorKind.Field)] - private static extern ref int2 dispatchSize(this ref readonly global::MyNamespace.MyShader value); - } - } - """"; - - await VerifyGeneratedDiagnosticsAsync(source, ("MyNamespace.MyShader.g.cs", result)); - } - - [TestMethod] - public async Task SimpleShader_WithCompiledHlslBytecode() - { - const string source = """ - using ComputeSharp; - using ComputeSharp.D2D1; - using int2 = global::ComputeSharp.Int2; - using float2 = global::ComputeSharp.Float2; - using float3 = global::ComputeSharp.Float3; - using float4 = global::ComputeSharp.Float4; - - namespace MyNamespace; - - [D2DInputCount(0)] - [D2DRequiresScenePosition] - [D2DShaderProfile(D2D1ShaderProfile.PixelShader50)] - [D2DGeneratedPixelShaderDescriptor] - internal readonly partial struct MyShader : ID2D1PixelShader - { - private readonly float time; - private readonly int2 dispatchSize; - - public float4 Execute() - { - int2 xy = (int2)D2D.GetScenePosition().XY; - float2 uv = xy / (float2)this.dispatchSize; - float3 col = 0.5f + (0.5f * Hlsl.Cos(this.time + new float3(uv, uv.X) + new float3(0, 2, 4))); - return new(col, 1f); - } - } - """; - - const string result = """" - // - #pragma warning disable - - namespace MyNamespace - { - /// - partial struct MyShader : global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor - { - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static ref readonly global::System.Guid global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectId - { - [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - get - { - global::System.ReadOnlySpan bytes = - [ - 0xF4, 0xE8, 0x90, 0x26, - 0x36, 0xE8, - 0x71, 0x89, - 0x25, - 0x1F, - 0x69, - 0xE1, - 0x5F, - 0x27, - 0x60, - 0xBE - ]; - - return ref global::System.Runtime.CompilerServices.Unsafe.As(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(bytes)); - } - } - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static string? global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectDisplayName => null; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static string? global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectDescription => null; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static string? global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectCategory => null; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static string? global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectAuthor => null; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static unsafe nint global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectFactory - { - [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - get - { - [global::System.Runtime.InteropServices.UnmanagedCallersOnly(CallConvs = [typeof(global::System.Runtime.CompilerServices.CallConvStdcall)])] - static int EffectFactory(void** effectImpl) - { - return global::ComputeSharp.D2D1.Interop.D2D1PixelShaderEffect.CreateEffectUnsafe(effectImpl); - } - - return (nint)(delegate* unmanaged[Stdcall])&EffectFactory; - } - } - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static int global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.ConstantBufferSize => 12; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static int global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.InputCount => 0; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static int global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.ResourceTextureCount => 0; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static global::System.ReadOnlyMemory global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.InputTypes => default; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static global::System.ReadOnlyMemory global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.InputDescriptions => default; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static global::System.ReadOnlyMemory global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.ResourceTextureDescriptions => default; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static ComputeSharp.D2D1.D2D1PixelOptions global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.PixelOptions => global::ComputeSharp.D2D1.D2D1PixelOptions.None; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static ComputeSharp.D2D1.D2D1BufferPrecision global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.BufferPrecision => global::ComputeSharp.D2D1.D2D1BufferPrecision.Unknown; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static ComputeSharp.D2D1.D2D1ChannelDepth global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.ChannelDepth => global::ComputeSharp.D2D1.D2D1ChannelDepth.Default; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static ComputeSharp.D2D1.D2D1ShaderProfile global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.ShaderProfile => global::ComputeSharp.D2D1.D2D1ShaderProfile.PixelShader50; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static ComputeSharp.D2D1.D2D1CompileOptions global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.CompileOptions => global::ComputeSharp.D2D1.D2D1CompileOptions.Default; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static string global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.HlslSource => - """ - #define D2D_INPUT_COUNT 0 - #define D2D_REQUIRES_SCENE_POSITION - - #include "d2d1effecthelpers.hlsli" - - float time; - int2 dispatchSize; - - D2D_PS_ENTRY(Execute) - { - int2 xy = (int2)D2DGetScenePosition().xy; - float2 uv = xy / (float2)dispatchSize; - float3 col = asfloat(1056964608U) + (asfloat(1056964608U) * cos(time + float3(uv, uv.x) + float3(0, 2, 4))); - return float4(col, asfloat(1065353216U)); - } - """; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static global::System.ReadOnlyMemory global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.HlslBytecode => global::ComputeSharp.D2D1.Generated.HlslBytecodeMemoryManager.Instance.Memory; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - [global::System.Runtime.CompilerServices.SkipLocalsInit] - static MyShader global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.CreateFromConstantBuffer(global::System.ReadOnlySpan data) - { - ref readonly global::ComputeSharp.D2D1.Generated.ConstantBuffer buffer = ref global::System.Runtime.InteropServices.MemoryMarshal.AsRef(data); - - return global::ComputeSharp.D2D1.Generated.ConstantBufferMarshaller.ToManaged(in buffer); - } - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - [global::System.Runtime.CompilerServices.SkipLocalsInit] - static unsafe void global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.LoadConstantBuffer(in MyShader shader, ref TLoader loader) - { - global::System.Runtime.CompilerServices.Unsafe.SkipInit(out global::ComputeSharp.D2D1.Generated.ConstantBuffer buffer); - - global::System.Runtime.InteropServices.NativeMemory.Clear(&buffer, (uint)sizeof(global::ComputeSharp.D2D1.Generated.ConstantBuffer)); - - global::ComputeSharp.D2D1.Generated.ConstantBufferMarshaller.FromManaged(in shader, out buffer); - - loader.LoadConstantBuffer(new global::System.ReadOnlySpan(&buffer, sizeof(global::ComputeSharp.D2D1.Generated.ConstantBuffer))); - } - } - } - - namespace ComputeSharp.D2D1.Generated - { - using global::System; - using global::System.Buffers; - using global::System.CodeDom.Compiler; - using global::System.Diagnostics; - using global::System.Diagnostics.CodeAnalysis; - using global::System.Runtime.CompilerServices; - using global::System.Runtime.InteropServices; - - /// - /// A type representing the constant buffer native layout for . - /// - [GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [DebuggerNonUserCode] - [ExcludeFromCodeCoverage] - [StructLayout(LayoutKind.Explicit, Size = 12)] - file struct ConstantBuffer - { - /// - [FieldOffset(0)] - public float time; - - /// - [FieldOffset(4)] - public int2 dispatchSize; - } - - /// - /// A type containing marshalling logic for the constant buffer in shaders of type . - /// - [GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [DebuggerNonUserCode] - [ExcludeFromCodeCoverage] - file static class ConstantBufferMarshaller - { - /// - /// Marshals managed instances to native constant buffer data. - /// - /// The input native constant buffer. - /// The marshalled instance. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [SkipLocalsInit] - public static void FromManaged(in global::MyNamespace.MyShader shader, out ConstantBuffer buffer) - { - buffer.time = shader.time(); - buffer.dispatchSize = shader.dispatchSize(); - } - - /// - /// Marshals native constant buffer data to managed instances. - /// - /// The input native constant buffer. - /// The marshalled instance. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [SkipLocalsInit] - public static global::MyNamespace.MyShader ToManaged(ref readonly ConstantBuffer buffer) - { - Unsafe.SkipInit(out global::MyNamespace.MyShader shader); - - shader.time() = buffer.time; - shader.dispatchSize() = buffer.dispatchSize; - - return shader; - } - - /// - /// The input value. - /// A mutable reference to . - [UnsafeAccessor(UnsafeAccessorKind.Field)] - private static extern ref float time(this ref readonly global::MyNamespace.MyShader value); - - /// - /// The input value. - /// A mutable reference to . - [UnsafeAccessor(UnsafeAccessorKind.Field)] - private static extern ref int2 dispatchSize(this ref readonly global::MyNamespace.MyShader value); - } - - /// - /// implementation to get the HLSL bytecode. - /// - [GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [DebuggerNonUserCode] - [ExcludeFromCodeCoverage] - file sealed class HlslBytecodeMemoryManager : MemoryManager - { - /// The singleton instance to use. - public static readonly HlslBytecodeMemoryManager Instance = new(); - - /// The RVA data with the HLSL bytecode. - private static ReadOnlySpan Data => [0x44, 0x58, 0x42, 0x43, 0x00, 0x7E, 0x4F, 0xA0, 0xD0, 0x90, 0x42, 0x20, 0xBA, 0x51, 0xF0, 0x59, 0x1A, 0x83, 0x95, 0x27, 0x01, 0x00, 0x00, 0x00, 0xB7, 0x08, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0xA0, 0x01, 0x00, 0x00, 0xFC, 0x01, 0x00, 0x00, 0x30, 0x02, 0x00, 0x00, 0x70, 0x03, 0x00, 0x00, 0x0C, 0x04, 0x00, 0x00, 0x52, 0x44, 0x45, 0x46, 0x60, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x05, 0xFF, 0xFF, 0x08, 0x81, 0x04, 0x00, 0x38, 0x01, 0x00, 0x00, 0x52, 0x44, 0x31, 0x31, 0x3C, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x47, 0x6C, 0x6F, 0x62, 0x61, 0x6C, 0x73, 0x00, 0xAB, 0xAB, 0xAB, 0x5C, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x14, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x74, 0x69, 0x6D, 0x65, 0x00, 0x66, 0x6C, 0x6F, 0x61, 0x74, 0x00, 0xAB, 0x00, 0x00, 0x03, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD5, 0x00, 0x00, 0x00, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x53, 0x69, 0x7A, 0x65, 0x00, 0x69, 0x6E, 0x74, 0x32, 0x00, 0xAB, 0xAB, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x01, 0x00, 0x00, 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4C, 0x53, 0x4C, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6F, 0x6D, 0x70, 0x69, 0x6C, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2E, 0x31, 0x00, 0x49, 0x53, 0x47, 0x4E, 0x54, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0F, 0x03, 0x00, 0x00, 0x53, 0x56, 0x5F, 0x50, 0x4F, 0x53, 0x49, 0x54, 0x49, 0x4F, 0x4E, 0x00, 0x53, 0x43, 0x45, 0x4E, 0x45, 0x5F, 0x50, 0x4F, 0x53, 0x49, 0x54, 0x49, 0x4F, 0x4E, 0x00, 0xAB, 0x4F, 0x53, 0x47, 0x4E, 0x2C, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5F, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x00, 0xAB, 0xAB, 0x53, 0x48, 0x45, 0x58, 0x38, 0x01, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x4E, 0x00, 0x00, 0x00, 0x6A, 0x08, 0x00, 0x01, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8E, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xF2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x06, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x96, 0x85, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x07, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, 0x00, 0x00, 0x4D, 0x00, 0x00, 0x06, 0x00, 0xD0, 0x00, 0x00, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0F, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3F, 0x3E, 0x00, 0x00, 0x01, 0x53, 0x54, 0x41, 0x54, 0x94, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x50, 0x52, 0x49, 0x56, 0xA3, 0x04, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x77, 0xD5, 0x53, 0x7B, 0x34, 0xFD, 0x69, 0xC9, 0x7D, 0xA1, 0x85, 0x94, 0xB1, 0x52, 0x5A, 0xD7, 0x01, 0x00, 0x00, 0x00, 0xA3, 0x04, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x48, 0x04, 0x00, 0x00, 0x4C, 0x49, 0x42, 0x46, 0x18, 0x04, 0x00, 0x00, 0x44, 0x58, 0x42, 0x43, 0x03, 0xE1, 0xA2, 0x41, 0x4F, 0x11, 0x4D, 0xCB, 0x79, 0x2A, 0xB6, 0x76, 0xCD, 0xD1, 0x6C, 0xF7, 0x01, 0x00, 0x00, 0x00, 0x18, 0x04, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x30, 0x00, 0x00, 0x00, 0x98, 0x01, 0x00, 0x00, 0x3C, 0x02, 0x00, 0x00, 0x7C, 0x03, 0x00, 0x00, 0x52, 0x44, 0x45, 0x46, 0x60, 0x01, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x05, 0x46, 0x4C, 0x08, 0x81, 0x04, 0x00, 0x38, 0x01, 0x00, 0x00, 0x52, 0x44, 0x31, 0x31, 0x3C, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x24, 0x47, 0x6C, 0x6F, 0x62, 0x61, 0x6C, 0x73, 0x00, 0xAB, 0xAB, 0xAB, 0x5C, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x14, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x74, 0x69, 0x6D, 0x65, 0x00, 0x66, 0x6C, 0x6F, 0x61, 0x74, 0x00, 0xAB, 0x00, 0x00, 0x03, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xD5, 0x00, 0x00, 0x00, 0x64, 0x69, 0x73, 0x70, 0x61, 0x74, 0x63, 0x68, 0x53, 0x69, 0x7A, 0x65, 0x00, 0x69, 0x6E, 0x74, 0x32, 0x00, 0xAB, 0xAB, 0x01, 0x00, 0x02, 0x00, 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x01, 0x00, 0x00, 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4C, 0x53, 0x4C, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6F, 0x6D, 0x70, 0x69, 0x6C, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2E, 0x31, 0x00, 0x4C, 0x46, 0x53, 0x30, 0x9C, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x77, 0x00, 0x00, 0x00, 0x8B, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x44, 0x32, 0x44, 0x5F, 0x66, 0x75, 0x6E, 0x63, 0x5F, 0x65, 0x6E, 0x74, 0x72, 0x79, 0x00, 0x5F, 0x5F, 0x64, 0x32, 0x64, 0x69, 0x6E, 0x70, 0x75, 0x74, 0x5F, 0x73, 0x63, 0x65, 0x6E, 0x65, 0x50, 0x6F, 0x73, 0x00, 0x53, 0x43, 0x45, 0x4E, 0x45, 0x5F, 0x50, 0x4F, 0x53, 0x49, 0x54, 0x49, 0x4F, 0x4E, 0x00, 0xAB, 0xAB, 0x53, 0x48, 0x45, 0x58, 0x38, 0x01, 0x00, 0x00, 0x50, 0x00, 0xF0, 0xFF, 0x4E, 0x00, 0x00, 0x00, 0x6A, 0x08, 0x00, 0x01, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8E, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5F, 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xF2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00, 0x43, 0x00, 0x00, 0x05, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2B, 0x00, 0x00, 0x06, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x96, 0x85, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0E, 0x00, 0x00, 0x07, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0A, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, 0x00, 0x00, 0x4D, 0x00, 0x00, 0x06, 0x00, 0xD0, 0x00, 0x00, 0x72, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0F, 0x72, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x3F, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3F, 0x3E, 0x00, 0x00, 0x01, 0x53, 0x54, 0x41, 0x54, 0x94, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4C, 0x49, 0x42, 0x48, 0x53, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00, 0x00, 0x4D, 0x69, 0x63, 0x72, 0x6F, 0x73, 0x6F, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4C, 0x53, 0x4C, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6F, 0x6D, 0x70, 0x69, 0x6C, 0x65, 0x72, 0x20, 0x31, 0x30, 0x2E, 0x31, 0x00, 0x44, 0x32, 0x44, 0x5F, 0x66, 0x75, 0x6E, 0x63, 0x5F, 0x65, 0x6E, 0x74, 0x72, 0x79, 0x00]; - - /// - public override unsafe Span GetSpan() - { - return new(Unsafe.AsPointer(ref MemoryMarshal.GetReference(Data)), Data.Length); - } - - /// - public override Memory Memory - { - [MethodImpl(MethodImplOptions.AggressiveInlining)] - get => CreateMemory(Data.Length); - } - - /// - public override unsafe MemoryHandle Pin(int elementIndex) - { - return new(Unsafe.AsPointer(ref Unsafe.AsRef(in Data[elementIndex])), pinnable: this); - } - - /// - public override void Unpin() - { - } - - /// - protected override void Dispose(bool disposing) - { - } - } - } - """"; - - await VerifyGeneratedDiagnosticsAsync(source, ("MyNamespace.MyShader.g.cs", result)); - } - - [TestMethod] - public async Task SimpleShader_WithEffectMetadata() - { - const string source = """ - using ComputeSharp; - using ComputeSharp.D2D1; - using int2 = global::ComputeSharp.Int2; - using float2 = global::ComputeSharp.Float2; - using float3 = global::ComputeSharp.Float3; - using float4 = global::ComputeSharp.Float4; - - [assembly: D2DEnableRuntimeCompilation] - - namespace MyNamespace; - - [D2DEffectId("B30E1384-DEE1-4200-9312-321521DF3B00")] - [D2DEffectDisplayName(nameof(MyShader))] - [D2DEffectDescription("A hello world effect that displays a color gradient.")] - [D2DEffectCategory("Render")] - [D2DEffectAuthor("ComputeSharp.D2D1")] - [D2DInputCount(0)] - [D2DRequiresScenePosition] - [D2DGeneratedPixelShaderDescriptor] - internal readonly partial struct MyShader : ID2D1PixelShader - { - private readonly float time; - private readonly int2 dispatchSize; - - public float4 Execute() - { - int2 xy = (int2)D2D.GetScenePosition().XY; - float2 uv = xy / (float2)this.dispatchSize; - float3 col = 0.5f + (0.5f * Hlsl.Cos(this.time + new float3(uv, uv.X) + new float3(0, 2, 4))); - return new(col, 1f); - } - } - """; - - const string result = """" - // - #pragma warning disable - - namespace MyNamespace - { - /// - partial struct MyShader : global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor - { - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static ref readonly global::System.Guid global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectId - { - [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - get - { - global::System.ReadOnlySpan bytes = - [ - 0x84, 0x13, 0x0E, 0xB3, - 0xE1, 0xDE, - 0x00, 0x42, - 0x93, - 0x12, - 0x32, - 0x15, - 0x21, - 0xDF, - 0x3B, - 0x00 - ]; - - return ref global::System.Runtime.CompilerServices.Unsafe.As(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(bytes)); - } - } - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static string? global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectDisplayName => "MyShader"; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static string? global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectDescription => "A hello world effect that displays a color gradient."; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static string? global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectCategory => "Render"; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static string? global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectAuthor => "ComputeSharp.D2D1"; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static unsafe nint global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectFactory - { - [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - get - { - [global::System.Runtime.InteropServices.UnmanagedCallersOnly(CallConvs = [typeof(global::System.Runtime.CompilerServices.CallConvStdcall)])] - static int EffectFactory(void** effectImpl) - { - return global::ComputeSharp.D2D1.Interop.D2D1PixelShaderEffect.CreateEffectUnsafe(effectImpl); - } - - return (nint)(delegate* unmanaged[Stdcall])&EffectFactory; - } - } - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static int global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.ConstantBufferSize => 12; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static int global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.InputCount => 0; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static int global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.ResourceTextureCount => 0; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static global::System.ReadOnlyMemory global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.InputTypes => default; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static global::System.ReadOnlyMemory global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.InputDescriptions => default; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static global::System.ReadOnlyMemory global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.ResourceTextureDescriptions => default; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static ComputeSharp.D2D1.D2D1PixelOptions global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.PixelOptions => global::ComputeSharp.D2D1.D2D1PixelOptions.None; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static ComputeSharp.D2D1.D2D1BufferPrecision global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.BufferPrecision => global::ComputeSharp.D2D1.D2D1BufferPrecision.Unknown; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static ComputeSharp.D2D1.D2D1ChannelDepth global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.ChannelDepth => global::ComputeSharp.D2D1.D2D1ChannelDepth.Default; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static ComputeSharp.D2D1.D2D1ShaderProfile global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.ShaderProfile => global::ComputeSharp.D2D1.D2D1ShaderProfile.PixelShader50; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static ComputeSharp.D2D1.D2D1CompileOptions global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.CompileOptions => global::ComputeSharp.D2D1.D2D1CompileOptions.Default; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static string global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.HlslSource => - """ - #define D2D_INPUT_COUNT 0 - #define D2D_REQUIRES_SCENE_POSITION - - #include "d2d1effecthelpers.hlsli" - - float time; - int2 dispatchSize; - - D2D_PS_ENTRY(Execute) - { - int2 xy = (int2)D2DGetScenePosition().xy; - float2 uv = xy / (float2)dispatchSize; - float3 col = asfloat(1056964608U) + (asfloat(1056964608U) * cos(time + float3(uv, uv.x) + float3(0, 2, 4))); - return float4(col, asfloat(1065353216U)); - } - """; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static global::System.ReadOnlyMemory global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.HlslBytecode => default; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - [global::System.Runtime.CompilerServices.SkipLocalsInit] - static MyShader global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.CreateFromConstantBuffer(global::System.ReadOnlySpan data) - { - ref readonly global::ComputeSharp.D2D1.Generated.ConstantBuffer buffer = ref global::System.Runtime.InteropServices.MemoryMarshal.AsRef(data); - - return global::ComputeSharp.D2D1.Generated.ConstantBufferMarshaller.ToManaged(in buffer); - } - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - [global::System.Runtime.CompilerServices.SkipLocalsInit] - static unsafe void global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.LoadConstantBuffer(in MyShader shader, ref TLoader loader) - { - global::System.Runtime.CompilerServices.Unsafe.SkipInit(out global::ComputeSharp.D2D1.Generated.ConstantBuffer buffer); - - global::System.Runtime.InteropServices.NativeMemory.Clear(&buffer, (uint)sizeof(global::ComputeSharp.D2D1.Generated.ConstantBuffer)); - - global::ComputeSharp.D2D1.Generated.ConstantBufferMarshaller.FromManaged(in shader, out buffer); - - loader.LoadConstantBuffer(new global::System.ReadOnlySpan(&buffer, sizeof(global::ComputeSharp.D2D1.Generated.ConstantBuffer))); - } - } - } - - namespace ComputeSharp.D2D1.Generated - { - using global::System.CodeDom.Compiler; - using global::System.Diagnostics; - using global::System.Diagnostics.CodeAnalysis; - using global::System.Runtime.CompilerServices; - using global::System.Runtime.InteropServices; - - /// - /// A type representing the constant buffer native layout for . - /// - [GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [DebuggerNonUserCode] - [ExcludeFromCodeCoverage] - [StructLayout(LayoutKind.Explicit, Size = 12)] - file struct ConstantBuffer - { - /// - [FieldOffset(0)] - public float time; - - /// - [FieldOffset(4)] - public int2 dispatchSize; - } - - /// - /// A type containing marshalling logic for the constant buffer in shaders of type . - /// - [GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [DebuggerNonUserCode] - [ExcludeFromCodeCoverage] - file static class ConstantBufferMarshaller - { - /// - /// Marshals managed instances to native constant buffer data. - /// - /// The input native constant buffer. - /// The marshalled instance. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [SkipLocalsInit] - public static void FromManaged(in global::MyNamespace.MyShader shader, out ConstantBuffer buffer) - { - buffer.time = shader.time(); - buffer.dispatchSize = shader.dispatchSize(); - } - - /// - /// Marshals native constant buffer data to managed instances. - /// - /// The input native constant buffer. - /// The marshalled instance. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [SkipLocalsInit] - public static global::MyNamespace.MyShader ToManaged(ref readonly ConstantBuffer buffer) - { - Unsafe.SkipInit(out global::MyNamespace.MyShader shader); - - shader.time() = buffer.time; - shader.dispatchSize() = buffer.dispatchSize; - - return shader; - } - - /// - /// The input value. - /// A mutable reference to . - [UnsafeAccessor(UnsafeAccessorKind.Field)] - private static extern ref float time(this ref readonly global::MyNamespace.MyShader value); - - /// - /// The input value. - /// A mutable reference to . - [UnsafeAccessor(UnsafeAccessorKind.Field)] - private static extern ref int2 dispatchSize(this ref readonly global::MyNamespace.MyShader value); - } - } - """"; - - await VerifyGeneratedDiagnosticsAsync(source, ("MyNamespace.MyShader.g.cs", result)); - } - - [TestMethod] - public async Task SimpleShader_WithPrimaryConstructorParameters() - { - const string source = """ - using ComputeSharp; - using ComputeSharp.D2D1; - using int2 = global::ComputeSharp.Int2; - using float2 = global::ComputeSharp.Float2; - using float3 = global::ComputeSharp.Float3; - using float4 = global::ComputeSharp.Float4; - - [assembly: D2DEnableRuntimeCompilation] - - namespace MyNamespace; - - [D2DInputCount(0)] - [D2DRequiresScenePosition] - [D2DGeneratedPixelShaderDescriptor] - internal readonly partial struct MyShader(float time, int2 dispatchSize) : ID2D1PixelShader - { - public float4 Execute() - { - int2 xy = (int2)D2D.GetScenePosition().XY; - float2 uv = xy / (float2)dispatchSize; - float3 col = 0.5f + (0.5f * Hlsl.Cos(time + new float3(uv, uv.X) + new float3(0, 2, 4))); - return new(col, 1f); - } - } - """; - - const string result = """" - // - #pragma warning disable - - namespace MyNamespace - { - /// - partial struct MyShader : global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor - { - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static ref readonly global::System.Guid global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectId - { - [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - get - { - global::System.ReadOnlySpan bytes = - [ - 0xF4, 0xE8, 0x90, 0x26, - 0x36, 0xE8, - 0x71, 0x89, - 0x25, - 0x1F, - 0x69, - 0xE1, - 0x5F, - 0x27, - 0x60, - 0xBE - ]; - - return ref global::System.Runtime.CompilerServices.Unsafe.As(ref global::System.Runtime.InteropServices.MemoryMarshal.GetReference(bytes)); - } - } - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static string? global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectDisplayName => null; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static string? global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectDescription => null; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static string? global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectCategory => null; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static string? global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectAuthor => null; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static unsafe nint global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.EffectFactory - { - [global::System.Runtime.CompilerServices.MethodImpl(global::System.Runtime.CompilerServices.MethodImplOptions.AggressiveInlining)] - get - { - [global::System.Runtime.InteropServices.UnmanagedCallersOnly(CallConvs = [typeof(global::System.Runtime.CompilerServices.CallConvStdcall)])] - static int EffectFactory(void** effectImpl) - { - return global::ComputeSharp.D2D1.Interop.D2D1PixelShaderEffect.CreateEffectUnsafe(effectImpl); - } - - return (nint)(delegate* unmanaged[Stdcall])&EffectFactory; - } - } - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static int global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.ConstantBufferSize => 12; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static int global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.InputCount => 0; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static int global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.ResourceTextureCount => 0; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static global::System.ReadOnlyMemory global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.InputTypes => default; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static global::System.ReadOnlyMemory global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.InputDescriptions => default; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static global::System.ReadOnlyMemory global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.ResourceTextureDescriptions => default; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static ComputeSharp.D2D1.D2D1PixelOptions global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.PixelOptions => global::ComputeSharp.D2D1.D2D1PixelOptions.None; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static ComputeSharp.D2D1.D2D1BufferPrecision global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.BufferPrecision => global::ComputeSharp.D2D1.D2D1BufferPrecision.Unknown; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static ComputeSharp.D2D1.D2D1ChannelDepth global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.ChannelDepth => global::ComputeSharp.D2D1.D2D1ChannelDepth.Default; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static ComputeSharp.D2D1.D2D1ShaderProfile global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.ShaderProfile => global::ComputeSharp.D2D1.D2D1ShaderProfile.PixelShader50; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static ComputeSharp.D2D1.D2D1CompileOptions global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.CompileOptions => global::ComputeSharp.D2D1.D2D1CompileOptions.Default; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static string global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.HlslSource => - """ - #define D2D_INPUT_COUNT 0 - #define D2D_REQUIRES_SCENE_POSITION - - #include "d2d1effecthelpers.hlsli" - - float time; - int2 dispatchSize; - - D2D_PS_ENTRY(Execute) - { - int2 xy = (int2)D2DGetScenePosition().xy; - float2 uv = xy / (float2)dispatchSize; - float3 col = asfloat(1056964608U) + (asfloat(1056964608U) * cos(time + float3(uv, uv.x) + float3(0, 2, 4))); - return float4(col, asfloat(1065353216U)); - } - """; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - static global::System.ReadOnlyMemory global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.HlslBytecode => default; - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - [global::System.Runtime.CompilerServices.SkipLocalsInit] - static MyShader global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.CreateFromConstantBuffer(global::System.ReadOnlySpan data) - { - ref readonly global::ComputeSharp.D2D1.Generated.ConstantBuffer buffer = ref global::System.Runtime.InteropServices.MemoryMarshal.AsRef(data); - - return global::ComputeSharp.D2D1.Generated.ConstantBufferMarshaller.ToManaged(in buffer); - } - - /// - [global::System.CodeDom.Compiler.GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [global::System.Diagnostics.DebuggerNonUserCode] - [global::System.Diagnostics.CodeAnalysis.ExcludeFromCodeCoverage] - [global::System.Runtime.CompilerServices.SkipLocalsInit] - static unsafe void global::ComputeSharp.D2D1.Descriptors.ID2D1PixelShaderDescriptor.LoadConstantBuffer(in MyShader shader, ref TLoader loader) - { - global::System.Runtime.CompilerServices.Unsafe.SkipInit(out global::ComputeSharp.D2D1.Generated.ConstantBuffer buffer); - - global::System.Runtime.InteropServices.NativeMemory.Clear(&buffer, (uint)sizeof(global::ComputeSharp.D2D1.Generated.ConstantBuffer)); - - global::ComputeSharp.D2D1.Generated.ConstantBufferMarshaller.FromManaged(in shader, out buffer); - - loader.LoadConstantBuffer(new global::System.ReadOnlySpan(&buffer, sizeof(global::ComputeSharp.D2D1.Generated.ConstantBuffer))); - } - } - } - - namespace ComputeSharp.D2D1.Generated - { - using global::System.CodeDom.Compiler; - using global::System.Diagnostics; - using global::System.Diagnostics.CodeAnalysis; - using global::System.Runtime.CompilerServices; - using global::System.Runtime.InteropServices; - - /// - /// A type representing the constant buffer native layout for . - /// - [GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [DebuggerNonUserCode] - [ExcludeFromCodeCoverage] - [StructLayout(LayoutKind.Explicit, Size = 12)] - file struct ConstantBuffer - { - /// The unspeakable field "time" of . - [FieldOffset(0)] - public float time; - - /// The unspeakable field "dispatchSize" of . - [FieldOffset(4)] - public int2 dispatchSize; - } - - /// - /// A type containing marshalling logic for the constant buffer in shaders of type . - /// - [GeneratedCode("ComputeSharp.D2D1.D2DPixelShaderDescriptorGenerator", )] - [DebuggerNonUserCode] - [ExcludeFromCodeCoverage] - file static class ConstantBufferMarshaller - { - /// - /// Marshals managed instances to native constant buffer data. - /// - /// The input native constant buffer. - /// The marshalled instance. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [SkipLocalsInit] - public static void FromManaged(in global::MyNamespace.MyShader shader, out ConstantBuffer buffer) - { - buffer.time = shader.time(); - buffer.dispatchSize = shader.dispatchSize(); - } - - /// - /// Marshals native constant buffer data to managed instances. - /// - /// The input native constant buffer. - /// The marshalled instance. - [MethodImpl(MethodImplOptions.AggressiveInlining)] - [SkipLocalsInit] - public static global::MyNamespace.MyShader ToManaged(ref readonly ConstantBuffer buffer) - { - Unsafe.SkipInit(out global::MyNamespace.MyShader shader); - - shader.time() = buffer.time; - shader.dispatchSize() = buffer.dispatchSize; - - return shader; - } - - /// Gets a reference to the unspeakable field "time" of type . - /// The input value. - /// A mutable reference to the unspeakable field "time". - [UnsafeAccessor(UnsafeAccessorKind.Field, Name = "

TT<&bb09=mn0K;AHD9OhtqdMa|A}Ojq2Y^Vj3f z-2)Tw{41YH&_- zVro;;=m+*F&&K*<%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bN{;B zkv5t20yA|gvP>PYB;*VjHwfQ?1P$q?{(-n3an2CsNQ{{+G|!|2hKJlHd-nH6S*X0? zI-}%Rig#JjC`_0rb6@9WN0t@TeKmI?#Utq;`NakCCnoc6h%Y;rHuoVoMR|i-gsu!& zpRn`BXW|8(uzMgIK9|0(R1RN?e(|Zk4Ya1r9TZHgGLJ_7S^fEyv|YY4D?q$vPxLn* zIZan6<} z9kyk=zMw$un`!I1+8=N6tJ}C*DCWD)A>`#9?Ojt{90LrK`oX(zv=3yH3)W#@pOwWz zGgrGT#q1{PnhD`}CqvYfN-1*?qH@Kniz5}Y?^D&jM`JJvlk%-d8ujN7Ha|Ii`R@qS z9|!Dhb`@cFwe+LgT`@lv8Ktki-SBD9``wz5QKV(RNxQ~Febt3}P4*N|Y5SFM2H(qh zzbw8tyI;9v`UkhuKJ(y1U{Jz|jVKivvDb%FsQl%8m5OoVh*`Ubpcem*Y-i&mFo9QP zqh`D9usweeK-jf&XLE#mY%i^XS2uD@Sn1<~r$qfm$s2*h=$=^Yz@C$0dv1x| zB^jx2-7^-QW)W(Z5>U59w{H@LH_V5LE)62t-rsSy?QC5*j^>XyrWb34Mf)3m{?a7* z!8lajuPL#p-$$-j=!Ave=nHgb?w{#0{?ygZT!F5_Mg7= F{{fiD5R(7^ diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/SmallTile.scale-100.png b/samples/ComputeSharp.SwapChain.UI/Assets/SmallTile.scale-100.png deleted file mode 100644 index 605059d8344e946289d22556b01776eb6093d95b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1799 zcmV+i2l)7jP) zyT|oDW~c0SY>%?PWNACI|J|A2%>2J*hcMQ?{X2r84ipXeC?gaG%wj5xQmGTcaNAtB zr>PJma*BpV{~`~QW{v63oI2#gbKQbwhEI+JJ~UTc2Ns2k+=~Ejm{?e&Q5%fA|#;?*JlE z8sH$2RI)FW9Oc}TQ!ue|um>ye>6t-uXBVx3EOuY~n`ZkZ>M@a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&33%q zK4cM4@V)PBVOEwEzr;FiqS4xe(Hr|?cr zMene+s!AKoBg}vt)7Ckxd-zc4JoI;%9L;kWz_Uhgvz2mi9{D@m7qh5^X~fULH1gj5 px3}`_G5I?hb?M2uhn0&>{Rimq9VIu%myZAd002ovPDHLkV1j*xSp5J1 diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/SmallTile.scale-125.png b/samples/ComputeSharp.SwapChain.UI/Assets/SmallTile.scale-125.png deleted file mode 100644 index cea406100ccadf77e1b49d0ef1f15fef2a40d706..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1882 zcmaKtcQhLc8^&Wqh*hIXnovYk8u zi=Xd!TMI^39Gif*vAr(ZyH2?r4WP;Vd{WyIk!`Va9S~6^4mCa^bxT#2< zlUA}4BF-COg~TpJ;&UyeNfZ+Kq8Ldpc3q#<2eQh2rfeV=!;Ib_3Plm$7@yHNdHMoE z@;WxwunccMIg@cbumReir1zMN#+5&&^I7EXXVtztkG7|#d^x(lJ6_y%tNSvf9*;^@ zq5+}+5Y(r%*14Bmk^r)>r4_S=VM;guKW9?r?Sxuu z0j8{YwM8_%JSQI&=4sLJl1S|XBU8pic4h`)MXCRxHE*_j%9n@f4NrsE%Xtx?gtFg% zIUEA6b>EBwmMjDyy*e%R;R9AewZ7!G5?#75MPscRh%eFafJDpX`f&{W(7&QXa|Zz%7v zL@nBAPp@&|OG4=+8JC$lksuq@lHlEqND&JTh7TbuHh1+(V5ydtH1O)T5gzB7A^*Zx zAps)WvO3)HW_yHiuh!+HXhsIi@t`-#+o2xcc)^1KBtL0bf@fjrg)JY$)GasFQBD-k zIOK1S?bK~&dpYV%(E^NlMkKg7rFJ<{Zs50Y+u7Z*LqN^cL4`blcZL(2F0S!D>5h>M zZC>kFIvk}KAM-I_=sF4N81a1Ia*?kU89ujU`04u%R%Zf^SehD9Ri(PJ-X2u#M)&6n zyHm|;_b(I@bYd=QOOIywREFxqglc>|{YL8O(kfhuI0lNAN!aRIhg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w0_smkjElP}vt|Rt8A+ejOLyMK9L{DXXa&1{PWhu&n8Lpx_k58!ifh0GJ|%hbu-y)zh4ob-=)9cj;KG* zycXA9S!ld`ZE86T@o^zmDgKLlqA$yC{J&`F@o}=ixh5LWn$vTP*H*CWYIh$K-P)7k z*UvcU<;Fw(%Y9D0H8tH1l*#aXS2VfMQSAW<)NS`_cpqA?S`@;no6(6xMEs!m9-voJ z1413CgXE|^bh#9HD<;O13DBp#nO82|*&1-O>qkr3=TPCEkLS`YVxGy@YXA;u_2$ej ziiLS+)Mj*&*R|%5a7$AA&Hi!d(GmLu`wg+zTZu}K?tAGyYh)!Dj#Zp%tY@kDZUkMH z^WP5P?OsljkNH5yS2p!^)xMx;ym>r?{gneb8BkQjcMt=}0k|)81#^$?dTUQDB?wBHM<8o`zWNrzl-@6$G z$ng~jJ2zG4D;u3wx}q}QJ2QVjT$H;SS+#Bl5ui@z(B=oMEn!vhj?0cKya-s=gUjDD zJhVIS%mUSaCiUVAVEyQzl-i`ITwaeB*p|zv^fkdRXiCWNOSL%{ZYzuraMv#jt#_O# z;q$Iku~iB2Fl-ZB6*O{~*9O)!Kgk<4BpzGki5?3t(_THfIk<5kdNlo-D}+wVt@++= zj;1$O7Hn3`MoEc?Ny@{*yy4A+CwH(E7fZc<8LPwYu?Elk_9M>@R11kkUT$+@B*H2* my6-0=-?Y2RJ4!BghXAUrfeOPi$@u8c5klEwZRpn5)BXdGW-q+} diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/SmallTile.scale-400.png b/samples/ComputeSharp.SwapChain.UI/Assets/SmallTile.scale-400.png deleted file mode 100644 index 418563fc19cc51d168d4c0ce2239b8c11bb72621..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3613 zcmd5<`#TeE8{Z-%hrA+(Ipmx~Atr|rqLieNZ?ce$a#-ZlHgZUjY|dX9QbbJ-TL>|d zHq7Kq&I~!M#TawQyT0##@P4oB{k}gu*K=LZec#t}A3o3LzMljKdmCXv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qsI$vW)a@R4A)? z!gbg)W#sJ`EESC9u=pDl2Gf`R<65MU^?5mz2$`aa`@bmiG5vJ5!6dVN=`Ir!p@LU!pK;cVV^L1G4b^iiXjfA=QF1 z^NxQi@h3GmJddhtK%0(W-`QmVTVuyvXy2C=r4G#+(?PxPXkK_1l6a4tdG(_TDSw<(} z&IjMf*cx)QJ_Ux*GR9Xjo!1SFFg%4;p});D_y(r|$5I)S>G-xA^cE}&Y%X})5X}Bu zY3l2DS>6UM4x-Hf8oj|_aW-S+M?CWi09(ore<1%jaGKZg=uES8Hd5-(qKsN=Q+q|8 zJa1!gX71QfV6Z^_M^lmT%-zZB><74HrUif!iI`@A*V`gM^>F20P*WC&7oLu5sT^^N zlPe*!8Y&?+1vH^tM%=Drl#G>mrZF@D zqCtm2*?z{~Y^&w=ztD#MrHlvhsoPeUKH zqhz4?$lCa2V<$HM>~L5196&Qj2G`n5A35Gf_2A2`?TJj<6h`P2}EcQh3X$3aBBM15r`-a9!U=9mNmC%jMdvU;IGC5 zt{nm)<<-YS_30)e6PTYcBRECx7EsS`-_YTPbdR*F_WL`0Rw6I5RqF@ zG2A8@;F5OY__Vjg6p($8>pIuDvA5w-pov%@cTT+6I+9$*k>8K?RRcd#j4W2`S{|9| zcP6|i*lCT+^N$knPr6T5$bR~G;#G;l-sXtgaTU=E6buG9N}M=h>b?z$ME`1eLYRu; Q{`Uaqt?jMK&fbdoH`^75IsgCw diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/SplashScreen.scale-100.png b/samples/ComputeSharp.SwapChain.UI/Assets/SplashScreen.scale-100.png deleted file mode 100644 index d800c4a0e04442dc27233e5cc36973bae2be3bcd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 4291 zcmds5`8!*A+dqn+8cL_?m0G&czAe=%u@yDiQB}cI6tR^WN)pi`N{I5#plazDOD$3D zRE7vqTP+D0G__M(ED2@oq}3v|M4prR8=kqY=XrlP*E!cY-}^rI{kcE){r#Mi--~bu`#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+hDK5Ddp= zE?#Ob_oXee8d_VB291S@Oh%aIwflY|ywbsV?0jm|dX`lH!xQWmA%5x;53V($II1#+ zfTtDBa6(n67j-?*!1`Uq>B#QVcbG7rSSU6ZYm5+5ys%w8h)9%z4w!>Uyo zs0EXz$iUyfbhiy{NTVLRH2zgg0`NS+*2s9%FoH@^=9$o?fQrNDbUS11gTN?wVFT8J z!*ce_{hJ^E=N<3fDJ9>jR{NUEyz9t>fODTPzBaaG1~FA)138LleX6199_#!~8WnwQ z)jgjhm5Ve#RBgdCFoPoCpMKM)4DUp)ra>;L8JJ~U*+LETUz?&l&QBeqp!;by+s(;# feQ_CULb1!RBQVC3Bcw$;#&Fl-f{l|=(d;C diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/SplashScreen.scale-125.png b/samples/ComputeSharp.SwapChain.UI/Assets/SplashScreen.scale-125.png deleted file mode 100644 index e2117c208117b1f9e4cf410466fe9093c4d4b1e2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5157 zcmeHK`CF6Mw%#F?C~5#HgAj-NKHauM$uMH0I`Q|E?|xG{6?00*xr}}*FjXV& z$9DrrMXTM4+fEsr@^)20o=-iM>hoYaY1{cbJI)aFjmyi8`CeY8>^1UhGKIp;naDBs z8lJmsb+k2#?NGSt!FRk^D_vV-yKU~TVoWKn8pldg4DauyYzMrO)$@(P5&NtpMflg_ ze_DGK>r+76`Ps#|b`MMD_!&?N7+X*sFZ>meJwIdW+AsMXNUA}E$-gIOTFM0)hr>v> z|Nrtof&qqo>|(DD;b&5d&W5l%ocKnTdt=Q~rFkxnVq#68A^W2*v8J_{3)iBhE&BT? z+v}892ZQK;HCfF{l!tM)b10|oXP<5wsEg|&RZw-)sif&n7smF!RTT+NCOkPwAMg__ z+BHscX!UlDJzkutY>vg6yX~_|bp?OB`loVVO~L_mqA~6MbQuA`dy{tms47BA>beOf}8lc3k_#moJO0d-vG43#6yKHTYm4Xj?}Y7b>oriXO8RN-o? zx!N_Y`Q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CVO%0nR~0} zTsQ6uz&9DN`tnqEH_Aa1fBP+fP3Y&7gXNvk{t@rdoKgh5;rg^)PJKH35GXPN(dk#! zf?OWY{d3`iK44paArw>qPNpTMP{X1jGddM!3?CZcgl7601p`44xlUUF2uo}6g7BU# z-9%nemU`8!9XS1#V6EcG<-zV=+JB3n0dTG#40B7H9csExqeT#Y&j<{8h9L&79XJUf zDE)Reqyx4Vb3ZAw))4jsDLZZHqsiv@ZsE^1pa+gSRGE9iop|u?T>my2>>^(j0%xvJ1RyJAf}{6Ryz-NgQJG*PCp3C;vu;8VBO3+2n!44TqtM?1kW92 zrHB7C+Apsm0NkRME_Q=(3ecaxn=sVJn{{s}7b$0*& diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/SplashScreen.scale-400.png b/samples/ComputeSharp.SwapChain.UI/Assets/SplashScreen.scale-400.png deleted file mode 100644 index 5aebcf43f9fa25fd3bf51ff556096d3f87dd2d0f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 20956 zcmeHv2UJu^w{Gj0M_^FL00<_;L=YqhNE;9aNh*qx5fPAXf=Z4(!>BNd_=6H`pdCR_ zvJxeAD+(fMkk~X0ttinZr)i+Mb?ThMc-MOCt#$8v_pbHcrPdM;=hWF%_3gdCy{k?Y zA*T(r1=fhHArJ@xI=^V1B@k9;5eUn&R;>Vcw&n8Qga1~${$g^2K-egW{9B@PcGob0 zaOR$l=CN~LvESJG*Uc{YRD9Z0FwN0EkiXKxP`cg9H&5!Hqj5Gv(T7Ldd^WzVl=6JK(O9+gsfA`R56>lXF z-+IK&>45eLoY#*-S~EJ|&GY+cFNvV9w-r9{!F{ndPFVe2`kk6>GeJl_M$o4{Hn}mj zfoll_L0!fQf~(KQ7bYh?k!PG|8?4sb|sUxj6j%vz*YJ@=f^yfM?5(Xey6x-A|c3iRjRw+eD{t3-WdI@ zP*lS=!ygC)zc)ox@7d|(`Fr`wslk2Tn%Of68x8`#X5??P2G3RQU;lwc3j~2P;yW0=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YIxuS>q9z6IIG0J~}C9WHx6UiBFjZe}kG`jA~ z^g&tGx&jjuaW=f{us2`I_}|I7__#Pu*hwKBThNGx6Klp&#j8c1Qb(i5=Ov#qeYT6;4_SLeF$O4NfVPu&}(L z8rAQ?%q3>j_DpQPXN{6)Rj6)Dn}_O7pI6RDP};~+fUStjZ6w#^+~k52epvszQM-yh z+ff_*2c}qWI8^lv?ya8t?K0kM%)5qHqcV(09|dVqhRI)iuAM|9$TVE@A_%4EZ22Lt zYaDzL24z?WRyRH!G5FvRd)ViWBIZ8!kiop#y|mog8A|c%xS2Z8p};#5P>or?J<4GZ zi$(Cg2QEQTlsJ_A;|F8SOUXyjDPz`pRQ}nBvcr4zuhS1>xtbqbC}5~Mf)RNbVH`5N z1cE!TB|j5rX{IL~TLbYx)px2tpCTP75Vjs$fSZ8`qz&{%AF?=`DU3P75E}HJJjyXN zdOP`13O{k{2R}4XCK?|da{3q-UbX2*jKMw8fMTLk*tOwhs3`LshJYu6K!DoB{qoFT z8A6BR1&+-A%dO`NPkpwC>9Ye2dD40|>~ucs(!fEmdF$2e*L4KW)R?`qKh1~bBgnZh zQRwD$xB1j{x*)MFT?*tN*0QJOd)%*1!E5jrTZ{ diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square150x150Logo.scale-100.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square150x150Logo.scale-100.png deleted file mode 100644 index 970458817fbff1f1b0378fe290d49e82f6584d69..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2368 zcmb`JXE+-Q7sq37Vns_!QL)u-t@a{jZ5lyqL?cD*Jz`&yShZTCNo&Lm8llu|%}dZ~ zX^U&~*t67lTe8Q9=P+gQ8B|hz%RdngheJM~u<}~gTT%_^OE%=`S6v0og z$vk7s-uN_`YaC*w0s1Z)F9o!0fJq(oFM#4{o8nr4JaRhtqIh0|9CNFAxnU z4duPnr!~<2%9NcbAUiJtv|BKmI~}(l^2&(~V3GtOWh5qyw00}-8us)c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i9U>VQKVm}acPc4VM!6JKk&LJgEiF?Ie%Jr%2UnD7oA{v~7_Dz!si>cnR< zA=+EL&N?=-2DQ>Vav_l4S%_AkMlFX`b2(QsEl9WpmXi6RWJ~dmrr&BUTB^H4F#&vw z)MBJ7XR(Q&GRp0$>{NgJmIj>R$(zjreB8e{4H|@&99$E1XE2MiQF@2%JML26hG5E? z!d7&Hn4O6a4KV~zjxTqhL4KUTE z{oO8qXMyQSLo!~D<`^&8m5#f>YmrGR{DH3*iT8#Vs`Vi(yUwEZb0ok_R&DYCvU_ITWm!sy_>{tMILA`v%TD?qbHGEVtfKm&l}6V z21{Z-mBwM6+rNo*swOEHGIO6VxjZMFH0b+EZHd#EUymmBe|D%0MDv8AS7v4xlm(eK ziD+QwuYL-pgYGzfZaH9$sUs$@1NhxK4(yf!ld{jaA_tu+!ghma>IC+kFLQtnazGZG zh?_XO)RnGEB6K7=UfGO?1ywvA^+OnL?%d)}4qOoN#tUD;aOs*~yhH#K0}DuH? Dx@I&F diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square150x150Logo.scale-125.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square150x150Logo.scale-125.png deleted file mode 100644 index b3f74401b43e21929b30ab86371d456020913f24..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2759 zcmbtW{XY{57uT%}k;+}VJSOkLrOPcTHYFCqy;RG-{eC|u^CwrRl7gCojEszu z>U80seC4730WjRR>b-z`>oRu$)&?Y>bI&$W4oP2vt@Oj8@d2U>!cBC2V) zE>R}D2}`1tePICvp4ThKHHOC2TZBH>3N!C6TIQ0&j&DeK*#e{qCd#qOz{q#%#bh=f z51+}tIeLS#vva#jKM#@?#}40pr5A6owyeJG-e?>M-mviYi*mbZg!hF%>v3`(#)3`f z$jJKxWr=e{I%lJZsajGi(Qt0m>C4q92*lbnab2)Uyu9uC^r9XNFWw|F@b=t7)Mih# zxhG+Ba>J097AS2!>tj z0tanJRRy1Fq3r*1@gHcb*Fqt@X)~8@!$a&Vf0l0z{H;8F0vuOR39#M(>#ka`Q zEal`*`Z(HedDb~l>{sQo%L_uNU&59R zQC!`*fH}II6Po0Iuj!@r<|`HVnuJ}HAa8GI%+FZVbSOHv=&}(OzTE?~TKT}cN|AEr zRJkr4gHHpH-PM??|0K|DCe8P2a6DsD_FM8ds-pSDuP|Mqgh#aM7D*uvamOsCbJ~fF;g;E6hIC3iJ0J>+muhUhU{;|=N=$Z}F$IRcyfO5K>X+m`yDnTwITnA-alIlvCrRJ| zGqIrK-hE9qJzm#yega_&PpmvCZRBJF9zGVP;$mB@3?g$W{MARK%^BkK!DegbJ{Yd) zDbDA?G;ebnJrS?Ce*-Zb7ug`RiMvGJ$_8XW=YEx1)>5*ik&R2rc@t~RBQ*?Jf@R`I z9j4*9L3gGt#6q8dQ@6PHzftXUj-tHkzj+@%r;|ucQhWco>_Ms-kh|8o?O&RW_apRn z--dT=5jbQe`xBIKmI}HYxeG-10@1((IDR zl*GzMCT7!TemE8+OE7cMUlA80tw{=Ih@=@GqiQp^vlmPedwm9PSsANbM{l(a!`FR} zz9YGYugZ;Rn1=&MUw77nG*3y$^|>XgL>#Fsi@G>LsriN5B{JZ% zVnGCBgILf=Sc>SRh?P;j!&BSjm>8z^4L{N#js3aCrLHRg5PUB&1#V)&nm??(e3UfI zjxE_YkX~;$4KVAb?Z$wZw}_|X^Z^v-^YL_KVmOkab8(ofBd!@p_db(ZL3I;R!%{{c z_}Gaju!#q7gKTGBa6{|RK>kE?`2om_0mafRHt1lK3525j80S=2zFu8az&f4F|50q{ zAC28VdM%;AZ8$X;l&iREOPtD$x&9Hz>x*nVXM8hl+ByK&+N{QdB4tVx3wIBJjq|+q UR=?lg`%GmV?OiX|UAme27YiARK>z>% diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square150x150Logo.scale-150.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square150x150Logo.scale-150.png deleted file mode 100644 index e4861d09d2a9b7bc18a678531b722cb46687282e..0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F_07+CYJ_AzSCRk7cd5x*28ZiEt|$Q0V{a1IY=#<*uA*mNrxl+{)yu)rrZ VZ|5IS#5#fkrkAV?%Pzp<{{g+2zOeuR diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square150x150Logo.scale-400.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square150x150Logo.scale-400.png deleted file mode 100644 index 3104ab19ef3163b604a948ef723e86ff43574d0a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6741 zcmeHM`8(Tb*Z<0BOE<;P4jM`^G-{}=*0yhHRnc~eSW2j^6N1vQB(`ctRaIvwLu#3N zrb>cT>=lWkMq{ZVN$p$hO9T-@czyBR<+`_XpYu8AbME^--=u4H zmk#Zh+Ydp|A?wQ*Z$JH7bI z1k-q)t8AwxSxBzB1UvVN;>ne>M92oFJ_tWaVmiw>d2B6bjyqXw+!#<1QR-IT?Tu_CvoM&nQu(M{-lv(xw=MojUlE{%;Pgj$97v zngCDn^+jt`)mfoL&K-UJd*d*Qi`RUqmMB@+g?A?E;_u12HqGfD%XPh?_m;5-b^tOi ztKMJA2=YsNG;7`5J@F_eYe=pvLyF)L{v*LczFtg=>{@aJ36U_JT^Ow?AV%3P*TB;O zM#vqiVd`bZo2tQN|`yom}=WKDzt}{6-qAK0U*!4=q^_|mV2 zZ7tQ#!VcYWPU8<6A?(2$Z2dnpMcVM2|uB1&oDq!3g-%MFa7*czOP;EE^_&4x+p@omr2$9vnN`-7!ob^Ea zv0JP*`Gr#9*|99EO*CLDY4J3eJ=I=Po?e43%bF}tkI({o8%u6H^znV)C_L^-rTaF?}sVLeU8kl)vrjeQ6@og^R;V2K}M#$?~^8`c&@mq z3>pj?Zlv2J^=Q^~=F~bEd|;P?C0&?6)&v&hiQrIeusm`Yq0Y2PDmY4ZEg=8i+%f#E zHjw5WWE?ubJ%P27kNhGB!=n3PIwX{z=IN1Ln=(5GHK&8M=+ydQ`N=&%QurJ&-XS>0 zB$UwZb;w}4T?;@^@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CoO$H-69%B(LIQS42i>6n diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-lightunplated_targetsize-32.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-lightunplated_targetsize-32.png deleted file mode 100644 index 90a762d97d321faca85433ccef3b313af61985fd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 711 zcmV;&0yzDNP)mRTYdl+Sc)wRTb8uU?8+w)?TRQU%Hf`4J+5TWo!Pn4*u{&F-(Wit$^wJJae=Cg zT?jFQ?H&yqonVuIvhZn(92I3>4O{_*+eZ@umXC z$AI^Qn$VYb7%T9cM2rIu*{+ZoFl^$dPe=0D$ZvNIK5#5paC{dAHoGZs2oy|Zy%?f?}!!`xbnrKeYO+K{QDkV z(9+di`FjZ%0_`p^bTvcE3k{F<$*xsEI11z%imL8vTXi*~3%~i9cN4%i`c7*Zkqy=8 zr827MhnH(*sV;m>HWY?tXbPZr01uF-XO}caHFz`6f}5 zOCQh#HwuslX?o39{RuEYFF;iF=**Yt82`QuZ3281=oa|t<%d)SYA)OEKe8N3ONwGy t3wo~Sjlbs(-Qaq_miY$|AfFB*{snSWge-D`6>$In002ovPDHLkV1k0WJB`6pHRCt{2T1!&fKoITGXKV`_EH<3PH_0M5NOA!l2$1| z2m!-0uei1er4)>#7?iN+AHCM>;&uT^2E(BTH(x)3f6{3v)b$7+BN%=80YR7p^v^KT zt~M`%%I7>*1}-oI{jS?su>Jd?`Dvh_7f0HSAHW1Wc(3UQ>_6r#XJSJx1XBh)i% zFf22FsmxfM@CinrzCm#RxXL*nz|F5K@CUuu52qd!GcJ|TbBJORGXb(owGYcU}@iUEjmAUm0^XwS=fTYpp+Kb@Id!`%;yj;uo3~?YvwuGX& zl5BB<$|KFpIao4OHVaOw?-{~KKsiz+mFaTxEg2n~bAAevYWYPIn;NE(02+fdNj8m0 zHmBdkX>++@jCPw7Ko6*LWHx8unLK(UjK^qOM%IXcof=sk0`|wq{!;+qXk<0xXk4RmUgN1fa zYO25xfW_#zxbP!#61Ca~9PmnrUS-p%NIc!Q1Q-~Z^!9G|2_!)3`rZNxyg1V7&@V*x zLkJC&Jd+Lva|d}ESN`0lI1xdi3C?EAYA498D2`o&f8#!8p#0TUNB{r;07*qoM6N<$ Eg8R#C5C8xG diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-unplated_targetsize-16.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-unplated_targetsize-16.png deleted file mode 100644 index 6c39100e0012bcd5cb3609a189cceac096ea0b97..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 508 zcmV>6E}VaTQ~Fvj8PZ)6_1=YA3 z!2_s;GGYOQYm#VGtY|V{mjpiI5F!b&y=lOZALU^bLsyj?PtPYoh{4E50*Zy=YkW$b zW%1kn1(a!%O;g9`*w69EV;m<5Dpzf|W1869fR;^V6jT&xAKgB4+`l`A)#^|efqv@* zR;|tW_2~wN2!O8v;E9}oN0oPwWH`<-NuX-pd@g8CMPZ)}n-BfxGe8 zyQLiOZ>=Li<6mW6r?=gEY@k}RQ#leh9L6gpuvw;K>qMB1&v-uPHwhCzfJZLtI`uS> zJkhmlOW32liT_gqu@2}DR4yOLBoTL(p2)h*W47|plbXqv5fkY0VMuSgV~U1uYLZop y9~12;eM}#S0-tSXnt=4Uy8724iMczyK=&I3ORvE0Tsy!30000P(bAI2$y>!sq zU0p>-1puJ#>EY@F03_Q&0InpHfU^~$GEt84@Q(#x!{$F0Nw;T5 z{C#x&b#lgVKZYOIq{n=J*MA@G29ka813Fp#2z_$$r&OqRQ!0!GVdHd-UuP&Cp6K3h z)25wehPUkg>a1m{*7oU~5B*<`pI$#DN+uY-(HfDpKL8V*1Js#5e<5Xcja^v-U5Raa2Wc>Op652m(SU!-3Hi0Gj`wT15 zba0+N|15;0aJlMTgl=a+T^&zBjaau7Kj4y5H?3s!VjgidRWL@v+D&c_At_~cZTl@@ znL-?jS>r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wM20LS z8Ca}#l9?g7$Hf#fCo%c`Om0u{67D0ayQEy|2YWnzVztvpd;J?2-f!C)lbT5^V`nh=o32Sc}_#anW6N*gRa4pjklcq)m+*5d9v^h%To$+K&1^ zh{m-dpJx3zx2&wI>1k4PhFe?@COdxllLI%=PNLF7l0JzJn`ummMoF~)jqVR*Pqw#_ zPJ6<@LHBR-Wj+G!vlv#5-j*|Q>>fiNmA6Qts_HIYuel(%rzJOxU>O^K1PMBG)LB>o z>0R{Wx?A|01UZ#YGZImfuejAOq2jqIqQ5q$Byekoc?;)xG`h#~#e8Ep=>u+Y#XU4v zRSra!4MM!r)xJoasJ(vchJ&ZqBbc@Rrplvk4v~uci(sJi!5|bv`0O{TQiypEWZ^Ot zzRrI(Z8zkM?CC7$AeZ>Qg%W_QDh>Ny(gdz9r6I9i2-Q_Wj!5ras^mpAUi>=IRwr+BW&~woK(uz zd{oJpQ!)#zQU{KQPC_p+2m$MCTecBTUY0~u$%t0G`wq4x)rLvPwFXsvs?xE=Ah!EQ zRc7Z@6X9gpnG_pdAzYr#k~cG!n-yE`Q2@eHp&UD06w+MP76}09;ttS7g0cGylMdg8 zc*z-|&WISAi2^gxRVO1p!5f`YRPA*F1(N)3LoriRO|sjjWkj0$3&;bZ8fpNN_76k# zPELjG*%0Cq5+H9XFJxsFn0h0W3^dPxtz_6_@d0<)AL+f<85mo@ZMwZ4?r1g-0`M0U z@85@Y%gAsqIe@BCoO$H-69%B(LIQS42i>6n diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-unplated_targetsize-32.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.altform-unplated_targetsize-32.png deleted file mode 100644 index 90a762d97d321faca85433ccef3b313af61985fd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 711 zcmV;&0yzDNP)mRTYdl+Sc)wRTb8uU?8+w)?TRQU%Hf`4J+5TWo!Pn4*u{&F-(Wit$^wJJae=Cg zT?jFQ?H&yqonVuIvhZn(92I3>4O{_*+eZ@umXC z$AI^Qn$VYb7%T9cM2rIu*{+ZoFl^$dPe=0D$ZvNIK5#5paC{dAHoGZs2oy|Zy%?f?}!!`xbnrKeYO+K{QDkV z(9+di`FjZ%0_`p^bTvcE3k{F<$*xsEI11z%imL8vTXi*~3%~i9cN4%i`c7*Zkqy=8 zr827MhnH(*sV;m>HWY?tXbPZr01uF-XO}caHFz`6f}5 zOCQh#HwuslX?o39{RuEYFF;iF=**Yt82`QuZ3281=oa|t<%d)SYA)OEKe8N3ONwGy t3wo~Sjlbs(-Qaq_miY$|AfFB*{snSWge-D`6>$In002ovPDHLkV1k0WJB`6pHRCt{2T1!&fKoITGXKV`_EH<3PH_0M5NOA!l2$1| z2m!-0uei1er4)>#7?iN+AHCM>;&uT^2E(BTH(x)3f6{3v)b$7+BN%=80YR7p^v^KT zt~M`%%I7>*1}-oI{jS?su>Jd?`Dvh_7f0HSAHW1Wc(3UQ>_6r#XJSJx1XBh)i% zFf22FsmxfM@CinrzCm#RxXL*nz|F5K@CUuu52qd!GcJ|TbBJORGXb(owGYcU}@iUEjmAUm0^XwS=fTYpp+Kb@Id!`%;yj;uo3~?YvwuGX& zl5BB<$|KFpIao4OHVaOw?-{~KKsiz+mFaTxEg2n~bAAevYWYPIn;NE(02+fdNj8m0 zHmBdkX>++@jCPw7Ko6*LWHx8unLK(UjK^qOM%IXcof=sk0`|wq{!;+qXk<0xXk4RmUgN1fa zYO25xfW_#zxbP!#61Ca~9PmnrUS-p%NIc!Q1Q-~Z^!9G|2_!)3`rZNxyg1V7&@V*x zLkJC&Jd+Lva|d}ESN`0lI1xdi3C?EAYA498D2`o&f8#!8p#0TUNB{r;07*qoM6N<$ Eg8R#C5C8xG diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.scale-100.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.scale-100.png deleted file mode 100644 index 11dabfeea716f1e59186823e2d1a181e14872a37..0000000000000000000000000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Z2zErae)3@b!kP~6~; zIj2V_xVxPfXnE32)qS}D=8|gg{c$7`^WIfKyb&i~J-9epBVS#>`HPcPR|UskI)Ki* zYyV~{Megcs0w0W?6^__df!1TZA}fW3j4P?TY(8e&%-9*DtzH zHWuqKw^boeZgKO$+2(CBy|$K}>Atn9UDX`v6H?@gynRGV5exR1OXp}2>nybvsC=?) z?M_mg)oz1zAKfp6hi#R`C6Dz!2}qH9Y*z=)jSTYI$9aJyzSZ_IM^jad(?T=D+6{;^)hn59Q=`^o{YMa z>juH{!)F}&BS%x^o1ZTsHFpEv%65IhJFA|`XbJeUis%>`JqIMG#Q#-oBsih_96f)Y zvRXAZiLF|t*6pMMe diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.scale-150.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.scale-150.png deleted file mode 100644 index 4255eac30fed3394121bce3c68effec87bd2bf50..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1523 zcmVrAb6VRCt{2oK0*SMHI)McfJ0Ioi7EYQc+b!Ay5NqlS}#`P?A$y z!3hY6L){*@wFnU6l1s~l6G&9h15!AI9zm!FB!ZAySFI2Q(I|YVTtZq^NHoyaB^%pW zfAQYz#9i;MU5_UrjypeT73b~PGxPV%oA+jS9fX%oFF-)=fpQTZN&-4y-_t>S*$=uA zhf-j(o3uG-C_$kZA|Wg&6@VQNFII4~ThJ;fAvj71juL{Sgy1M4I7$eP5`rTpL;$1D ztOby7@o=2t#Eu9CiP+9^xuLg+34tQK_S`T$vuk@Z&HLZD{OcbueeMcCcMpIbvcEtQ zq+F``9x)-T0vsCN2`}z@Ot!5XO1zwb=}#6hhd?2WD2|XA9v#?Q93`5Df&drg{%8@N z8fGrPzOCK>%vH>r^q}3@RTCh$Yzq(!b5ZaxP!!!jJIg-X-B||gX|a}A=W{r!v-tmQ zTLc;{(QbSlmKWmUZ+}8+?m9r&=cCZ64m{cm$+1MmbbC1mAJ5L)qtc!EbK8kSd!Vl~ zQZaw_%@tU@aSOjm!&^trg7JM%!PsyE(>0*oud|4wrf|<5F=&();;XBR@cx-^(J^&+ zPp;%(oOwR z1tkPW3Bgf9aHNIEQQon#${eEyw7Uba5;?>SmM`L8-Q_H~jg@g=X0g1P@o&I#23Jt| zjb~{g5*Q~;92lbI!+R1%7)ey;CGn^M6QhH5R}CuTjbQW z5J$%o>}Zr7eVuUrd^0E?!BIkRq=lf|;U5f}J@cKwIo}Zt;dF>sOje-? zi%b93{mg;>E(itn%KtZ)?m~tfre7WCU?0J#v#&eWbRP(5AwK$g9^U;l>OhXs z=@UqVU2mMN>nwjieFUD^-diyreeWz>xHRt{Vy8_w_0}tJ^4MXien<;ZqMe@-KfEVB zOW~TmR(an#$X+bb3-3v^mm1uTtB14@8f9@>z<=1HO{-zA`s;VjX(F4h*_$hF(9YT* ziE@@4B?Lza!BNhVqnss2T8P&V?}1k->8cY@IiX;Q;)Hro87DJSM=+pzxo$uui?k55 z$?Du_eGn8eI)kM~*wHUmz8RFW;jKZeNx&kjCZBNs%04+N|p=i>~B~eFoK0 z@VSW%?W_%wNDJ}&{-+^6m89jvd(z6ofa~JRw%#tb$H;E(awkjNMrEA5IXMoCqX~d8 z)lqid`c%15L>6fw#)gO3(I|agG2xBYS5yC7mpKbX;AwqM@r$PGychPsg-yl=&d2?M3@%6PBQuw}gL4gFWjIvL681>IBN^ Z{{WS});PQRzJUM$002ovPDHLkV1k)~!1(|G diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.scale-200.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.scale-200.png deleted file mode 100644 index f02661b2f4cabfe8fbf2580a4724f40155ed4b94..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1723 zcmZWqX*e5*7L5oJs&*=|rlv+|hN@*mi8a)cDQU+#6b-3_SgIOpN@AO7(|%f1o0-;< z>a^Bcqo^|4($O%8grumY(Ns{>Qbyl<-~5>OHQve)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44x44Logo.scale-400.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.scale-400.png deleted file mode 100644 index 64e172ad488434b3e068a27112739627c361adb2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1912 zcmb`IX;72r7RQs&5DEf{Ms`y0UQ}e$v_t{nB3Q)KU|AxCn6OwZ6k-Gtlr`0e&hnfy&-~B%@XT}L zEY4F~(?}BnfoOZ3^6=S?oOh<7zU|o!6U6QCG3C@(u@K1Kf4(!Qm(M@mKp+S!FAq1r zE59ftm&nHcdot$7Q+Gd!INfh|-iy|Xph2P_0}wsE*Fo_@;%^_}&)(>a&~v(R+$^?_ z`75=&@jh^Qs(E7V<9=8^)x%6eNOZ;|tKPCxS%B01lVm!RIK~QKs_F^+`{b=g#Z`J~ zoUbt38JpTrgp5$y1f-c?9JrJS1A}(jSMK`1(xGvbRA>X3!JMWmJq3fydlZO~={UJ4 zzGC6r?*X<2G?!A~g@8Q0GFg%CUnQYSwGx$)7v@q_Ex25rKvQ^=Aql5glDbAaAMDO0 z7HemOOGMu_TjSm4NLk3$Gl6NO9f;_g*Gw-+a;Xc|LzA9d;Ih?0>{iTAW}XM9+_|Gd zL1T@GCk9Mv5%O?8!U2Z&N$GKvM2eJW7l9>HWoJ|jzC*SPW#aF);xi(dCDt36!#cO< zPY43$L7$NZ{cw!FKe)-Tx}f`;D=USc{%vrLoA4Xr+O_5eO-Hz+0EeXwlfQUdiyu#@ z$uq@oZDl3SC>Zs&^*gqistdc+n_+O~zIBvCDcookOwJ&Hd> zX1~CXKN#LO7?iV+4swREgQ?^;JcIt9^28dhK;xIYiqEBOGwEQ}Fh*sixIA{Xk9R_t z6}FjvXAA7v7?H0xuNP7H7Ted?k4rBQ>Y@?gJAgSdLy7?t`#fc{brTfPeYbUzx`?>&nafvzmmM_y!sQi*uG*&N~ z=wUjUa7@E92JLJXfjDD+HG0(aDQSC_G1_eW?5yl(T9F}fhe867mg9mpIc3sBBOj=0 z3#|8!(M7k-SBVVEzt=Qqyh%6D`G7N4pnWFRv+&hdrj*A;enNAdf?WHySXVG1$4?mY z?x2Ps6jZ`!?;G#(B}?^zzx&#r!cAUNrZvzMA=T@@f@x}XSRZKSQG#RZ4in1ejlZa= z&+ZF8^&vlM9&K&u?cSN~C)}k&3(p9sgym8=Xmq;;l9T;DDZ?D*WPGsXhim^&U%kJ!+>J#0Y@gp;i2d3C7r?BJZiOoH(3fqU-t(#58&^Yr)1xlZnwO_9=g zN=~jy_wSmq0*6cUF;9NskOE_?jvToy=s3JU6O^j8A2=t$lC z#M$zsp1|AXE>>~0N-F$!o-qmMZqhMK7BX&?dS6m3{p!l%7S_5@VDQm8)I-U{d>yG` z6WQ3$o%bg@9K*;QmR=b+=Rkn0<^7b3Fzyf>8g@~EkdI}nXSQdv^*#YD&g9*Fk~XyA zs9-cjdw*oU-EM2u!z@fdtQ8qZC5{O{&#cmvWrU)OJxBE!F-u_^L5+JoJecRVg zY8Gl4Um@I~D;8Z=r^*#xpIG39{G5O5@QgBRJG8`Orx&qZ$58C{@lZHnjvXPN& zZ-%r6kpfnfG};>qorl$}v?Mj_1!)*iLI%3-B~y4gAl%d;Tc5Ki8e~7~spGMjcHbFt z7FQViFGhQ(fuZVz(YtwgkSJI`-evEgVZ;%j2&v66&r~hq1L4A6QuCV2Dy%b>GAxR z*_j=>jeXIdi@Vi&pXs0elIq)xu7oPG3i>>=gvQW6L0Y{ jMenoas*R%O<697Vr=}n}>pE)tD}{KS#Cg=62)_0Q;L4Hh diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.targetsize-16.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.targetsize-16.png deleted file mode 100644 index 6c39100e0012bcd5cb3609a189cceac096ea0b97..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 508 zcmV>6E}VaTQ~Fvj8PZ)6_1=YA3 z!2_s;GGYOQYm#VGtY|V{mjpiI5F!b&y=lOZALU^bLsyj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jWkj0$3&;bZ8fpNN_76k# zPELjG*%0Cq5+H9XFJxsFn0h0W3^dPxtz_6_@d0<)AL+f<85mo@ZMwZ4?r1g-0`M0U z@85@Y%gAsqIe@BCoO$H-69%B(LIQS42i>6n diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.targetsize-32.png b/samples/ComputeSharp.SwapChain.UI/Assets/Square44x44Logo.targetsize-32.png deleted file mode 100644 index 90a762d97d321faca85433ccef3b313af61985fd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 711 zcmV;&0yzDNP)mRTYdl+Sc)wRTb8uU?8+w)?TRQU%Hf`4J+5TWo!Pn4*u{&F-(Wit$^wJJae=Cg zT?jFQ?H&yqonVuIvhZn(92I3>4O{_*+eZ@umXC z$AI^Qn$VYb7%T9cM2rIu*{+ZoFl^$dPe=0D$ZvNIK5#5paC{dAHoGZs2oy|Zy%?f?}!!`xbnrKeYO+K{QDkV z(9+di`FjZ%0_`p^bTvcE3k{F<$*xsEI11z%imL8vTXi*~3%~i9cN4%i`c7*Zkqy=8 zr827MhnH(*sV;m>HWY?tXbPZr01uF-XO}caHFz`6f}5 zOCQh#HwuslX?o39{RuEYFF;iF=**Yt82`QuZ3281=oa|t<%d)SYA)OEKe8N3ONwGy t3wo~Sjlbs(-Qaq_miY$|AfFB*{snSWge-D`6>$In002ovPDHLkV1k0WJB`6pHRCt{2T1!&fKoITGXKV`_EH<3PH_0M5NOA!l2$1| z2m!-0uei1er4)>#7?iN+AHCM>;&uT^2E(BTH(x)3f6{3v)b$7+BN%=80YR7p^v^KT zt~M`%%I7>*1}-oI{jS?su>Jd?`Dvh_7f0HSAHW1Wc(3UQ>_6r#XJSJx1XBh)i% zFf22FsmxfM@CinrzCm#RxXL*nz|F5K@CUuu52qd!GcJ|TbBJORGXb(owGYcU}@iUEjmAUm0^XwS=fTYpp+Kb@Id!`%;yj;uo3~?YvwuGX& zl5BB<$|KFpIao4OHVaOw?-{~KKsiz+mFaTxEg2n~bAAevYWYPIn;NE(02+fdNj8m0 zHmBdkX>++@jCPw7Ko6*LWHx8unLK(UjK^qOM%IXcof=sk0`|wq{!;+qXk<0xXk4RmUgN1fa zYO25xfW_#zxbP!#61Ca~9PmnrUS-p%NIc!Q1Q-~Z^!9G|2_!)3`rZNxyg1V7&@V*x zLkJC&Jd+Lva|d}ESN`0lI1xdi3C?EAYA498D2`o&f8#!8p#0TUNB{r;07*qoM6N<$ Eg8R#C5C8xG diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/StoreLogo.backup.png b/samples/ComputeSharp.SwapChain.UI/Assets/StoreLogo.backup.png deleted file mode 100644 index a4586f26bdf7841cad10f39cdffe2aca3af252c1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 456 zcmeAS@N?(olHy`uVBq!ia0vp^Mj*_=1|;R|J2o;fF!p=8IEGZ*dUM0H=rDtTTVkd2 z(%lbKn@VS_lUaADVB&;Z6F#LM+mPsa?e>FnHo;HND^!P`-lX%BH~FOg%y&x+t*x!? zg$#_1A1kgsSvO(fw`bOmo;lrJX8byO1j^gf7qohR%mmt z@L)WX;>gqgK|tWJvQ5j;4;=gt4HXVKSMYRv5RhY5vS~TqfK_NAP*r{h!!g^BZ;w4r z7CGdsai)y;fJQc`7{Zc2b==h%o`Op$|bg6a&nL{*m7-=0>k4M4-PXlU;G-?%*(*g>iFt^ U$m#7DfHB12>FVdQ&MBb@0G`#n8vpK1oDDRCt{2T1{*lMHGI!_S#;@>%^^TP(>)M8cIS%14vDa3JvO^ zL~ub>i#XKezzKm=#4QJYPF#8bL@!8|h_8skUcjG(3=7XMfi&)LKV}|&zp!|hUZ3hz_A0n zTP15##LZR6elibGUPNhCfM^e{QXI=s42B^d*}?FqTKUp?%LQ(P{2B)8P?)cPo(EW4 zL78Mugb1mkgBOqwfy?{ zW02NV*7WK5S(v|eliPuXk`7}B_rlo7VBO3TAIr+5$|bbhBKBWm?SYAWi6l;+`3iM5 zZa3yj@Z{5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J*lFJs%LkC*_OygN4pemt<2#B#GWtZMEgs%`|&E| zboA_w;UBzNnus3Y&+f#?1;Z)Qv8eqXuV)z@I=izMpve+|CQAUCECHw`OE!Cuw2T)> zt2Bk6kgO`1aP(_D#Q0fGO9LFo_lMf~S&q{p7x+=WpGAvi!_H}t4#M)P!fi9k$eJ9> z!z^V149@IM(3bpQ^A!L1a1Lfazr>&D2-Yl&w`327a|1AYb;kd~LL`OdkjQ5g2HVQW zqUF=mr^QzV(*)@BDe-wd3Sp)v)OhCGg;wwaklz&+3TnFvN$M>{7Nu(E7w*G)7w!sM zEUZc!NpZ5!qHR_jc=5tzfYN$&T-M2O{q&A!eFY&m3>gwu#ha}c1GC*lVC)g^WTkFQ z8ykxcg6(B{1Ck0J9X%@@{8du5JGcKzK(c31uE_HD?t&LR$Rq1>r zBdeyjy3LE1L_)G?iBa0uTi#II-J~H|%=Vm1Sx~r>?(>y=w}n321+~km+Q^doH#pcW ssiYkzL7u$Qb#|QuFJ1fKf6jq8Wo1Hx!vFvP07*qoM6N<$f&fA{EC2ui diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/StoreLogo.scale-200.png b/samples/ComputeSharp.SwapChain.UI/Assets/StoreLogo.scale-200.png deleted file mode 100644 index 7bc22428e676b2606bb41df873550e150cb617d2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2077 zcmaJ?dpHw}9v-!|+-5c-iD8+TY%aOS7~8&F=2p2Z*IXWw+!HF6W=C22B;;E0b+Pzp zNG@}a6K2KOP!x-D2{p;rspmP*^PNA=Ie)yr_j&*PJ@5Pee%TZkqO6pP6aWB_C6fs5 zKRM(Vz@VQqW;WmRC+&?PdB*_&h=ac%L3T&20swo4$ppM-@|{m5)NoZVc;E2y$D#E1 z!KPf2UO10Jqx;m5e0mU(iawlgYo3_~y5dUYt*ne5JB^dC3N*nzNoPkUAxWOFibIvPU))NeX^mwhf6pyO~^I$Bql+hg<_``X%B{sXsy}$vy#H^kF>rBwv)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zVIGjfuvSPI_clbdjFLaXw;T{&^PagQb|)Vb2gST*(k6J}I-6-g_sH#@O6jheXuvq> ziIH?FRqpU9YD+FK0(g;u39He0Ok}Lz!TWTp;f|W1(sO9{{R30 diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/StoreLogo.scale-400.png b/samples/ComputeSharp.SwapChain.UI/Assets/StoreLogo.scale-400.png deleted file mode 100644 index 87e3523c31b746d3375dad7b9cfa38d4274cf8ca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2808 zcmcImX*3(!7EaI>sp*-j=nYk44XqXz722q%sa2weh^o0Nt=o!9N?cb>RZ-JL&2uWz z$&kd*MiEn$7Nz0}bxT4>iFtVGTkrjRcdhr{dO!BrYoGJ&b=E%T`}W#NmmO`yM30IB z001#t7}S~X=|4>PAb%xZBNg(U$ZeSWF93kti5~{Ebyiyj07MD4P%D?nr;CjKG$k8_ zE^gptV1&81)2~cR@jsI#(v^{__)u$6=O=N;rvRFbnpes-e~w*8CJJhRM7l@4n!vwF z0+Uj7-vYZE1QNVX3d`e5-%-uj1?!EUKAyWd(y$YW8Do(+yV2z@(2E6yd8|zb*F_gM z*V%+o&L#3t)}}q6)`g&&G8W;Q-HU>e$Ga)!mX~{u;_tWbYDwqFB!vOi+#Lz-@<3q) zAn>q|kb$J+8%s-o;QueU5DC=Ef?kwPKV{~vtkWNb_3V44*L{Hoq6cZq4-}-^1s3&E z)L?`CF*|l)6Pxzs3@NP~>+IeQ^ZzpaG^=B~W|~<$o`vKbJ>SL;78>jdMq59}q9oM&fbc{WWyQ>-rB?drdzj zR8vsJb;L&vMj{8dgoF;P1i6JSP<+cGi;<*GmEc;6uj%9aJ%M^cLLCilI+aC3X%W-; z5!6-V>rPvJ{_(h}jmT;p^|e5~dJh>@fnR5OxB9FhsG2h=Qj&`noWor&mrbOt{=klS z-djh{&qJC|=k@u`g*}Ec^L6<@P=B+0CS~Zd93BzLBd&ysu)u<7eqWk5_p9d zazZ>I4VMY;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p*#Q{>~7*tX2K=xK>|9KE297u#^ZRc7T<0K_=j^ zH}IOIzN$wT@VN$ps+bwc(d53)9V1Y#$QiJXsklN|AVO5>2J@gFO3AsBXBiRh{%+je{<(h6=OBXG1`tzK7R<|F0)c{L$s`Rm}qrS^ZDksdn&KUdcj<9oj z5e}NeginW!+=yLiW+Gb!N_%EE zwA)2;n6$Q?1JHSs@)&)#^VAVK(z3Moc0N~wZKu~BkNo*CeQ$nA&_W{CZ4;EJP3%;e zu@Dn(?g_N~eeZE*kWK3`{bw1+k3PC+)+&>OsGf?89x*B!J*$AEV@*@**58XD=p|ms lhgh#vJ~~d>1e14VnR7EKrjp*D`J*hr*4hzDI`8xA-vNb<2krm> diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Wide310x150Logo.scale-100.png b/samples/ComputeSharp.SwapChain.UI/Assets/Wide310x150Logo.scale-100.png deleted file mode 100644 index a5704b35e4fd7d9709ebe919e4af0d613a8b6469..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2626 zcmcImdpHwp8=u36ra44!Z&;%_B+2_W+Z;lAuse_dThJw>=O+D{ABPQGA=0n&(hde7YBPUTnT^b zELO*Rch8r|C5&~pMpSJoy3ZYzrIDcC8{SLOt}TUz5?Y~d@=+;>UNqX$SO z8Rzx`OF-awl>p(;^H&LhF@yeN=}i<(w4vXF+P%s}?(dd^7c~0GJ#!m$=tKW&(}9J1 zL!6?rxbZRpLO0`w26!cm$2a(sFOTQ%#}QAFb{R8BTSeKlLfCbaM=(g{Xz1|Y`S24& z(CJ*S7_Et?<36UD@&>st22YIhLJww@fa!BZrH>C4FB;Mm+MOS4K{}r9X1@s@Qezxg zz?vsFSJkezypdSytZb|3IH-&53ESor<@#lZMuWeeRe0-{=87knTo?rAQ0*x{57-5Tj~^Ro9=+h{+3Z^N2obZo ze$Mc99QuY6D=DH=kpJf4LC2~(XtaW%U$$(&r8gP}RxM|fhZEqSNFAl3 z2(|^w46^kK_jXlrOAP_|^q-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GAwPc_v1_tadMR{rjiKn2~#@D&XyR21?m-}z$RpJ90^o(YeH`^1=GA}*J z`21sn5bkn{R&d4>(4Xz(t&zgMy)*WkmXxkHCb0L%^>2a`?lQU92RJeZu1pAt9P!JI z?R>N2|L7DAm_9%XJaz9r5%#S|lKbWDCWxIcE8~17mp8irLa3Ml6;r;4YN)q3rBY&) zA6GY1=j>7#(9*Zw@Aa1n$LhcIhQa?J+b=aW@Xh5vCsSrkiX~WeMQu|stI2gwlU>&{QVyjHlb!sb!EKeRb+(3 zp9e!rw-5N1{-b;d2`=wgzuZhYagp2KRr7cD#S~~rFzps*gUmk{VesXzO2aFiT&zGt z@H#{{5kE@-4WJg2yEsvVkHyk;J^_0nDStbOYn8v(2PZ6QBOk5?E9&$Ngz1qMBNOrO zD3n6@L1`Mp??IS+ZHlmOCJ-BaY(o({-S&`2gBJuHsQeQe(xI3T^z;2!$x> z4$By2_=to!K!o>luzCoS@bik0U+fIczDA-`Mr^uHG;4@;XEH<`5y}4QkU3;qR-@eL zY>1LjWeGGSj$-s7k$B=qpgE+3dF;A>Th<5)@D)P0K=7Rky>M`XPye{%O7CZ9X9hn diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Wide310x150Logo.scale-150.png b/samples/ComputeSharp.SwapChain.UI/Assets/Wide310x150Logo.scale-150.png deleted file mode 100644 index 73ac19b220235ce2a7fa997fd390892102c209ed..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 3267 zcmd5<{XY|2{~tXou@DtjTV=Is6_Sgg%tI<{VYQK>i-oYrSXk$ICEo`rm=(3lkS>8CRVs{sAp$`e1f^y;ucpWzKW;7 zFl24^LK|8C2>C5#+`EO_k@fF)HRQA-D6q?Xihg|r$ZDIGK>DEA`PNbd7xe)RbhpD@?`_CH?1m$Xs0_(^dr7Pu!g%~-f=@Y^1< zjf_Iq&bqyia1>}`D9do+Aoz=Kdf%8{376>Do3EPiLFx|KODrdDwwo8xvcp`l28g@8 z&nImr+G%!3w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NS+*2s9%FoH@^=9$o?fQrNDbUS11gTN?wVFT8J z!*ce_{hJ^E=N<3fDJ9>jR{NUEyz9t>fODTPzBaaG1~FA)138LleX6199_#!~8WnwQ z)jgjhm5Ve#RBgdCFoPoCpMKM)4DUp)ra>;L8JJ~U*+LETUz?&l&QBeqp!;by+s(;# feQ_CULb1!RBQVC3Bcw$;#&Fl-f{l|=(d;C diff --git a/samples/ComputeSharp.SwapChain.UI/Assets/Wide310x150Logo.scale-400.png b/samples/ComputeSharp.SwapChain.UI/Assets/Wide310x150Logo.scale-400.png deleted file mode 100644 index 1df2cb624fb4a39fb64691083bf756821241572b..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8537 zcmeHMiC0rsx4%$@qC$!kr3Qi%IDryW~YKvL{Yj=q)BFYCJz*?5V4lkK&z4*q~~Sl)$*h$j>eT3e*O zQ>3ZmZ=Sx+OM)@e(@uSn9uirSi*&qdF|)akqSjU+{1rjS?B4C(dPWKK)uvTv{`WE$ zc^>@Fkc-VtwWRs&TR803G6=J4k)p*^lk5%YVC;*HQvn< zE2N+EIT;~8U|CZqT0CPsSNCDjc*+tk#+(U!mb~F{Al>h`w*+&yI3)_DmNR$3b5yH)aEV1 z1T5p078F7h)Ct&N$9eVOGIyJZg{+&^G?f7zt@ZsT3SuIF6TUK%I+P%Zx(ly(tWe^IW_cE zAm2fy*M`AL`jV6jjX@0d9p(>uUnQ#QX%J4>yVzPsr`T(mkSiyT?Uf;Qpkk&3K+&a| z+2ES_m&d+*sGh{6w_3ay7O<=9-}zp}a@%1L5YyHJ@>&hMw42h0AJsp8l#{~ZTW+?V+)dRPZlfLsJYr~U|vEs z8HI_nZhrDTHZ~uu(gF5=@XIE4y%r8;t+Tb3F|>t&yx8JrYn^%gzR5XVt)61dIe@Xx zRpLT#$kp`6kC1aaVH`tiL-vi;3fOtab`LC<#0F7Plx$qz24L}h2IY!bVX{~R`F78_ zb2f&z?wKa2X%c4VJa9>;d|%#84FHbk=$9+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QFKW+?T$tL3HHn@A5dPn^3V*sVRBUU)2=vwLnYJ<48$2zb5{XzdEH_9?Jm9IgB*7LC9h zn3I2dY&6R(MlCtA^KHX<5bj>sz8p_2bxw{=$Sg703?j(`;GRnI$sW#%0z(E^BT-GD zN>|gQYK6(M8~g!i<$#H#OP~O|X&Yi+n5cml;ov&R%}pE3B&Tsed-#C2CVO%0nR~0} zTsQ6uz&9DN`tnqEH_Aa1fBP+fP3Y&7gXNvk{t@rdoKgh5;rg^)PJKH35GXPN(dk#! zf?OWY{d3`iK44paArw>qPNpTMP{X1jGddM!3?CZcgl7601p`44xlUUF2uo}6g7BU# z-9%nemU`8!9XS1#V6EcG<-zV=+JB3n0dTG#40B7H9csExqeT#Y&j<{8h9L&79XJUf zDE)Reqyx4Vb3ZAw))4jsDLZZHqsiv@ZsE^1pa+gSRGE9iop|u?T>my2>>^(j0%xvJ1RyJAf}{6Ryz-NgQJG*PCp3C;vu;8VBO3+2n!44TqtM?1kW92 zrHB7C+Apsm0NkRME_Q=(3ecaxn=sVJn{{s}7b$0*& diff --git a/samples/ComputeSharp.SwapChain.UI/ComputeSharp.SwapChain.UI.projitems b/samples/ComputeSharp.SwapChain.UI/ComputeSharp.SwapChain.UI.projitems deleted file mode 100644 index dbe45679..00000000 --- a/samples/ComputeSharp.SwapChain.UI/ComputeSharp.SwapChain.UI.projitems +++ /dev/null @@ -1,78 +0,0 @@ - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - true - 6bc471c6-72f9-43cf-ae1e-f6d3e5ed3129 - - - ComputeSharp.SwapChain.UI - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/samples/ComputeSharp.SwapChain.UI/ComputeSharp.SwapChain.UI.shproj b/samples/ComputeSharp.SwapChain.UI/ComputeSharp.SwapChain.UI.shproj deleted file mode 100644 index 509c4d3f..00000000 --- a/samples/ComputeSharp.SwapChain.UI/ComputeSharp.SwapChain.UI.shproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - 6bc471c6-72f9-43cf-ae1e-f6d3e5ed3129 - 14.0 - - - - - - - - diff --git a/samples/ComputeSharp.SwapChain.UI/Controls/D2D1AnimatedPixelShaderPanel.cs b/samples/ComputeSharp.SwapChain.UI/Controls/D2D1AnimatedPixelShaderPanel.cs deleted file mode 100644 index bbde7698..00000000 --- a/samples/ComputeSharp.SwapChain.UI/Controls/D2D1AnimatedPixelShaderPanel.cs +++ /dev/null @@ -1,157 +0,0 @@ -using ComputeSharp.SwapChain.Core.Shaders; -using Microsoft.Graphics.Canvas; -using Microsoft.Graphics.Canvas.UI.Xaml; -#if WINDOWS_UWP -using Windows.UI.Xaml; -using Windows.UI.Xaml.Controls; -#else -using Microsoft.UI.Xaml; -using Microsoft.UI.Xaml.Controls; -#endif - -#if WINDOWS_UWP -namespace ComputeSharp.SwapChain.Uwp.Views; -#else -namespace ComputeSharp.SwapChain.WinUI.Views; -#endif - -///