xoreos  0.0.5
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
Graphics::Shader::ShaderSurface Class Reference

#include <shadersurface.h>

Collaboration diagram for Graphics::Shader::ShaderSurface:
Collaboration graph
[legend]

Classes

struct  ShaderSurfaceVariable
 

Public Member Functions

 ShaderSurface (Shader::ShaderObject *vertShader, const Common::UString &name="unnamed")
 
 ~ShaderSurface ()
 
const Common::UStringgetName () const
 
Shader::ShaderObjectgetVertexShader () const
 
uint32 getFlags () const
 
void setFlags (uint32 flags)
 
uint32 getVariableCount () const
 
Shader::ShaderVariableType getVariableType (uint32 index) const
 
void * getVariableData (uint32 index) const
 
void * getVariableData (const Common::UString &name) const
 
const Common::UStringgetVariableName (uint32 index) const
 
uint32 getVariableFlags (uint32 index) const
 
void setVariableExternal (uint32 index, void *loc)
 
void setVariableExternal (const Common::UString &name, void *loc)
 
void setVariableInternal (uint32 index)
 
void setVariableInternal (const Common::UString &name)
 
bool isVariableOwned (uint32 index) const
 
bool isVariableOwned (const Common::UString &name) const
 
void addUBO (uint32 index, GLuint glid)
 
void bindProgram (Shader::ShaderProgram *program)
 
void bindProgram (Shader::ShaderProgram *program, const glm::mat4 *t)
 
void bindObjectModelview (Shader::ShaderProgram *program, const glm::mat4 *t)
 
void bindTextureView (Shader::ShaderProgram *program, const glm::mat4 *t)
 
void bindGLState ()
 
void unbindGLState ()
 
void restoreGLState ()
 
void useIncrement ()
 
void useDecrement ()
 
uint32 useCount () const
 

Private Member Functions

void * genSurfaceVar (uint32 index)
 
void delSurfaceVar (uint32 index)
 

Private Attributes

std::vector< ShaderSurfaceVariable_variableData
 
std::vector< Shader::ShaderUBO_uboArray
 
Shader::ShaderObject_vertShader
 
uint32 _flags
 
Common::UString _name
 
uint32 _usageCount
 
uint32 _objectModelviewIndex
 
uint32 _textureViewIndex
 

Detailed Description

Definition at line 40 of file shadersurface.h.

Constructor & Destructor Documentation

◆ ShaderSurface()

Graphics::Shader::ShaderSurface::ShaderSurface ( Shader::ShaderObject vertShader,
const Common::UString name = "unnamed" 
)

◆ ~ShaderSurface()

Graphics::Shader::ShaderSurface::~ShaderSurface ( )

Definition at line 56 of file shadersurface.cpp.

References _variableData, and delSurfaceVar().

Here is the call graph for this function:

Member Function Documentation

◆ addUBO()

void Graphics::Shader::ShaderSurface::addUBO ( uint32  index,
GLuint  glid 
)

Definition at line 157 of file shadersurface.cpp.

References _uboArray.

◆ bindGLState()

void Graphics::Shader::ShaderSurface::bindGLState ( )

◆ bindObjectModelview()

void Graphics::Shader::ShaderSurface::bindObjectModelview ( Shader::ShaderProgram program,
const glm::mat4 *  t 
)

◆ bindProgram() [1/2]

void Graphics::Shader::ShaderSurface::bindProgram ( Shader::ShaderProgram program)

◆ bindProgram() [2/2]

void Graphics::Shader::ShaderSurface::bindProgram ( Shader::ShaderProgram program,
const glm::mat4 *  t 
)

◆ bindTextureView()

void Graphics::Shader::ShaderSurface::bindTextureView ( Shader::ShaderProgram program,
const glm::mat4 *  t 
)

◆ delSurfaceVar()

void Graphics::Shader::ShaderSurface::delSurfaceVar ( uint32  index)
private

Definition at line 270 of file shadersurface.cpp.

