diff --git a/src/ComputeSharp.Shaders/ShaderRunner.cs b/src/ComputeSharp.Shaders/ShaderRunner.cs index 0af20faf..01f3818d 100644 --- a/src/ComputeSharp.Shaders/ShaderRunner.cs +++ b/src/ComputeSharp.Shaders/ShaderRunner.cs @@ -8,7 +8,7 @@ using ComputeSharp.Graphics.Buffers.Extensions; using ComputeSharp.Shaders.Renderer; using ComputeSharp.Shaders.Renderer.Models; using ComputeSharp.Shaders.Translation; -using SharpDX.Direct3D12; +using Vortice.DirectX.Direct3D12; using CommandList = ComputeSharp.Graphics.Commands.CommandList; using PipelineState = ComputeSharp.Graphics.Commands.PipelineState; @@ -95,8 +95,8 @@ namespace ComputeSharp.Shaders } // Create the root signature for the pipeline and get the pipeline state - RootSignatureDescription rootSignatureDescription = new RootSignatureDescription(RootSignatureFlags.None, shaderData.Loader.RootParameters); - RootSignature rootSignature = device.CreateRootSignature(rootSignatureDescription); + VersionedRootSignatureDescription rootSignatureDescription = new VersionedRootSignatureDescription(new RootSignatureDescription1(RootSignatureFlags.None, shaderData.Loader.RootParameters)); + ID3D12RootSignature rootSignature = device.CreateRootSignature(rootSignatureDescription); PipelineState pipelineState = new PipelineState(device, rootSignature, shaderData.Bytecode); // Create the commands list and set the pipeline state diff --git a/src/ComputeSharp.Shaders/Translation/ShaderCompiler.cs b/src/ComputeSharp.Shaders/Translation/ShaderCompiler.cs index 6c7cfe14..f8d61d3e 100644 --- a/src/ComputeSharp.Shaders/Translation/ShaderCompiler.cs +++ b/src/ComputeSharp.Shaders/Translation/ShaderCompiler.cs @@ -1,7 +1,7 @@ using System; using System.Diagnostics.Contracts; using DotNetDxc; -using SharpDX.Direct3D12; +using Vortice.DirectX.Direct3D12; namespace ComputeSharp.Shaders.Translation { diff --git a/src/ComputeSharp.Shaders/Translation/ShaderLoader.cs b/src/ComputeSharp.Shaders/Translation/ShaderLoader.cs index 5e2f5e4d..d550d1dc 100644 --- a/src/ComputeSharp.Shaders/Translation/ShaderLoader.cs +++ b/src/ComputeSharp.Shaders/Translation/ShaderLoader.cs @@ -11,7 +11,7 @@ using ComputeSharp.Shaders.Renderer.Models.Fields.Abstract; using ComputeSharp.Shaders.Translation.Models; using Microsoft.CodeAnalysis; using Microsoft.CodeAnalysis.CSharp.Syntax; -using SharpDX.Direct3D12; +using Vortice.DirectX.Direct3D12; #pragma warning disable CS8618 // Non-nullable field is uninitialized @@ -58,16 +58,16 @@ namespace ComputeSharp.Shaders.Translation public Type ShaderType { get; } /// - /// The of items that are required to load the captured values + /// The of items that are required to load the captured values /// - private readonly List DescriptorRanges = new List(); + private readonly List DescriptorRanges = new List(); - private RootParameter[] _RootParameters; + private RootParameter1[] _RootParameters; /// - /// Gets the array for the current shader + /// Gets the array for the current shader /// - public RootParameter[] RootParameters => _RootParameters ??= DescriptorRanges.Select(range => new RootParameter(ShaderVisibility.All, range)).ToArray(); + public RootParameter1[] RootParameters => _RootParameters ??= DescriptorRanges.Select(range => new RootParameter1(new RootDescriptorTable1(range), ShaderVisibility.All)).ToArray(); /// /// The of instances mapping the captured buffers in the current shader @@ -162,7 +162,7 @@ namespace ComputeSharp.Shaders.Translation if (shaderFields.Any(fieldInfo => fieldInfo.IsStatic)) throw new InvalidOperationException("Empty shader body"); // Descriptor for the buffer for captured scalar/vector variables - DescriptorRanges.Add(new DescriptorRange(DescriptorRangeType.ConstantBufferView, 1, _ConstantBuffersCount++)); + DescriptorRanges.Add(new DescriptorRange1(DescriptorRangeType.ConstantBufferView, 1, _ConstantBuffersCount++)); // Inspect the captured fields foreach (FieldInfo fieldInfo in shaderFields) @@ -185,7 +185,7 @@ namespace ComputeSharp.Shaders.Translation // Constant buffer if (HlslKnownTypes.IsConstantBufferType(fieldType)) { - DescriptorRanges.Add(new DescriptorRange(DescriptorRangeType.ConstantBufferView, 1, _ConstantBuffersCount)); + DescriptorRanges.Add(new DescriptorRange1(DescriptorRangeType.ConstantBufferView, 1, _ConstantBuffersCount)); // Track the buffer field _BufferMembers.Add((memberInfo, parents)); @@ -196,7 +196,7 @@ namespace ComputeSharp.Shaders.Translation else if (HlslKnownTypes.IsReadOnlyBufferType(fieldType)) { // Root parameter for a readonly buffer - DescriptorRanges.Add(new DescriptorRange(DescriptorRangeType.ShaderResourceView, 1, _ReadOnlyBuffersCount)); + DescriptorRanges.Add(new DescriptorRange1(DescriptorRangeType.ShaderResourceView, 1, _ReadOnlyBuffersCount)); // Track the buffer field _BufferMembers.Add((memberInfo, parents)); @@ -207,7 +207,7 @@ namespace ComputeSharp.Shaders.Translation else if (HlslKnownTypes.IsReadWriteBufferType(fieldType)) { // Root parameter for a read write buffer - DescriptorRanges.Add(new DescriptorRange(DescriptorRangeType.UnorderedAccessView, 1, _ReadWriteBuffersCount)); + DescriptorRanges.Add(new DescriptorRange1(DescriptorRangeType.UnorderedAccessView, 1, _ReadWriteBuffersCount)); // Track the buffer field _BufferMembers.Add((memberInfo, parents));