Major refactor of shader compiler and related systems:
- Switch ShaderDescriptor/PassDescriptor to arrays; remove IPassDescriptor
- Rewrite keywords block parser/semantic analysis for flexible syntax
- Change property initializers to brace syntax `{ ... }`
- Simplify TokenStream API (remove ref index params)
- Make GetBindlessIndex return uint (~0u for not found)
- Update shader compilation and variant logic for new descriptors
- Update test shader syntax to match new property/keyword formats
- Add AGENTS.md agent development guide
- Add Antlr4 dependency to Ghost.DSL
- Miscellaneous code style and error handling improvements
58 lines
1.2 KiB
C#
58 lines
1.2 KiB
C#
namespace Ghost.DSL.ShaderCompiler;
|
|
|
|
internal struct FunctionCallDeclaration
|
|
{
|
|
public Token name;
|
|
public List<Token>? arguments;
|
|
}
|
|
|
|
internal struct PropertyDeclaration
|
|
{
|
|
public Token scope;
|
|
public Token type;
|
|
public Token name;
|
|
public List<Token>? propertyInitializer;
|
|
}
|
|
|
|
internal struct ValueDeclaration
|
|
{
|
|
public Token name;
|
|
public Token value;
|
|
}
|
|
|
|
internal struct HlslDeclaration
|
|
{
|
|
public List<Token>? tokens;
|
|
}
|
|
|
|
internal class PropertiesSyntax
|
|
{
|
|
public List<PropertyDeclaration>? properties;
|
|
public List<FunctionCallDeclaration>? functionCalls;
|
|
}
|
|
|
|
internal class PipelineSyntax
|
|
{
|
|
public List<ValueDeclaration>? values;
|
|
public List<FunctionCallDeclaration>? functionCalls;
|
|
}
|
|
|
|
internal class PassSyntax
|
|
{
|
|
public Token name;
|
|
public PipelineSyntax? localPipeline;
|
|
public HlslDeclaration? hlsl;
|
|
public List<Token>? defines;
|
|
public List<Token>? includes;
|
|
public List<List<Token>>? keywords;
|
|
public List<FunctionCallDeclaration>? functionCalls;
|
|
}
|
|
|
|
internal class DSLShaderSyntax
|
|
{
|
|
public Token name;
|
|
public PropertiesSyntax? properties;
|
|
public PipelineSyntax? pipeline;
|
|
public List<PassSyntax>? passes;
|
|
public List<FunctionCallDeclaration>? functionCalls;
|
|
} |