ファイル
ComputeSharp/src/ComputeSharp.D2D1.SourceGenerators/Mappings/HlslKnownKeywords.cs
T
Sergio Pedri 5390d8b27c Rename package to ComputeSharp.D2D1
Also rename D2D1 to D2D for consistency with HLSL, and tweak namespaces
2022-04-24 21:04:30 +02:00

23 行
650 B
C#

using System.Collections.Generic;
using System.Reflection;
using ComputeSharp.Core.Intrinsics.Attributes;
using ComputeSharp.D2D1;
namespace ComputeSharp.SourceGeneration.Mappings;
/// <inheritdoc/>
partial class HlslKnownKeywords
{
/// <inheritdoc/>
static partial void AddKnownKeywords(ICollection<string> knownKeywords)
{
// D2D1 intrinsics method names
foreach (var method in typeof(D2D).GetMethods(BindingFlags.Public | BindingFlags.Static))
{
string name = method.GetCustomAttribute<HlslIntrinsicNameAttribute>()?.Name ?? method.Name;
knownKeywords.Add(name);
}
}
}