Remove EffectIdInfo model

このコミットが含まれているのは:
Sergio Pedri committed 2023-09-28 20:29:35 +02:00
1 親 4fa5a7c35e
コミット 8f2afaef99
4ファイル変更
+7 -17

検索条件に一致するファイルはありません

@@ -1,7 +1,6 @@
using System;
using System.Text;
using ComputeSharp.D2D1.__Internals;
using ComputeSharp.D2D1.SourceGenerators.Models;
using ComputeSharp.SourceGeneration.Helpers;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
@@ -22,10 +21,10 @@ partial class ID2D1ShaderGenerator
/// <summary>
/// Creates a <see cref="PropertyDeclarationSyntax"/> instance for the <c>EffectId</c> property.
/// </summary>
/// <param name="info">The input <see cref="EffectIdInfo"/> instance.</param>
/// <param name="info">The input <see cref="EquatableArray{T}"/> instance with the effect GUID.</param>
/// <param name="fixup">An opaque <see cref="Func{TResult}"/> instance to transform the final tree into text.</param>
/// <returns>The resulting <see cref="PropertyDeclarationSyntax"/> instance for the <c>EffectId</c> property.</returns>
public static PropertyDeclarationSyntax GetSyntax(EffectIdInfo info, out Func<SyntaxNode, SourceText> fixup)
public static PropertyDeclarationSyntax GetSyntax(EquatableArray<byte> info, out Func<SyntaxNode, SourceText> fixup)
{
// Create the local declaration:
//
@@ -48,7 +47,7 @@ partial class ID2D1ShaderGenerator
SingletonSeparatedList<ExpressionSyntax>(IdentifierName("__EMBEDDED_EFFECT_ID_BYTES"))))))));
// Prepare the initialization text
string effectIdLiterals = SyntaxFormattingHelper.BuildByteArrayInitializationExpressionString(info.Bytes.AsSpan());
string effectIdLiterals = SyntaxFormattingHelper.BuildByteArrayInitializationExpressionString(info.AsSpan());
// Set the fixup function
fixup = tree => SourceText.From(tree.ToFullString().Replace("__EMBEDDED_EFFECT_ID_BYTES", effectIdLiterals), Encoding.UTF8);
+2 -2
ファイルの表示
@@ -139,7 +139,7 @@ public sealed partial class ID2D1ShaderGenerator : IIncrementalGenerator
return new D2D1ShaderInfo(
Hierarchy: HierarchyInfo.From(typeSymbol),
EffectId: new EffectIdInfo(effectId),
EffectId: effectId,
EffectDisplayName: effectDisplayName,
EffectDescription: effectDescription,
EffectCategory: effectCategory,
@@ -166,7 +166,7 @@ public sealed partial class ID2D1ShaderGenerator : IIncrementalGenerator
.Select(static (item, _) => item.Diagnostcs));
// Get the EffectId info (hierarchy and effect id info)
IncrementalValuesProvider<(HierarchyInfo Hierarchy, EffectIdInfo EffectId)> effectIdInfo =
IncrementalValuesProvider<(HierarchyInfo Hierarchy, EquatableArray<byte> EffectId)> effectIdInfo =
shaderInfoWithErrors
.Select(static (item, _) => (item.Hierarchy, item.EffectId));
+2 -2
ファイルの表示
@@ -7,7 +7,7 @@ namespace ComputeSharp.D2D1.SourceGenerators.Models;
/// A model representing all necessary info for a full generation pass for a D2D1 shader.
/// </summary>
/// <param name="Hierarchy">The hierarchy info for the shader type.</param>
/// <param name="EffectId">The effect id info for the shader type.</param>
/// <param name="EffectId">The GUID bytes for the effect id.</param>
/// <param name="EffectDisplayName">The effect display name for the shader type, if available.</param>
/// <param name="EffectDescription">The effect description for the shader type, if available.</param>
/// <param name="EffectCategory">The effect category for the shader type, if available.</param>
@@ -22,7 +22,7 @@ namespace ComputeSharp.D2D1.SourceGenerators.Models;
/// <param name="Diagnostcs">The discovered diagnostics, if any.</param>
internal sealed record D2D1ShaderInfo(
HierarchyInfo Hierarchy,
EffectIdInfo EffectId,
EquatableArray<byte> EffectId,
string? EffectDisplayName,
string? EffectDescription,
string? EffectCategory,
-9
ファイルの表示
@@ -1,9 +0,0 @@
using ComputeSharp.SourceGeneration.Helpers;
namespace ComputeSharp.D2D1.SourceGenerators.Models;
/// <summary>
/// A model representing info to use to generate an effect id for a shader.
/// </summary>
/// <param name="Bytes">The bytes for the processed effect id.</param>
internal sealed record EffectIdInfo(EquatableArray<byte> Bytes);