MaterialX 1.39.5
Loading...
Searching...
No Matches
ShaderGraphRefactor.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_SHADERGRAPHREFACTOR_H
7#define MATERIALX_SHADERGRAPHREFACTOR_H
8
11
13
14MATERIALX_NAMESPACE_BEGIN
15
16class GenContext;
17class ShaderGraph;
18
20using ShaderGraphRefactorPtr = shared_ptr<class ShaderGraphRefactor>;
21
27class MX_GENSHADER_API ShaderGraphRefactor
28{
29 public:
30 virtual ~ShaderGraphRefactor() { }
31
33 virtual const string& getName() const = 0;
34
38 virtual size_t execute(ShaderGraph& graph, GenContext& context) = 0;
39};
40
46class MX_GENSHADER_API NodeElisionRefactor : public ShaderGraphRefactor
47{
48 public:
49 const string& getName() const override;
50 size_t execute(ShaderGraph& graph, GenContext& context) override;
51};
52
60{
61 public:
62 const string& getName() const override;
63 size_t execute(ShaderGraph& graph, GenContext& context) override;
64};
65
72{
73 public:
74 const string& getName() const override;
75 size_t execute(ShaderGraph& graph, GenContext& context) override;
76};
77
78MATERIALX_NAMESPACE_END
79
80#endif
Macros for declaring imported and exported symbols.
shared_ptr< class ShaderGraphRefactor > ShaderGraphRefactorPtr
A shared pointer to a shader graph refactor.
Definition ShaderGraphRefactor.h:20
Distributes layer operations over mix nodes.
Definition ShaderGraphRefactor.h:72
size_t execute(ShaderGraph &graph, GenContext &context) override
Execute the pass on the given graph.
const string & getName() const override
Return the name of this refactoring pass.
A context class for shader generation.
Definition GenContext.h:30
Removes constant and dot nodes by bypassing them.
Definition ShaderGraphRefactor.h:47
size_t execute(ShaderGraph &graph, GenContext &context) override
Execute the pass on the given graph.
const string & getName() const override
Return the name of this refactoring pass.
Replaces BSDF mix nodes with premultiplied add nodes.
Definition ShaderGraphRefactor.h:60
size_t execute(ShaderGraph &graph, GenContext &context) override
Execute the pass on the given graph.
const string & getName() const override
Return the name of this refactoring pass.
Class representing a graph (DAG) for shader generation.
Definition ShaderGraph.h:45
Base class for shader graph refactoring passes.
Definition ShaderGraphRefactor.h:28
virtual const string & getName() const =0
Return the name of this refactoring pass.
virtual size_t execute(ShaderGraph &graph, GenContext &context)=0
Execute the pass on the given graph.