Add tracking steps to DX12/D2D source generators

このコミットが含まれているのは:
Sergio Pedri committed 2023-12-26 14:45:31 +01:00
1 親 4f75380750
コミット 50c6a9435f
4ファイル変更
+49 -7

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

+12 -2
ファイルの表示
@@ -1,6 +1,7 @@
using System.Collections.Immutable;
using System.ComponentModel;
using System.Linq;
using ComputeSharp.SourceGeneration.Constants;
using ComputeSharp.SourceGeneration.Extensions;
using ComputeSharp.SourceGeneration.Helpers;
using ComputeSharp.SourceGeneration.Models;
@@ -146,11 +147,20 @@ public sealed partial class ComputeShaderDescriptorGenerator : IIncrementalGener
HlslInfo: hlslInfo,
Diagnostcs: diagnostics.ToImmutable());
})
.WithTrackingName(WellKnownTrackingNames.Execute)
.Where(static item => item is not null)!;
// Split the diagnostics, and drop them from the output provider (see more notes in the D2D1 generator)
IncrementalValuesProvider<EquatableArray<DiagnosticInfo>> diagnosticInfo = shaderInfo.Select(static (item, _) => item.Diagnostcs);
IncrementalValuesProvider<ShaderInfo> outputInfo = shaderInfo.Select(static (item, _) => item with { Diagnostcs = default });
IncrementalValuesProvider<EquatableArray<DiagnosticInfo>> diagnosticInfo =
shaderInfo
.Select(static (item, _) => item.Diagnostcs)
.WithTrackingName(WellKnownTrackingNames.Diagnostics);
// Gather the models to produce sources for
IncrementalValuesProvider<ShaderInfo> outputInfo =
shaderInfo
.Select(static (item, _) => item with { Diagnostcs = default })
.WithTrackingName(WellKnownTrackingNames.Output);
// Output the diagnostics, if any
context.ReportDiagnostics(diagnosticInfo);