References _variableData, _vertShader, Graphics::Shader::SHADER_FLOAT, Graphics::Shader::SHADER_INT, Graphics::Shader::SHADER_ISAMPLER1D, Graphics::Shader::SHADER_ISAMPLER1DARRAY, Graphics::Shader::SHADER_ISAMPLER2D, Graphics::Shader::SHADER_ISAMPLER2DARRAY, Graphics::Shader::SHADER_ISAMPLER3D, Graphics::Shader::SHADER_ISAMPLERCUBE, Graphics::Shader::SHADER_IVEC2, Graphics::Shader::SHADER_IVEC3, Graphics::Shader::SHADER_IVEC4, Graphics::Shader::SHADER_MAT2, Graphics::Shader::SHADER_MAT3, Graphics::Shader::SHADER_MAT4, Graphics::Shader::SHADER_SAMPLER1D, Graphics::Shader::SHADER_SAMPLER1DARRAY, Graphics::Shader::SHADER_SAMPLER1DARRAYSHADOW, Graphics::Shader::SHADER_SAMPLER1DSHADOW, Graphics::Shader::SHADER_SAMPLER2D, Graphics::Shader::SHADER_SAMPLER2DARRAY, Graphics::Shader::SHADER_SAMPLER2DARRAYSHADOW, Graphics::Shader::SHADER_SAMPLER2DSHADOW, Graphics::Shader::SHADER_SAMPLER3D, Graphics::Shader::SHADER_SAMPLERBUFFER, Graphics::Shader::SHADER_SAMPLERCUBE, SHADER_SURFACE_VARIABLE_OWNED, Graphics::Shader::SHADER_UNIFORM_BUFFER, Graphics::Shader::SHADER_USAMPLER1D, Graphics::Shader::SHADER_USAMPLER1DARRAY, Graphics::Shader::SHADER_USAMPLER2D, Graphics::Shader::SHADER_USAMPLER2DARRAY, Graphics::Shader::SHADER_USAMPLER3D, Graphics::Shader::SHADER_USAMPLERCUBE, Graphics::Shader::SHADER_VEC2, Graphics::Shader::SHADER_VEC3, Graphics::Shader::SHADER_VEC4, and Graphics::Shader::ShaderObject::variablesCombined.

Referenced by setVariableExternal(), and ~ShaderSurface().

Here is the caller graph for this function:

◆ genSurfaceVar()

void * Graphics::Shader::ShaderSurface::genSurfaceVar ( uint32  index)
private

Definition at line 210 of file shadersurface.cpp.

References _variableData, _vertShader, Graphics::Shader::SHADER_FLOAT, Graphics::Shader::SHADER_INT, Graphics::Shader::SHADER_ISAMPLER1D, Graphics::Shader::SHADER_ISAMPLER1DARRAY, Graphics::Shader::SHADER_ISAMPLER2D, Graphics::Shader::SHADER_ISAMPLER2DARRAY, Graphics::Shader::SHADER_ISAMPLER3D, Graphics::Shader::SHADER_ISAMPLERCUBE, Graphics::Shader::SHADER_IVEC2, Graphics::Shader::SHADER_IVEC3, Graphics::Shader::SHADER_IVEC4, Graphics::Shader::SHADER_MAT2, Graphics::Shader::SHADER_MAT3, Graphics::Shader::SHADER_MAT4, Graphics::Shader::SHADER_SAMPLER1D, Graphics::Shader::SHADER_SAMPLER1DARRAY, Graphics::Shader::SHADER_SAMPLER1DARRAYSHADOW, Graphics::Shader::SHADER_SAMPLER1DSHADOW, Graphics::Shader::SHADER_SAMPLER2D, Graphics::Shader::SHADER_SAMPLER2DARRAY, Graphics::Shader::SHADER_SAMPLER2DARRAYSHADOW, Graphics::Shader::SHADER_SAMPLER2DSHADOW, Graphics::Shader::SHADER_SAMPLER3D, Graphics::Shader::SHADER_SAMPLERBUFFER, Graphics::Shader::SHADER_SAMPLERCUBE, SHADER_SURFACE_VARIABLE_OWNED, Graphics::Shader::SHADER_UNIFORM_BUFFER, Graphics::Shader::SHADER_USAMPLER1D, Graphics::Shader::SHADER_USAMPLER1DARRAY, Graphics::Shader::SHADER_USAMPLER2D, Graphics::Shader::SHADER_USAMPLER2DARRAY, Graphics::Shader::SHADER_USAMPLER3D, Graphics::Shader::SHADER_USAMPLERCUBE, Graphics::Shader::SHADER_VEC2, Graphics::Shader::SHADER_VEC3, Graphics::Shader::SHADER_VEC4, and Graphics::Shader::ShaderObject::variablesCombined.

Referenced by setVariableInternal(), and ShaderSurface().

Here is the caller graph for this function:

◆ getFlags()

uint32 Graphics::Shader::ShaderSurface::getFlags ( ) const

Definition at line 71 of file shadersurface.cpp.

References _flags.

◆ getName()

const Common::UString & Graphics::Shader::ShaderSurface::getName ( ) const

Definition at line 63 of file shadersurface.cpp.

References _name.

Referenced by Graphics::Shader::SurfaceManager::addSurface(), Graphics::Shader::SurfaceManager::delSurface(), and Graphics::Shader::SurfaceManager::SurfaceManager().

Here is the caller graph for this function:

◆ getVariableCount()

uint32 Graphics::Shader::ShaderSurface::getVariableCount ( ) const

◆ getVariableData() [1/2]

void * Graphics::Shader::ShaderSurface::getVariableData ( uint32  index) const

Definition at line 88 of file shadersurface.cpp.

References _variableData.

◆ getVariableData() [2/2]

void * Graphics::Shader::ShaderSurface::getVariableData ( const Common::UString name) const

◆ getVariableFlags()

uint32 Graphics::Shader::ShaderSurface::getVariableFlags ( uint32  index) const

Definition at line 109 of file shadersurface.cpp.

References _variableData.

◆ getVariableName()

const Common::UString & Graphics::Shader::ShaderSurface::getVariableName ( uint32  index) const

