Switch to EquatableArray<T> in ComputeSharp.D2D1 models
このコミットが含まれているのは:
1 親
23e5300dee
コミット
4def9f65a9
14ファイル変更
+29
-472
検索条件に一致するファイルはありません
@@ -1,7 +1,3 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Immutable;
|
||||
using ComputeSharp.SourceGeneration.Extensions;
|
||||
using ComputeSharp.SourceGeneration.Helpers;
|
||||
|
||||
namespace ComputeSharp.D2D1.SourceGenerators.Models;
|
||||
@@ -11,38 +7,4 @@ namespace ComputeSharp.D2D1.SourceGenerators.Models;
|
||||
/// </summary>
|
||||
/// <param name="FieldInfos">The description on shader instance fields.</param>
|
||||
/// <param name="ConstantBufferSizeInBytes">The size of the shader constant buffer.</param>
|
||||
internal sealed record DispatchDataInfo(ImmutableArray<FieldInfo> FieldInfos, int ConstantBufferSizeInBytes)
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
public bool Equals(DispatchDataInfo? obj)
|
||||
{
|
||||
return Comparer.Default.Equals(this, obj);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
public override int GetHashCode()
|
||||
{
|
||||
return Comparer.Default.GetHashCode(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// An <see cref="IEqualityComparer{T}"/> implementation for <see cref="DispatchDataInfo"/>.
|
||||
/// </summary>
|
||||
private sealed class Comparer : Comparer<DispatchDataInfo, Comparer>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
protected override void AddToHashCode(ref HashCode hashCode, DispatchDataInfo obj)
|
||||
{
|
||||
hashCode.AddRange(obj.FieldInfos);
|
||||
hashCode.Add(obj.ConstantBufferSizeInBytes);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override bool AreEqual(DispatchDataInfo x, DispatchDataInfo y)
|
||||
{
|
||||
return
|
||||
x.FieldInfos.SequenceEqual(y.FieldInfos) &&
|
||||
x.ConstantBufferSizeInBytes == y.ConstantBufferSizeInBytes;
|
||||
}
|
||||
}
|
||||
}
|
||||
internal sealed record DispatchDataInfo(EquatableArray<FieldInfo> FieldInfos, int ConstantBufferSizeInBytes);
|
||||
新しいイシューから参照
ユーザーをブロックする