Dali 3D User Interface Engine
List of all members | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Private Member Functions | Private Attributes
Dali::Internal::Program Class Reference

#include <program.h>

Collaboration diagram for Dali::Internal::Program:
Collaboration graph
[legend]

Public Types

enum  AttribType { ATTRIB_UNKNOWN = -1, ATTRIB_POSITION, ATTRIB_TEXCOORD, ATTRIB_TYPE_LAST }
 Vertex attributes. More...
 
enum  UniformType {
  UNIFORM_NOT_QUERIED = -2, UNIFORM_UNKNOWN = -1, UNIFORM_MVP_MATRIX, UNIFORM_MODELVIEW_MATRIX,
  UNIFORM_PROJECTION_MATRIX, UNIFORM_MODEL_MATRIX, UNIFORM_VIEW_MATRIX, UNIFORM_NORMAL_MATRIX,
  UNIFORM_COLOR, UNIFORM_SAMPLER, UNIFORM_SAMPLER_RECT, UNIFORM_EFFECT_SAMPLER,
  UNIFORM_SIZE, UNIFORM_TYPE_LAST
}
 Common shader uniform names. More...
 

Public Member Functions

void Use ()
 Takes this program into use. More...
 
bool IsUsed ()
 
GLint GetAttribLocation (AttribType type)
 
unsigned int RegisterCustomAttribute (const std::string &name)
 Register an attribute name in our local cache. More...
 
GLint GetCustomAttributeLocation (unsigned int attributeIndex)
 Gets the location of a pre-registered attribute. More...
 
unsigned int RegisterUniform (const std::string &name)
 Register a uniform name in our local cache. More...
 
GLint GetUniformLocation (unsigned int uniformIndex)
 Gets the location of a pre-registered uniform. More...
 
GLint GetSamplerUniformLocation (int32_t uniqueIndex, const std::string &samplerName)
 Gets the uniform location for a sampler. More...
 
void SetUniform1i (GLint location, GLint value0)
 Sets the uniform value. More...
 
void SetUniform4i (GLint location, GLint value0, GLint value1, GLint value2, GLint value3)
 Sets the uniform value. More...
 
void SetUniform1f (GLint location, GLfloat value0)
 Sets the uniform value. More...
 
void SetUniform2f (GLint location, GLfloat value0, GLfloat value1)
 Sets the uniform value. More...
 
void SetSizeUniform3f (GLint location, GLfloat value0, GLfloat value1, GLfloat value2)
 Special handling for size as we're using uniform geometry so size is passed on to most programs but it rarely changes so we can cache it. More...
 
void SetUniform3f (GLint location, GLfloat value0, GLfloat value1, GLfloat value2)
 Sets the uniform value. More...
 
void SetUniform4f (GLint location, GLfloat value0, GLfloat value1, GLfloat value2, GLfloat value3)
 Sets the uniform value. More...
 
void SetUniformMatrix4fv (GLint location, GLsizei count, const GLfloat *value)
 Sets the uniform value as matrix. More...
 
void SetUniformMatrix3fv (GLint location, GLsizei count, const GLfloat *value)
 Sets the uniform value as matrix. More...
 
void GlContextCreated ()
 Needs to be called when GL context is (re)created. More...
 
void GlContextDestroyed ()
 Needs to be called when GL context is destroyed. More...
 
bool ModifiesGeometry ()
 
void SetProjectionMatrix (const Matrix *matrix)
 Set the projection matrix that has currently been sent. More...
 
const MatrixGetProjectionMatrix ()
 Get the projection matrix that has currently been sent. More...
 
void SetViewMatrix (const Matrix *matrix)
 Set the projection matrix that has currently been sent. More...
 
const MatrixGetViewMatrix ()
 Get the projection matrix that has currently been sent. More...
 
 ~Program ()
 Destructor, non virtual as no virtual methods or inheritance. More...
 

Static Public Member Functions

static ProgramNew (ProgramCache &cache, Internal::ShaderDataPtr shaderData, bool modifiesGeometry)
 Creates a new program, or returns a copy of an existing program in the program cache. More...
 

