Vixen
02b45cc4
csharp
public static class DeclarationFacts

Reads modifiers and attributes off declaration syntax.

No guide page documents this yet — the page shows what the code says about itself.

Methods (17)

  • public static bool Has(SyntaxList<SyntaxToken> modifiers, SyntaxKind kind)
  • public static string GetAttributeName(AttributeSyntax attribute)

    The bare name of an attribute, with any Attribute suffix removed.

  • public static IEnumerable<AttributeSyntax> GetAttributes(SyntaxList<AttributeListSyntax> attributeLists)

    Every attribute across the declaration's attribute lists.

  • public static ShaderStage GetShaderStage(SyntaxList<AttributeListSyntax> attributeLists)

    The pipeline stage named by a stage attribute on this declaration, or None.

  • public static bool IsStageAttributeName(string name)

    True when the name is one of the recognised stage attributes.

  • public static WorkgroupSize? GetWorkgroupSize(SyntaxList<AttributeListSyntax> attributeLists)

    The workgroup size written on a stage attribute — [ComputeShader(8, 8, 1)] — or null when the attribute carries no arguments.

  • public static bool IsPermutation(SyntaxList<AttributeListSyntax> attributeLists)

    Whether the declaration is marked [Permutation], making it a compile-time key whose value the caller supplies per effect variant.

  • public static IEnumerable<(string Name, ResourceSet Set)> GetResourceSets(SyntaxList<AttributeListSyntax> attributeLists)

    Every descriptor-set marker on the declaration, in source order, with the name it was written as.

  • public static ResourceSet? GetResourceSet(SyntaxList<AttributeListSyntax> attributeLists)

    The descriptor set the declaration is marked with, or null when it carries no marker and the default applies.

  • public static bool IsResourceSetAttributeName(string name)

    True when the name is one of the recognised descriptor-set markers.

  • public static bool IsPushConstant(SyntaxList<AttributeListSyntax> attributeLists)

    Whether the declaration is marked [PushConstant].

  • public static bool IsShared(SyntaxList<AttributeListSyntax> attributeLists)

    Whether the declaration is marked [Shared].

  • public static bool IsMaterialIndex(SyntaxList<AttributeListSyntax> attributeLists)

    Whether the declaration is marked [MaterialIndex].

  • public static string? GetMaterialIndexCondition(SyntaxList<AttributeListSyntax> attributeLists)

    The permutation a [MaterialIndex("Key")] is conditional on, or null when it is unconditional.

  • public static string? GetImageFormat(SyntaxList<AttributeListSyntax> attributeLists)

    The texel format a declaration is tagged with — [Format("rgba16f")] — or null.

  • public static bool HasFormat(SyntaxList<AttributeListSyntax> attributeLists)

    Whether the declaration carries a [Format] at all, well-formed or not.

  • public static string? GetSemanticName(SyntaxList<AttributeListSyntax> attributeLists)

    The pipeline semantic a declaration is tagged with — [Semantic("POSITION")], [Semantic("SV_Target")] — or null. This is what the backends key stage inputs and outputs off.

Used by (5)

  • SourceFieldSymbolVixen.Raven
  • SourceMethodSymbolVixen.Raven
  • SourceNamedTypeSymbolVixen.Raven
  • SourceParameterSymbolVixen.Raven
  • SourcePropertySymbolVixen.Raven