xoreos
0.0.5
|
#include <shadersurface.h>
Classes | |
struct | ShaderSurfaceVariable |
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 |
Definition at line 40 of file shadersurface.h.
Graphics::Shader::ShaderSurface::ShaderSurface | ( | Shader::ShaderObject * | vertShader, |
const Common::UString & | name = "unnamed" |
||
) |
Definition at line 35 of file shadersurface.cpp.
References _objectModelviewIndex, _textureViewIndex, _variableData, genSurfaceVar(), GfxMan, setVariableExternal(), Graphics::Shader::ShaderObject::usageCount, and Graphics::Shader::ShaderObject::variablesCombined.
Graphics::Shader::ShaderSurface::~ShaderSurface | ( | ) |
Definition at line 56 of file shadersurface.cpp.
References _variableData, and delSurfaceVar().
void Graphics::Shader::ShaderSurface::addUBO | ( | uint32 | index, |
GLuint | glid | ||
) |
Definition at line 157 of file shadersurface.cpp.
References _uboArray.
void Graphics::Shader::ShaderSurface::bindGLState | ( | ) |
Definition at line 189 of file shadersurface.cpp.
References _flags, _uboArray, and SHADER_SURFACE_NOCULL.
Referenced by Graphics::Render::RenderQueue::render(), Graphics::Aurora::ABCFont::renderBind(), Graphics::Aurora::TextureFont::renderBind(), and Graphics::Shader::ShaderRenderable::renderImmediate().
void Graphics::Shader::ShaderSurface::bindObjectModelview | ( | Shader::ShaderProgram * | program, |
const glm::mat4 * | t | ||
) |
Definition at line 177 of file shadersurface.cpp.
References _objectModelviewIndex, ShaderMan, Graphics::Shader::ShaderObject::variablesCombined, Graphics::Shader::ShaderProgram::vertexObject, and Graphics::Shader::ShaderProgram::vertexVariableLocations.
Referenced by Graphics::Render::RenderQueue::render().
void Graphics::Shader::ShaderSurface::bindProgram | ( | Shader::ShaderProgram * | program | ) |
Definition at line 161 of file shadersurface.cpp.
References _variableData, ShaderMan, Graphics::Shader::ShaderObject::variablesCombined, Graphics::Shader::ShaderProgram::vertexObject, and Graphics::Shader::ShaderProgram::vertexVariableLocations.
Referenced by Graphics::Render::RenderQueue::render(), Graphics::Aurora::ABCFont::renderBind(), Graphics::Aurora::TextureFont::renderBind(), and Graphics::Shader::ShaderRenderable::renderImmediate().
void Graphics::Shader::ShaderSurface::bindProgram | ( | Shader::ShaderProgram * | program, |
const glm::mat4 * | t | ||
) |
Definition at line 167 of file shadersurface.cpp.
References _objectModelviewIndex, _variableData, ShaderMan, Graphics::Shader::ShaderObject::variablesCombined, Graphics::Shader::ShaderProgram::vertexObject, and Graphics::Shader::ShaderProgram::vertexVariableLocations.
void Graphics::Shader::ShaderSurface::bindTextureView | ( | Shader::ShaderProgram * | program, |
const glm::mat4 * | t | ||
) |
Definition at line 183 of file shadersurface.cpp.
References _objectModelviewIndex, _textureViewIndex, ShaderMan, Graphics::Shader::ShaderObject::variablesCombined, Graphics::Shader::ShaderProgram::vertexObject, and Graphics::Shader::ShaderProgram::vertexVariableLocations.
|
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().
|
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().
uint32 Graphics::Shader::ShaderSurface::getFlags | ( | ) | const |
Definition at line 71 of file shadersurface.cpp.
References _flags.
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().
uint32 Graphics::Shader::ShaderSurface::getVariableCount | ( | ) | const |
Definition at line 79 of file shadersurface.cpp.
References _vertShader, and Graphics::Shader::ShaderObject::variablesCombined.
void * Graphics::Shader::ShaderSurface::getVariableData | ( | uint32 | index | ) | const |
Definition at line 88 of file shadersurface.cpp.
References _variableData.
void * Graphics::Shader::ShaderSurface::getVariableData | ( | const Common::UString & | name | ) | const |
Definition at line 92 of file shadersurface.cpp.
References _variableData, _vertShader, and Graphics::Shader::ShaderObject::variablesCombined.
Definition at line 109 of file shadersurface.cpp.
References _variableData.
const Common::UString & Graphics::Shader::ShaderSurface::getVariableName | ( | uint32 | index | ) | const |
Definition at line 105 of file shadersurface.cpp.
References _vertShader, and Graphics::Shader::ShaderObject::variablesCombined.
Shader::ShaderVariableType Graphics::Shader::ShaderSurface::getVariableType | ( | uint32 | index | ) | const |
Definition at line 84 of file shadersurface.cpp.
References _vertShader, and Graphics::Shader::ShaderObject::variablesCombined.
Shader::ShaderObject * Graphics::Shader::ShaderSurface::getVertexShader | ( | ) | const |
Definition at line 67 of file shadersurface.cpp.
References _vertShader.
Referenced by Graphics::Shader::ShaderRenderable::updateProgram().
bool Graphics::Shader::ShaderSurface::isVariableOwned | ( | uint32 | index | ) | const |
Definition at line 141 of file shadersurface.cpp.
References _variableData, and SHADER_SURFACE_VARIABLE_OWNED.
bool Graphics::Shader::ShaderSurface::isVariableOwned | ( | const Common::UString & | name | ) | const |
Definition at line 145 of file shadersurface.cpp.
References _variableData, _vertShader, SHADER_SURFACE_VARIABLE_OWNED, and Graphics::Shader::ShaderObject::variablesCombined.
void Graphics::Shader::ShaderSurface::restoreGLState | ( | ) |
Definition at line 207 of file shadersurface.cpp.
void Graphics::Shader::ShaderSurface::setFlags | ( | uint32 | flags | ) |
Definition at line 75 of file shadersurface.cpp.
References _flags.
void Graphics::Shader::ShaderSurface::setVariableExternal | ( | uint32 | index, |
void * | loc | ||
) |
Definition at line 113 of file shadersurface.cpp.
References _variableData, and delSurfaceVar().
Referenced by ShaderSurface().
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.
void Graphics::Shader::ShaderSurface::setVariableInternal | ( | uint32 | index | ) |
Definition at line 128 of file shadersurface.cpp.
References genSurfaceVar().
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.
void Graphics::Shader::ShaderSurface::unbindGLState | ( | ) |
Definition at line 199 of file shadersurface.cpp.
References _flags, and SHADER_SURFACE_NOCULL.
Referenced by Graphics::Render::RenderQueue::render(), Graphics::Shader::ShaderRenderable::renderImmediate(), Graphics::Aurora::ABCFont::renderUnbind(), and Graphics::Aurora::TextureFont::renderUnbind().
uint32 Graphics::Shader::ShaderSurface::useCount | ( | ) | const |
Definition at line 338 of file shadersurface.cpp.
References _usageCount.
Referenced by Graphics::Shader::SurfaceManager::cleanup().
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().
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().
|
private |
Definition at line 99 of file shadersurface.h.
Referenced by bindGLState(), getFlags(), setFlags(), and unbindGLState().
|
private |
Definition at line 101 of file shadersurface.h.
Referenced by getName().
|
private |
Definition at line 104 of file shadersurface.h.
Referenced by bindObjectModelview(), bindProgram(), bindTextureView(), and ShaderSurface().
|
private |
Definition at line 105 of file shadersurface.h.
Referenced by bindTextureView(), and ShaderSurface().
|
private |
Definition at line 97 of file shadersurface.h.
Referenced by addUBO(), and bindGLState().
|
private |
Definition at line 102 of file shadersurface.h.
Referenced by useCount(), useDecrement(), and useIncrement().
|
private |
Definition at line 96 of file shadersurface.h.
Referenced by bindProgram(), delSurfaceVar(), genSurfaceVar(), getVariableData(), getVariableFlags(), isVariableOwned(), setVariableExternal(), setVariableInternal(), ShaderSurface(), and ~ShaderSurface().
|
private |
Definition at line 98 of file shadersurface.h.
Referenced by delSurfaceVar(), genSurfaceVar(), getVariableCount(), getVariableData(), getVariableName(), getVariableType(), getVertexShader(), isVariableOwned(), setVariableExternal(), and setVariableInternal().