Static Public Attributes

static const int MAX_UNIFORM_CACHE_SIZE = 16
 Size of the uniform cache per program GLES specification states that minimum uniform count for fragment shader is 16 and for vertex shader 128. More...
 
static const int NOT_FOUND = -1
 Constant for uniform / attribute not found. More...
 

Private Member Functions

 Program (ProgramCache &cache, Internal::ShaderDataPtr shaderData, bool modifiesGeometry)
 Constructor, private so no direct instantiation. More...
 
 Program ()
 
Programoperator= (const Program &)
 
void Load ()
 Load the shader, from a precompiled binary if available, else from source code. More...
 
void Unload ()
 Unload the shader. More...
 
bool CompileShader (GLenum shaderType, GLuint &shaderId, const char *src)
 Compile the shader. More...
 
void Link ()
 Links the shaders together to create program. More...
 
void FreeShaders ()
 Frees the shader programs. More...
 
void ResetAttribsUniformCache ()
 Resets caches. More...
 

Private Attributes

ProgramCachemCache
 The program cache. More...
 
Integration::GlAbstractionmGlAbstraction
 The OpenGL Abstraction layer. More...
 
const MatrixmProjectionMatrix
 currently set projection matrix More...
 
const MatrixmViewMatrix
 currently set view matrix More...
 
bool mLinked
 whether the program is linked More...
 
GLuint mVertexShaderId
 GL identifier for vertex shader. More...
 
GLuint mFragmentShaderId
 GL identifier for fragment shader. More...
 
GLuint mProgramId
 GL identifier for program. More...
 
Internal::ShaderDataPtr mProgramData
 Shader program source and binary (when compiled & linked or loaded) More...
 
std::vector< std::pair
< std::string, GLint > > 
mAttributeLocations
 attribute location cache More...
 
std::vector< std::pair
< std::string, GLint > > 
mUniformLocations
 uniform location cache More...
 
Dali::Vector< GLintmSamplerUniformLocations
 sampler uniform location cache More...
 
GLint mUniformCacheInt [MAX_UNIFORM_CACHE_SIZE]
 Value cache for uniforms of single int. More...
 
GLfloat mUniformCacheFloat [MAX_UNIFORM_CACHE_SIZE]
 Value cache for uniforms of single float. More...
 
GLfloat mUniformCacheFloat2 [MAX_UNIFORM_CACHE_SIZE][2]
 Value cache for uniforms of two floats. More...
 
GLfloat mUniformCacheFloat4 [MAX_UNIFORM_CACHE_SIZE][4]
 Value cache for uniforms of four floats. More...
 
Vector3 mSizeUniformCache
 Cache value for size uniform. More...
 
bool mModifiesGeometry
 True if the program changes geometry. More...
 

Detailed Description

Definition at line 54 of file program.h.

Member Enumeration Documentation

Vertex attributes.

Enumerator
ATTRIB_UNKNOWN 
ATTRIB_POSITION 
ATTRIB_TEXCOORD 
ATTRIB_TYPE_LAST 

Definition at line 73 of file program.h.

Common shader uniform names.

Enumerator
UNIFORM_NOT_QUERIED 
UNIFORM_UNKNOWN 
UNIFORM_MVP_MATRIX 
UNIFORM_MODELVIEW_MATRIX 
UNIFORM_PROJECTION_MATRIX 
UNIFORM_MODEL_MATRIX 
UNIFORM_VIEW_MATRIX 
UNIFORM_NORMAL_MATRIX 
UNIFORM_COLOR 
UNIFORM_SAMPLER 
UNIFORM_SAMPLER_RECT 
UNIFORM_EFFECT_SAMPLER 
UNIFORM_SIZE 
UNIFORM_TYPE_LAST 

Definition at line 84 of file program.h.

Constructor & Destructor Documentation

Dali::Internal::Program::Program ( ProgramCache cache,
Internal::ShaderDataPtr  shaderData,
bool  modifiesGeometry 
)
private

Constructor, private so no direct instantiation.

Parameters
[in]cachewhere the programs are stored
[in]shaderDataA smart pointer to a data structure containing the program source and binary
[in]modifiesGeometryTrue if the vertex shader changes geometry

