Switch methods to block bodies
このコミットが含まれているのは:
1 親
16c0fc9aab
コミット
b2afb88f30
53ファイル変更
+426
-132
検索条件に一致するファイルはありません
@@ -4,6 +4,8 @@
|
||||
using System.Numerics;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
#pragma warning disable IDE0022
|
||||
|
||||
namespace SixLabors.ImageSharp;
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -8,6 +8,8 @@ using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using Win32;
|
||||
using Win32.Graphics.Direct2D;
|
||||
|
||||
#pragma warning disable IDE0022
|
||||
|
||||
namespace ComputeSharp.D2D1.Tests;
|
||||
|
||||
[TestClass]
|
||||
|
||||
+4
-1
@@ -14,6 +14,9 @@ internal sealed partial class D2D1ResourceTextureUninitializedFieldDiagnosticSup
|
||||
[D2DResourceTextureIndex(0)]
|
||||
private readonly D2D1ResourceTexture1D<float4> texture;
|
||||
|
||||
public float4 Execute() => texture[0];
|
||||
public float4 Execute()
|
||||
{
|
||||
return texture[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
+41
-26
@@ -179,61 +179,76 @@ public abstract class NativeLibrariesResolverTestsBase
|
||||
/// </summary>
|
||||
/// <param name="rid">The input <see cref="RID"/> value.</param>
|
||||
/// <returns>A text representation for <paramref name="rid"/>.</returns>
|
||||
private static string ToOption(RID rid) => rid switch
|
||||
private static string ToOption(RID rid)
|
||||
{
|
||||
RID.None => "",
|
||||
RID.Win_x64 => "-r win-x64",
|
||||
_ => throw new InvalidEnumArgumentException(nameof(rid), (int)rid, typeof(RID))
|
||||
};
|
||||
return rid switch
|
||||
{
|
||||
RID.None => "",
|
||||
RID.Win_x64 => "-r win-x64",
|
||||
_ => throw new InvalidEnumArgumentException(nameof(rid), (int)rid, typeof(RID))
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a text representation of the command line argument for the given <see cref="PublishMode"/>.
|
||||
/// </summary>
|
||||
/// <param name="publishMode">The input <see cref="PublishMode"/> value.</param>
|
||||
/// <returns>A text representation for <paramref name="publishMode"/>.</returns>
|
||||
private static string ToOption(PublishMode publishMode) => publishMode switch
|
||||
private static string ToOption(PublishMode publishMode)
|
||||
{
|
||||
PublishMode.FrameworkDependent => "--self-contained false",
|
||||
PublishMode.SelfContained => "--self-contained true",
|
||||
_ => throw new InvalidEnumArgumentException(nameof(publishMode), (int)publishMode, typeof(PublishMode))
|
||||
};
|
||||
return publishMode switch
|
||||
{
|
||||
PublishMode.FrameworkDependent => "--self-contained false",
|
||||
PublishMode.SelfContained => "--self-contained true",
|
||||
_ => throw new InvalidEnumArgumentException(nameof(publishMode), (int)publishMode, typeof(PublishMode))
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a text representation of the command line argument for the given <see cref="DeploymentMode"/>.
|
||||
/// </summary>
|
||||
/// <param name="deploymentMode">The input <see cref="DeploymentMode"/> value.</param>
|
||||
/// <returns>A text representation for <paramref name="deploymentMode"/>.</returns>
|
||||
private static string ToOption(DeploymentMode deploymentMode) => deploymentMode switch
|
||||
private static string ToOption(DeploymentMode deploymentMode)
|
||||
{
|
||||
DeploymentMode.Multiassembly => "/p:PublishSingleFile=false",
|
||||
DeploymentMode.SingleFile => "/p:PublishSingleFile=true",
|
||||
_ => throw new InvalidEnumArgumentException(nameof(deploymentMode), (int)deploymentMode, typeof(DeploymentMode))
|
||||
};
|
||||
return deploymentMode switch
|
||||
{
|
||||
DeploymentMode.Multiassembly => "/p:PublishSingleFile=false",
|
||||
DeploymentMode.SingleFile => "/p:PublishSingleFile=true",
|
||||
_ => throw new InvalidEnumArgumentException(nameof(deploymentMode), (int)deploymentMode, typeof(DeploymentMode))
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a text representation of the command line argument for the given <see cref="NativeLibrariesDeploymentMode"/>.
|
||||
/// </summary>
|
||||
/// <param name="deploymentMode">The input <see cref="NativeLibrariesDeploymentMode"/> value.</param>
|
||||
/// <returns>A text representation for <paramref name="deploymentMode"/>.</returns>
|
||||
private static string ToOption(NativeLibrariesDeploymentMode deploymentMode) => deploymentMode switch
|
||||
private static string ToOption(NativeLibrariesDeploymentMode deploymentMode)
|
||||
{
|
||||
NativeLibrariesDeploymentMode.NotApplicable => "",
|
||||
NativeLibrariesDeploymentMode.CopyToApplicationDirectory => "/p:IncludeNativeLibrariesForSelfExtract=false",
|
||||
NativeLibrariesDeploymentMode.ExtractToTemporaryDirectory => "/p:IncludeNativeLibrariesForSelfExtract=true",
|
||||
_ => throw new InvalidEnumArgumentException(nameof(deploymentMode), (int)deploymentMode, typeof(NativeLibrariesDeploymentMode))
|
||||
};
|
||||
return deploymentMode switch
|
||||
{
|
||||
NativeLibrariesDeploymentMode.NotApplicable => "",
|
||||
NativeLibrariesDeploymentMode.CopyToApplicationDirectory => "/p:IncludeNativeLibrariesForSelfExtract=false",
|
||||
NativeLibrariesDeploymentMode.ExtractToTemporaryDirectory => "/p:IncludeNativeLibrariesForSelfExtract=true",
|
||||
_ => throw new InvalidEnumArgumentException(nameof(deploymentMode), (int)deploymentMode, typeof(NativeLibrariesDeploymentMode))
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a text representation of the build folder for the given <see cref="RID"/>.
|
||||
/// </summary>
|
||||
/// <param name="rid">The input <see cref="RID"/> value.</param>
|
||||
/// <returns>A text representation for <paramref name="rid"/>.</returns>
|
||||
private static string ToDirectory(RID rid) => rid switch
|
||||
private static string ToDirectory(RID rid)
|
||||
{
|
||||
RID.None => "",
|
||||
RID.Win_x64 => "win-x64",
|
||||
_ => throw new InvalidEnumArgumentException(nameof(rid), (int)rid, typeof(RID))
|
||||
};
|
||||
return rid switch
|
||||
{
|
||||
RID.None => "",
|
||||
RID.Win_x64 => "win-x64",
|
||||
_ => throw new InvalidEnumArgumentException(nameof(rid), (int)rid, typeof(RID))
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -26,16 +26,28 @@ public partial class MetaprogrammingTests
|
||||
public static class Activations
|
||||
{
|
||||
[ShaderMethod]
|
||||
public static int Square(int x) => x * x;
|
||||
public static int Square(int x)
|
||||
{
|
||||
return x * x;
|
||||
}
|
||||
|
||||
[ShaderMethod]
|
||||
public static int AddOne(int x) => x + 1;
|
||||
public static int AddOne(int x)
|
||||
{
|
||||
return x + 1;
|
||||
}
|
||||
|
||||
// Missing attribute
|
||||
public static int Identity(int x) => x;
|
||||
public static int Identity(int x)
|
||||
{
|
||||
return x;
|
||||
}
|
||||
|
||||
[ShaderMethod]
|
||||
public static int FunctionWithConstants(int x) => (int)(x + FourAndAHalf);
|
||||
public static int FunctionWithConstants(int x)
|
||||
{
|
||||
return (int)(x + FourAndAHalf);
|
||||
}
|
||||
|
||||
[ShaderMethod]
|
||||
public static Position FunctionWithTypes(int x)
|
||||
|
||||
@@ -3,7 +3,7 @@ using ComputeSharp.Interop;
|
||||
using ComputeSharp.Tests.Misc;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
#pragma warning disable IDE0008
|
||||
#pragma warning disable IDE0008, IDE0022
|
||||
|
||||
namespace ComputeSharp.Tests
|
||||
{
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする