Support [GloballyCoherent] in generator
このコミットが含まれているのは:
1 親
7ba3b2578b
コミット
c661ef7e80
3ファイル変更
+25
-6
検索条件に一致するファイルはありません
@@ -137,10 +137,10 @@ partial class ComputeShaderDescriptorGenerator
|
||||
continue;
|
||||
}
|
||||
|
||||
AttributeData? attribute = fieldSymbol.GetAttributes().FirstOrDefault(static a => a.AttributeClass?.ToDisplayString() == "ComputeSharp.GroupSharedAttribute");
|
||||
AttributeData? groupSharedAttribute = fieldSymbol.GetAttributes().FirstOrDefault(static a => a.AttributeClass?.ToDisplayString() == "ComputeSharp.GroupSharedAttribute");
|
||||
|
||||
// Group shared fields must be static
|
||||
if (attribute is not null)
|
||||
if (groupSharedAttribute is not null)
|
||||
{
|
||||
diagnostics.Add(InvalidGroupSharedFieldDeclaration, fieldSymbol, structDeclarationSymbol, fieldName);
|
||||
}
|
||||
@@ -169,6 +169,13 @@ partial class ComputeShaderDescriptorGenerator
|
||||
types.Add((INamedTypeSymbol)typeSymbol.TypeArguments[0]);
|
||||
}
|
||||
|
||||
// Check whether the resource is a globallycoherent writeable buffer
|
||||
if (HlslKnownTypes.IsReadWriteBufferType(metadataName) &&
|
||||
fieldSymbol.TryGetAttributeWithFullyQualifiedMetadataName("ComputeSharp.GloballyCoherentAttribute", out _))
|
||||
{
|
||||
typeName = "globallycoherent " + typeName;
|
||||
}
|
||||
|
||||
// Add the current mapping for the name (if the name used a reserved keyword)
|
||||
resources.Add((metadataName, mapping ?? fieldName, typeName));
|
||||
}
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする