Shader: Fix optimization issues
Moving the unique_ptrs but failing to optimize the expression could cause issues Also the constant query callback defaulted to ConstantValue (without const ref), thanks auto.
This commit is contained in:
@@ -48,9 +48,9 @@ namespace Nz::ShaderAst
|
||||
StatementPtr Clone(BranchStatement& node) override;
|
||||
StatementPtr Clone(ConditionalStatement& node) override;
|
||||
|
||||
template<BinaryType Type> ExpressionPtr PropagateBinaryConstant(std::unique_ptr<ConstantValueExpression>&& lhs, std::unique_ptr<ConstantValueExpression>&& rhs);
|
||||
template<typename TargetType> ExpressionPtr PropagateSingleValueCast(std::unique_ptr<ConstantValueExpression>&& operand);
|
||||
template<UnaryType Type> ExpressionPtr PropagateUnaryConstant(std::unique_ptr<ConstantValueExpression>&& operand);
|
||||
template<BinaryType Type> ExpressionPtr PropagateBinaryConstant(const ConstantValueExpression& lhs, const ConstantValueExpression& rhs);
|
||||
template<typename TargetType> ExpressionPtr PropagateSingleValueCast(const ConstantValueExpression& operand);
|
||||
template<UnaryType Type> ExpressionPtr PropagateUnaryConstant(const ConstantValueExpression& operand);
|
||||
template<typename TargetType> ExpressionPtr PropagateVec2Cast(TargetType v1, TargetType v2);
|
||||
template<typename TargetType> ExpressionPtr PropagateVec3Cast(TargetType v1, TargetType v2, TargetType v3);
|
||||
template<typename TargetType> ExpressionPtr PropagateVec4Cast(TargetType v1, TargetType v2, TargetType v3, TargetType v4);
|
||||
|
||||
Reference in New Issue
Block a user