HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SourceCodeNode.h
Go to the documentation of this file.
1 //
2 // Copyright Contributors to the MaterialX Project
3 // SPDX-License-Identifier: Apache-2.0
4 //
5 
6 #ifndef MATERIALX_SOURCECODENODE_H
7 #define MATERIALX_SOURCECODENODE_H
8 
10 
11 #include <MaterialXFormat/File.h>
12 
14 
15 /// @class SourceCodeNode
16 /// Implemention for a node using data-driven static source code.
17 /// This is the default implementation used for all nodes that
18 /// do not have a custom ShaderNodeImpl class.
20 {
21  public:
22  static ShaderNodeImplPtr create();
23 
24  void initialize(const InterfaceElement& element, GenContext& context) override;
25  void emitFunctionDefinition(const ShaderNode& node, GenContext& context, ShaderStage& stage) const override;
26  void emitFunctionCall(const ShaderNode& node, GenContext& context, ShaderStage& stage) const override;
27 
28  protected:
29  bool _inlined;
30  string _functionName;
33 };
34 
36 
37 #endif
shared_ptr< ShaderNodeImpl > ShaderNodeImplPtr
Shared pointer to a ShaderNodeImpl.
Definition: Library.h:40
Definition: File.h:26
#define MATERIALX_NAMESPACE_BEGIN
Definition: Generated.h:25
string _functionSource
#define MX_GENSHADER_API
Definition: Export.h:18
virtual void emitFunctionDefinition(const ShaderNode &node, GenContext &context, ShaderStage &stage) const
Emit function definition for the given node instance.
FilePath _sourceFilename
string _functionName
virtual void initialize(const InterfaceElement &element, GenContext &context)
#define MATERIALX_NAMESPACE_END
Definition: Generated.h:26
virtual void emitFunctionCall(const ShaderNode &node, GenContext &context, ShaderStage &stage) const
Emit the function call or inline source code for given node instance in the given context...