Shader: Add support for custom functions calls (and better handle intrinsics)

This commit is contained in:
Jérôme Leclercq
2021-05-22 13:37:54 +02:00
parent 8a6f0db034
commit f6fd996bf1
24 changed files with 777 additions and 356 deletions

View File

@@ -12,6 +12,7 @@
#include <Nazara/Shader/ShaderLangLexer.hpp>
#include <Nazara/Shader/Ast/Nodes.hpp>
#include <filesystem>
#include <optional>
namespace Nz::ShaderLang
{
@@ -69,7 +70,7 @@ namespace Nz::ShaderLang
// Flow control
const Token& Advance();
void Consume(std::size_t count = 1);
ShaderAst::ExpressionType DecodeType(const std::string& identifier);
std::optional<ShaderAst::ExpressionType> DecodeType(const std::string& identifier);
void EnterScope();
const Token& Expect(const Token& token, TokenType type);
const Token& ExpectNot(const Token& token, TokenType type);