Minor code refactorings
このコミットが含まれているのは:
1 親
c14dd305ae
コミット
b24e6b4c0d
27ファイル変更
+131
-121
検索条件に一致するファイルはありません
+1
-1
@@ -29,7 +29,7 @@ public sealed class InvalidAssemblyLevelCompileOptionsAnalyzer : DiagnosticAnaly
|
||||
// - The type symbol for the assembly, to get the AttributeData object for the [D2D1CompileOptions] attribute, if used.
|
||||
// - The syntax node representing the attribute targeting the assembly, to get a location (this is retrieved from the AttributeData).
|
||||
// - The input D2D1CompileOptions value, which can be retrieved from the constructor arguments of the AttributeData object.
|
||||
if (assemblySymbol.TryGetAttributeWithFullMetadataName("ComputeSharp.D2D1.D2DCompileOptionsAttribute", out AttributeData? attributeData))
|
||||
if (assemblySymbol.TryGetAttributeWithFullyQualifiedMetadataName("ComputeSharp.D2D1.D2DCompileOptionsAttribute", out AttributeData? attributeData))
|
||||
{
|
||||
D2D1CompileOptions options = (D2D1CompileOptions)attributeData!.ConstructorArguments[0].Value!;
|
||||
|
||||
|
||||
+2
-2
@@ -27,9 +27,9 @@ public sealed class InvalidD2DResourceTextureIndexUseAnalyzer : DiagnosticAnalyz
|
||||
{
|
||||
IFieldSymbol fieldSymbol = (IFieldSymbol)context.Symbol;
|
||||
|
||||
if (fieldSymbol.TryGetAttributeWithFullMetadataName("ComputeSharp.D2D1.D2DResourceTextureIndexAttribute", out _))
|
||||
if (fieldSymbol.TryGetAttributeWithFullyQualifiedMetadataName("ComputeSharp.D2D1.D2DResourceTextureIndexAttribute", out _))
|
||||
{
|
||||
string metadataName = fieldSymbol.Type.GetFullMetadataName();
|
||||
string metadataName = fieldSymbol.Type.GetFullyQualifiedMetadataName();
|
||||
|
||||
if (!HlslKnownTypes.IsResourceTextureType(metadataName))
|
||||
{
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ public sealed class D2D1ResourceTextureUninitializedFieldDiagnosticSuppressor :
|
||||
|
||||
// Check if the field is in a struct and it's of a D2D1 resource texture type
|
||||
if (declaredSymbol is IFieldSymbol { ContainingType: { TypeKind: TypeKind.Struct } structSymbol } fieldSymbol &&
|
||||
HlslKnownTypes.IsResourceTextureType(fieldSymbol.Type.GetFullMetadataName()))
|
||||
HlslKnownTypes.IsResourceTextureType(fieldSymbol.Type.GetFullyQualifiedMetadataName()))
|
||||
{
|
||||
// Get the ID2D1PixelShader interface symbol to the check the containing type of the field
|
||||
INamedTypeSymbol? pixelShaderInterfaceSymbol = semanticModel.Compilation.GetTypeByMetadataName(typeof(ID2D1PixelShader).FullName)!;
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする