MaterialX 1.38.10
Loading...
Searching...
No Matches
ClosureCompoundNode.h
1//
2// Copyright Contributors to the MaterialX Project
3// SPDX-License-Identifier: Apache-2.0
4//
5
6#ifndef MATERIALX_CLOSURECOMPOUNDNODE_H
7#define MATERIALX_CLOSURECOMPOUNDNODE_H
8
9#include <MaterialXGenShader/Nodes/CompoundNode.h>
11
12MATERIALX_NAMESPACE_BEGIN
13
15class MX_GENSHADER_API ClosureCompoundNode : public CompoundNode
16{
17 public:
18 static ShaderNodeImplPtr create();
19
20 void addClassification(ShaderNode& node) const override;
21
22 void emitFunctionDefinition(const ShaderNode& node, GenContext& context, ShaderStage& stage) const override;
23
24 void emitFunctionCall(const ShaderNode& node, GenContext& context, ShaderStage& stage) const override;
25
26 protected:
27 void emitFunctionDefinition(ClosureContext* cct, GenContext& context, ShaderStage& stage) const;
28};
29
30MATERIALX_NAMESPACE_END
31
32#endif
Context classes for shader generation.
shared_ptr< ShaderNodeImpl > ShaderNodeImplPtr
Shared pointer to a ShaderNodeImpl.
Definition: Library.h:40
Extending the CompoundNode with requirements for closures.
Definition: ClosureCompoundNode.h:16
Class representing a context for closure evaluation.
Definition: GenContext.h:248
Compound node implementation.
Definition: CompoundNode.h:17
void emitFunctionDefinition(const ShaderNode &node, GenContext &context, ShaderStage &stage) const override
Emit function definition for the given node instance.
Definition: CompoundNode.cpp:57
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.
Definition: CompoundNode.cpp:107
A context class for shader generation.
Definition: GenContext.h:31
Class representing a node in the shader generation DAG.
Definition: ShaderNode.h:326
virtual void addClassification(ShaderNode &node) const
Add additional classifications on a node.
Definition: ShaderNodeImpl.cpp:45
A shader stage, containing the state and resulting source code for the stage.
Definition: ShaderStage.h:139