|
HDK
|
#include <OslNetworkShaderGenerator.h>
Inheritance diagram for OslNetworkShaderGenerator:Public Member Functions | |
| OslNetworkShaderGenerator (TypeSystemPtr typeSystem) | |
| Constructor. More... | |
| ShaderNodeImplPtr | createShaderNodeImplForImplementation (const Implementation &implElement) const override |
| Create the shader node implementation for an Implementation implementation. More... | |
| const string & | getTarget () const override |
| Return a unique identifier for the target this generator is for. More... | |
| ShaderPtr | generate (const string &name, ElementPtr element, GenContext &context) const override |
Public Member Functions inherited from OslShaderGenerator | |
| OslShaderGenerator (TypeSystemPtr typeSystem) | |
| Constructor. More... | |
| const string & | getTarget () const override |
| Return a unique identifier for the target this generator is for. More... | |
| ShaderPtr | generate (const string &name, ElementPtr element, GenContext &context) const override |
| void | emitAllDependentFunctionCalls (const ShaderNode &node, GenContext &context, ShaderStage &stage) const |
| Add all function calls for a node, and all upstream nodes. More... | |
| void | registerShaderMetadata (const DocumentPtr &doc, GenContext &context) const override |
| Register metadata that should be exported to the generated shaders. More... | |
Public Member Functions inherited from ShaderGenerator | |
| virtual | ~ShaderGenerator () |
| Destructor. More... | |
| virtual void | emitScopeBegin (ShaderStage &stage, Syntax::Punctuation punc=Syntax::CURLY_BRACKETS) const |
| Start a new scope using the given bracket type. More... | |
| virtual void | emitScopeEnd (ShaderStage &stage, bool semicolon=false, bool newline=true) const |
| End the current scope. More... | |
| virtual void | emitLineBegin (ShaderStage &stage) const |
| Start a new line. More... | |
| virtual void | emitLineEnd (ShaderStage &stage, bool semicolon=true) const |
| End the current line. More... | |
| virtual void | emitLineBreak (ShaderStage &stage) const |
| Add a line break. More... | |
| virtual void | emitString (const string &str, ShaderStage &stage) const |
| Add a string. More... | |
| virtual void | emitLine (const string &str, ShaderStage &stage, bool semicolon=true) const |
| Add a single line of code, optionally appending a semicolon. More... | |
| virtual void | emitComment (const string &str, ShaderStage &stage) const |
| Add a single line code comment. More... | |
| virtual void | emitBlock (const string &str, const FilePath &sourceFilename, GenContext &context, ShaderStage &stage) const |
| Add a block of code. More... | |
| virtual void | emitLibraryInclude (const FilePath &filename, GenContext &context, ShaderStage &stage) const |
| template<typename T > | |
| void | emitValue (const T &value, ShaderStage &stage) const |
| Add a value. More... | |
| virtual void | emitFunctionDefinition (const ShaderNode &node, GenContext &context, ShaderStage &stage) const |
| Add the function definition for a single node. More... | |
| virtual void | emitFunctionDefinitionParameter (const ShaderPort *shaderPort, bool isOutput, GenContext &context, ShaderStage &stage) const |
| virtual void | emitFunctionDefinitions (const ShaderGraph &graph, GenContext &context, ShaderStage &stage) const |
| Add all function definitions for a graph. More... | |
| virtual void | emitFunctionCall (const ShaderNode &node, GenContext &context, ShaderStage &stage) const |
| Add the function call for a single node. More... | |
| virtual void | emitFunctionCall (const ShaderNode &node, GenContext &context, ShaderStage &stage, bool checkScope) const |
| virtual void | emitFunctionCalls (const ShaderGraph &graph, GenContext &context, ShaderStage &stage, uint32_t classification=0u) const |
| virtual void | emitDependentFunctionCalls (const ShaderNode &node, GenContext &context, ShaderStage &stage, uint32_t classification=0u) const |
| 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. More... | |
| virtual void | emitFunctionBodyEnd (const ShaderNode &node, GenContext &context, ShaderStage &stage) const |
| Emit code for ending a function body. More... | |
| virtual void | emitTypeDefinitions (GenContext &context, ShaderStage &stage) const |
| Emit type definitions for all data types that needs it. More... | |
| virtual void | emitInput (const ShaderInput *input, GenContext &context, ShaderStage &stage) const |
| virtual void | emitOutput (const ShaderOutput *output, bool includeType, bool assignValue, GenContext &context, ShaderStage &stage) const |
| virtual void | emitVariableDeclarations (const VariableBlock &block, const string &qualifier, const string &separator, GenContext &context, ShaderStage &stage, bool assignValue=true) const |
| virtual void | emitVariableDeclaration (const ShaderPort *variable, const string &qualifier, GenContext &context, ShaderStage &stage, bool assignValue=true) const |
| virtual bool | nodeNeedsClosureData (const ShaderNode &) const |
| Return true if the node needs the additional ClosureData added. More... | |
| virtual void | emitClosureDataArg (const ShaderNode &, GenContext &, ShaderStage &) const |
| virtual void | emitClosureDataParameter (const ShaderNode &, GenContext &, ShaderStage &) const |
| virtual string | getUpstreamResult (const ShaderInput *input, GenContext &context) const |
| Return the result of an upstream connection or value for an input. More... | |
| const Syntax & | getSyntax () const |
| Return the syntax object for the language used by the code generator. More... | |
| void | registerImplementation (const string &name, CreatorFunction< ShaderNodeImpl > creator) |
| Register a shader node implementation for a given implementation element name. More... | |
| void | registerImplementation (const StringVec &nameVec, CreatorFunction< ShaderNodeImpl > creator) |
| Register a shader node implementation for a given set of implementation element names. More... | |
| bool | implementationRegistered (const string &name) const |
| Determine if a shader node implementation has been registered for a given implementation element name. More... | |
| virtual ShaderNodeImplPtr | createShaderNodeImplForNodeGraph (const NodeGraph &nodegraph) const |
| Create the shader node implementation for a NodeGraph implementation. More... | |
| virtual ShaderNodeImplPtr | getImplementation (const NodeDef &nodedef, GenContext &context) const |
| Return a registered shader node implementation for the given nodedef. More... | |
| void | setColorManagementSystem (ColorManagementSystemPtr colorManagementSystem) |
| Sets the color management system. More... | |
| ColorManagementSystemPtr | getColorManagementSystem () const |
| Returns the color management system. More... | |
| void | setUnitSystem (UnitSystemPtr unitSystem) |
| Sets the unit system. More... | |
| UnitSystemPtr | getUnitSystem () const |
| Returns the unit system. More... | |
| TypeSystemPtr | getTypeSystem () const |
| Returns the type system. More... | |
| const StringMap & | getTokenSubstitutions () const |
| Return the map of token substitutions used by the generator. More... | |
| void | registerRefactor (ShaderGraphRefactorPtr refactor) |
| Register a shader graph refactoring pass. More... | |
| const vector < ShaderGraphRefactorPtr > & | getRefactors () const |
| Return the registered graph refactoring passes. More... | |
| virtual void | applyDefaultOptions (GenOptions &options) const |
| Apply the default GenOptions for this generator's target. More... | |
| virtual void | registerTypeDefs (const DocumentPtr &doc) |
| Register type definitions from the document. More... | |
| virtual const string & | getLightDataTypevarString () const |
Static Public Member Functions | |
| static ShaderGeneratorPtr | create (TypeSystemPtr typeSystem=nullptr) |
Static Public Member Functions inherited from OslShaderGenerator | |
| static ShaderGeneratorPtr | create (TypeSystemPtr typeSystem=nullptr) |
Static Public Attributes | |
| static const string | TARGET |
| Unique identifier for this generator target. More... | |
Static Public Attributes inherited from OslShaderGenerator | |
| static const string | TARGET |
| Unique identifier for this generator target. More... | |
Protected Member Functions | |
| ShaderPtr | createShader (const string &name, ElementPtr element, GenContext &context) const override |
| Create and initialize a new OSL shader for shader generation. More... | |
Protected Member Functions inherited from OslShaderGenerator | |
| virtual void | emitLibraryIncludes (ShaderStage &stage, GenContext &context) const |
| Emit include headers needed by the generated shader code. More... | |
| virtual void | emitShaderInputs (const VariableBlock &inputs, ShaderStage &stage) const |
| Emit a block of shader inputs. More... | |
| virtual void | emitShaderOutputs (const VariableBlock &inputs, ShaderStage &stage) const |
| Emit a block of shader outputs. More... | |
| virtual void | emitMetadata (const ShaderPort *port, ShaderStage &stage) const |
| Emit metadata for a shader parameter. More... | |
| void | addSetCiTerminalNode (ShaderGraph &graph, ConstDocumentPtr document, GenContext &context) const |
Protected Member Functions inherited from ShaderGenerator | |
| ShaderGenerator (TypeSystemPtr typeSystem, SyntaxPtr syntax) | |
| Protected constructor. More... | |
| virtual ShaderStagePtr | createStage (const string &name, Shader &shader) const |
| Create a new stage in a shader. More... | |
| void | setFunctionName (const string &functionName, ShaderStage &stage) const |
| Set function name for a stage. More... | |
| void | replaceTokens (const StringMap &substitutions, ShaderStage &stage) const |
| Replace tokens with identifiers according to the given substitutions map. More... | |
| void | createVariables (ShaderGraphPtr graph, GenContext &context, Shader &shader) const |
Additional Inherited Members | |
Protected Attributes inherited from ShaderGenerator | |
| TypeSystemPtr | _typeSystem |
| SyntaxPtr | _syntax |
| Factory< ShaderNodeImpl > | _implFactory |
| ColorManagementSystemPtr | _colorManagementSystem |
| UnitSystemPtr | _unitSystem |
| StringMap | _tokenSubstitutions |
| vector< ShaderGraphRefactorPtr > | _refactors |
| friend | ShaderGraph |
Static Protected Attributes inherited from ShaderGenerator | |
| static const string | T_FILE_TRANSFORM_UV |
| static const string | LIGHTDATA_TYPEVAR_STRING |
OSL (Open Shading Language) Network shader generator. Generates a command string that OSL can use to build a ShaderGroup.
Definition at line 23 of file OslNetworkShaderGenerator.h.
| OslNetworkShaderGenerator::OslNetworkShaderGenerator | ( | TypeSystemPtr | typeSystem | ) |
Constructor.
|
inlinestatic |
Creator function. If a TypeSystem is not provided it will be created internally. Optionally pass in an externally created TypeSystem here, if you want to keep type descriptions alive after the lifetime of the shader generator.
Definition at line 34 of file OslNetworkShaderGenerator.h.
|
overrideprotectedvirtual |
Create and initialize a new OSL shader for shader generation.
Reimplemented from OslShaderGenerator.
|
overridevirtual |
Create the shader node implementation for an Implementation implementation.
Reimplemented from ShaderGenerator.
|
overridevirtual |
Generate a shader starting from the given element, translating the element and all dependencies upstream into shader code.
Reimplemented from ShaderGenerator.
|
inlineoverridevirtual |
Return a unique identifier for the target this generator is for.
Reimplemented from ShaderGenerator.
Definition at line 42 of file OslNetworkShaderGenerator.h.
|
static |
Unique identifier for this generator target.
Definition at line 49 of file OslNetworkShaderGenerator.h.