Renderer/ShaderAst: Add ConditionalStatement
This commit is contained in:
@@ -8,8 +8,10 @@
|
||||
#define NAZARA_SHADERWRITER_HPP
|
||||
|
||||
#include <Nazara/Prerequesites.hpp>
|
||||
#include <Nazara/Core/String.hpp>
|
||||
#include <Nazara/Renderer/Config.hpp>
|
||||
#include <Nazara/Renderer/ShaderAst.hpp>
|
||||
#include <unordered_set>
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
@@ -21,6 +23,10 @@ namespace Nz
|
||||
ShaderWriter(ShaderWriter&&) = delete;
|
||||
virtual ~ShaderWriter();
|
||||
|
||||
void EnableCondition(const String& name, bool cond);
|
||||
|
||||
bool IsConditionEnabled(const String& name) const;
|
||||
|
||||
virtual Nz::String Generate(const ShaderAst::StatementPtr& node) = 0;
|
||||
|
||||
virtual void RegisterFunction(const String& name, ShaderAst::StatementPtr node, std::initializer_list<ShaderAst::NamedVariablePtr> parameters, ShaderAst::ExpressionType ret) = 0;
|
||||
@@ -37,6 +43,9 @@ namespace Nz
|
||||
virtual void Write(const ShaderAst::NodePtr& node) = 0;
|
||||
virtual void Write(const ShaderAst::StatementBlock& node) = 0;
|
||||
virtual void Write(const ShaderAst::SwizzleOp& node) = 0;
|
||||
|
||||
private:
|
||||
std::unordered_set<String> m_conditions;
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user