HDK
|
#include <GenContext.h>
Public Types | |
using | Argument = std::pair< const TypeDesc *, string > |
using | Arguments = vector< Argument > |
An array of arguments. More... | |
using | ClosureParams = std::unordered_map< string, const ShaderInput * > |
Extra parameters for closure evaluation. More... | |
Public Member Functions | |
ClosureContext (int type=0) | |
Constructor. More... | |
int | getType () const |
Return the identifier for this context. More... | |
void | addArgument (const TypeDesc *nodeType, const Argument &arg) |
For the given node type add an extra argument to be used for the function in this context. More... | |
const Arguments & | getArguments (const TypeDesc *nodeType) const |
Return a list of extra argument to be used for the given node in this context. More... | |
void | setSuffix (const TypeDesc *nodeType, const string &suffix) |
For the given node type set a function name suffix to be used for the function in this context. More... | |
const string & | getSuffix (const TypeDesc *nodeType) const |
Return the function name suffix to be used for the given node in this context. More... | |
void | setClosureParams (const ShaderNode *closure, const ClosureParams *params) |
Set extra parameters to use for evaluating a closure. More... | |
const ClosureParams * | getClosureParams (const ShaderNode *closure) const |
Protected Attributes | |
const int | _type |
std::unordered_map< const TypeDesc *, Arguments > | _arguments |
std::unordered_map< const TypeDesc *, string > | _suffix |
std::unordered_map< const ShaderNode *, const ClosureParams * > | _params |
Static Protected Attributes | |
static const Arguments | EMPTY_ARGUMENTS |
Class representing a context for closure evaluation. On hardware BSDF closures are evaluated differently in reflection, transmission or environment/indirect contexts. This class represents the context we are in and if extra arguments and function decorators are needed for that context.
Definition at line 219 of file GenContext.h.
using ClosureContext::Argument = std::pair<const TypeDesc*, string> |
An extra argument for closure functions. An argument is a pair of strings holding the 'type' and 'name' of the argument.
Definition at line 225 of file GenContext.h.
using ClosureContext::Arguments = vector<Argument> |
An array of arguments.
Definition at line 227 of file GenContext.h.
using ClosureContext::ClosureParams = std::unordered_map<string, const ShaderInput*> |
Extra parameters for closure evaluation.
Definition at line 230 of file GenContext.h.
|
inline |
Constructor.
Definition at line 233 of file GenContext.h.
For the given node type add an extra argument to be used for the function in this context.
Definition at line 239 of file GenContext.h.
Return a list of extra argument to be used for the given node in this context.
Definition at line 245 of file GenContext.h.
|
inline |
Return extra parameters to use for evaluating a closure. Or return nullptr if no parameters have been set for the given closure.
Definition at line 279 of file GenContext.h.
Return the function name suffix to be used for the given node in this context.
Definition at line 258 of file GenContext.h.
|
inline |
Return the identifier for this context.
Definition at line 236 of file GenContext.h.
|
inline |
Set extra parameters to use for evaluating a closure.
Definition at line 265 of file GenContext.h.
For the given node type set a function name suffix to be used for the function in this context.
Definition at line 252 of file GenContext.h.
Definition at line 287 of file GenContext.h.
|
protected |
Definition at line 289 of file GenContext.h.
Definition at line 288 of file GenContext.h.
Definition at line 286 of file GenContext.h.
Definition at line 291 of file GenContext.h.