Definition at line 498 of file program.cpp.

References ATTRIB_TYPE_LAST, Dali::Internal::anonymous_namespace{program.cpp}::gStdAttribs, Dali::Internal::anonymous_namespace{program.cpp}::gStdUniforms, mAttributeLocations, mUniformLocations, RegisterCustomAttribute(), RegisterUniform(), ResetAttribsUniformCache(), and UNIFORM_TYPE_LAST.

Here is the call graph for this function:

Dali::Internal::Program::~Program ( )

Destructor, non virtual as no virtual methods or inheritance.

Definition at line 529 of file program.cpp.

References Unload().

Here is the call graph for this function:

Dali::Internal::Program::Program ( )
private

Referenced by New().

Here is the caller graph for this function:

Member Function Documentation

bool Dali::Internal::Program::CompileShader ( GLenum  shaderType,
GLuint shaderId,
const char *  src 
)
private
void Dali::Internal::Program::FreeShaders ( )
private

Frees the shader programs.

Definition at line 711 of file program.cpp.

References CHECK_GL, Dali::Integration::GlAbstraction::DeleteShader(), Dali::Integration::GlAbstraction::DetachShader(), LOG_GL, mFragmentShaderId, mGlAbstraction, mProgramId, and mVertexShaderId.

Referenced by Load(), and Unload().

Here is the call graph for this function:

Here is the caller graph for this function:

GLint Dali::Internal::Program::GetAttribLocation ( AttribType  type)
Parameters
[in]typeof the attribute
Returns
the index of the attribute

Definition at line 145 of file program.cpp.

References ATTRIB_UNKNOWN, DALI_ASSERT_DEBUG, and GetCustomAttributeLocation().

Here is the call graph for this function:

GLint Dali::Internal::Program::GetCustomAttributeLocation ( unsigned int  attributeIndex)

Gets the location of a pre-registered attribute.

Parameters
[in]attributeIndexof the attribute in local cache
Returns
the index of the attribute in the GL program

Definition at line 169 of file program.cpp.

References ATTRIB_UNKNOWN, CHECK_GL, DALI_ASSERT_DEBUG, Dali::Integration::GlAbstraction::GetAttribLocation(), LOG_GL, mAttributeLocations, mGlAbstraction, and mProgramId.

Referenced by GetAttribLocation(), and Dali::Internal::SceneGraph::RenderGeometry::GetAttributeLocationFromProgram().

Here is the call graph for this function:

Here is the caller graph for this function:

const Matrix* Dali::Internal::Program::GetProjectionMatrix ( )
inline

Get the projection matrix that has currently been sent.

Returns
the matrix that is set

Definition at line 273 of file program.h.

References mProjectionMatrix.

Referenced by Dali::Internal::anonymous_namespace{render-renderer.cpp}::SetMatrices().

Here is the caller graph for this function:

GLint Dali::Internal::Program::GetSamplerUniformLocation ( int32_t  uniqueIndex,
const std::string &  samplerName 
)

Gets the uniform location for a sampler.

Parameters
[in]uniqueIndexof the sampler uniform in local cache
Returns
the index of the uniform in the GL program

Definition at line 225 of file program.cpp.

References CHECK_GL, DALI_ASSERT_DEBUG, Dali::Integration::GlAbstraction::GetUniformLocation(), mGlAbstraction, mProgramId, mSamplerUniformLocations, Dali::Vector< T, IsTrivialType >::Resize(), Dali::VectorBase::Size(), and UNIFORM_NOT_QUERIED.

Referenced by Dali::Internal::Render::Renderer::BindTextures().

Here is the call graph for this function:

Here is the caller graph for this function:

GLint Dali::Internal::Program::GetUniformLocation ( unsigned int  uniformIndex)

Gets the location of a pre-registered uniform.

Uniforms in list UniformType are always registered and in the order of the enumeration

Parameters
[in]uniformIndexof the uniform in local cache
Returns
the index of the uniform in the GL program

Definition at line 206 of file program.cpp.

References CHECK_GL, DALI_ASSERT_DEBUG, Dali::Integration::GlAbstraction::GetUniformLocation(), LOG_GL, mGlAbstraction, mProgramId, mUniformLocations, and UNIFORM_NOT_QUERIED.

Referenced by Dali::Internal::CustomUniform::GetUniformLocation(), Dali::Internal::Render::Renderer::Render(), Dali::Internal::anonymous_namespace{render-renderer.cpp}::SetMatrices(), Dali::Internal::Render::Renderer::SetUniformFromProperty(), Dali::Internal::Render::Renderer::SetUniforms(), and Dali::Internal::SceneGraph::Shader::SetUniforms().

Here is the call graph for this function:

Here is the caller graph for this function:

const Matrix* Dali::Internal::Program::GetViewMatrix ( )
inline

Get the projection matrix that has currently been sent.

Returns
the matrix that is set

Definition at line 291 of file program.h.

References mViewMatrix.

Referenced by Dali::Internal::anonymous_namespace{render-renderer.cpp}::SetMatrices().

Here is the caller graph for this function:

void Dali::Internal::Program::GlContextCreated ( )

Needs to be called when GL context is (re)created.

Definition at line 479 of file program.cpp.

void Dali::Internal::Program::GlContextDestroyed ( )

Needs to be called when GL context is destroyed.

Definition at line 483 of file program.cpp.

References mFragmentShaderId, mLinked, mProgramId, mVertexShaderId, and ResetAttribsUniformCache().

Here is the call graph for this function:

bool Dali::Internal::Program::IsUsed ( )
Returns
true if this program is used currently

Definition at line 140 of file program.cpp.

References Dali::Internal::ProgramCache::GetCurrentProgram(), and mCache.

Referenced by SetUniform1f(), SetUniform1i(), SetUniform2f(), SetUniform3f(), SetUniform4f(), SetUniform4i(), SetUniformMatrix3fv(), and SetUniformMatrix4fv().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::Program::Link ( )
private
void Dali::Internal::Program::Load ( )
private
bool Dali::Internal::Program::ModifiesGeometry ( )
Returns
true if this program modifies geometry

Definition at line 493 of file program.cpp.

References mModifiesGeometry.

Program * Dali::Internal::Program::New ( ProgramCache cache,
Internal::ShaderDataPtr  shaderData,
bool  modifiesGeometry 
)
static

Creates a new program, or returns a copy of an existing program in the program cache.

Parameters
[in]cachewhere the programs are stored
[in]shaderDataA pointer to a data structure containing the program source and optionally precompiled binary. If the binary is empty the program bytecode is copied into it after compilation and linking)
[in]modifiesGeometryTrue if the shader modifies geometry
Returns
pointer to the program

Definition at line 104 of file program.cpp.

References Dali::Internal::ProgramCache::AddProgram(), Dali::Internal::ProgramCache::GetProgram(), and Program().

Referenced by Dali::Internal::SceneGraph::Shader::SetProgram().

Here is the call graph for this function:

Here is the caller graph for this function:

Program& Dali::Internal::Program::operator= ( const Program )
private
unsigned int Dali::Internal::Program::RegisterCustomAttribute ( const std::string &  name)

Register an attribute name in our local cache.

Parameters
[in]nameattribute name
Returns
the index of the attribute name in local cache

Definition at line 152 of file program.cpp.

References ATTRIB_UNKNOWN, and mAttributeLocations.

Referenced by Dali::Internal::SceneGraph::RenderGeometry::GetAttributeLocationFromProgram(), and Program().

Here is the caller graph for this function:

unsigned int Dali::Internal::Program::RegisterUniform ( const std::string &  name)

Register a uniform name in our local cache.

Parameters
[in]nameuniform name
Returns
the index of the uniform name in local cache

Definition at line 189 of file program.cpp.

References mUniformLocations, and UNIFORM_NOT_QUERIED.

Referenced by Dali::Internal::CustomUniform::Initialize(), Program(), Dali::Internal::Render::Renderer::SetUniforms(), and Dali::Internal::SceneGraph::Shader::SetUniforms().

Here is the caller graph for this function:

void Dali::Internal::Program::ResetAttribsUniformCache ( )
private
void Dali::Internal::Program::SetProjectionMatrix ( const Matrix matrix)
inline

Set the projection matrix that has currently been sent.

Parameters
matrixto set

Definition at line 264 of file program.h.

References mProjectionMatrix.

Referenced by Dali::Internal::ProgramController::ResetProgramMatrices(), and Dali::Internal::anonymous_namespace{render-renderer.cpp}::SetMatrices().

Here is the caller graph for this function:

void Dali::Internal::Program::SetSizeUniform3f ( GLint  location,
GLfloat  value0,
GLfloat  value1,
GLfloat  value2 
)

Special handling for size as we're using uniform geometry so size is passed on to most programs but it rarely changes so we can cache it.

Parameters
[in]locationof uniform
[in]value0as float
[in]value1as float
[in]value2as float

Definition at line 370 of file program.cpp.

References Dali::Math::MACHINE_EPSILON_1, mSizeUniformCache, SetUniform3f(), Dali::anonymous_namespace{compile-time-math.cpp}::value0, Dali::anonymous_namespace{compile-time-math.cpp}::value1, Dali::anonymous_namespace{compile-time-math.cpp}::value2, Dali::Vector3::x, Dali::Vector3::y, and Dali::Vector3::z.

Referenced by Dali::Internal::Render::Renderer::SetUniforms().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::Program::SetUniform1f ( GLint  location,
GLfloat  value0 
)

Sets the uniform value.

Parameters
[in]locationof uniform
[in]value0as float

Definition at line 300 of file program.cpp.

References CHECK_GL, DALI_ASSERT_DEBUG, IsUsed(), LOG_GL, Dali::Math::MACHINE_EPSILON_1, MAX_UNIFORM_CACHE_SIZE, mGlAbstraction, mUniformCacheFloat, Dali::Integration::GlAbstraction::Uniform1f(), UNIFORM_UNKNOWN, and Dali::anonymous_namespace{compile-time-math.cpp}::value0.

Referenced by Dali::Internal::Render::Renderer::SetUniformFromProperty(), and Dali::Internal::SceneGraph::Shader::SetUniforms().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::Program::SetUniform1i ( GLint  location,
GLint  value0 
)

Sets the uniform value.

Parameters
[in]locationof uniform
[in]value0as int

Definition at line 250 of file program.cpp.

References CHECK_GL, DALI_ASSERT_DEBUG, IsUsed(), LOG_GL, MAX_UNIFORM_CACHE_SIZE, mGlAbstraction, mUniformCacheInt, Dali::Integration::GlAbstraction::Uniform1i(), UNIFORM_UNKNOWN, and Dali::anonymous_namespace{compile-time-math.cpp}::value0.

Referenced by Dali::Internal::Render::Renderer::BindTextures(), Dali::Internal::Render::Renderer::SetUniformFromProperty(), and Dali::Internal::SceneGraph::Shader::SetUniforms().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::Program::SetUniform2f ( GLint  location,
GLfloat  value0,
GLfloat  value1 
)
void Dali::Internal::Program::SetUniform3f ( GLint  location,
GLfloat  value0,
GLfloat  value1,
GLfloat  value2 
)

Sets the uniform value.

Parameters
[in]locationof uniform
[in]value0as float
[in]value1as float
[in]value2as float

Definition at line 383 of file program.cpp.

References CHECK_GL, DALI_ASSERT_DEBUG, IsUsed(), LOG_GL, mGlAbstraction, Dali::Integration::GlAbstraction::Uniform3f(), and UNIFORM_UNKNOWN.

Referenced by SetSizeUniform3f(), Dali::Internal::Render::Renderer::SetUniformFromProperty(), and Dali::Internal::SceneGraph::Shader::SetUniforms().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::Program::SetUniform4f ( GLint  location,
GLfloat  value0,
GLfloat  value1,
GLfloat  value2,
GLfloat  value3 
)
void Dali::Internal::Program::SetUniform4i ( GLint  location,
GLint  value0,
GLint  value1,
GLint  value2,
GLint  value3 
)

