// 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 #include namespace Nz::ShaderBuilder { template template std::shared_ptr GenBuilder::operator()(Args&&... args) const { return T::Build(std::forward(args)...); } template std::shared_ptr AssignOpBuilder::operator()(const ShaderNodes::ExpressionPtr& left, const ShaderNodes::ExpressionPtr& right) const { return ShaderNodes::AssignOp::Build(op, left, right); } template std::shared_ptr BinOpBuilder::operator()(const ShaderNodes::ExpressionPtr& left, const ShaderNodes::ExpressionPtr& right) const { return ShaderNodes::BinaryOp::Build(op, left, right); } inline std::shared_ptr BuiltinBuilder::operator()(ShaderNodes::BuiltinEntry builtin) const { ShaderNodes::BasicType exprType = ShaderNodes::BasicType::Void; switch (builtin) { case ShaderNodes::BuiltinEntry::VertexPosition: exprType = ShaderNodes::BasicType::Float4; break; } NazaraAssert(exprType != ShaderNodes::BasicType::Void, "Unhandled builtin"); return ShaderNodes::BuiltinVariable::Build(builtin, exprType); } template std::shared_ptr Cast(Args&&... args) { return ShaderNodes::Cast::Build(Type, std::forward(args)...); } } #include