diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index d348c6f2..d8f2a7d9 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -42,8 +42,8 @@ jobs: run: dotnet pack src\ComputeSharp.Core\ComputeSharp.Core.csproj -c Release - name: Build ComputeSharp package run: dotnet pack src\ComputeSharp\ComputeSharp.csproj -c Release - - name: Build ComputeSharp.Dynamic package - run: dotnet pack src\ComputeSharp.Dynamic\ComputeSharp.Dynamic.csproj -c Release + - name: Build ComputeSharp.Dxc package + 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 @@ -68,7 +68,7 @@ jobs: needs: [build-solution] runs-on: windows-2022 - # Set the environment variable which is then looked up in ComputeSharp.Dynamic. + # Set the environment variable which is then looked up in ComputeSharp.Dxc. # This is a workaround for https://github.com/actions/runner-images/issues/6531. env: CI_RUNNER_DOTNET_TEST_PLATFORM: x64 @@ -289,8 +289,8 @@ jobs: 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.Dynamic.NuGet - run: dotnet run --project tests\ComputeSharp.Dynamic.NuGet\ComputeSharp.Dynamic.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 @@ -306,11 +306,11 @@ jobs: $env:COMPUTESHARP_NUGET_TESTS_PUBLISH_AOT='true'; dotnet publish tests\ComputeSharp.NuGet\ComputeSharp.NuGet.csproj -c Release -r win-x64 -v n; tests\ComputeSharp.NuGet\bin\Release\net7.0\win-x64\publish\ComputeSharp.NuGet.exe - - name: Publish and run ComputeSharp.Dynamic.NuGet with NativeAOT + - name: Publish and run ComputeSharp.Dxc.NuGet with NativeAOT run: > $env:COMPUTESHARP_NUGET_TESTS_PUBLISH_AOT='true'; - dotnet publish tests\ComputeSharp.Dynamic.NuGet\ComputeSharp.Dynamic.NuGet.csproj -c Release -r win-x64 -v n; - tests\ComputeSharp.Dynamic.NuGet\bin\Release\net7.0\win-x64\publish\ComputeSharp.Dynamic.NuGet.exe + dotnet publish tests\ComputeSharp.Dxc.NuGet\ComputeSharp.Dxc.NuGet.csproj -c Release -r win-x64 -v n; + tests\ComputeSharp.Dxc.NuGet\bin\Release\net7.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'; diff --git a/ComputeSharp.sln b/ComputeSharp.sln index d4ae56c6..e3be080b 100644 --- a/ComputeSharp.sln +++ b/ComputeSharp.sln @@ -60,7 +60,7 @@ Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.SwapChain.Shad 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.Dynamic", "src\ComputeSharp.Dynamic\ComputeSharp.Dynamic.csproj", "{76C66257-FDAA-47AB-85E7-EF757EAB10C0}" +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 @@ -82,10 +82,10 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.D2D1.Tests.Ass 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.Dynamic.NuGet", "ComputeSharp.Dynamic.NuGet", "{CBA545B4-31EF-4E9F-A1A8-2A1290B54046}" +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "ComputeSharp.Dxc.NuGet", "ComputeSharp.Dxc.NuGet", "{CBA545B4-31EF-4E9F-A1A8-2A1290B54046}" ProjectSection(SolutionItems) = preProject - tests\ComputeSharp.Dynamic.NuGet\ComputeSharp.Dynamic.NuGet.csproj = tests\ComputeSharp.Dynamic.NuGet\ComputeSharp.Dynamic.NuGet.csproj - tests\ComputeSharp.Dynamic.NuGet\Program.cs = tests\ComputeSharp.Dynamic.NuGet\Program.cs + 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}" @@ -148,7 +148,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Win32", "Win32", "{D991153C EndProject Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "ComputeSharp.CodeFixing", "src\ComputeSharp.CodeFixing\ComputeSharp.CodeFixing.shproj", "{29F6E256-BA0E-4F3B-854E-50839D67C6DD}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ComputeSharp.CodeFixers", "src\ComputeSharp.CodeFixers\ComputeSharp.CodeFixers.csproj", "{9B4448B1-200F-4966-8A13-A508691B3003}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ComputeSharp.CodeFixers", "src\ComputeSharp.CodeFixers\ComputeSharp.CodeFixers.csproj", "{9B4448B1-200F-4966-8A13-A508691B3003}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/README.md b/README.md index c3bb9bfa..c9ce216d 100644 --- a/README.md +++ b/README.md @@ -34,8 +34,8 @@ The sample app is available in the Microsoft Store, showcasing several pixel sha | Name | Description | | ------ | ------ | | **ComputeSharp** | The main library, with compiled shaders support | -| **ComputeSharp.Dynamic** | An extension for **ComputeSharp**, enabling dynamic shader compilation at runtime and shader metaprogramming | -| **ComputeSharp.D3D12MemoryAllocator** | An extension for **ComputeSharp**, adding D3D12MA as the memory allocator for graphics resources. | +| **ComputeSharp.D3D12MemoryAllocator** | An extension library for **ComputeSharp**, adding D3D12MA as the memory allocator for graphics resources. | +| **ComputeSharp.Dxc** | An extension library for **ComputeSharp**, bundling the DXC compiler and enabling shader reflection | | **ComputeSharp.Pix** | An extension library for **ComputeSharp**, enabling PIX support to produce debugging information | | **ComputeSharp.WinUI** | A WinUI 3 library with controls to render DX12 shaders powered by **ComputeSharp** | | **ComputeSharp.D2D1** | A library to write D2D1 pixel shaders entirely with C# code, and to easily register and create ID2D1Effect-s from them | diff --git a/src/ComputeSharp.Core/ComputeSharp.Core.csproj b/src/ComputeSharp.Core/ComputeSharp.Core.csproj index 74743472..64e1c888 100644 --- a/src/ComputeSharp.Core/ComputeSharp.Core.csproj +++ b/src/ComputeSharp.Core/ComputeSharp.Core.csproj @@ -6,7 +6,7 @@ - + diff --git a/src/ComputeSharp.Dynamic/ComputeSharp.Dynamic.csproj b/src/ComputeSharp.Dxc/ComputeSharp.Dxc.csproj similarity index 100% rename from src/ComputeSharp.Dynamic/ComputeSharp.Dynamic.csproj rename to src/ComputeSharp.Dxc/ComputeSharp.Dxc.csproj diff --git a/src/ComputeSharp.Dynamic/Interop/ReflectionServices.LibraryLoading.cs b/src/ComputeSharp.Dxc/Interop/ReflectionServices.LibraryLoading.cs similarity index 100% rename from src/ComputeSharp.Dynamic/Interop/ReflectionServices.LibraryLoading.cs rename to src/ComputeSharp.Dxc/Interop/ReflectionServices.LibraryLoading.cs diff --git a/src/ComputeSharp.Dynamic/Interop/ReflectionServices.cs b/src/ComputeSharp.Dxc/Interop/ReflectionServices.cs similarity index 100% rename from src/ComputeSharp.Dynamic/Interop/ReflectionServices.cs rename to src/ComputeSharp.Dxc/Interop/ReflectionServices.cs diff --git a/src/ComputeSharp.Dynamic/Interop/ShaderInfo.cs b/src/ComputeSharp.Dxc/Interop/ShaderInfo.cs similarity index 100% rename from src/ComputeSharp.Dynamic/Interop/ShaderInfo.cs rename to src/ComputeSharp.Dxc/Interop/ShaderInfo.cs diff --git a/src/ComputeSharp.Dynamic/Libraries/arm64/dxcompiler.dll b/src/ComputeSharp.Dxc/Libraries/arm64/dxcompiler.dll similarity index 100% rename from src/ComputeSharp.Dynamic/Libraries/arm64/dxcompiler.dll rename to src/ComputeSharp.Dxc/Libraries/arm64/dxcompiler.dll diff --git a/src/ComputeSharp.Dynamic/Libraries/arm64/dxil.dll b/src/ComputeSharp.Dxc/Libraries/arm64/dxil.dll similarity index 100% rename from src/ComputeSharp.Dynamic/Libraries/arm64/dxil.dll rename to src/ComputeSharp.Dxc/Libraries/arm64/dxil.dll diff --git a/src/ComputeSharp.Dynamic/Libraries/x64/dxcompiler.dll b/src/ComputeSharp.Dxc/Libraries/x64/dxcompiler.dll similarity index 100% rename from src/ComputeSharp.Dynamic/Libraries/x64/dxcompiler.dll rename to src/ComputeSharp.Dxc/Libraries/x64/dxcompiler.dll diff --git a/src/ComputeSharp.Dynamic/Libraries/x64/dxil.dll b/src/ComputeSharp.Dxc/Libraries/x64/dxil.dll similarity index 100% rename from src/ComputeSharp.Dynamic/Libraries/x64/dxil.dll rename to src/ComputeSharp.Dxc/Libraries/x64/dxil.dll diff --git a/src/ComputeSharp.SourceGenerators/ComputeShaderDescriptorGenerator.NumThreads.cs b/src/ComputeSharp.SourceGenerators/ComputeShaderDescriptorGenerator.NumThreads.cs index 0efd19fb..2b21811e 100644 --- a/src/ComputeSharp.SourceGenerators/ComputeShaderDescriptorGenerator.NumThreads.cs +++ b/src/ComputeSharp.SourceGenerators/ComputeShaderDescriptorGenerator.NumThreads.cs @@ -32,7 +32,7 @@ partial class ComputeShaderDescriptorGenerator out int threadsZ, out bool isCompilationEnabled) { - // Try to get the attribute that controls shader precompilation (has to be present when ComputeSharp.Dynamic is not referenced) + // Try to get the attribute that controls shader precompilation (this is always required) if (!structDeclarationSymbol.TryGetAttributeWithFullyQualifiedMetadataName(typeof(EmbeddedBytecodeAttribute).FullName, out AttributeData? attribute)) { // Emit the diagnostics if dynamic shaders are not supported diff --git a/src/ComputeSharp.SourceGenerators/ComputeSharp.SourceGenerators.csproj b/src/ComputeSharp.SourceGenerators/ComputeSharp.SourceGenerators.csproj index 4ab06edc..33cb7f2a 100644 --- a/src/ComputeSharp.SourceGenerators/ComputeSharp.SourceGenerators.csproj +++ b/src/ComputeSharp.SourceGenerators/ComputeSharp.SourceGenerators.csproj @@ -80,10 +80,10 @@ - - - - + + + + diff --git a/src/ComputeSharp.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs b/src/ComputeSharp.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs index 0d5f840a..5002c477 100644 --- a/src/ComputeSharp.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs +++ b/src/ComputeSharp.SourceGenerators/Diagnostics/DiagnosticDescriptors.cs @@ -640,7 +640,7 @@ partial class DiagnosticDescriptors helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); /// - /// Gets a for a shader without the embedded bytecode attribute, when dynamic shaders are not supported. + /// Gets a for a shader without the embedded bytecode attribute,. /// /// Format: "The shader of type {0} needs to be annotated as having embedded bytecode (using the [EmbeddedBytecode] attribute), as dynamic shader compilation is not supported". /// @@ -652,7 +652,7 @@ partial class DiagnosticDescriptors category: "ComputeSharp.Shaders", defaultSeverity: DiagnosticSeverity.Error, isEnabledByDefault: true, - description: "When dynamic shader compilation is not supported (ie. when ComputeSharp.Dynamic is not referenced), all shaders need to be annotated as having embedded bytecode (using the [EmbeddedBytecode] attribute).", + description: "All shaders need to be annotated as having embedded bytecode (using the [EmbeddedBytecode] attribute).", helpLinkUri: "https://github.com/Sergio0694/ComputeSharp"); /// diff --git a/src/ComputeSharp/ComputeSharp.csproj b/src/ComputeSharp/ComputeSharp.csproj index a2410fee..efc44dd0 100644 --- a/src/ComputeSharp/ComputeSharp.csproj +++ b/src/ComputeSharp/ComputeSharp.csproj @@ -6,7 +6,7 @@ - + diff --git a/src/ComputeSharp/Core/Attributes/EmbeddedBytecodeAttribute.cs b/src/ComputeSharp/Core/Attributes/EmbeddedBytecodeAttribute.cs index fb39c5f0..faf2154e 100644 --- a/src/ComputeSharp/Core/Attributes/EmbeddedBytecodeAttribute.cs +++ b/src/ComputeSharp/Core/Attributes/EmbeddedBytecodeAttribute.cs @@ -30,12 +30,12 @@ namespace ComputeSharp; /// /// /// The runtime compilation will automatically be skipped if the shader is invoked using matching thread count values, -/// otherwise the usual runtime compilation will be used as fallback if the ComputeSharp.Dynamic library is +/// otherwise the usual runtime compilation will be used as fallback if the ComputeSharp.Dxc library is /// referenced. If not, will be thrown when trying to dispatch the shader. /// /// /// -/// Using this attribute is mandatory when not referencing ComputeSharp.Dynamic. +/// Using this attribute is mandatory when not referencing ComputeSharp.Dxc. /// /// /// This attribute can only be used when the shader type being annotated does not require dynamic diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 82e682af..435885da 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -20,8 +20,8 @@ - - + + diff --git a/tests/ComputeSharp.Dynamic.NuGet/ComputeSharp.Dynamic.NuGet.csproj b/tests/ComputeSharp.Dxc.NuGet/ComputeSharp.Dxc.NuGet.csproj similarity index 89% rename from tests/ComputeSharp.Dynamic.NuGet/ComputeSharp.Dynamic.NuGet.csproj rename to tests/ComputeSharp.Dxc.NuGet/ComputeSharp.Dxc.NuGet.csproj index 8ace0fde..79096162 100644 --- a/tests/ComputeSharp.Dynamic.NuGet/ComputeSharp.Dynamic.NuGet.csproj +++ b/tests/ComputeSharp.Dxc.NuGet/ComputeSharp.Dxc.NuGet.csproj @@ -15,6 +15,6 @@ - + diff --git a/tests/ComputeSharp.Dynamic.NuGet/Program.cs b/tests/ComputeSharp.Dxc.NuGet/Program.cs similarity index 100% rename from tests/ComputeSharp.Dynamic.NuGet/Program.cs rename to tests/ComputeSharp.Dxc.NuGet/Program.cs diff --git a/tests/ComputeSharp.Tests.Internals/ComputeSharp.Tests.Internals.csproj b/tests/ComputeSharp.Tests.Internals/ComputeSharp.Tests.Internals.csproj index 70a95d5d..92eee51b 100644 --- a/tests/ComputeSharp.Tests.Internals/ComputeSharp.Tests.Internals.csproj +++ b/tests/ComputeSharp.Tests.Internals/ComputeSharp.Tests.Internals.csproj @@ -15,7 +15,7 @@ - + diff --git a/tests/ComputeSharp.Tests.NativeLibrariesResolver/DynamicNativeLibrariesResolverTests.cs b/tests/ComputeSharp.Tests.NativeLibrariesResolver/DxcNativeLibrariesResolverTests.cs similarity index 73% rename from tests/ComputeSharp.Tests.NativeLibrariesResolver/DynamicNativeLibrariesResolverTests.cs rename to tests/ComputeSharp.Tests.NativeLibrariesResolver/DxcNativeLibrariesResolverTests.cs index 539562d0..848d209c 100644 --- a/tests/ComputeSharp.Tests.NativeLibrariesResolver/DynamicNativeLibrariesResolverTests.cs +++ b/tests/ComputeSharp.Tests.NativeLibrariesResolver/DxcNativeLibrariesResolverTests.cs @@ -6,10 +6,10 @@ using Microsoft.VisualStudio.TestTools.UnitTesting; namespace ComputeSharp.Tests.NativeLibrariesResolver; [TestClass] -public class DynamicNativeLibrariesResolverTests : NativeLibrariesResolverTestsBase +public class DxcNativeLibrariesResolverTests : NativeLibrariesResolverTestsBase { /// - protected override string SampleProjectName => "ComputeSharp.Dynamic.NuGet"; + protected override string SampleProjectName => "ComputeSharp.Dxc.NuGet"; /// /// Performs static initialization for the assembly before any unit tests are run. @@ -18,7 +18,7 @@ public class DynamicNativeLibrariesResolverTests : NativeLibrariesResolverTestsB [ClassInitialize] public static void InitializeDynamicDependencies(TestContext _) { - string path = Path.GetDirectoryName(typeof(DynamicNativeLibrariesResolverTests).Assembly.Location)!; + string path = Path.GetDirectoryName(typeof(DxcNativeLibrariesResolverTests).Assembly.Location)!; while (Path.GetFileName(path) is not "ComputeSharp") { @@ -27,10 +27,10 @@ public class DynamicNativeLibrariesResolverTests : NativeLibrariesResolverTestsB string coreProjectPath = Path.Combine(path, "src", "ComputeSharp.Core", "ComputeSharp.Core.csproj"); string projectPath = Path.Combine(path, "src", "ComputeSharp", "ComputeSharp.csproj"); - string dynamicProjectPath = Path.Combine(path, "src", "ComputeSharp.Dynamic", "ComputeSharp.Dynamic.csproj"); + string dxcProjectPath = Path.Combine(path, "src", "ComputeSharp.Dxc", "ComputeSharp.Dxc.csproj"); Process.Start("dotnet", $"pack {coreProjectPath} -c Release").WaitForExit(); Process.Start("dotnet", $"pack {projectPath} -c Release").WaitForExit(); - Process.Start("dotnet", $"pack {dynamicProjectPath} -c Release").WaitForExit(); + Process.Start("dotnet", $"pack {dxcProjectPath} -c Release").WaitForExit(); } } \ No newline at end of file diff --git a/tests/ComputeSharp.Tests.NativeLibrariesResolver/NativeLibrariesResolverTests.cs b/tests/ComputeSharp.Tests.NativeLibrariesResolver/NativeLibrariesResolverTests.cs index 5d895df0..5fa54a0c 100644 --- a/tests/ComputeSharp.Tests.NativeLibrariesResolver/NativeLibrariesResolverTests.cs +++ b/tests/ComputeSharp.Tests.NativeLibrariesResolver/NativeLibrariesResolverTests.cs @@ -18,7 +18,7 @@ public class NativeLibrariesResolverTests : NativeLibrariesResolverTestsBase [ClassInitialize] public static void InitializeDynamicDependencies(TestContext _) { - string path = Path.GetDirectoryName(typeof(DynamicNativeLibrariesResolverTests).Assembly.Location)!; + string path = Path.GetDirectoryName(typeof(DxcNativeLibrariesResolverTests).Assembly.Location)!; while (Path.GetFileName(path) is not "ComputeSharp") { diff --git a/tests/ComputeSharp.Tests/ComputeSharp.Tests.csproj b/tests/ComputeSharp.Tests/ComputeSharp.Tests.csproj index 35c21b0b..772d7f15 100644 --- a/tests/ComputeSharp.Tests/ComputeSharp.Tests.csproj +++ b/tests/ComputeSharp.Tests/ComputeSharp.Tests.csproj @@ -25,7 +25,7 @@ - +