Mitsuba Renderer  0.5.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mitsuba::VPLShaderManager::DependencyNode Struct Reference

This helper class stores a reference to a Shader and all sub-shaders that are part of its evaluation. More...

#include <mitsuba/hw/vpl.h>

Public Member Functions

 DependencyNode (Shader *shader=NULL)
 Create from a Shader object. More...
 
 DependencyNode (const DependencyNode &node)
 Copy constructor. More...
 
std::string generateCode (std::ostringstream &oss, int &id) const
 Generate GLSL code for the entire shader chain. More...
 
void resolve (GPUProgram *program, int &id)
 Resolve all parameters of the shader chain. More...
 
void bind (GPUProgram *program, const DependencyNode &targetNode, int &textureUnitOffset)
 Bind all referenced resources (textures etc) More...
 
void unbind ()
 Release resources that were bound by bind() More...
 
void toString (std::ostringstream &oss) const
 Generate a textual summary of the entire shader chain. More...
 
std::string toString () const
 

Public Attributes

const Shadershader
 
std::vector< DependencyNodechildren
 
std::vector< int > parameterIDs
 

Detailed Description

This helper class stores a reference to a Shader and all sub-shaders that are part of its evaluation.

It also allows to generate GLSL code for the entire chain, and to bind any uniform parameters to the target parameters

Constructor & Destructor Documentation

mitsuba::VPLShaderManager::DependencyNode::DependencyNode ( Shader shader = NULL)
inline

Create from a Shader object.

mitsuba::VPLShaderManager::DependencyNode::DependencyNode ( const DependencyNode node)
inline

Copy constructor.

Member Function Documentation

void mitsuba::VPLShaderManager::DependencyNode::bind ( GPUProgram program,
const DependencyNode targetNode,
int &  textureUnitOffset 
)
inline

Bind all referenced resources (textures etc)

std::string mitsuba::VPLShaderManager::DependencyNode::generateCode ( std::ostringstream &  oss,
int &  id 
) const
inline

Generate GLSL code for the entire shader chain.

void mitsuba::VPLShaderManager::DependencyNode::resolve ( GPUProgram program,
int &  id 
)
inline

Resolve all parameters of the shader chain.

void mitsuba::VPLShaderManager::DependencyNode::toString ( std::ostringstream &  oss) const
inline

Generate a textual summary of the entire shader chain.

std::string mitsuba::VPLShaderManager::DependencyNode::toString ( ) const
inline
void mitsuba::VPLShaderManager::DependencyNode::unbind ( )
inline

Release resources that were bound by bind()

Member Data Documentation

std::vector<DependencyNode> mitsuba::VPLShaderManager::DependencyNode::children
std::vector<int> mitsuba::VPLShaderManager::DependencyNode::parameterIDs
const Shader* mitsuba::VPLShaderManager::DependencyNode::shader

The documentation for this struct was generated from the following file: