6#ifndef MATERIALX_OSLSHADERGENERATOR_H
7#define MATERIALX_OSLSHADERGENERATOR_H
16MATERIALX_NAMESPACE_BEGIN
18using OslShaderGeneratorPtr = shared_ptr<class OslShaderGenerator>;
31 const string&
getTarget()
const override {
return TARGET; }
71extern MX_GENOSL_API
const string UNIFORMS;
72extern MX_GENOSL_API
const string INPUTS;
73extern MX_GENOSL_API
const string OUTPUTS;
77MATERIALX_NAMESPACE_END
shared_ptr< Document > DocumentPtr
A shared pointer to a Document.
Definition: Document.h:22
shared_ptr< Element > ElementPtr
A shared pointer to an Element.
Definition: Element.h:31
Macros for declaring imported and exported symbols.
shared_ptr< Shader > ShaderPtr
Shared pointer to a Shader.
Definition: Library.h:34
shared_ptr< ShaderGenerator > ShaderGeneratorPtr
Shared pointer to a ShaderGenerator.
Definition: Library.h:38
Base shader generator class.
A context class for shader generation.
Definition: GenContext.h:31
Base class for OSL (Open Shading Language) shader generators.
Definition: OslShaderGenerator.h:24
const string & getTarget() const override
Return a unique identifier for the target this generator is for.
Definition: OslShaderGenerator.h:31
static const string TARGET
Unique identifier for this generator target.
Definition: OslShaderGenerator.h:45
Base class for shader generators All third-party shader generators should derive from this class.
Definition: ShaderGenerator.h:31
virtual void emitFunctionCalls(const ShaderGraph &graph, GenContext &context, ShaderStage &stage, uint32_t classification=0u) const
Add all function calls for a graph.
Definition: ShaderGenerator.cpp:119
virtual void registerShaderMetadata(const DocumentPtr &doc, GenContext &context) const
Register metadata that should be exported to the generated shaders.
Definition: ShaderGenerator.cpp:366
virtual void emitFunctionBodyBegin(const ShaderNode &node, GenContext &context, ShaderStage &stage, Syntax::Punctuation punc=Syntax::CURLY_BRACKETS) const
Emit code for starting a new function body.
Definition: ShaderGenerator.cpp:142
virtual ShaderPtr generate(const string &, ElementPtr, GenContext &) const
Generate a shader starting from the given element, translating the element and all dependencies upstr...
Definition: ShaderGenerator.h:44
Class representing a graph (DAG) for shader generation.
Definition: ShaderGraph.h:44
Class representing a node in the shader generation DAG.
Definition: ShaderNode.h:326
An input or output port on a ShaderNode.
Definition: ShaderNode.h:123
A shader stage, containing the state and resulting source code for the stage.
Definition: ShaderStage.h:139
Punctuation
Punctuation types.
Definition: Syntax.h:44
A block of variables in a shader stage.
Definition: ShaderStage.h:61