molecular
|
Generates shader programs from a given set of inputs and outputs. More...
#include <ProgramGenerator.h>
Classes | |
struct | Function |
Information about a function. More... | |
struct | ProgramText |
Output of the program generator. More... | |
struct | VariableInfo |
Information about a variable. More... | |
Public Types | |
typedef util::Hash | Variable |
Public Member Functions | |
ProgramText | GenerateProgram (const std::set< Variable > &inputs, const std::set< Variable > &outputs, const std::unordered_map< Variable, int > &arraySizes=std::unordered_map< Variable, int >(), bool highQuality=true) |
Generate program from separate inputs and outputs. More... | |
template<class Iterator > | |
ProgramText | GenerateProgram (Iterator varsBegin, Iterator varsEnd, const std::unordered_map< Variable, int > &arraySizes=std::unordered_map< Variable, int >(), bool highQuality=true) |
Generate program from collection of variables (inputs and outputs) More... | |
void | AddFunction (const Function &function) |
Add a function to be considered in program generation. More... | |
Variable | AddVariable (const char *name, const char *type, bool array=false, VariableInfo::Usage usage=VariableInfo::Usage::kUniformOrLocal) |
Variable | AddVariable (const VariableInfo &variable) |
Generates shader programs from a given set of inputs and outputs.
void molecular::programgenerator::ProgramGenerator::AddFunction | ( | const Function & | function | ) |
Add a function to be considered in program generation.
ProgramGenerator::Variable molecular::programgenerator::ProgramGenerator::AddVariable | ( | const char * | name, |
const char * | type, | ||
bool | array = false , |
||
VariableInfo::Usage | usage = VariableInfo::Usage::kUniformOrLocal |
||
) |
ProgramGenerator::Variable molecular::programgenerator::ProgramGenerator::AddVariable | ( | const VariableInfo & | variable | ) |
ProgramGenerator::ProgramText molecular::programgenerator::ProgramGenerator::GenerateProgram | ( | const std::set< Variable > & | inputs, |
const std::set< Variable > & | outputs, | ||
const std::unordered_map< Variable, int > & | arraySizes = std::unordered_map<Variable, int>() , |
||
bool | highQuality = true |
||
) |
Generate program from separate inputs and outputs.
ProgramGenerator::ProgramText molecular::programgenerator::ProgramGenerator::GenerateProgram | ( | Iterator | varsBegin, |
Iterator | varsEnd, | ||
const std::unordered_map< Variable, int > & | arraySizes = std::unordered_map<Variable, int>() , |
||
bool | highQuality = true |
||
) |
Generate program from collection of variables (inputs and outputs)
Variables are sorted first by querying their VariableInfo.