Shader: Handle type as expressions
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
|
||||
namespace Nz
|
||||
{
|
||||
class NAZARA_SHADER_API GlslWriter : public ShaderWriter, public ShaderAst::ExpressionVisitorExcept, public ShaderAst::StatementVisitorExcept
|
||||
class NAZARA_SHADER_API GlslWriter : public ShaderWriter, public ShaderAst::AstExpressionVisitorExcept, public ShaderAst::AstStatementVisitorExcept
|
||||
{
|
||||
public:
|
||||
using BindingMapping = std::unordered_map<UInt64 /* set | binding */, unsigned /*glBinding*/>;
|
||||
@@ -51,15 +51,20 @@ namespace Nz
|
||||
|
||||
private:
|
||||
void Append(const ShaderAst::ArrayType& type);
|
||||
void Append(const ShaderAst::ExpressionType& type);
|
||||
void Append(ShaderAst::BuiltinEntry builtin);
|
||||
void Append(const ShaderAst::ExpressionType& type);
|
||||
void Append(const ShaderAst::ExpressionValue<ShaderAst::ExpressionType>& type);
|
||||
void Append(const ShaderAst::FunctionType& functionType);
|
||||
void Append(const ShaderAst::IdentifierType& identifierType);
|
||||
void Append(const ShaderAst::IntrinsicFunctionType& intrinsicFunctionType);
|
||||
void Append(const ShaderAst::MatrixType& matrixType);
|
||||
void Append(const ShaderAst::MethodType& methodType);
|
||||
void Append(ShaderAst::MemoryLayout layout);
|
||||
void Append(ShaderAst::NoType);
|
||||
void Append(ShaderAst::PrimitiveType type);
|
||||
void Append(const ShaderAst::SamplerType& samplerType);
|
||||
void Append(const ShaderAst::StructType& structType);
|
||||
void Append(const ShaderAst::Type& type);
|
||||
void Append(const ShaderAst::UniformType& uniformType);
|
||||
void Append(const ShaderAst::VectorType& vecType);
|
||||
template<typename T> void Append(const T& param);
|
||||
@@ -81,6 +86,8 @@ namespace Nz
|
||||
void RegisterStruct(std::size_t structIndex, ShaderAst::StructDescription* desc);
|
||||
void RegisterVariable(std::size_t varIndex, std::string varName);
|
||||
|
||||
void ScopeVisit(ShaderAst::Statement& node);
|
||||
|
||||
void Visit(ShaderAst::ExpressionPtr& expr, bool encloseIfRequired = false);
|
||||
|
||||
void Visit(ShaderAst::AccessIdentifierExpression& node) override;
|
||||
@@ -107,6 +114,7 @@ namespace Nz
|
||||
void Visit(ShaderAst::MultiStatement& node) override;
|
||||
void Visit(ShaderAst::NoOpStatement& node) override;
|
||||
void Visit(ShaderAst::ReturnStatement& node) override;
|
||||
void Visit(ShaderAst::ScopedStatement& node) override;
|
||||
void Visit(ShaderAst::WhileStatement& node) override;
|
||||
|
||||
static bool HasExplicitBinding(ShaderAst::StatementPtr& shader);
|
||||
|
||||
Reference in New Issue
Block a user