◆ getVariableType()

Shader::ShaderVariableType Graphics::Shader::ShaderSurface::getVariableType ( uint32  index) const

◆ getVertexShader()

Shader::ShaderObject * Graphics::Shader::ShaderSurface::getVertexShader ( ) const

Definition at line 67 of file shadersurface.cpp.

References _vertShader.

Referenced by Graphics::Shader::ShaderRenderable::updateProgram().

Here is the caller graph for this function:

◆ isVariableOwned() [1/2]

bool Graphics::Shader::ShaderSurface::isVariableOwned ( uint32  index) const

Definition at line 141 of file shadersurface.cpp.

References _variableData, and SHADER_SURFACE_VARIABLE_OWNED.

◆ isVariableOwned() [2/2]

bool Graphics::Shader::ShaderSurface::isVariableOwned ( const Common::UString name) const

◆ restoreGLState()

void Graphics::Shader::ShaderSurface::restoreGLState ( )

Definition at line 207 of file shadersurface.cpp.

◆ setFlags()

void Graphics::Shader::ShaderSurface::setFlags ( uint32  flags)

Definition at line 75 of file shadersurface.cpp.

References _flags.

◆ setVariableExternal() [1/2]

void Graphics::Shader::ShaderSurface::setVariableExternal ( uint32  index,
void *  loc 
)

Definition at line 113 of file shadersurface.cpp.

References _variableData, and delSurfaceVar().

Referenced by ShaderSurface().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setVariableExternal() [2/2]

void Graphics::Shader::ShaderSurface::setVariableExternal ( const Common::UString name,
void *  loc 
)

Definition at line 118 of file shadersurface.cpp.

References _variableData, _vertShader, delSurfaceVar(), and Graphics::Shader::ShaderObject::variablesCombined.

Here is the call graph for this function:

◆ setVariableInternal() [1/2]

void Graphics::Shader::ShaderSurface::setVariableInternal ( uint32  index)

Definition at line 128 of file shadersurface.cpp.

References genSurfaceVar().

Here is the call graph for this function:

◆ setVariableInternal() [2/2]

void Graphics::Shader::ShaderSurface::setVariableInternal ( const Common::UString name)

Definition at line 132 of file shadersurface.cpp.

References _variableData, _vertShader, genSurfaceVar(), and Graphics::Shader::ShaderObject::variablesCombined.

Here is the call graph for this function:

◆ unbindGLState()

void Graphics::Shader::ShaderSurface::unbindGLState ( )

◆ useCount()

uint32 Graphics::Shader::ShaderSurface::useCount ( ) const

Definition at line 338 of file shadersurface.cpp.

References _usageCount.

Referenced by Graphics::Shader::SurfaceManager::cleanup().

Here is the caller graph for this function:

◆ useDecrement()

void Graphics::Shader::ShaderSurface::useDecrement ( )

Definition at line 332 of file shadersurface.cpp.

References _usageCount.

Referenced by Graphics::Shader::ShaderRenderable::setSurface(), and Graphics::Shader::ShaderRenderable::~ShaderRenderable().

Here is the caller graph for this function:

◆ useIncrement()

void Graphics::Shader::ShaderSurface::useIncrement ( )

Definition at line 328 of file shadersurface.cpp.

References _usageCount.

Referenced by Graphics::Shader::ShaderRenderable::setSurface(), and Graphics::Shader::ShaderRenderable::ShaderRenderable().

Here is the caller graph for this function:

Member Data Documentation

◆ _flags

uint32 Graphics::Shader::ShaderSurface::_flags
private

Definition at line 99 of file shadersurface.h.

Referenced by bindGLState(), getFlags(), setFlags(), and unbindGLState().

◆ _name

Common::UString Graphics::Shader::ShaderSurface::_name
private

Definition at line 101 of file shadersurface.h.

Referenced by getName().

◆ _objectModelviewIndex

uint32 Graphics::Shader::ShaderSurface::_objectModelviewIndex
private

Definition at line 104 of file shadersurface.h.

Referenced by bindObjectModelview(), bindProgram(), bindTextureView(), and ShaderSurface().

◆ _textureViewIndex

uint32 Graphics::Shader::ShaderSurface::_textureViewIndex
private

Definition at line 105 of file shadersurface.h.

Referenced by bindTextureView(), and ShaderSurface().

◆ _uboArray

std::vector<Shader::ShaderUBO> Graphics::Shader::ShaderSurface::_uboArray
private

Definition at line 97 of file shadersurface.h.

Referenced by addUBO(), and bindGLState().

◆ _usageCount

uint32 Graphics::Shader::ShaderSurface::_usageCount
private

Definition at line 102 of file shadersurface.h.

Referenced by useCount(), useDecrement(), and useIncrement().

◆ _variableData

std::vector<ShaderSurfaceVariable> Graphics::Shader::ShaderSurface::_variableData
private

◆ _vertShader

Shader::ShaderObject* Graphics::Shader::ShaderSurface::_vertShader
private

The documentation for this class was generated from the following files: