diff --git a/src/ComputeSharp.Dynamic/Shaders/Translation/__Internals/ShaderCompiler.cs b/src/ComputeSharp.Dynamic/Shaders/Translation/__Internals/ShaderCompiler.cs index b61ec078..59c02eec 100644 --- a/src/ComputeSharp.Dynamic/Shaders/Translation/__Internals/ShaderCompiler.cs +++ b/src/ComputeSharp.Dynamic/Shaders/Translation/__Internals/ShaderCompiler.cs @@ -16,15 +16,15 @@ public static class ShaderCompiler /// /// Compiles a new HLSL shader from the input source code. /// - /// The type of bytecode loader being used. + /// The type of bytecode loader being used. /// The type of shader being dispatched. - /// The instance to use to load the bytecode. + /// The instance to use to load the bytecode. /// The number of threads in each thread group for the X axis. /// The number of threads in each thread group for the Y axis. /// The number of threads in each thread group for the Z axis. /// The input instance representing the compute shader to run. - public static unsafe void LoadDynamicBytecode(ref TBytecodeLoader loader, int threadsX, int threadsY, int threadsZ, in T shader) - where TBytecodeLoader : struct, IBytecodeLoader + public static unsafe void LoadDynamicBytecode(ref TLoadeer loader, int threadsX, int threadsY, int threadsZ, in T shader) + where TLoadeer : struct, IBytecodeLoader where T : struct, IShader { Unsafe.AsRef(in shader).BuildHlslString(out ArrayPoolStringBuilder builder, threadsX, threadsY, threadsZ); diff --git a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadBytecodeMethod.Syntax.cs b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadBytecodeMethod.Syntax.cs index d85f10f8..d69fa0bf 100644 --- a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadBytecodeMethod.Syntax.cs +++ b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadBytecodeMethod.Syntax.cs @@ -39,7 +39,7 @@ public sealed partial class IShaderGenerator // This code produces a method declaration as follows: // - // readonly void global::ComputeSharp.__Internals.IShader.LoadBytecode(ref TBytecodeLoader loader, int threadsX, int threadsY, int threadsZ) + // readonly void global::ComputeSharp.__Internals.IShader.LoadBytecode(ref TLoader loader, int threadsX, int threadsY, int threadsZ) // { // // } @@ -49,11 +49,11 @@ public sealed partial class IShaderGenerator Identifier("LoadBytecode")) .WithExplicitInterfaceSpecifier(ExplicitInterfaceSpecifier(IdentifierName($"global::ComputeSharp.__Internals.{nameof(IShader)}"))) .AddModifiers(Token(SyntaxKind.ReadOnlyKeyword)) - .AddTypeParameterListParameters(TypeParameter(Identifier("TBytecodeLoader"))) + .AddTypeParameterListParameters(TypeParameter(Identifier("TLoader"))) .AddParameterListParameters( Parameter(Identifier("loader")) .AddModifiers(Token(SyntaxKind.RefKeyword)) - .WithType(IdentifierName("TBytecodeLoader")), + .WithType(IdentifierName("TLoader")), Parameter(Identifier("threadsX")).WithType(PredefinedType(Token(SyntaxKind.IntKeyword))), Parameter(Identifier("threadsY")).WithType(PredefinedType(Token(SyntaxKind.IntKeyword))), Parameter(Identifier("threadsZ")).WithType(PredefinedType(Token(SyntaxKind.IntKeyword)))) diff --git a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadDispatchDataMethod.Syntax.cs b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadDispatchDataMethod.Syntax.cs index e834356d..2c9391cc 100644 --- a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadDispatchDataMethod.Syntax.cs +++ b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadDispatchDataMethod.Syntax.cs @@ -32,7 +32,7 @@ public sealed partial class IShaderGenerator { // This code produces a method declaration as follows: // - // readonly void global::ComputeSharp.__Internals.IShader.LoadDispatchData(ref TDataLoader loader, global::ComputeSharp.GraphicsDevice device, int x, int y, int z) + // readonly void global::ComputeSharp.__Internals.IShader.LoadDispatchData(ref TLoader loader, global::ComputeSharp.GraphicsDevice device, int x, int y, int z) // { // // } @@ -42,11 +42,11 @@ public sealed partial class IShaderGenerator Identifier("LoadDispatchData")) .WithExplicitInterfaceSpecifier(ExplicitInterfaceSpecifier(IdentifierName($"global::ComputeSharp.__Internals.{nameof(IShader)}"))) .AddModifiers(Token(SyntaxKind.ReadOnlyKeyword)) - .AddTypeParameterListParameters(TypeParameter(Identifier("TDataLoader"))) + .AddTypeParameterListParameters(TypeParameter(Identifier("TLoader"))) .AddParameterListParameters( Parameter(Identifier("loader")) .AddModifiers(Token(SyntaxKind.RefKeyword)) - .WithType(IdentifierName("TDataLoader")), + .WithType(IdentifierName("TLoader")), Parameter(Identifier("device")).WithType(IdentifierName("global::ComputeSharp.GraphicsDevice")), Parameter(Identifier("x")).WithType(PredefinedType(Token(SyntaxKind.IntKeyword))), Parameter(Identifier("y")).WithType(PredefinedType(Token(SyntaxKind.IntKeyword))), diff --git a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadDispatchMetadataMethod.Syntax.cs b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadDispatchMetadataMethod.Syntax.cs index a886d33e..0e5f945f 100644 --- a/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadDispatchMetadataMethod.Syntax.cs +++ b/src/ComputeSharp.SourceGenerators/IShaderGenerator.CreateLoadDispatchMetadataMethod.Syntax.cs @@ -25,7 +25,7 @@ public sealed partial class IShaderGenerator { // This code produces a method declaration as follows: // - // readonly void global::ComputeSharp.__Internals.IShader.LoadDispatchMetadata(ref TMetadataLoader loader, out global::System.IntPtr result) + // readonly void global::ComputeSharp.__Internals.IShader.LoadDispatchMetadata(ref TLoader loader, out global::System.IntPtr result) // { // // } @@ -35,11 +35,11 @@ public sealed partial class IShaderGenerator Identifier("LoadDispatchMetadata")) .WithExplicitInterfaceSpecifier(ExplicitInterfaceSpecifier(IdentifierName($"global::ComputeSharp.__Internals.{nameof(IShader)}"))) .AddModifiers(Token(SyntaxKind.ReadOnlyKeyword)) - .AddTypeParameterListParameters(TypeParameter(Identifier("TMetadataLoader"))) + .AddTypeParameterListParameters(TypeParameter(Identifier("TLoader"))) .AddParameterListParameters( Parameter(Identifier("loader")) .AddModifiers(Token(SyntaxKind.RefKeyword)) - .WithType(IdentifierName("TMetadataLoader")), + .WithType(IdentifierName("TLoader")), Parameter(Identifier("result")) .AddModifiers(Token(SyntaxKind.OutKeyword)) .WithType(IdentifierName($"global::System.{typeof(IntPtr).Name}"))) diff --git a/src/ComputeSharp/Core/Interfaces/__Internals/IShader.cs b/src/ComputeSharp/Core/Interfaces/__Internals/IShader.cs index dc4495b0..262b7d0d 100644 --- a/src/ComputeSharp/Core/Interfaces/__Internals/IShader.cs +++ b/src/ComputeSharp/Core/Interfaces/__Internals/IShader.cs @@ -28,16 +28,16 @@ public interface IShader /// /// Loads the dispatch data for the shader. /// - /// The type of data loader being used. - /// The instance to use to load the data. + /// The type of data loader being used. + /// The instance to use to load the data. /// The device the shader is being dispatched on. /// The number of iterations to run on the X axis. /// The number of iterations to run on the Y axis. /// The number of iterations to run on the Z axis. [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This method is not intended to be called directly by user code")] - void LoadDispatchData(ref TDataLoader loader, GraphicsDevice device, int x, int y, int z) - where TDataLoader : struct, IDispatchDataLoader + void LoadDispatchData(ref TLoader loader, GraphicsDevice device, int x, int y, int z) + where TLoader : struct, IDispatchDataLoader #if NET6_0_OR_GREATER { throw new NotImplementedException(); @@ -49,13 +49,13 @@ public interface IShader /// /// Loads an opaque metadata handle from the metadata of the current shader. /// - /// The type of data loader being used. - /// The instance to use to load the data. + /// The type of data loader being used. + /// The instance to use to load the data. /// The resulting opaque metadata handle. [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This method is not intended to be called directly by user code")] - void LoadDispatchMetadata(ref TMetadataLoader loader, out IntPtr result) - where TMetadataLoader : struct, IDispatchMetadataLoader + void LoadDispatchMetadata(ref TLoader loader, out IntPtr result) + where TLoader : struct, IDispatchMetadataLoader #if NET6_0_OR_GREATER { throw new NotImplementedException(); @@ -85,15 +85,15 @@ public interface IShader /// /// Loads the bytecode for the current shader. /// - /// The type of bytecode loader being used. - /// The instance to use to load the bytecode. + /// The type of bytecode loader being used. + /// The instance to use to load the bytecode. /// The number of threads in each thread group for the X axis. /// The number of threads in each thread group for the Y axis. /// The number of threads in each thread group for the Z axis. [EditorBrowsable(EditorBrowsableState.Never)] [Obsolete("This method is not intended to be used directly by user code")] - void LoadBytecode(ref TBytecodeLoader loader, int threadsX, int threadsY, int threadsZ) - where TBytecodeLoader : struct, IBytecodeLoader + void LoadBytecode(ref TLoader loader, int threadsX, int threadsY, int threadsZ) + where TLoader : struct, IBytecodeLoader #if NET6_0_OR_GREATER { throw new NotImplementedException();