Moved [AutoConstructor] attribute to ComputeSharp.Core
このコミットが含まれているのは:
1 親
d17874c940
コミット
2a02358cc7
2ファイル変更
+12
-19
検索条件に一致するファイルはありません
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <summary>
|
||||
/// A shader that indicates that a target shader type should get an automatic constructor for all fields.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Struct, AllowMultiple = false)]
|
||||
public sealed class AutoConstructorAttribute : Attribute
|
||||
{
|
||||
}
|
||||
}
|
||||
@@ -21,25 +21,6 @@ namespace ComputeSharp.SourceGenerators
|
||||
/// <inheritdoc/>
|
||||
public void Execute(GeneratorExecutionContext context)
|
||||
{
|
||||
const string attributeText = @"
|
||||
using System;
|
||||
|
||||
namespace ComputeSharp
|
||||
{
|
||||
/// <summary>
|
||||
/// A shader that indicates that a target shader type should get an automatic constructor for all fields.
|
||||
/// </summary>
|
||||
[AttributeUsage(AttributeTargets.Struct, AllowMultiple = false)]
|
||||
public sealed class AutoConstructorAttribute : Attribute
|
||||
{
|
||||
}
|
||||
}";
|
||||
|
||||
var attributeSource = SourceText.From(ParseCompilationUnit(attributeText).NormalizeWhitespace().ToFullString(), Encoding.UTF8);
|
||||
|
||||
// Add the [AutoConstructor] attribute
|
||||
context.AddSource("__ComputeSharp_AutoConstructorAttribute", attributeSource);
|
||||
|
||||
// Find all the [AutoConstructor] usages
|
||||
ImmutableArray<AttributeSyntax> attributes = (
|
||||
from tree in context.Compilation.SyntaxTrees
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする