Fix IPixelShader<TPixel> lookup, switch GetDispatchId() to incremental

このコミットが含まれているのは:
Sergio Pedri committed 2021-12-08 11:17:04 +01:00
1 親 fd820a67c7
コミット 4b1180225d
3ファイル変更
+8 -5

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

@@ -13,7 +13,7 @@ using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;
namespace ComputeSharp.SourceGenerators;
/// <inheritdoc/>
public sealed partial class IShaderGenerator
public sealed partial class IShaderGenerator2
{
/// <summary>
/// Extracts the names of all instance fields of a <see cref="System.Delegate"/> type.
+6 -3
ファイルの表示
@@ -13,8 +13,11 @@ using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;
namespace ComputeSharp.SourceGenerators;
/// <inheritdoc/>
public sealed partial class IShaderGenerator : IIncrementalGenerator
/// <summary>
/// A source generator creating data loaders for <see cref="IComputeShader"/> and <see cref="IPixelShader{TPixel}"/> types.
/// </summary>
[Generator]
public sealed partial class IShaderGenerator2 : IIncrementalGenerator
{
/// <inheritdoc/>
public void Initialize(IncrementalGeneratorInitializationContext context)
@@ -91,7 +94,7 @@ public sealed partial class IShaderGenerator : IIncrementalGenerator
if (interfaceSymbol.IsGenericType &&
interfaceSymbol.Name == nameof(IPixelShader<byte>) &&
SymbolEqualityComparer.Default.Equals(interfaceSymbol, interfaceSymbol.ConstructUnboundGenericType()))
SymbolEqualityComparer.Default.Equals(interfaceSymbol.ConstructedFrom, iPixelShaderSymbol))
{
return typeof(IPixelShader<>);
}
+1 -1
ファイルの表示
@@ -65,7 +65,7 @@ public sealed partial class IShaderGenerator : ISourceGenerator
// Reorder the method declarations to respect the order in the interface definition
MethodDeclarationSyntax[] methods =
{
getDispatchIdMethod,
// getDispatchIdMethod,
loadDispatchDataMethod,
loadDispatchMetadataMethod,
buildHlslStringMethod,