Refactor shader system: arrays, keywords, property syntax

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
This commit is contained in:
2026-01-10 18:36:18 +09:00
parent 6a041f75ba
commit d71bdb3fc9
18 changed files with 548 additions and 246 deletions

View File

@@ -33,19 +33,6 @@ public struct KeywordsGroup
public List<string> keywords;
}
public interface IPassDescriptor
{
public string Identifier
{
get;
}
public string Name
{
get;
}
}
public struct PropertyDescriptor
{
public ShaderPropertyType type;
@@ -53,30 +40,27 @@ public struct PropertyDescriptor
public object? defaultValue;
}
public class PassDescriptor : IPassDescriptor
public struct PassDescriptor
{
public string uniqueIdentifier = string.Empty;
public string name = string.Empty;
public string identifier;
public string name;
public ShaderEntryPoint taskShader;
public ShaderEntryPoint meshShader;
public ShaderEntryPoint pixelShader;
public List<string>? defines;
public List<string>? includes;
public List<KeywordsGroup>? keywords;
public string[] defines;
public string[] includes;
public KeywordsGroup[] keywords;
public PipelineState localPipeline;
public string Identifier => uniqueIdentifier;
public string Name => name;
}
public class ShaderDescriptor
{
public string name = string.Empty;
public uint cbufferSize;
public List<PropertyDescriptor> globalProperties = new();
public List<PropertyDescriptor> properties = new();
public List<IPassDescriptor> passes = new();
public PropertyDescriptor[] globalProperties = null!;
public PropertyDescriptor[] properties = null!;
public PassDescriptor[] passes = null!;
}
public static class ShaderDescriptorExtensions