|
HDK
|
#include <Shader.h>
Public Member Functions | |
| Shader (const string &name, ShaderGraphPtr graph) | |
| Constructor. More... | |
| virtual | ~Shader () |
| Destructor. More... | |
| const string & | getName () const |
| Return the shader name. More... | |
| size_t | numStages () const |
| Return the number of shader stages for this shader. More... | |
| ShaderStage & | getStage (size_t index) |
| Return a stage by index. More... | |
| const ShaderStage & | getStage (size_t index) const |
| Return a stage by index. More... | |
| bool | hasStage (const string &name) |
| Return if stage exists. More... | |
| ShaderStage & | getStage (const string &name) |
| Return a stage by name. More... | |
| const ShaderStage & | getStage (const string &name) const |
| Return a stage by name. More... | |
| bool | hasAttribute (const string &attrib) const |
| Return true if the shader has a given named attribute. More... | |
| ValuePtr | getAttribute (const string &attrib) const |
| void | setAttribute (const string &attrib, ValuePtr value) |
| Set a value attribute on the shader. More... | |
| void | setAttribute (const string &attrib) |
| Set a flag attribute on the shader. More... | |
| const ShaderGraph & | getGraph () const |
| Return the shader graph. More... | |
| ShaderGraph & | getGraph () |
| Return the shader graph. More... | |
| bool | hasClassification (unsigned int c) const |
| Return true if this shader matches the given classification. More... | |
| void | setSourceCode (const string &code, const string &stage=Stage::PIXEL) |
| Set the shader source code for a given shader stage. More... | |
| const string & | getSourceCode (const string &stage=Stage::PIXEL) const |
| Return the shader source code for a given shader stage. More... | |
Protected Member Functions | |
| ShaderStagePtr | createStage (const string &name, ConstSyntaxPtr syntax) |
| Create a new stage in the shader. More... | |
Protected Attributes | |
| string | _name |
| ShaderGraphPtr | _graph |
| std::unordered_map< string, ShaderStagePtr > | _stagesMap |
| vector< ShaderStage * > | _stages |
| std::unordered_map< string, ValuePtr > | _attributeMap |
Friends | |
| class | ShaderGenerator |
Class containing all data needed during shader generation. After generation is completed it will contain the resulting source code emitted by shader generators.
The class contains a default implementation using a single shader stage. Derived shaders can override this, as well as overriding all methods that add code to the shader.
| Shader::Shader | ( | const string & | name, |
| ShaderGraphPtr | graph | ||
| ) |
Constructor.
|
protected |
Create a new stage in the shader.
|
inline |
|
inline |
|
inline |
|
inline |
| ShaderStage& Shader::getStage | ( | size_t | index | ) |
Return a stage by index.
| const ShaderStage& Shader::getStage | ( | size_t | index | ) | const |
Return a stage by index.
| ShaderStage& Shader::getStage | ( | const string & | name | ) |
Return a stage by name.
| const ShaderStage& Shader::getStage | ( | const string & | name | ) | const |
Return a stage by name.
|
inline |
|
inline |
| bool Shader::hasStage | ( | const string & | name | ) |
Return if stage exists.
|
inline |
|
inline |
|
friend |
|
protected |
|
protected |
|
protected |