Use type aliases in DX12/D2D generators to write HLSL

このコミットが含まれているのは:
Sergio Pedri committed 2023-12-12 23:22:37 +01:00
1 親 1cc03cdd7b
コミット 0d667a5da0
8ファイル変更
+121 -105

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

@@ -26,9 +26,9 @@ internal static class HlslDefinitionsSyntaxProcessor
/// </summary>
/// <param name="constantDefinitions">The collection of discovered constant definitions.</param>
/// <returns>A sequence of discovered constants to declare in the shader.</returns>
public static ImmutableArray<(string Name, string Value)> GetDefinedConstants(IReadOnlyDictionary<IFieldSymbol, string> constantDefinitions)
public static ImmutableArray<HlslConstant> GetDefinedConstants(IReadOnlyDictionary<IFieldSymbol, string> constantDefinitions)
{
using ImmutableArrayBuilder<(string, string)> builder = new();
using ImmutableArrayBuilder<HlslConstant> builder = new();
foreach (KeyValuePair<IFieldSymbol, string> constant in constantDefinitions)
{
@@ -144,14 +144,14 @@ internal static class HlslDefinitionsSyntaxProcessor
/// <param name="instanceMethods">The collection of discovered instance methods for custom struct types.</param>
/// <param name="constructors">The collection of discovered constructors for custom struct types.</param>
/// <returns>A sequence of custom type definitions to add to the shader source.</returns>
public static ImmutableArray<(string Name, string Definition)> GetDeclaredTypes(
public static ImmutableArray<HlslUserType> GetDeclaredTypes(
ImmutableArrayBuilder<DiagnosticInfo> diagnostics,
INamedTypeSymbol structDeclarationSymbol,
IEnumerable<INamedTypeSymbol> types,
IReadOnlyDictionary<IMethodSymbol, MethodDeclarationSyntax> instanceMethods,
IReadOnlyDictionary<IMethodSymbol, (MethodDeclarationSyntax, MethodDeclarationSyntax)> constructors)
{
using ImmutableArrayBuilder<(string, string)> builder = new();
using ImmutableArrayBuilder<HlslUserType> builder = new();
IReadOnlyCollection<INamedTypeSymbol> invalidTypes;