Sets the uniform value.

Parameters
[in]locationof uniform
[in]value0as int
[in]value1as int
[in]value2as int
[in]value3as int

Definition at line 283 of file program.cpp.

References CHECK_GL, DALI_ASSERT_DEBUG, IsUsed(), LOG_GL, mGlAbstraction, Dali::Integration::GlAbstraction::Uniform4i(), and UNIFORM_UNKNOWN.

Here is the call graph for this function:

void Dali::Internal::Program::SetUniformMatrix3fv ( GLint  location,
GLsizei  count,
const GLfloat value 
)

Sets the uniform value as matrix.

NOTE! we never want GPU to transpose so make sure your matrix is in correct order for GL.

Parameters
[in]locationLocation of uniform
[in]countCount of matrices
[in]valuevalues as float pointers

Definition at line 459 of file program.cpp.

References CHECK_GL, DALI_ASSERT_DEBUG, GL_FALSE, IsUsed(), LOG_GL, mGlAbstraction, UNIFORM_UNKNOWN, and Dali::Integration::GlAbstraction::UniformMatrix3fv().

Referenced by Dali::Internal::anonymous_namespace{render-renderer.cpp}::SetMatrices(), Dali::Internal::Render::Renderer::SetUniformFromProperty(), and Dali::Internal::SceneGraph::Shader::SetUniforms().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::Program::SetUniformMatrix4fv ( GLint  location,
GLsizei  count,
const GLfloat value 
)

Sets the uniform value as matrix.

NOTE! we never want GPU to transpose so make sure your matrix is in correct order for GL.

Parameters
[in]locationLocation of uniform
[in]countCount of matrices
[in]valuevalues as float pointers

Definition at line 440 of file program.cpp.

References CHECK_GL, DALI_ASSERT_DEBUG, GL_FALSE, IsUsed(), LOG_GL, mGlAbstraction, UNIFORM_UNKNOWN, and Dali::Integration::GlAbstraction::UniformMatrix4fv().

Referenced by Dali::Internal::anonymous_namespace{render-renderer.cpp}::SetMatrices(), Dali::Internal::Render::Renderer::SetUniformFromProperty(), and Dali::Internal::SceneGraph::Shader::SetUniforms().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::Program::SetViewMatrix ( const Matrix matrix)
inline

Set the projection matrix that has currently been sent.

Parameters
matrixto set

Definition at line 282 of file program.h.

References mViewMatrix.

Referenced by Dali::Internal::ProgramController::ResetProgramMatrices(), and Dali::Internal::anonymous_namespace{render-renderer.cpp}::SetMatrices().

Here is the caller graph for this function:

void Dali::Internal::Program::Unload ( )
private

Unload the shader.

Definition at line 619 of file program.cpp.

References CHECK_GL, Dali::Integration::GlAbstraction::DeleteProgram(), FreeShaders(), Dali::Internal::ProgramCache::GetCurrentProgram(), LOG_GL, mCache, mGlAbstraction, mLinked, mProgramId, Dali::Internal::ProgramCache::SetCurrentProgram(), and Dali::Integration::GlAbstraction::UseProgram().

Referenced by ~Program().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::Program::Use ( )

Takes this program into use.

Definition at line 121 of file program.cpp.

References CHECK_GL, Dali::Internal::ProgramCache::GetCurrentProgram(), Load(), LOG_GL, mCache, mGlAbstraction, mLinked, mProgramId, Dali::Internal::ProgramCache::SetCurrentProgram(), and Dali::Integration::GlAbstraction::UseProgram().

Referenced by Dali::Internal::Render::Renderer::Render().

Here is the call graph for this function:

Here is the caller graph for this function:

Member Data Documentation

std::vector< std::pair< std::string, GLint > > Dali::Internal::Program::mAttributeLocations
private

attribute location cache

Definition at line 367 of file program.h.

Referenced by GetCustomAttributeLocation(), Program(), RegisterCustomAttribute(), and ResetAttribsUniformCache().

const int Dali::Internal::Program::MAX_UNIFORM_CACHE_SIZE = 16
static

