Added missing dots
このコミットが含まれているのは:
1 親
e45b712000
コミット
33870886b6
51ファイル変更
+5686
-5686
検索条件に一致するファイルはありません
@@ -10,9 +10,9 @@ namespace ComputeSharp.Exceptions
|
||||
public sealed class HlslCompilationException : Exception
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="HlslCompilationException"/> instance
|
||||
/// Creates a new <see cref="HlslCompilationException"/> instance.
|
||||
/// </summary>
|
||||
/// <param name="error">The error message produced by the DXC compiler</param>
|
||||
/// <param name="error">The error message produced by the DXC compiler.</param>
|
||||
internal HlslCompilationException(string error)
|
||||
: base(GetExceptionMessage(error))
|
||||
{
|
||||
@@ -28,7 +28,7 @@ namespace ComputeSharp.Exceptions
|
||||
{
|
||||
StringBuilder builder = new(512);
|
||||
|
||||
builder.AppendLine("The Dxc compiler encountered one or more errors while trying to compile the shader:");
|
||||
builder.AppendLine("The DXC compiler encountered one or more errors while trying to compile the shader:");
|
||||
builder.AppendLine();
|
||||
builder.AppendLine(error.Trim());
|
||||
builder.AppendLine();
|
||||
|
||||
@@ -8,15 +8,15 @@ using Microsoft.Toolkit.Diagnostics;
|
||||
namespace ComputeSharp.Shaders.Extensions
|
||||
{
|
||||
/// <summary>
|
||||
/// A <see langword="class"/> that provides extension methods for the <see langword="ILGenerator"/> type
|
||||
/// A <see langword="class"/> that provides extension methods for the <see langword="ILGenerator"/> type.
|
||||
/// </summary>
|
||||
internal static class ILGeneratorExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Puts the appropriate <see langword="ldsfld"/>, <see langword="ldfld"/>, <see langword="call"/> or <see langword="callvirt"/> instruction to read a member onte the stream of instructions
|
||||
/// Puts the appropriate <see langword="ldsfld"/>, <see langword="ldfld"/>, <see langword="call"/> or <see langword="callvirt"/> instruction to read a member onte the stream of instructions.
|
||||
/// </summary>
|
||||
/// <param name="il">The input <see cref="ILGenerator"/> instance to use to emit instructions</param>
|
||||
/// <param name="member">The member to read</param>
|
||||
/// <param name="il">The input <see cref="ILGenerator"/> instance to use to emit instructions.</param>
|
||||
/// <param name="member">The member to read.</param>
|
||||
public static void EmitReadMember(this ILGenerator il, MemberInfo member)
|
||||
{
|
||||
switch (member)
|
||||
@@ -32,18 +32,18 @@ namespace ComputeSharp.Shaders.Extensions
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Puts the appropriate <see langword="ldc.i4"/>, <see langword="conv.i"/> and <see langword="add"/> instructions to advance a reference onto the stream of instructions
|
||||
/// Puts the appropriate <see langword="ldc.i4"/>, <see langword="conv.i"/> and <see langword="add"/> instructions to advance a reference onto the stream of instructions.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of reference at the top of the stack</typeparam>
|
||||
/// <param name="il">The input <see cref="ILGenerator"/> instance to use to emit instructions</param>
|
||||
/// <param name="offset">The offset to use to advance the current reference on top of the execution stack</param>
|
||||
/// <typeparam name="T">The type of reference at the top of the stack.</typeparam>
|
||||
/// <param name="il">The input <see cref="ILGenerator"/> instance to use to emit instructions.</param>
|
||||
/// <param name="offset">The offset to use to advance the current reference on top of the execution stack.</param>
|
||||
public static void EmitAddOffset<T>(this ILGenerator il, int offset) => il.EmitAddOffset(Unsafe.SizeOf<T>() * offset);
|
||||
|
||||
/// <summary>
|
||||
/// Puts the appropriate <see langword="ldc.i4"/>, <see langword="conv.i"/> and <see langword="add"/> instructions to advance a reference onto the stream of instructions
|
||||
/// Puts the appropriate <see langword="ldc.i4"/>, <see langword="conv.i"/> and <see langword="add"/> instructions to advance a reference onto the stream of instructions.
|
||||
/// </summary>
|
||||
/// <param name="il">The input <see cref="ILGenerator"/> instance to use to emit instructions</param>
|
||||
/// <param name="offset">The offset in bytes to use to advance the current reference on top of the execution stack</param>
|
||||
/// <param name="il">The input <see cref="ILGenerator"/> instance to use to emit instructions.</param>
|
||||
/// <param name="offset">The offset in bytes to use to advance the current reference on top of the execution stack.</param>
|
||||
public static void EmitAddOffset(this ILGenerator il, int offset)
|
||||
{
|
||||
// Push the offset to the stack
|
||||
@@ -74,10 +74,10 @@ namespace ComputeSharp.Shaders.Extensions
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Puts the appropriate <see langword="stind"/> or <see langword="stobj"/> instruction to write to a reference onto the stream of instructions
|
||||
/// Puts the appropriate <see langword="stind"/> or <see langword="stobj"/> instruction to write to a reference onto the stream of instructions.
|
||||
/// </summary>
|
||||
/// <param name="il">The input <see cref="ILGenerator"/> instance to use to emit instructions</param>
|
||||
/// <param name="type">The type of value being written to the current reference on top of the execution stack</param>
|
||||
/// <param name="il">The input <see cref="ILGenerator"/> instance to use to emit instructions.</param>
|
||||
/// <param name="type">The type of value being written to the current reference on top of the execution stack.</param>
|
||||
public static void EmitStoreToAddress(this ILGenerator il, Type type)
|
||||
{
|
||||
if (type.IsValueType)
|
||||
|
||||
@@ -6,7 +6,7 @@ using System.Numerics;
|
||||
namespace ComputeSharp.Shaders.Mappings
|
||||
{
|
||||
/// <summary>
|
||||
/// A <see langword="class"/> that contains and maps known HLSL type names to common .NET types
|
||||
/// A <see langword="class"/> that contains and maps known HLSL type names to common .NET types.
|
||||
/// </summary>
|
||||
internal static class HlslKnownTypes
|
||||
{
|
||||
@@ -20,10 +20,10 @@ namespace ComputeSharp.Shaders.Mappings
|
||||
});
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether or not the input type is a known scalar type
|
||||
/// Checks whether or not the input type is a known scalar type.
|
||||
/// </summary>
|
||||
/// <param name="type">The input <see cref="Type"/> instance to check</param>
|
||||
/// <returns>A <see langword="bool"/> indicating whether the input <see cref="Type"/> is in fact a known HLSL scalar type</returns>
|
||||
/// <param name="type">The input <see cref="Type"/> instance to check.</param>
|
||||
/// <returns>A <see langword="bool"/> indicating whether the input <see cref="Type"/> is in fact a known HLSL scalar type.</returns>
|
||||
[Pure]
|
||||
public static bool IsKnownScalarType(Type type) => type == typeof(bool) ||
|
||||
type == typeof(Bool) ||
|
||||
@@ -33,10 +33,10 @@ namespace ComputeSharp.Shaders.Mappings
|
||||
type == typeof(double);
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether or not the input type is a known vector type
|
||||
/// Checks whether or not the input type is a known vector type.
|
||||
/// </summary>
|
||||
/// <param name="type">The input <see cref="Type"/> instance to check</param>
|
||||
/// <returns>A <see langword="bool"/> indicating whether the input <see cref="Type"/> is in fact a known HLSL vector type</returns>
|
||||
/// <param name="type">The input <see cref="Type"/> instance to check.</param>
|
||||
/// <returns>A <see langword="bool"/> indicating whether the input <see cref="Type"/> is in fact a known HLSL vector type.</returns>
|
||||
[Pure]
|
||||
public static bool IsKnownVectorType(Type type) => _HlslMappedVectorTypes.Contains(type) ||
|
||||
type == typeof(Vector2) ||
|
||||
@@ -44,38 +44,38 @@ namespace ComputeSharp.Shaders.Mappings
|
||||
type == typeof(Vector4);
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether or not the input type is a known buffer type
|
||||
/// Checks whether or not the input type is a known buffer type.
|
||||
/// </summary>
|
||||
/// <param name="type">The input <see cref="Type"/> instance to check</param>
|
||||
/// <returns>A <see langword="bool"/> indicating whether the input <see cref="Type"/> is in fact a known buffer type</returns>
|
||||
/// <param name="type">The input <see cref="Type"/> instance to check.</param>
|
||||
/// <returns>A <see langword="bool"/> indicating whether the input <see cref="Type"/> is in fact a known buffer type.</returns>
|
||||
[Pure]
|
||||
public static bool IsKnownBufferType(Type type) => IsConstantBufferType(type) ||
|
||||
IsReadOnlyBufferType(type) ||
|
||||
IsReadWriteBufferType(type);
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether or not the input type is a <see cref="ConstantBuffer{T}"/> value
|
||||
/// Checks whether or not the input type is a <see cref="ConstantBuffer{T}"/> value.
|
||||
/// </summary>
|
||||
/// <param name="type">The input <see cref="Type"/> instance to check</param>
|
||||
/// <returns>A <see langword="bool"/> indicating whether the input <see cref="Type"/> is in fact a <see cref="ConstantBuffer{T}"/> instance</returns>
|
||||
/// <param name="type">The input <see cref="Type"/> instance to check.</param>
|
||||
/// <returns>A <see langword="bool"/> indicating whether the input <see cref="Type"/> is in fact a <see cref="ConstantBuffer{T}"/> instance.</returns>
|
||||
[Pure]
|
||||
public static bool IsConstantBufferType(Type type) => type.IsGenericType &&
|
||||
type.GetGenericTypeDefinition() == typeof(ConstantBuffer<>);
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether or not the input type is a <see cref="ReadOnlyBuffer{T}"/> value
|
||||
/// Checks whether or not the input type is a <see cref="ReadOnlyBuffer{T}"/> value.
|
||||
/// </summary>
|
||||
/// <param name="type">The input <see cref="Type"/> instance to check</param>
|
||||
/// <returns>A <see langword="bool"/> indicating whether the input <see cref="Type"/> is in fact a <see cref="ReadOnlyBuffer{T}"/> instance</returns>
|
||||
/// <param name="type">The input <see cref="Type"/> instance to check.</param>
|
||||
/// <returns>A <see langword="bool"/> indicating whether the input <see cref="Type"/> is in fact a <see cref="ReadOnlyBuffer{T}"/> instance.</returns>
|
||||
[Pure]
|
||||
public static bool IsReadOnlyBufferType(Type type) => type.IsGenericType &&
|
||||
type.GetGenericTypeDefinition() == typeof(ReadOnlyBuffer<>);
|
||||
|
||||
/// <summary>
|
||||
/// Checks whether or not the input type is a <see cref="ReadWriteBuffer{T}"/> value
|
||||
/// Checks whether or not the input type is a <see cref="ReadWriteBuffer{T}"/> value.
|
||||
/// </summary>
|
||||
/// <param name="type">The input <see cref="Type"/> instance to check</param>
|
||||
/// <returns>A <see langword="bool"/> indicating whether the input <see cref="Type"/> is in fact a <see cref="ReadWriteBuffer{T}"/> instance</returns>
|
||||
/// <param name="type">The input <see cref="Type"/> instance to check.</param>
|
||||
/// <returns>A <see langword="bool"/> indicating whether the input <see cref="Type"/> is in fact a <see cref="ReadWriteBuffer{T}"/> instance.</returns>
|
||||
[Pure]
|
||||
public static bool IsReadWriteBufferType(Type type) => type.IsGenericType &&
|
||||
type.GetGenericTypeDefinition() == typeof(ReadWriteBuffer<>);
|
||||
|
||||
@@ -14,13 +14,13 @@ namespace ComputeSharp.Shaders.Renderer
|
||||
internal static class HlslShaderRenderer
|
||||
{
|
||||
/// <summary>
|
||||
/// Renders a new HLSL shader source with the given parameters
|
||||
/// Renders a new HLSL shader source with the given parameters.
|
||||
/// </summary>
|
||||
/// <param name="threadsX">The number of threads in each thread group for the X axis.</param>
|
||||
/// <param name="threadsY">The number of threads in each thread group for the Y axis.</param>
|
||||
/// <param name="threadsZ">The number of threads in each thread group for the Z axis.</param>
|
||||
/// <param name="info">The input <see cref="IShaderLoader"/> instance with the shader information</param>
|
||||
/// <returns>The source code for the new HLSL shader</returns>
|
||||
/// <param name="info">The input <see cref="IShaderLoader"/> instance with the shader information.</param>
|
||||
/// <returns>The source code for the new HLSL shader.</returns>
|
||||
[Pure]
|
||||
public static ArrayPoolStringBuilder Render(int threadsX, int threadsY, int threadsZ, IShaderLoader info)
|
||||
{
|
||||
|
||||
@@ -4,37 +4,37 @@ using System.Runtime.CompilerServices;
|
||||
namespace ComputeSharp.Shaders.Translation.Models
|
||||
{
|
||||
/// <summary>
|
||||
/// A <see langword="struct"/> representing a key for a given shader
|
||||
/// A <see langword="struct"/> representing a key for a given shader.
|
||||
/// </summary>
|
||||
internal readonly struct ShaderKey : IEquatable<ShaderKey>
|
||||
{
|
||||
/// <summary>
|
||||
/// The hashcode of the current shader type
|
||||
/// The hashcode of the current shader type.
|
||||
/// </summary>
|
||||
private readonly int Id;
|
||||
|
||||
/// <summary>
|
||||
/// The number of iterations to run on the X axis
|
||||
/// The number of iterations to run on the X axis.
|
||||
/// </summary>
|
||||
private readonly int ThreadsX;
|
||||
|
||||
/// <summary>
|
||||
/// The number of iterations to run on the Y axis
|
||||
/// The number of iterations to run on the Y axis.
|
||||
/// </summary>
|
||||
private readonly int ThreadsY;
|
||||
|
||||
/// <summary>
|
||||
/// The number of iterations to run on the Z axis
|
||||
/// The number of iterations to run on the Z axis.
|
||||
/// </summary>
|
||||
private readonly int ThreadsZ;
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="ShaderKey"/> instance with the specified parameters
|
||||
/// Creates a new <see cref="ShaderKey"/> instance with the specified parameters.
|
||||
/// </summary>
|
||||
/// <param name="id">The hashcode of the current shader type</param>
|
||||
/// <param name="threadsX">The number of iterations to run on the X axis</param>
|
||||
/// <param name="threadsY">The number of iterations to run on the Y axis</param>
|
||||
/// <param name="threadsZ">The number of iterations to run on the Z axis</param>
|
||||
/// <param name="id">The hashcode of the current shader type.</param>
|
||||
/// <param name="threadsX">The number of iterations to run on the X axis.</param>
|
||||
/// <param name="threadsY">The number of iterations to run on the Y axis.</param>
|
||||
/// <param name="threadsZ">The number of iterations to run on the Z axis.</param>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public ShaderKey(int id, int threadsX, int threadsY, int threadsZ)
|
||||
{
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace ComputeSharp.Shaders.Translation
|
||||
private static readonly ComPtr<IDxcIncludeHandler> DxcIncludeHandler;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes <see cref="DxcCompiler"/>, <see cref="DxcLibrary"/> and <see cref="DxcIncludeHandler"/>
|
||||
/// Initializes <see cref="DxcCompiler"/>, <see cref="DxcLibrary"/> and <see cref="DxcIncludeHandler"/>.
|
||||
/// </summary>
|
||||
static ShaderCompiler()
|
||||
{
|
||||
|
||||
@@ -10,29 +10,29 @@ using ComputeSharp.Shaders.Extensions;
|
||||
namespace ComputeSharp.Shaders.Translation
|
||||
{
|
||||
/// <summary>
|
||||
/// A <see langword="static"/> <see langword="class"/> that handles the cache system for the generated shaders
|
||||
/// A <see langword="static"/> <see langword="class"/> that handles the cache system for the generated shaders.
|
||||
/// </summary>
|
||||
internal static class ShaderHashCodeProvider
|
||||
{
|
||||
/// <summary>
|
||||
/// A type containing static info for a given shader type <typeparamref name="T"/>
|
||||
/// A type containing static info for a given shader type <typeparamref name="T"/>.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of compute shader currently in use</typeparam>
|
||||
/// <typeparam name="T">The type of compute shader currently in use.</typeparam>
|
||||
private static class TypeInfo<T>
|
||||
where T : struct, IComputeShader
|
||||
{
|
||||
/// <summary>
|
||||
/// The id of the compute shader type in use
|
||||
/// The id of the compute shader type in use.
|
||||
/// </summary>
|
||||
public static readonly int Id;
|
||||
|
||||
/// <summary>
|
||||
/// The optional <see cref="Hasher{T}"/> instance, if needed
|
||||
/// The optional <see cref="Hasher{T}"/> instance, if needed.
|
||||
/// </summary>
|
||||
public static readonly Hasher<T>? Hasher;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes the static members of the <see cref="TypeInfo{T}"/> type
|
||||
/// Initializes the static members of the <see cref="TypeInfo{T}"/> type.
|
||||
/// </summary>
|
||||
static TypeInfo()
|
||||
{
|
||||
@@ -53,10 +53,10 @@ namespace ComputeSharp.Shaders.Translation
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a unique hashcode for the input compute shader instance
|
||||
/// Gets a unique hashcode for the input compute shader instance.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of compute shader currently in use</typeparam>
|
||||
/// <param name="shader">The input <typeparamref name="T"/> instance representing the shader to run</param>
|
||||
/// <typeparam name="T">The type of compute shader currently in use.</typeparam>
|
||||
/// <param name="shader">The input <typeparamref name="T"/> instance representing the shader to run.</param>
|
||||
[Pure]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static int GetHashCode<T>(in T shader)
|
||||
@@ -72,20 +72,20 @@ namespace ComputeSharp.Shaders.Translation
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A <see langword="delegate"/> that represents an aggregate hash function for a given <typeparamref name="T"/> instance
|
||||
/// A <see langword="delegate"/> that represents an aggregate hash function for a given <typeparamref name="T"/> instance.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of compute shader currently in use</typeparam>
|
||||
/// <param name="hash">The initial hash value</param>
|
||||
/// <param name="shader">The compute shader instance to use to compute the final hash value</param>
|
||||
/// <returns>The final hash value for the input closure</returns>
|
||||
/// <typeparam name="T">The type of compute shader currently in use.</typeparam>
|
||||
/// <param name="hash">The initial hash value.</param>
|
||||
/// <param name="shader">The compute shader instance to use to compute the final hash value.</param>
|
||||
/// <returns>The final hash value for the input closure.</returns>
|
||||
private delegate int Hasher<T>(int hash, in T shader)
|
||||
where T : struct, IComputeShader;
|
||||
|
||||
/// <summary>
|
||||
/// Builds a new <see cref="Hasher{T}"/> instance for the target <see cref="Type"/> and sequence of <see cref="FieldInfo"/> values
|
||||
/// Builds a new <see cref="Hasher{T}"/> instance for the target <see cref="Type"/> and sequence of <see cref="FieldInfo"/> values.
|
||||
/// </summary>
|
||||
/// <typeparam name="T">The type of compute shader currently in use</typeparam>
|
||||
/// <param name="fieldInfos">The list of captured fields to inspect</param>
|
||||
/// <typeparam name="T">The type of compute shader currently in use.</typeparam>
|
||||
/// <param name="fieldInfos">The list of captured fields to inspect.</param>
|
||||
[Pure]
|
||||
private static Hasher<T> BuildDynamicHasher<T>(IReadOnlyCollection<FieldInfo> fieldInfos)
|
||||
where T : struct, IComputeShader
|
||||
|
||||
@@ -97,10 +97,10 @@ namespace ComputeSharp.Shaders.Translation
|
||||
public IReadOnlyCollection<string> DeclaredTypes => this.declaredTypes;
|
||||
|
||||
/// <summary>
|
||||
/// Loads and processes an input<typeparamref name="T"/> shadeer
|
||||
/// Loads and processes an input<typeparamref name="T"/> shadeer.
|
||||
/// </summary>
|
||||
/// <param name="shader">The <typeparamref name="T"/> instance to use to build the shader</param>
|
||||
/// <returns>A new <see cref="ShaderLoader"/> instance representing the input shader</returns>
|
||||
/// <param name="shader">The <typeparamref name="T"/> instance to use to build the shader.</param>
|
||||
/// <returns>A new <see cref="ShaderLoader"/> instance representing the input shader.</returns>
|
||||
[Pure]
|
||||
public static ShaderLoader<T> Load(in T shader)
|
||||
{
|
||||
@@ -119,9 +119,9 @@ namespace ComputeSharp.Shaders.Translation
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads the fields info for the current shader being loaded
|
||||
/// Loads the fields info for the current shader being loaded.
|
||||
/// </summary>
|
||||
/// <param name="shader">The boxed <typeparamref name="T"/> instance to use to build the shader</param>
|
||||
/// <param name="shader">The boxed <typeparamref name="T"/> instance to use to build the shader.</param>
|
||||
private void LoadFieldsInfo(object shader)
|
||||
{
|
||||
IReadOnlyList<FieldInfo> shaderFields = typeof(T).GetFields(
|
||||
@@ -147,10 +147,10 @@ namespace ComputeSharp.Shaders.Translation
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Loads a specified <see cref="ReadableMember"/> and adds it to the shader model
|
||||
/// Loads a specified <see cref="ReadableMember"/> and adds it to the shader model.
|
||||
/// </summary>
|
||||
/// <param name="shader">The boxed <typeparamref name="T"/> instance to use to build the shader</param>
|
||||
/// <param name="memberInfo">The target <see cref="FieldInfo"/> to load</param>
|
||||
/// <param name="shader">The boxed <typeparamref name="T"/> instance to use to build the shader.</param>
|
||||
/// <param name="memberInfo">The target <see cref="FieldInfo"/> to load.</param>
|
||||
private void LoadFieldInfo(object shader, FieldInfo fieldInfo)
|
||||
{
|
||||
Type fieldType = fieldInfo.FieldType;
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする