Split shader generation to a new module

This commit is contained in:
Jérôme Leclercq
2020-08-11 00:00:36 +02:00
parent 0313f2d0a6
commit 837a6585a1
86 changed files with 564 additions and 312 deletions

View File

@@ -0,0 +1,29 @@
// 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
#include <Nazara/Shader/ShaderAstVisitor.hpp>
#include <Nazara/Shader/Debug.hpp>
namespace Nz
{
ShaderAstVisitor::~ShaderAstVisitor() = default;
void ShaderAstVisitor::EnableCondition(const std::string& name, bool cond)
{
if (cond)
m_conditions.insert(name);
else
m_conditions.erase(name);
}
bool ShaderAstVisitor::IsConditionEnabled(const std::string& name) const
{
return m_conditions.count(name) != 0;
}
void ShaderAstVisitor::Visit(const ShaderNodes::NodePtr& node)
{
node->Visit(*this);
}
}