Shader: Remove ShaderNode::GetExpressionType (replaced by visitor) and minor stuff

This commit is contained in:
Jérôme Leclercq
2021-01-14 22:01:53 +01:00
parent 00ac6e8a0a
commit a037eef4c9
9 changed files with 157 additions and 32 deletions

View File

@@ -8,6 +8,7 @@
#include <Nazara/Math/Algorithm.hpp>
#include <Nazara/Shader/ShaderBuilder.hpp>
#include <Nazara/Shader/ShaderAstCloner.hpp>
#include <Nazara/Shader/ShaderAstUtils.hpp>
#include <Nazara/Shader/ShaderAstValidator.hpp>
#include <stdexcept>
#include <Nazara/Shader/Debug.hpp>
@@ -349,7 +350,7 @@ namespace Nz
void GlslWriter::Visit(ShaderNodes::ExpressionPtr& expr, bool encloseIfRequired)
{
bool enclose = encloseIfRequired && (expr->GetExpressionCategory() != ShaderNodes::ExpressionCategory::LValue);
bool enclose = encloseIfRequired && (GetExpressionCategory(expr) != ShaderNodes::ExpressionCategory::LValue);
if (enclose)
Append("(");
@@ -461,7 +462,6 @@ namespace Nz
Append(")");
}
void GlslWriter::Visit(ShaderNodes::ConditionalExpression& node)
{
std::size_t conditionIndex = m_context.shader->FindConditionByName(node.conditionName);