Rename D3D12 generator type
このコミットが含まれているのは:
1 親
f5b38e1af8
コミット
0f9b975336
11ファイル変更
+69
-69
検索条件に一致するファイルはありません
@@ -0,0 +1,41 @@
|
||||
using Microsoft.CodeAnalysis;
|
||||
|
||||
namespace ComputeSharp.SourceGenerators;
|
||||
|
||||
/// <inheritdoc/>
|
||||
partial class ComputeShaderDescriptorGenerator
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets whether a given type is a compute shader type (ie. implements any of the interfaces).
|
||||
/// </summary>
|
||||
/// <param name="typeSymbol">The input <see cref="INamedTypeSymbol"/> instance to check.</param>
|
||||
/// <param name="compilation">The <see cref="Compilation"/> instance currently in use.</param>
|
||||
/// <param name="result">Whether <paramref name="typeSymbol"/> is a "pixel shader like" type.</param>
|
||||
/// <returns>Whether <paramref name="typeSymbol"/> is a compute shader type at all.</returns>
|
||||
private static bool TryGetIsPixelShaderLike(INamedTypeSymbol typeSymbol, Compilation compilation, out bool result)
|
||||
{
|
||||
INamedTypeSymbol computeShaderSymbol = compilation.GetTypeByMetadataName("ComputeSharp.IComputeShader")!;
|
||||
INamedTypeSymbol pixelShaderSymbol = compilation.GetTypeByMetadataName("ComputeSharp.IComputeShader`1")!;
|
||||
|
||||
foreach (INamedTypeSymbol interfaceSymbol in typeSymbol.AllInterfaces)
|
||||
{
|
||||
if (SymbolEqualityComparer.Default.Equals(interfaceSymbol, computeShaderSymbol))
|
||||
{
|
||||
result = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
else if (interfaceSymbol is { IsGenericType: true } &&
|
||||
SymbolEqualityComparer.Default.Equals(interfaceSymbol.ConstructedFrom, pixelShaderSymbol))
|
||||
{
|
||||
result = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
result = false;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
新しいイシューから参照
ユーザーをブロックする