HDK
|
#include <GenContext.h>
Protected Member Functions | |
GenContext ()=delete | |
Protected Attributes | |
ShaderGeneratorPtr | _sg |
GenOptions | _options |
FileSearchPath | _sourceCodeSearchPath |
StringSet | _reservedWords |
std::unordered_map< string, ShaderNodeImplPtr > | _nodeImpls |
std::unordered_map< string, vector< GenUserDataPtr > > | _userData |
std::unordered_map< const ShaderInput *, string > | _inputSuffix |
std::unordered_map< const ShaderOutput *, string > | _outputSuffix |
vector< ClosureContext * > | _closureContexts |
A context class for shader generation. Used for thread local storage of data needed during shader generation.
Definition at line 27 of file GenContext.h.
GenContext::GenContext | ( | ShaderGeneratorPtr | sg | ) |
Constructor.
|
protecteddelete |
void GenContext::addInputSuffix | ( | const ShaderInput * | input, |
const string & | suffix | ||
) |
Add an input suffix to be used for the input in this context.
input | Node input |
suffix | Suffix string |
void GenContext::addNodeImplementation | ( | const string & | name, |
ShaderNodeImplPtr | impl | ||
) |
Cache a shader node implementation.
void GenContext::addOutputSuffix | ( | const ShaderOutput * | output, |
const string & | suffix | ||
) |
Add an output suffix to be used for the output in this context.
output | Node output |
suffix | Suffix string |
Add reserved words that should not be used as identifiers during code generation.
Definition at line 71 of file GenContext.h.
void GenContext::clearNodeImplementations | ( | ) |
Clear all cached shader node implementation.
void GenContext::clearUserData | ( | ) |
Clear all user data from the context.
ShaderNodeImplPtr GenContext::findNodeImplementation | ( | const string & | name | ) | const |
Find and return a cached shader node implementation, or return nullptr if no implementation is found.
|
inline |
Return the current closure context.
Definition at line 112 of file GenContext.h.
void GenContext::getInputSuffix | ( | const ShaderInput * | input, |
string & | suffix | ||
) | const |
Get an input suffix to be used for the input in this context.
input | Node input |
suffix | Suffix string returned. Is empty if not found. |
Get the names of all cached node implementations.
|
inline |
Return shader generation options.
Definition at line 40 of file GenContext.h.
|
inline |
Return shader generation options.
Definition at line 46 of file GenContext.h.
void GenContext::getOutputSuffix | ( | const ShaderOutput * | output, |
string & | suffix | ||
) | const |
Get an output suffix to be used for the output in this context.
output | Node output |
suffix | Suffix string returned. Is empty if not found. |
Return the set of reserved words that should not be used as identifiers during code generation.
Definition at line 78 of file GenContext.h.
|
inline |
Return shader generatior.
Definition at line 34 of file GenContext.h.
Return user data with given name, or nullptr if no data is found.
Definition at line 148 of file GenContext.h.
|
inline |
Pop the current closure context.
Definition at line 103 of file GenContext.h.
Remove user data from the context.
Definition at line 133 of file GenContext.h.
|
inline |
Push a new closure context to use for closure evaluation.
Definition at line 97 of file GenContext.h.
|
inline |
Add user data to the context to make it available during shader generator.
Definition at line 119 of file GenContext.h.
Add to the search path used for finding source code.
Definition at line 52 of file GenContext.h.
|
inline |
Add to the search path used for finding source code.
Definition at line 58 of file GenContext.h.
void GenContext::removeInputSuffix | ( | const ShaderInput * | input | ) |
Remove an input suffix to be used for the input in this context.
input | Node input |
void GenContext::removeOutputSuffix | ( | const ShaderOutput * | output | ) |
Remove an output suffix to be used for the output in this context.
output | Node output |
Resolve a file using the registered search paths.
Definition at line 64 of file GenContext.h.
|
protected |
Definition at line 210 of file GenContext.h.
|
protected |
Definition at line 204 of file GenContext.h.
|
protected |
Definition at line 198 of file GenContext.h.
|
protected |
Definition at line 189 of file GenContext.h.
|
protected |
Definition at line 207 of file GenContext.h.
|
protected |
Definition at line 195 of file GenContext.h.
|
protected |
Definition at line 186 of file GenContext.h.
|
protected |
Definition at line 192 of file GenContext.h.
|
protected |
Definition at line 201 of file GenContext.h.