Renderer/ShaderAst: Add ConditionalStatement

This commit is contained in:
Lynix
2017-01-21 15:53:18 +01:00
parent 205b8b1ba6
commit cb69b1ed01
5 changed files with 42 additions and 0 deletions

View File

@@ -8,4 +8,17 @@
namespace Nz
{
ShaderWriter::~ShaderWriter() = default;
void ShaderWriter::EnableCondition(const String& name, bool cond)
{
if (cond)
m_conditions.insert(name);
else
m_conditions.erase(name);
}
bool ShaderWriter::IsConditionEnabled(const String & name) const
{
return m_conditions.count(name) != 0;
}
}