Switch methods to block bodies
このコミットが含まれているのは:
1 親
16c0fc9aab
コミット
b2afb88f30
53ファイル変更
+426
-132
検索条件に一致するファイルはありません
@@ -14,10 +14,16 @@ namespace ComputeSharp.Core.SourceGenerators.Models;
|
||||
internal sealed record ConstructorInfo(ImmutableArray<ParameterInfo> Parameters, ImmutableArray<string> DefaultedFields)
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Equals(ConstructorInfo? obj) => Comparer.Default.Equals(this, obj);
|
||||
public bool Equals(ConstructorInfo? obj)
|
||||
{
|
||||
return Comparer.Default.Equals(this, obj);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode() => Comparer.Default.GetHashCode(this);
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Comparer.Default.GetHashCode(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An <see cref="IEqualityComparer{T}"/> implementation for <see cref="ConstructorInfo"/>.
|
||||
|
||||
@@ -14,5 +14,8 @@ internal static class RuntimeHelpers
|
||||
/// <param name="type">The type to associate the memory to.</param>
|
||||
/// <param name="size">The size in byte of the memory to allocate.</param>
|
||||
/// <returns>A pointer to the allocated memory.</returns>
|
||||
public static IntPtr AllocateTypeAssociatedMemory(Type type, int size) => Marshal.AllocHGlobal(size);
|
||||
public static IntPtr AllocateTypeAssociatedMemory(Type type, int size)
|
||||
{
|
||||
return Marshal.AllocHGlobal(size);
|
||||
}
|
||||
}
|
||||
@@ -19,10 +19,16 @@ internal sealed record D2D1PixelShaderSourceInfo(
|
||||
ImmutableArray<DiagnosticInfo> Diagnostcs)
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Equals(D2D1PixelShaderSourceInfo? obj) => Comparer.Default.Equals(this, obj);
|
||||
public bool Equals(D2D1PixelShaderSourceInfo? obj)
|
||||
{
|
||||
return Comparer.Default.Equals(this, obj);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode() => Comparer.Default.GetHashCode(this);
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Comparer.Default.GetHashCode(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An <see cref="IEqualityComparer{T}"/> implementation for <see cref="D2D1PixelShaderSourceInfo"/>.
|
||||
|
||||
@@ -31,10 +31,16 @@ internal sealed record D2D1ShaderInfo(
|
||||
ImmutableArray<DiagnosticInfo> Diagnostcs)
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Equals(D2D1ShaderInfo? obj) => Comparer.Default.Equals(this, obj);
|
||||
public bool Equals(D2D1ShaderInfo? obj)
|
||||
{
|
||||
return Comparer.Default.Equals(this, obj);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode() => Comparer.Default.GetHashCode(this);
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Comparer.Default.GetHashCode(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An <see cref="IEqualityComparer{T}"/> implementation for <see cref="D2D1ShaderInfo"/>.
|
||||
|
||||
@@ -14,10 +14,16 @@ namespace ComputeSharp.D2D1.SourceGenerators.Models;
|
||||
internal sealed record DispatchDataInfo(ImmutableArray<FieldInfo> FieldInfos, int ConstantBufferSizeInBytes)
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Equals(DispatchDataInfo? obj) => Comparer.Default.Equals(this, obj);
|
||||
public bool Equals(DispatchDataInfo? obj)
|
||||
{
|
||||
return Comparer.Default.Equals(this, obj);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode() => Comparer.Default.GetHashCode(this);
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Comparer.Default.GetHashCode(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An <see cref="IEqualityComparer{T}"/> implementation for <see cref="DispatchDataInfo"/>.
|
||||
|
||||
@@ -16,10 +16,16 @@ namespace ComputeSharp.D2D1.SourceGenerators.Models;
|
||||
internal sealed record EmbeddedBytecodeInfo(string HlslSource, D2D1ShaderProfile? ShaderProfile, D2D1CompileOptions? CompileOptions, ImmutableArray<byte> Bytecode)
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Equals(EmbeddedBytecodeInfo? obj) => Comparer.Default.Equals(this, obj);
|
||||
public bool Equals(EmbeddedBytecodeInfo? obj)
|
||||
{
|
||||
return Comparer.Default.Equals(this, obj);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode() => Comparer.Default.GetHashCode(this);
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Comparer.Default.GetHashCode(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An <see cref="IEqualityComparer{T}"/> implementation for <see cref="EmbeddedBytecodeInfo"/>.
|
||||
|
||||
@@ -24,10 +24,16 @@ internal sealed record EmbeddedBytecodeMethodInfo(
|
||||
ImmutableArray<byte> Bytecode)
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Equals(EmbeddedBytecodeMethodInfo? obj) => Comparer.Default.Equals(this, obj);
|
||||
public bool Equals(EmbeddedBytecodeMethodInfo? obj)
|
||||
{
|
||||
return Comparer.Default.Equals(this, obj);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode() => Comparer.Default.GetHashCode(this);
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Comparer.Default.GetHashCode(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An <see cref="IEqualityComparer{T}"/> implementation for <see cref="EmbeddedBytecodeMethodInfo"/>.
|
||||
|
||||
@@ -20,10 +20,16 @@ internal abstract record FieldInfo
|
||||
public sealed record Primitive(ImmutableArray<string> FieldPath, string TypeName, int Offset) : FieldInfo
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Equals(Primitive? obj) => Comparer.Default.Equals(this, obj);
|
||||
public bool Equals(Primitive? obj)
|
||||
{
|
||||
return Comparer.Default.Equals(this, obj);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode() => Comparer.Default.GetHashCode(this);
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Comparer.Default.GetHashCode(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An <see cref="IEqualityComparer{T}"/> implementation for <see cref="Primitive"/>.
|
||||
@@ -67,10 +73,16 @@ internal abstract record FieldInfo
|
||||
ImmutableArray<int> Offsets) : FieldInfo
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Equals(NonLinearMatrix? obj) => Comparer.Default.Equals(this, obj);
|
||||
public bool Equals(NonLinearMatrix? obj)
|
||||
{
|
||||
return Comparer.Default.Equals(this, obj);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode() => Comparer.Default.GetHashCode(this);
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Comparer.Default.GetHashCode(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An <see cref="IEqualityComparer{T}"/> implementation for <see cref="NonLinearMatrix"/>.
|
||||
|
||||
@@ -27,10 +27,16 @@ internal sealed record HlslShaderMethodSourceInfo(
|
||||
bool HasErrors)
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Equals(HlslShaderMethodSourceInfo? obj) => Comparer.Default.Equals(this, obj);
|
||||
public bool Equals(HlslShaderMethodSourceInfo? obj)
|
||||
{
|
||||
return Comparer.Default.Equals(this, obj);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode() => Comparer.Default.GetHashCode(this);
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Comparer.Default.GetHashCode(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An <see cref="IEqualityComparer{T}"/> implementation for <see cref="HlslShaderMethodSourceInfo"/>.
|
||||
|
||||
@@ -12,10 +12,16 @@ namespace ComputeSharp.D2D1.SourceGenerators.Models;
|
||||
internal sealed record InputDescriptionsInfo(ImmutableArray<InputDescription> InputDescriptions)
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Equals(InputDescriptionsInfo? obj) => Comparer.Default.Equals(this, obj);
|
||||
public bool Equals(InputDescriptionsInfo? obj)
|
||||
{
|
||||
return Comparer.Default.Equals(this, obj);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode() => Comparer.Default.GetHashCode(this);
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Comparer.Default.GetHashCode(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An <see cref="IEqualityComparer{T}"/> implementation for <see cref="InputDescriptionsInfo"/>.
|
||||
|
||||
@@ -13,10 +13,16 @@ namespace ComputeSharp.D2D1.SourceGenerators.Models;
|
||||
internal sealed record InputTypesInfo(ImmutableArray<uint> InputTypes)
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Equals(InputTypesInfo? obj) => Comparer.Default.Equals(this, obj);
|
||||
public bool Equals(InputTypesInfo? obj)
|
||||
{
|
||||
return Comparer.Default.Equals(this, obj);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode() => Comparer.Default.GetHashCode(this);
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Comparer.Default.GetHashCode(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An <see cref="IEqualityComparer{T}"/> implementation for <see cref="InputTypesInfo"/>.
|
||||
|
||||
@@ -12,10 +12,16 @@ namespace ComputeSharp.D2D1.SourceGenerators.Models;
|
||||
internal sealed record ResourceTextureDescriptionsInfo(ImmutableArray<ResourceTextureDescription> ResourceTextureDescriptions)
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Equals(ResourceTextureDescriptionsInfo? obj) => Comparer.Default.Equals(this, obj);
|
||||
public bool Equals(ResourceTextureDescriptionsInfo? obj)
|
||||
{
|
||||
return Comparer.Default.Equals(this, obj);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode() => Comparer.Default.GetHashCode(this);
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Comparer.Default.GetHashCode(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An <see cref="IEqualityComparer{T}"/> implementation for <see cref="ResourceTextureDescriptionsInfo"/>.
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using ComputeSharp.Exceptions;
|
||||
|
||||
#pragma warning disable IDE0022
|
||||
|
||||
namespace ComputeSharp.D2D1;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using ComputeSharp.Exceptions;
|
||||
|
||||
#pragma warning disable IDE0022
|
||||
|
||||
namespace ComputeSharp.D2D1;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using ComputeSharp.Exceptions;
|
||||
|
||||
#pragma warning disable IDE0022
|
||||
|
||||
namespace ComputeSharp.D2D1;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -43,14 +43,11 @@ unsafe partial struct PixelShaderEffect
|
||||
#endif
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get
|
||||
{
|
||||
#if NET6_0_OR_GREATER
|
||||
return &GetConstantBufferImpl;
|
||||
get => &GetConstantBufferImpl;
|
||||
#else
|
||||
return (void*)Marshal.GetFunctionPointerForDelegate(GetConstantBufferWrapper);
|
||||
get => (void*)Marshal.GetFunctionPointerForDelegate(GetConstantBufferWrapper);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -63,14 +60,11 @@ unsafe partial struct PixelShaderEffect
|
||||
#endif
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
get
|
||||
{
|
||||
#if NET6_0_OR_GREATER
|
||||
return &SetConstantBufferImpl;
|
||||
get => &SetConstantBufferImpl;
|
||||
#else
|
||||
return (void*)Marshal.GetFunctionPointerForDelegate(SetConstantBufferWrapper);
|
||||
get => (void*)Marshal.GetFunctionPointerForDelegate(SetConstantBufferWrapper);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
/// <inheritdoc cref="D2D1_PROPERTY_BINDING.getFunction"/>
|
||||
|
||||
@@ -14,5 +14,8 @@ internal static class RuntimeHelpers
|
||||
/// <param name="type">The type to associate the memory to.</param>
|
||||
/// <param name="size">The size in byte of the memory to allocate.</param>
|
||||
/// <returns>A pointer to the allocated memory.</returns>
|
||||
public static IntPtr AllocateTypeAssociatedMemory(Type type, int size) => Marshal.AllocHGlobal(size);
|
||||
public static IntPtr AllocateTypeAssociatedMemory(Type type, int size)
|
||||
{
|
||||
return Marshal.AllocHGlobal(size);
|
||||
}
|
||||
}
|
||||
@@ -12,6 +12,8 @@ using Microsoft.CodeAnalysis.CSharp.Syntax;
|
||||
using Microsoft.CodeAnalysis.Operations;
|
||||
using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;
|
||||
|
||||
#pragma warning disable IDE0051
|
||||
|
||||
namespace ComputeSharp.SourceGeneration.SyntaxRewriters;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -470,12 +470,18 @@ internal struct HashCode
|
||||
/// <inheritdoc/>
|
||||
[Obsolete("HashCode is a mutable struct and should not be compared with other HashCodes. Use ToHashCode to retrieve the computed hash code.", error: true)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public override int GetHashCode() => throw new NotSupportedException();
|
||||
public override int GetHashCode()
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
[Obsolete("HashCode is a mutable struct and should not be compared with other HashCodes.", error: true)]
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public override bool Equals(object? obj) => throw new NotSupportedException();
|
||||
public override bool Equals(object? obj)
|
||||
{
|
||||
throw new NotSupportedException();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Rotates the specified value left by the specified number of bits.
|
||||
|
||||
@@ -16,10 +16,16 @@ namespace ComputeSharp.SourceGeneration.Models;
|
||||
internal sealed record DeferredDiagnosticInfo(DiagnosticDescriptor Descriptor, ImmutableArray<string> Arguments)
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Equals(DeferredDiagnosticInfo? obj) => Comparer.Default.Equals(this, obj);
|
||||
public bool Equals(DeferredDiagnosticInfo? obj)
|
||||
{
|
||||
return Comparer.Default.Equals(this, obj);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode() => Comparer.Default.GetHashCode(this);
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Comparer.Default.GetHashCode(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="DeferredDiagnosticInfo"/> instance with the specified parameters.
|
||||
|
||||
@@ -23,10 +23,16 @@ internal sealed record DiagnosticInfo(
|
||||
ImmutableArray<string> Arguments)
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Equals(DiagnosticInfo? obj) => Comparer.Default.Equals(this, obj);
|
||||
public bool Equals(DiagnosticInfo? obj)
|
||||
{
|
||||
return Comparer.Default.Equals(this, obj);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode() => Comparer.Default.GetHashCode(this);
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Comparer.Default.GetHashCode(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new <see cref="Diagnostic"/> instance with the state from this model.
|
||||
|
||||
@@ -112,10 +112,16 @@ internal sealed partial record HierarchyInfo(string FilenameHint, string FullyQu
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public bool Equals(HierarchyInfo? obj) => Comparer.Default.Equals(this, obj);
|
||||
public bool Equals(HierarchyInfo? obj)
|
||||
{
|
||||
return Comparer.Default.Equals(this, obj);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode() => Comparer.Default.GetHashCode(this);
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Comparer.Default.GetHashCode(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An <see cref="IEqualityComparer{T}"/> implementation for <see cref="HierarchyInfo"/>.
|
||||
|
||||
@@ -20,10 +20,16 @@ internal sealed record DispatchDataInfo(
|
||||
int Root32BitConstantCount)
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Equals(DispatchDataInfo? obj) => Comparer.Default.Equals(this, obj);
|
||||
public bool Equals(DispatchDataInfo? obj)
|
||||
{
|
||||
return Comparer.Default.Equals(this, obj);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode() => Comparer.Default.GetHashCode(this);
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Comparer.Default.GetHashCode(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An <see cref="IEqualityComparer{T}"/> implementation for <see cref="DispatchDataInfo"/>.
|
||||
|
||||
@@ -13,10 +13,16 @@ namespace ComputeSharp.SourceGenerators.Models;
|
||||
internal sealed record DispatchIdInfo(ImmutableArray<string> Delegates)
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Equals(DispatchIdInfo? obj) => Comparer.Default.Equals(this, obj);
|
||||
public bool Equals(DispatchIdInfo? obj)
|
||||
{
|
||||
return Comparer.Default.Equals(this, obj);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode() => Comparer.Default.GetHashCode(this);
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Comparer.Default.GetHashCode(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An <see cref="IEqualityComparer{T}"/> implementation for <see cref="DispatchIdInfo"/>.
|
||||
|
||||
@@ -18,10 +18,16 @@ internal sealed record DispatchMetadataInfo(
|
||||
ImmutableArray<ResourceDescriptor> ResourceDescriptors)
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Equals(DispatchMetadataInfo? obj) => Comparer.Default.Equals(this, obj);
|
||||
public bool Equals(DispatchMetadataInfo? obj)
|
||||
{
|
||||
return Comparer.Default.Equals(this, obj);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode() => Comparer.Default.GetHashCode(this);
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Comparer.Default.GetHashCode(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An <see cref="IEqualityComparer{T}"/> implementation for <see cref="DispatchMetadataInfo"/>.
|
||||
|
||||
@@ -16,10 +16,16 @@ namespace ComputeSharp.SourceGenerators.Models;
|
||||
internal sealed record EmbeddedBytecodeInfo(int X, int Y, int Z, ImmutableArray<byte> Bytecode)
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Equals(EmbeddedBytecodeInfo? obj) => Comparer.Default.Equals(this, obj);
|
||||
public bool Equals(EmbeddedBytecodeInfo? obj)
|
||||
{
|
||||
return Comparer.Default.Equals(this, obj);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode() => Comparer.Default.GetHashCode(this);
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Comparer.Default.GetHashCode(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An <see cref="IEqualityComparer{T}"/> implementation for <see cref="EmbeddedBytecodeInfo"/>.
|
||||
|
||||
@@ -20,10 +20,16 @@ internal abstract record FieldInfo
|
||||
public sealed record Resource(string FieldName, string TypeName, int Offset) : FieldInfo
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Equals(Resource? obj) => Comparer.Default.Equals(this, obj);
|
||||
public bool Equals(Resource? obj)
|
||||
{
|
||||
return Comparer.Default.Equals(this, obj);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode() => Comparer.Default.GetHashCode(this);
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Comparer.Default.GetHashCode(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An <see cref="IEqualityComparer{T}"/> implementation for <see cref="Resource"/>.
|
||||
@@ -58,10 +64,16 @@ internal abstract record FieldInfo
|
||||
public sealed record Primitive(ImmutableArray<string> FieldPath, string TypeName, int Offset) : FieldInfo
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Equals(Primitive? obj) => Comparer.Default.Equals(this, obj);
|
||||
public bool Equals(Primitive? obj)
|
||||
{
|
||||
return Comparer.Default.Equals(this, obj);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode() => Comparer.Default.GetHashCode(this);
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Comparer.Default.GetHashCode(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An <see cref="IEqualityComparer{T}"/> implementation for <see cref="Primitive"/>.
|
||||
@@ -105,10 +117,16 @@ internal abstract record FieldInfo
|
||||
ImmutableArray<int> Offsets) : FieldInfo
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Equals(NonLinearMatrix? obj) => Comparer.Default.Equals(this, obj);
|
||||
public bool Equals(NonLinearMatrix? obj)
|
||||
{
|
||||
return Comparer.Default.Equals(this, obj);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode() => Comparer.Default.GetHashCode(this);
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Comparer.Default.GetHashCode(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An <see cref="IEqualityComparer{T}"/> implementation for <see cref="NonLinearMatrix"/>.
|
||||
|
||||
@@ -22,10 +22,16 @@ internal sealed record HlslMethodSourceInfo(
|
||||
ImmutableArray<(string Signature, string Definition)> DependentMethods)
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Equals(HlslMethodSourceInfo? obj) => Comparer.Default.Equals(this, obj);
|
||||
public bool Equals(HlslMethodSourceInfo? obj)
|
||||
{
|
||||
return Comparer.Default.Equals(this, obj);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode() => Comparer.Default.GetHashCode(this);
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Comparer.Default.GetHashCode(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An <see cref="IEqualityComparer{T}"/> implementation for <see cref="HlslMethodSourceInfo"/>.
|
||||
|
||||
@@ -40,10 +40,16 @@ internal sealed record HlslShaderSourceInfo(
|
||||
ImmutableArray<string> Delegates)
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Equals(HlslShaderSourceInfo? obj) => Comparer.Default.Equals(this, obj);
|
||||
public bool Equals(HlslShaderSourceInfo? obj)
|
||||
{
|
||||
return Comparer.Default.Equals(this, obj);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode() => Comparer.Default.GetHashCode(this);
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Comparer.Default.GetHashCode(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An <see cref="IEqualityComparer{T}"/> implementation for <see cref="HlslShaderSourceInfo"/>.
|
||||
|
||||
@@ -27,10 +27,16 @@ internal sealed record ShaderInfo(
|
||||
ImmutableArray<DiagnosticInfo> Diagnostcs)
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Equals(ShaderInfo? obj) => Comparer.Default.Equals(this, obj);
|
||||
public bool Equals(ShaderInfo? obj)
|
||||
{
|
||||
return Comparer.Default.Equals(this, obj);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode() => Comparer.Default.GetHashCode(this);
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Comparer.Default.GetHashCode(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An <see cref="IEqualityComparer{T}"/> implementation for <see cref="ShaderInfo"/>.
|
||||
|
||||
@@ -15,10 +15,16 @@ namespace ComputeSharp.SourceGenerators.Models;
|
||||
internal sealed record ShaderMethodInfo(HlslMethodSourceInfo HlslMethodSource, ImmutableArray<DiagnosticInfo> Diagnostcs)
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Equals(ShaderMethodInfo? obj) => Comparer.Default.Equals(this, obj);
|
||||
public bool Equals(ShaderMethodInfo? obj)
|
||||
{
|
||||
return Comparer.Default.Equals(this, obj);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode() => Comparer.Default.GetHashCode(this);
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Comparer.Default.GetHashCode(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An <see cref="IEqualityComparer{T}"/> implementation for <see cref="ShaderMethodInfo"/>.
|
||||
|
||||
@@ -136,18 +136,30 @@ public struct Bgra32 : IEquatable<Bgra32>, IPixel<Bgra32, Float4>
|
||||
public static bool operator !=(Bgra32 left, Bgra32 right) => !left.Equals(right);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly bool Equals(object? obj) => obj is Bgra32 other && Equals(other);
|
||||
public override readonly bool Equals(object? obj)
|
||||
{
|
||||
return obj is Bgra32 other && Equals(other);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public readonly bool Equals(Bgra32 other) => PackedValue.Equals(other.PackedValue);
|
||||
public readonly bool Equals(Bgra32 other)
|
||||
{
|
||||
return PackedValue.Equals(other.PackedValue);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public override readonly int GetHashCode() => PackedValue.GetHashCode();
|
||||
public override readonly int GetHashCode()
|
||||
{
|
||||
return PackedValue.GetHashCode();
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
public override readonly string ToString() => $"{nameof(Bgra32)}({this.B}, {this.G}, {this.R}, {this.A})";
|
||||
public override readonly string ToString()
|
||||
{
|
||||
return $"{nameof(Bgra32)}({this.B}, {this.G}, {this.R}, {this.A})";
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <inheritdoc />
|
||||
|
||||
@@ -72,18 +72,30 @@ public struct R16 : IEquatable<R16>, IPixel<R16, float>
|
||||
public static bool operator !=(R16 left, R16 right) => !left.Equals(right);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly bool Equals(object? obj) => obj is R16 R16 && Equals(R16);
|
||||
public override readonly bool Equals(object? obj)
|
||||
{
|
||||
return obj is R16 R16 && Equals(R16);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public readonly bool Equals(R16 other) => PackedValue.Equals(other.PackedValue);
|
||||
public readonly bool Equals(R16 other)
|
||||
{
|
||||
return PackedValue.Equals(other.PackedValue);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public override readonly int GetHashCode() => PackedValue.GetHashCode();
|
||||
public override readonly int GetHashCode()
|
||||
{
|
||||
return PackedValue.GetHashCode();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly string ToString() => $"{nameof(R16)}({this.R})";
|
||||
public override readonly string ToString()
|
||||
{
|
||||
return $"{nameof(R16)}({this.R})";
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <inheritdoc/>
|
||||
|
||||
@@ -72,18 +72,30 @@ public struct R8 : IEquatable<R8>, IPixel<R8, float>
|
||||
public static bool operator !=(R8 left, R8 right) => !left.Equals(right);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly bool Equals(object? obj) => obj is R8 R8 && Equals(R8);
|
||||
public override readonly bool Equals(object? obj)
|
||||
{
|
||||
return obj is R8 R8 && Equals(R8);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public readonly bool Equals(R8 other) => PackedValue.Equals(other.PackedValue);
|
||||
public readonly bool Equals(R8 other)
|
||||
{
|
||||
return PackedValue.Equals(other.PackedValue);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public override readonly int GetHashCode() => PackedValue.GetHashCode();
|
||||
public override readonly int GetHashCode()
|
||||
{
|
||||
return PackedValue.GetHashCode();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly string ToString() => $"{nameof(R8)}({this.R})";
|
||||
public override readonly string ToString()
|
||||
{
|
||||
return $"{nameof(R8)}({this.R})";
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <inheritdoc/>
|
||||
|
||||
@@ -79,18 +79,30 @@ public struct Rg16 : IEquatable<Rg16>, IPixel<Rg16, Float2>
|
||||
public static bool operator !=(Rg16 left, Rg16 right) => !left.Equals(right);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly bool Equals(object? obj) => obj is Rg16 rgba32 && Equals(rgba32);
|
||||
public override readonly bool Equals(object? obj)
|
||||
{
|
||||
return obj is Rg16 rgba32 && Equals(rgba32);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public readonly bool Equals(Rg16 other) => PackedValue.Equals(other.PackedValue);
|
||||
public readonly bool Equals(Rg16 other)
|
||||
{
|
||||
return PackedValue.Equals(other.PackedValue);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public override readonly int GetHashCode() => PackedValue.GetHashCode();
|
||||
public override readonly int GetHashCode()
|
||||
{
|
||||
return PackedValue.GetHashCode();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly string ToString() => $"{nameof(Rg16)}({this.R}, {this.G})";
|
||||
public override readonly string ToString()
|
||||
{
|
||||
return $"{nameof(Rg16)}({this.R}, {this.G})";
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <inheritdoc/>
|
||||
|
||||
@@ -79,18 +79,30 @@ public struct Rg32 : IEquatable<Rg32>, IPixel<Rg32, Float2>
|
||||
public static bool operator !=(Rg32 left, Rg32 right) => !left.Equals(right);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly bool Equals(object? obj) => obj is Rg32 rgba32 && Equals(rgba32);
|
||||
public override readonly bool Equals(object? obj)
|
||||
{
|
||||
return obj is Rg32 rgba32 && Equals(rgba32);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public readonly bool Equals(Rg32 other) => PackedValue.Equals(other.PackedValue);
|
||||
public readonly bool Equals(Rg32 other)
|
||||
{
|
||||
return PackedValue.Equals(other.PackedValue);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public override readonly int GetHashCode() => PackedValue.GetHashCode();
|
||||
public override readonly int GetHashCode()
|
||||
{
|
||||
return PackedValue.GetHashCode();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly string ToString() => $"{nameof(Rg32)}({this.R}, {this.G})";
|
||||
public override readonly string ToString()
|
||||
{
|
||||
return $"{nameof(Rg32)}({this.R}, {this.G})";
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <inheritdoc/>
|
||||
|
||||
@@ -134,18 +134,30 @@ public struct Rgba32 : IEquatable<Rgba32>, IPixel<Rgba32, Float4>
|
||||
public static bool operator !=(Rgba32 left, Rgba32 right) => !left.Equals(right);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly bool Equals(object? obj) => obj is Rgba32 rgba32 && Equals(rgba32);
|
||||
public override readonly bool Equals(object? obj)
|
||||
{
|
||||
return obj is Rgba32 rgba32 && Equals(rgba32);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public readonly bool Equals(Rgba32 other) => PackedValue.Equals(other.PackedValue);
|
||||
public readonly bool Equals(Rgba32 other)
|
||||
{
|
||||
return PackedValue.Equals(other.PackedValue);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public override readonly int GetHashCode() => PackedValue.GetHashCode();
|
||||
public override readonly int GetHashCode()
|
||||
{
|
||||
return PackedValue.GetHashCode();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly string ToString() => $"{nameof(Rgba32)}({this.R}, {this.G}, {this.B}, {this.A})";
|
||||
public override readonly string ToString()
|
||||
{
|
||||
return $"{nameof(Rgba32)}({this.R}, {this.G}, {this.B}, {this.A})";
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <inheritdoc/>
|
||||
|
||||
@@ -132,18 +132,30 @@ public struct Rgba64 : IEquatable<Rgba64>, IPixel<Rgba64, Float4>
|
||||
public static bool operator !=(Rgba64 left, Rgba64 right) => !left.Equals(right);
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly bool Equals(object? obj) => obj is Rgba64 rgba32 && Equals(rgba32);
|
||||
public override readonly bool Equals(object? obj)
|
||||
{
|
||||
return obj is Rgba64 rgba32 && Equals(rgba32);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public readonly bool Equals(Rgba64 other) => PackedValue.Equals(other.PackedValue);
|
||||
public readonly bool Equals(Rgba64 other)
|
||||
{
|
||||
return PackedValue.Equals(other.PackedValue);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public override readonly int GetHashCode() => PackedValue.GetHashCode();
|
||||
public override readonly int GetHashCode()
|
||||
{
|
||||
return PackedValue.GetHashCode();
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override readonly string ToString() => $"{nameof(Rgba64)}({this.R}, {this.G}, {this.B}, {this.A})";
|
||||
public override readonly string ToString()
|
||||
{
|
||||
return $"{nameof(Rgba64)}({this.R}, {this.G}, {this.B}, {this.A})";
|
||||
}
|
||||
|
||||
#if NET6_0_OR_GREATER
|
||||
/// <inheritdoc/>
|
||||
|
||||
@@ -5,6 +5,8 @@ using ComputeSharp.Resources;
|
||||
using ComputeSharp.Resources.Debug;
|
||||
using static TerraFX.Interop.DirectX.D3D12_FORMAT_SUPPORT1;
|
||||
|
||||
#pragma warning disable IDE0022
|
||||
|
||||
namespace ComputeSharp;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -5,6 +5,8 @@ using ComputeSharp.Resources;
|
||||
using ComputeSharp.Resources.Debug;
|
||||
using static TerraFX.Interop.DirectX.D3D12_FORMAT_SUPPORT1;
|
||||
|
||||
#pragma warning disable IDE0022
|
||||
|
||||
namespace ComputeSharp;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -5,6 +5,8 @@ using ComputeSharp.Resources;
|
||||
using ComputeSharp.Resources.Debug;
|
||||
using static TerraFX.Interop.DirectX.D3D12_FORMAT_SUPPORT1;
|
||||
|
||||
#pragma warning disable IDE0022
|
||||
|
||||
namespace ComputeSharp;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -9,7 +9,7 @@ using ComputeSharp.Interop;
|
||||
using TerraFX.Interop.DirectX;
|
||||
using static TerraFX.Interop.DirectX.D3D12_SRV_DIMENSION;
|
||||
|
||||
#pragma warning disable CS0618
|
||||
#pragma warning disable CS0618, IDE0022
|
||||
|
||||
namespace ComputeSharp;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ using ComputeSharp.Interop;
|
||||
using TerraFX.Interop.DirectX;
|
||||
using static TerraFX.Interop.DirectX.D3D12_SRV_DIMENSION;
|
||||
|
||||
#pragma warning disable CS0618
|
||||
#pragma warning disable CS0618, IDE0022
|
||||
|
||||
namespace ComputeSharp;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ using ComputeSharp.Interop;
|
||||
using TerraFX.Interop.DirectX;
|
||||
using static TerraFX.Interop.DirectX.D3D12_SRV_DIMENSION;
|
||||
|
||||
#pragma warning disable CS0618
|
||||
#pragma warning disable CS0618, IDE0022
|
||||
|
||||
namespace ComputeSharp;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ using ComputeSharp.Interop;
|
||||
using TerraFX.Interop.DirectX;
|
||||
using static TerraFX.Interop.DirectX.D3D12_SRV_DIMENSION;
|
||||
|
||||
#pragma warning disable CS0618
|
||||
#pragma warning disable CS0618, IDE0022
|
||||
|
||||
namespace ComputeSharp;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ using ComputeSharp.Interop;
|
||||
using TerraFX.Interop.DirectX;
|
||||
using static TerraFX.Interop.DirectX.D3D12_SRV_DIMENSION;
|
||||
|
||||
#pragma warning disable CS0618
|
||||
#pragma warning disable CS0618, IDE0022
|
||||
|
||||
namespace ComputeSharp;
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ using ComputeSharp.Interop;
|
||||
using TerraFX.Interop.DirectX;
|
||||
using static TerraFX.Interop.DirectX.D3D12_SRV_DIMENSION;
|
||||
|
||||
#pragma warning disable CS0618
|
||||
#pragma warning disable CS0618, IDE0022
|
||||
|
||||
namespace ComputeSharp;
|
||||
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする