// Copyright (C) 2020 Jérôme Leclercq // This file is part of the "Nazara Engine - Shader generator" // For conditions of distribution and use, see copyright notice in Config.hpp #pragma once #ifndef NAZARA_SHADERASTCACHE_HPP #define NAZARA_SHADERASTCACHE_HPP #include #include #include #include namespace Nz::ShaderAst { struct AstCache { struct Variable { ShaderExpressionType type; }; struct Identifier { std::string name; std::variant value; }; struct Scope { std::optional parentScopeIndex; std::vector identifiers; }; inline const Identifier* FindIdentifier(std::size_t startingScopeId, const std::string& identifierName) const; inline std::size_t GetScopeId(const Node* node) const; ShaderStageType stageType = ShaderStageType::Undefined; std::unordered_map nodeExpressionType; std::unordered_map scopeIdByNode; std::vector scopes; }; } #include #endif