Initial implementation of LoadResourceTextureDescriptions generator
このコミットが含まれているのは:
1 親
b28d3f2500
コミット
8b42c7011e
12ファイル変更
+437
-15
検索条件に一致するファイルはありません
@@ -3,7 +3,7 @@
|
||||
/// <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="Index">The index of the input resource the description is 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);
|
||||
@@ -8,7 +8,7 @@ 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>
|
||||
/// <param name="InputDescriptions">The input descriptions for a given shader.</param>
|
||||
internal sealed record InputDescriptionsInfo(ImmutableArray<InputDescription> InputDescriptions)
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
namespace ComputeSharp.D2D1.SourceGenerators.Models;
|
||||
|
||||
/// <summary>
|
||||
/// A model representing a resource texture description for a shader.
|
||||
/// </summary>
|
||||
/// <param name="Index">The index of the resource texture resource the description is for.</param>
|
||||
/// <param name="Rank">The rank of the resource texture.</param>
|
||||
internal sealed record ResourceTextureDescription(uint Index, uint Rank);
|
||||
@@ -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 resource texture descriptions for a shader.
|
||||
/// </summary>
|
||||
/// <param name="ResourceTextureDescriptions">The resource textures for the current shader.</param>
|
||||
internal sealed record ResourceTextureDescriptionsInfo(ImmutableArray<ResourceTextureDescription> ResourceTextureDescriptions)
|
||||
{
|
||||
/// <summary>
|
||||
/// An <see cref="IEqualityComparer{T}"/> implementation for <see cref="ResourceTextureDescriptionsInfo"/>.
|
||||
/// </summary>
|
||||
public sealed class Comparer : Comparer<ResourceTextureDescriptionsInfo, Comparer>
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
protected override void AddToHashCode(ref HashCode hashCode, ResourceTextureDescriptionsInfo obj)
|
||||
{
|
||||
hashCode.AddRange(obj.ResourceTextureDescriptions);
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
protected override bool AreEqual(ResourceTextureDescriptionsInfo x, ResourceTextureDescriptionsInfo y)
|
||||
{
|
||||
return x.ResourceTextureDescriptions.SequenceEqual(y.ResourceTextureDescriptions);
|
||||
}
|
||||
}
|
||||
}
|
||||
新しいイシューから参照
ユーザーをブロックする