Allow D2D1 attributes at assembly level

このコミットが含まれているのは:
Sergio Pedri committed 2022-05-24 02:36:39 +02:00
1 親 48b6b4245e
コミット f5ea4b7911
3ファイル変更
+23 -2

検索条件に一致するファイルはありません

@@ -38,6 +38,11 @@ partial class ID2D1ShaderGenerator
return (D2D1ShaderProfile)attributeData!.ConstructorArguments[0].Value!;
}
if (structDeclarationSymbol.ContainingAssembly.TryGetAttributeWithFullMetadataName("ComputeSharp.D2D1.D2DEmbeddedBytecodeAttribute", out attributeData))
{
return (D2D1ShaderProfile)attributeData!.ConstructorArguments[0].Value!;
}
return null;
}
@@ -65,6 +70,12 @@ partial class ID2D1ShaderGenerator
return options | D2D1CompileOptions.PackMatrixRowMajor;
}
if (structDeclarationSymbol.ContainingAssembly.TryGetAttributeWithFullMetadataName("ComputeSharp.D2D1.D2DCompileOptionsAttribute", out attributeData))
{
// No need to validate against PackMatrixColumnMajor as that's checked separately
return (D2D1CompileOptions)attributeData!.ConstructorArguments[0].Value! | D2D1CompileOptions.PackMatrixRowMajor;
}
return null;
}