HDK
|
Node to handle user defined implementations in external MDL files or using the inline sourcecode
attribute.
More...
#include <CustomNodeMdl.h>
Public Member Functions | |
void | initialize (const InterfaceElement &element, GenContext &context) override |
void | emitFunctionDefinition (const ShaderNode &node, GenContext &context, ShaderStage &stage) const override |
Emit function definition for the given node instance. More... | |
const string & | getQualifiedModuleName () const |
string | modifyPortName (const string &name, const MdlSyntax &syntax) const |
![]() | |
void | initialize (const InterfaceElement &element, GenContext &context) override |
void | emitFunctionDefinition (const ShaderNode &, GenContext &, ShaderStage &) const override |
Emit function definition for the given node instance. More... | |
void | emitFunctionCall (const ShaderNode &node, GenContext &context, ShaderStage &stage) const override |
Emit the function call or inline source code for given node instance in the given context. More... | |
![]() | |
void | initialize (const InterfaceElement &element, GenContext &context) override |
void | emitFunctionDefinition (const ShaderNode &node, GenContext &context, ShaderStage &stage) const override |
Emit function definition for the given node instance. More... | |
void | emitFunctionCall (const ShaderNode &node, GenContext &context, ShaderStage &stage) const override |
Emit the function call or inline source code for given node instance in the given context. More... | |
![]() | |
virtual | ~ShaderNodeImpl () |
virtual const string & | getTarget () const |
const string & | getName () const |
Return the name of this implementation. More... | |
size_t | getHash () const |
virtual void | addInputs (ShaderNode &node, GenContext &context) const |
Add additional inputs on a node. More... | |
virtual void | setValues (const Node &node, ShaderNode &shaderNode, GenContext &context) const |
Set values for additional inputs on a node. More... | |
virtual void | addClassification (ShaderNode &node) const |
Add additional classifications on a node. More... | |
virtual void | createVariables (const ShaderNode &node, GenContext &context, Shader &shader) const |
virtual void | emitOutputVariables (const ShaderNode &node, GenContext &context, ShaderStage &stage) const |
Emit declaration and initialization of output variables to use in a function call. More... | |
virtual ShaderGraph * | getGraph () const |
virtual bool | isEditable (const ShaderInput &) const |
virtual bool | isEditable (const ShaderGraphInputSocket &) const |
Static Public Member Functions | |
static ShaderNodeImplPtr | create () |
![]() | |
static ShaderNodeImplPtr | create () |
![]() | |
static ShaderNodeImplPtr | create () |
Protected Member Functions | |
void | initializeForInlineSourceCode (const InterfaceElement &element, GenContext &context) |
Initialize function for nodes that use the inline sourcecode attribute. More... | |
void | initializeForExternalSourceCode (const InterfaceElement &element, GenContext &context) |
Initialize function for nodes that use the file and function attribute. More... | |
void | initializeFunctionCallTemplateString (const MdlSyntax &syntax, const NodeDef &node) |
Computes the function call string with replacement markers use by base class. More... | |
void | initializeOutputDefaults (const MdlSyntax &syntax, const NodeDef &node) |
Keep track of the default values needed for the inline sourcecode case. More... | |
![]() | |
void | resolveSourceCode (const InterfaceElement &element, GenContext &context) override |
Resolve the source file and read the source code during the initialization of the node. More... | |
![]() | |
ShaderNodeImpl () | |
Protected constructor. More... | |
Protected Attributes | |
std::vector< ValuePtr > | _outputDefaults |
store default values of the node definition More... | |
bool | _useExternalSourceCode |
string | _inlineFunctionName |
string | _inlineSourceCode |
string | _qualifiedModuleName |
![]() | |
string | _returnStruct |
![]() | |
bool | _inlined |
string | _functionName |
string | _functionSource |
FilePath | _sourceFilename |
![]() | |
string | _name |
size_t | _hash |
Node to handle user defined implementations in external MDL files or using the inline sourcecode
attribute.
Definition at line 17 of file CustomNodeMdl.h.
|
static |
|
overridevirtual |
Emit function definition for the given node instance.
Reimplemented from ShaderNodeImpl.
const string& CustomCodeNodeMdl::getQualifiedModuleName | ( | ) | const |
Get the MDL qualified name of the externally references user module. It's used for import statements and functions calls in the generated target code.
|
overridevirtual |
Initialize with the given implementation element. Initialization must set the name and hash for the implementation, as well as any other data needed to emit code for the node.
Reimplemented from ShaderNodeImpl.
|
protected |
Initialize function for nodes that use the file
and function
attribute.
|
protected |
Initialize function for nodes that use the inline sourcecode
attribute.
|
protected |
Computes the function call string with replacement markers use by base class.
|
protected |
Keep track of the default values needed for the inline sourcecode
case.
To avoid collisions with reserved names in MDL, input and output names are prefixed. In the sourcecode
case all inputs and outputs are prefixed so authors don't need knowledge about reserved words in MDL. In the file
and function
case, only reserved names are prefixed to support existing MDL implementations without changes.
|
protected |
Definition at line 49 of file CustomNodeMdl.h.
|
protected |
Definition at line 50 of file CustomNodeMdl.h.
|
protected |
store default values of the node definition
Definition at line 46 of file CustomNodeMdl.h.
|
protected |
Definition at line 51 of file CustomNodeMdl.h.
|
protected |
Definition at line 48 of file CustomNodeMdl.h.