MaterialX 1.38.2
|
A shader stage, containing the state and resulting source code for the stage. More...
#include <ShaderStage.h>
Public Member Functions | |
ShaderStage (const string &name, ConstSyntaxPtr syntax) | |
Contructor. | |
const string & | getName () const |
Return the stage name. | |
const string & | getFunctionName () const |
Return the stage function name. | |
const string & | getSourceCode () const |
Return the stage source code. | |
VariableBlockPtr | createUniformBlock (const string &name, const string &instance=EMPTY_STRING) |
Create a new uniform variable block. | |
VariableBlockPtr | createInputBlock (const string &name, const string &instance=EMPTY_STRING) |
Create a new input variable block. | |
VariableBlockPtr | createOutputBlock (const string &name, const string &instance=EMPTY_STRING) |
Create a new output variable block. | |
VariableBlock & | getUniformBlock (const string &name) |
Return the uniform variable block with given name. | |
const VariableBlock & | getUniformBlock (const string &name) const |
Return the uniform variable block with given name. | |
VariableBlock & | getInputBlock (const string &name) |
Return the input variable block with given name. | |
const VariableBlock & | getInputBlock (const string &name) const |
Return the input variable block with given name. | |
VariableBlock & | getOutputBlock (const string &name) |
Return the output variable block with given name. | |
const VariableBlock & | getOutputBlock (const string &name) const |
Return the output variable block with given name. | |
VariableBlock & | getConstantBlock () |
Return the constant variable block. | |
const VariableBlock & | getConstantBlock () const |
Return the constant variable block. | |
const VariableBlockMap & | getUniformBlocks () const |
Return a map of all uniform blocks. | |
const VariableBlockMap & | getInputBlocks () const |
Return a map of all input blocks. | |
const VariableBlockMap & | getOutputBlocks () const |
Return a map of all output blocks. | |
Protected Member Functions | |
void | beginScope (Syntax::Punctuation punc=Syntax::CURLY_BRACKETS) |
Start a new scope using the given bracket type. | |
void | endScope (bool semicolon=false, bool newline=true) |
End the current scope. | |
void | beginLine () |
Start a new line. | |
void | endLine (bool semicolon=true) |
End the current line. | |
void | newLine () |
Add a newline character. | |
void | addString (const string &str) |
Add a string. | |
void | addLine (const string &str, bool semicolon=true) |
Add a single line of code, optionally appending a semicolon. | |
void | addComment (const string &str) |
Add a single line code comment. | |
void | addBlock (const string &str, GenContext &context) |
Add a block of code. | |
void | addInclude (const string &file, GenContext &context) |
Add the contents of an include file. More... | |
template<typename T > | |
void | addValue (const T &value) |
Add a value. | |
void | addFunctionDefinition (const ShaderNode &node, GenContext &context) |
Add the function definition for a node. | |
void | setFunctionName (const string &functionName) |
Set stage function name. | |
Friends | |
class | ShaderGenerator |
A shader stage, containing the state and resulting source code for the stage.
|
protected |
Add the contents of an include file.
Making sure it is only included once for the shader stage.