Port MissingAllowUnsafeBlocksCompilationOptionAnalyzer to ComputeSharp
このコミットが含まれているのは:
1 親
0804b66ca2
コミット
6fc3c0d971
5ファイル変更
+63
-2
検索条件に一致するファイルはありません
@@ -34,6 +34,12 @@ public sealed partial class IShaderGenerator : IIncrementalGenerator
|
||||
static (node, _) => node.IsTypeDeclarationWithOrPotentiallyWithBaseTypes<StructDeclarationSyntax>(),
|
||||
static (context, token) =>
|
||||
{
|
||||
// The source generator requires unsafe blocks to be enabled (eg. for pointers, [SkipLocalsInit], etc.)
|
||||
if (!context.SemanticModel.Compilation.IsAllowUnsafeBlocksEnabled())
|
||||
{
|
||||
return default;
|
||||
}
|
||||
|
||||
StructDeclarationSyntax typeDeclaration = (StructDeclarationSyntax)context.Node;
|
||||
|
||||
// If the type symbol doesn't have at least one interface, it can't possibly be a shader type
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする