23 行
650 B
C#
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);
|
|
}
|
|
}
|
|
}
|