Enable generation for ID2D1Shader.LoadInputDescriptions API
このコミットが含まれているのは:
1 親
54d7cb53e2
コミット
3b760f02d4
11ファイル変更
+386
-1
検索条件に一致するファイルはありません
@@ -0,0 +1,9 @@
|
||||
namespace ComputeSharp.D2D1.SourceGenerators.Models;
|
||||
|
||||
/// <summary>
|
||||
/// A model representing an input description for a shader.
|
||||
/// </summary>
|
||||
/// <param name="Index">The index of the input resource the description if for.</param>
|
||||
/// <param name="Filter">The input filter to use.</param>
|
||||
/// <param name="LevelOfDetail">The level of detail to use.</param>
|
||||
internal sealed record InputDescription(uint Index, D2D1Filter Filter, int LevelOfDetail);
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections.Immutable;
|
||||
using ComputeSharp.SourceGeneration.Extensions;
|
||||
using ComputeSharp.SourceGeneration.Helpers;
|
||||
|
||||
namespace ComputeSharp.D2D1.SourceGenerators.Models;
|
||||
|
||||
/// <summary>
|
||||
/// A model representing gathered input descriptions for a shader.
|
||||
/// </summary>
|
||||
/// <param name="InputDescriptions">The input types for a given shader.</param>
|
||||
internal sealed record InputDescriptionsInfo(ImmutableArray<InputDescription> InputDescriptions)
|
||||
{
|
||||
/// <summary>
|
||||
/// An <see cref="IEqualityComparer{T}"/> implementation for <see cref="InputDescriptionsInfo"/>.
|
||||
/// </summary>
|
||||
public sealed class Comparer : Comparer<InputDescriptionsInfo, Comparer>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
protected override void AddToHashCode(ref HashCode hashCode, InputDescriptionsInfo obj)
|
||||
{
|
||||
hashCode.AddRange(obj.InputDescriptions);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override bool AreEqual(InputDescriptionsInfo x, InputDescriptionsInfo y)
|
||||
{
|
||||
return x.InputDescriptions.SequenceEqual(y.InputDescriptions);
|
||||
}
|
||||
}
|
||||
}
|
||||
新しいイシューから参照
ユーザーをブロックする