HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SwizzleNode.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_SWIZZLENODE_H
7 #define MATERIALX_SWIZZLENODE_H
8 
10 
12 
13 /// Swizzle node implementation
15 {
16  public:
17  static ShaderNodeImplPtr create();
18 
19  void emitFunctionCall(const ShaderNode& node, GenContext& context, ShaderStage& stage) const override;
20 
21  /// Returns true if the input is editable by users.
22  /// Editable inputs are allowed to be published as shader uniforms
23  /// and hence must be presentable in a user interface.
24  bool isEditable(const ShaderInput& input) const override;
25 
26  protected:
27  /// Get the implementation name of the variable that supports swizzles.
28  /// Allows to override that name in generated code based on the target language.
29  virtual string getVariableName(const ShaderInput* input) const;
30 };
31 
33 
34 #endif
shared_ptr< ShaderNodeImpl > ShaderNodeImplPtr
Shared pointer to a ShaderNodeImpl.
Definition: Library.h:40
#define MATERIALX_NAMESPACE_BEGIN
Definition: Generated.h:25
#define MX_GENSHADER_API
Definition: Export.h:18
virtual bool isEditable(const ShaderInput &) const
Swizzle node implementation.
Definition: SwizzleNode.h:14
#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...