MaterialX 1.38.2
|
Class representing a context for closure evaluation on hardware targets. More...
#include <HwShaderGenerator.h>
Public Types | |
enum | Type { REFLECTION , TRANSMISSION , INDIRECT , EMISSION } |
Types of closure contexts. | |
using | Argument = std::pair< const TypeDesc *, string > |
An extra argument for closure functions. More... | |
using | Arguments = vector< Argument > |
An array of arguments. | |
Public Member Functions | |
HwClosureContext (int type) | |
Constructor. | |
int | getType () const |
Return the identifier for this context. | |
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. | |
const Arguments & | getArguments (const TypeDesc *nodeType) const |
Return a list of extra argument to be used for the given node in this context. | |
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. | |
const string & | getSuffix (const TypeDesc *nodeType) const |
Return the function name suffix to be used for the given node in this context. | |
![]() | |
GenUserDataPtr | getSelf () |
Return a shared pointer for this object. | |
ConstGenUserDataPtr | getSelf () const |
Return a shared pointer for this object. | |
template<class T > | |
shared_ptr< T > | asA () |
Return this object cast to a templated type. | |
template<class T > | |
shared_ptr< const T > | asA () const |
Return this object cast to a templated type. | |
Static Public Member Functions | |
static HwClosureContextPtr | create (int type) |
Create and return a new instance. | |
Protected Attributes | |
const int | _type |
std::unordered_map< const TypeDesc *, Arguments > | _arguments |
std::unordered_map< const TypeDesc *, string > | _suffix |
Static Protected Attributes | |
static const Arguments | EMPTY_ARGUMENTS |
Class representing a context for closure evaluation on hardware targets.
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.
An extra argument for closure functions.
An argument is a pair of strings holding the 'type' and 'name' of the argument.