Size of the uniform cache per program GLES specification states that minimum uniform count for fragment shader is 16 and for vertex shader 128.

We're caching the 16 common ones for now

Definition at line 63 of file program.h.

Referenced by ResetAttribsUniformCache(), SetUniform1f(), SetUniform1i(), SetUniform2f(), and SetUniform4f().

ProgramCache& Dali::Internal::Program::mCache
private

The program cache.

Definition at line 356 of file program.h.

Referenced by IsUsed(), Load(), Unload(), and Use().

GLuint Dali::Internal::Program::mFragmentShaderId
private

GL identifier for fragment shader.

Definition at line 362 of file program.h.

Referenced by FreeShaders(), GlContextDestroyed(), and Load().

Integration::GlAbstraction& Dali::Internal::Program::mGlAbstraction
private
bool Dali::Internal::Program::mLinked
private

whether the program is linked

Definition at line 360 of file program.h.

Referenced by GlContextDestroyed(), Link(), Load(), Unload(), and Use().

bool Dali::Internal::Program::mModifiesGeometry
private

True if the program changes geometry.

Definition at line 377 of file program.h.

Referenced by ModifiesGeometry().

Internal::ShaderDataPtr Dali::Internal::Program::mProgramData
private

Shader program source and binary (when compiled & linked or loaded)

Definition at line 364 of file program.h.

Referenced by Load().

GLuint Dali::Internal::Program::mProgramId
private
const Matrix* Dali::Internal::Program::mProjectionMatrix
private

currently set projection matrix

Definition at line 358 of file program.h.

Referenced by GetProjectionMatrix(), and SetProjectionMatrix().

Dali::Vector< GLint > Dali::Internal::Program::mSamplerUniformLocations
private

sampler uniform location cache

Definition at line 369 of file program.h.

Referenced by GetSamplerUniformLocation(), and ResetAttribsUniformCache().

Vector3 Dali::Internal::Program::mSizeUniformCache
private

Cache value for size uniform.

Definition at line 376 of file program.h.

Referenced by ResetAttribsUniformCache(), and SetSizeUniform3f().

GLfloat Dali::Internal::Program::mUniformCacheFloat[MAX_UNIFORM_CACHE_SIZE]
private

Value cache for uniforms of single float.

Definition at line 373 of file program.h.

Referenced by ResetAttribsUniformCache(), and SetUniform1f().

GLfloat Dali::Internal::Program::mUniformCacheFloat2[MAX_UNIFORM_CACHE_SIZE][2]
private

Value cache for uniforms of two floats.

Definition at line 374 of file program.h.

Referenced by ResetAttribsUniformCache(), and SetUniform2f().

GLfloat Dali::Internal::Program::mUniformCacheFloat4[MAX_UNIFORM_CACHE_SIZE][4]
private

Value cache for uniforms of four floats.

Definition at line 375 of file program.h.

Referenced by ResetAttribsUniformCache(), and SetUniform4f().

GLint Dali::Internal::Program::mUniformCacheInt[MAX_UNIFORM_CACHE_SIZE]
private

Value cache for uniforms of single int.

Definition at line 372 of file program.h.

Referenced by ResetAttribsUniformCache(), and SetUniform1i().

std::vector< std::pair< std::string, GLint > > Dali::Internal::Program::mUniformLocations
private

uniform location cache

Definition at line 368 of file program.h.

Referenced by GetUniformLocation(), Program(), RegisterUniform(), and ResetAttribsUniformCache().

GLuint Dali::Internal::Program::mVertexShaderId
private

GL identifier for vertex shader.

Definition at line 361 of file program.h.

Referenced by FreeShaders(), GlContextDestroyed(), and Load().

const Matrix* Dali::Internal::Program::mViewMatrix
private

currently set view matrix

Definition at line 359 of file program.h.

Referenced by GetViewMatrix(), and SetViewMatrix().

const int Dali::Internal::Program::NOT_FOUND = -1
static

Constant for uniform / attribute not found.

Definition at line 68 of file program.h.


The documentation for this class was generated from the following files:
Dali Docs Home
Read more about Dali