CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
StructParameterAnalyzer.hpp
Go to the documentation of this file.
1//
2// CeresEngine - A game development framework
3//
4// Created by Rogiel Sulzbach.
5// Copyright (c) 2018-2022 Rogiel Sulzbach. All rights reserved.
6//
7
8#pragma once
9
10#include "VisitorTracker.hpp"
11
13
15
17
22 private:
23 Program* mProgram = nullptr;
25
27
28 public:
29 // Marks all declarational AST nodes (i.e. function decl, structure decl etc.) that are reachable from the specififed entry point.
30 void markStructsFromEntryPoint(Program& program, const ShaderTarget shaderTarget);
31
32 private:
33 // Returns true if the specified AST has not yet been visited.
34 bool notVisited(const AST* ast);
35
37
38 // Returns true if the specified variable is a paramter of the entry point.
40
41 // Returns true if the active function declaration is the main entry point.
43
44 private: // Visitor implementation
48
52
56
59 };
60
61} // namespace CeresEngine::ShaderCompiler
#define DECLARATION_VISIT_PROC(CLASS_NAME)
Definition Visitor.hpp:88
Structure parameter analyzer.
Definition StructParameterAnalyzer.hpp:21
void visitStatementList(const Vector< StatementPtr > &statements)
Set< const AST * > mVisitSet
Definition StructParameterAnalyzer.hpp:26
ShaderTarget mShaderTarget
Definition StructParameterAnalyzer.hpp:24
bool isVariableAnEntryPointParameter(VarDeclarationStatement *var) const
Program * mProgram
Definition StructParameterAnalyzer.hpp:23
void markStructsFromEntryPoint(Program &program, const ShaderTarget shaderTarget)
Definition VisitorTracker.hpp:18
Definition AST.hpp:33
ShaderTarget
Shader target enumeration.
Definition Targets.hpp:16
std::vector< T, ScopedAllocatorAdaptor< StdAllocator< T, RawAllocator > > > Vector
Vector is a sequence container that encapsulates dynamic size arrays.
Definition Vector.hpp:17
constexpr size_t hash(const T &v)
Generates a hash for the provided type.
Definition Hash.hpp:25
std::set< Key, Compare, ScopedAllocatorAdaptor< StdAllocator< Key, RawAllocator > > > Set
Set is an associative container that contains a sorted set of unique objects of type Key.
Definition Set.hpp:21