Skip generating for generic shader types, and warn

このコミットが含まれているのは:
Sergio Pedri committed 2023-11-26 16:35:20 +01:00
1 親 4df52a9e40
コミット bf7c470cb3
6ファイル変更
+26 -18

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

+3 -2
ファイルの表示
@@ -39,8 +39,9 @@ public sealed partial class D2DPixelShaderDescriptorGenerator : IIncrementalGene
return default;
}
// If the type symbol doesn't have at least one interface, it can't possibly be a shader type
if (context.TargetSymbol is not INamedTypeSymbol { AllInterfaces.Length: > 0 } typeSymbol)
// If the type symbol doesn't have at least one interface, it can't possibly be a shader type.
// Also check for generic types, just like with DX12 shaders (including nesting inside generics).
if (context.TargetSymbol is not INamedTypeSymbol { AllInterfaces.Length: > 0, IsGenericType: false } typeSymbol)
{
return default;
}