forked from Misaki/GhostEngine
Update namespace
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Shader.Compiler.Parser;
|
||||
namespace Ghost.SDL.Compiler.Parser;
|
||||
|
||||
internal class DefinesBlock : IBlockParser<List<Token>, List<string>>
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Shader.Compiler.Parser;
|
||||
namespace Ghost.SDL.Compiler.Parser;
|
||||
|
||||
internal interface IBlockParser<T, U>
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Shader.Compiler.Parser;
|
||||
namespace Ghost.SDL.Compiler.Parser;
|
||||
|
||||
internal class IncludesBlock : IBlockParser<List<Token>, List<string>>
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Ghost.Core.Graphics;
|
||||
|
||||
namespace Ghost.Shader.Compiler.Parser;
|
||||
namespace Ghost.SDL.Compiler.Parser;
|
||||
|
||||
internal class KeywordsBlock : IBlockParser<List<FunctionCallDeclaration>, List<KeywordsGroup>>
|
||||
{
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
namespace Ghost.Shader.Compiler.Parser;
|
||||
namespace Ghost.SDL.Compiler.Parser;
|
||||
|
||||
internal static class ParseUtility
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Ghost.Core.Graphics;
|
||||
|
||||
namespace Ghost.Shader.Compiler.Parser;
|
||||
namespace Ghost.SDL.Compiler.Parser;
|
||||
|
||||
// TODO: Add pass template support.
|
||||
// Pass templates let user to inject their own custom code into the generated HLSL code.
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
using Ghost.Core.Graphics;
|
||||
|
||||
namespace Ghost.Shader.Compiler.Parser;
|
||||
namespace Ghost.SDL.Compiler.Parser;
|
||||
|
||||
internal class PipelineBlock : IBlockParser<PipelineSyntax, PipelineSemantic>
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@ using Ghost.Core.Graphics;
|
||||
using Misaki.HighPerformance.Mathematics;
|
||||
using System.Globalization;
|
||||
|
||||
namespace Ghost.Shader.Compiler.Parser;
|
||||
namespace Ghost.SDL.Compiler.Parser;
|
||||
|
||||
internal class PropertiesBlock : IBlockParser<PropertiesSyntax, List<PropertySemantic>>
|
||||
{
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
namespace Ghost.Shader.Compiler.Parser;
|
||||
namespace Ghost.SDL.Compiler.Parser;
|
||||
|
||||
internal class ShaderBlock : IBlockParser<ShaderSyntax, ShaderSemantics>
|
||||
internal class ShaderBlock : IBlockParser<SDLSyntax, SDLSemantics>
|
||||
{
|
||||
public static bool ShouldEnter(Token token)
|
||||
{
|
||||
return token.Match(TokenType.Keyword, TokenLexicon.KnownKeywords.SHADER);
|
||||
}
|
||||
|
||||
public static ShaderSyntax Parse(TokenStreamSlice stream)
|
||||
public static SDLSyntax Parse(TokenStreamSlice stream)
|
||||
{
|
||||
var shader = new ShaderSyntax();
|
||||
var shader = new SDLSyntax();
|
||||
|
||||
stream.Expect(TokenType.Keyword);
|
||||
shader.name = stream.Expect(TokenType.StringLiteral);
|
||||
@@ -49,14 +49,14 @@ internal class ShaderBlock : IBlockParser<ShaderSyntax, ShaderSemantics>
|
||||
return shader;
|
||||
}
|
||||
|
||||
public static ShaderSemantics? SemanticAnalysis(ShaderSyntax? syntax, List<SDLError> errors)
|
||||
public static SDLSemantics? SemanticAnalysis(SDLSyntax? syntax, List<SDLError> errors)
|
||||
{
|
||||
if (syntax == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var shaderModel = new ShaderSemantics
|
||||
var shaderModel = new SDLSemantics
|
||||
{
|
||||
name = syntax.name.lexeme,
|
||||
properties = PropertiesBlock.SemanticAnalysis(syntax.properties, errors),
|
||||
|
||||
Reference in New Issue
Block a user