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

This class is the owner of GL shader programs. More...

#include <program-controller.h>

Inheritance diagram for Dali::Internal::ProgramController:
Inheritance graph
[legend]
Collaboration diagram for Dali::Internal::ProgramController:
Collaboration graph
[legend]

Classes

class  ProgramPair
 Wrapper for a program and its hash code. More...
 

Public Member Functions

 ProgramController (Integration::GlAbstraction &glAbstraction)
 Constructor. More...
 
 ~ProgramController ()
 Destructor, non virtual as not a base class. More...
 
void ResetProgramMatrices ()
 Resets the program matrices. More...
 
void GlContextCreated ()
 Notifies the cache that context is (re)created. More...
 
void GlContextDestroyed ()
 Notifies cache that context is lost. More...
 
void SetShaderSaver (ShaderSaver &shaderSaver)
 Set the destination for compiler shader binaries so they can be saved. More...
 
- Public Member Functions inherited from Dali::Internal::ProgramCache
 ProgramCache ()
 Constructor. More...
 
virtual ~ProgramCache ()
 Destructor, virtual as this is an interface. More...
 

Private Types

typedef OwnerContainer
< ProgramPair * > 
ProgramContainer
 
typedef ProgramContainer::Iterator ProgramIterator
 

Private Member Functions

virtual
Integration::GlAbstraction
GetGlAbstraction ()
  More...
 
virtual ProgramGetProgram (size_t shaderHash)
 Get the program from cache with hash. More...
 
virtual void AddProgram (size_t shaderHash, Program *program)
 Add a program to cache. More...
 
virtual ProgramGetCurrentProgram ()
 Get currently bound program. More...
 
virtual void SetCurrentProgram (Program *program)
 Set the currently bound program. More...
 
virtual bool IsBinarySupported ()
  More...
 
virtual GLenum ProgramBinaryFormat ()
  More...
 
virtual void StoreBinary (Internal::ShaderDataPtr programData)
  More...
 
 ProgramController (const ProgramController &rhs)
 
ProgramControlleroperator= (const ProgramController &rhs)
 

Private Attributes

ShaderSavermShaderSaver
 
Integration::GlAbstractionmGlAbstraction
 
ProgrammCurrentProgram
 
ProgramContainer mProgramCache
 
GLint mProgramBinaryFormat
 
GLint mNumberOfProgramBinaryFormats
 

Detailed Description

This class is the owner of GL shader programs.

Definition at line 37 of file program-controller.h.

Member Typedef Documentation

Definition at line 179 of file program-controller.h.

Definition at line 180 of file program-controller.h.

Constructor & Destructor Documentation

Dali::Internal::ProgramController::ProgramController ( Integration::GlAbstraction glAbstraction)

Constructor.

Parameters
postProcessDispatcherto send save binary message back to update

Definition at line 35 of file program-controller.cpp.

References mProgramCache, and Dali::Vector< T, IsTrivialType >::Reserve().

Here is the call graph for this function:

Dali::Internal::ProgramController::~ProgramController ( )

Destructor, non virtual as not a base class.

Definition at line 46 of file program-controller.cpp.

Dali::Internal::ProgramController::ProgramController ( const ProgramController rhs)
private

Member Function Documentation

void Dali::Internal::ProgramController::AddProgram ( size_t  shaderHash,
Program program 
)
privatevirtual

Add a program to cache.

Parameters
shaderHashof the program
programto add

Implements Dali::Internal::ProgramCache.

Definition at line 117 of file program-controller.cpp.

References mProgramCache, and Dali::Vector< T, IsTrivialType >::PushBack().

Here is the call graph for this function:

Program * Dali::Internal::ProgramController::GetCurrentProgram ( )
privatevirtual

Get currently bound program.

Returns
program that is currently used

Implements Dali::Internal::ProgramCache.

Definition at line 124 of file program-controller.cpp.

References mCurrentProgram.

Integration::GlAbstraction & Dali::Internal::ProgramController::GetGlAbstraction ( )
privatevirtual

Returns
GlAbstraction

Implements Dali::Internal::ProgramCache.

Definition at line 96 of file program-controller.cpp.

References mGlAbstraction.

Program * Dali::Internal::ProgramController::GetProgram ( size_t  shaderHash)
privatevirtual

Get the program from cache with hash.

Parameters
shaderHashto use
Returns
program

Implements Dali::Internal::ProgramCache.

Definition at line 101 of file program-controller.cpp.

References Dali::Vector< T, IsTrivialType >::Begin(), Dali::Vector< T, IsTrivialType >::End(), and mProgramCache.

Here is the call graph for this function:

void Dali::Internal::ProgramController::GlContextCreated ( )

Notifies the cache that context is (re)created.

Definition at line 61 of file program-controller.cpp.

References CHECK_GL, Dali::Integration::GlAbstraction::GetError(), Dali::Integration::GlAbstraction::GetIntegerv(), GL_NO_ERROR, GL_NUM_PROGRAM_BINARY_FORMATS_OES, GL_PROGRAM_BINARY_FORMATS_OES, LOG_GL, mGlAbstraction, mNumberOfProgramBinaryFormats, and mProgramBinaryFormat.

Referenced by Dali::Internal::SceneGraph::RenderManager::ContextCreated().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::ProgramController::GlContextDestroyed ( )

Notifies cache that context is lost.

Definition at line 82 of file program-controller.cpp.

References Dali::Vector< T, IsTrivialType >::Begin(), Dali::Vector< T, IsTrivialType >::End(), mNumberOfProgramBinaryFormats, mProgramBinaryFormat, mProgramCache, and SetCurrentProgram().

Referenced by Dali::Internal::SceneGraph::RenderManager::ContextDestroyed().

Here is the call graph for this function:

Here is the caller graph for this function:

bool Dali::Internal::ProgramController::IsBinarySupported ( )
privatevirtual

Returns
true if program binaries are supported

Implements Dali::Internal::ProgramCache.

Definition at line 134 of file program-controller.cpp.

References mNumberOfProgramBinaryFormats.

ProgramController& Dali::Internal::ProgramController::operator= ( const ProgramController rhs)
private
unsigned int Dali::Internal::ProgramController::ProgramBinaryFormat ( )
privatevirtual

Returns
the binary format to use

Implements Dali::Internal::ProgramCache.

Definition at line 139 of file program-controller.cpp.

References mProgramBinaryFormat.

void Dali::Internal::ProgramController::ResetProgramMatrices ( )

Resets the program matrices.

Must be called at the beginning of every frame

Definition at line 50 of file program-controller.cpp.

References Dali::Vector< T, IsTrivialType >::Begin(), Dali::Vector< T, IsTrivialType >::End(), mProgramCache, Dali::Internal::Program::SetProjectionMatrix(), and Dali::Internal::Program::SetViewMatrix().

Referenced by Dali::Internal::SceneGraph::RenderManager::Render().

Here is the call graph for this function:

Here is the caller graph for this function:

void Dali::Internal::ProgramController::SetCurrentProgram ( Program program)
privatevirtual

Set the currently bound program.

Parameters
programthat is used

Implements Dali::Internal::ProgramCache.

Definition at line 129 of file program-controller.cpp.

References mCurrentProgram.

Referenced by GlContextDestroyed().

Here is the caller graph for this function:

void Dali::Internal::ProgramController::SetShaderSaver ( ShaderSaver shaderSaver)

Set the destination for compiler shader binaries so they can be saved.

Note
Must be called during initialisation.

Definition at line 155 of file program-controller.cpp.

References mShaderSaver.

Referenced by Dali::Internal::SceneGraph::RenderManager::SetShaderSaver().

Here is the caller graph for this function:

void Dali::Internal::ProgramController::StoreBinary ( Internal::ShaderDataPtr  programData)
privatevirtual

Parameters
programDatato store/save

Implements Dali::Internal::ProgramCache.

Definition at line 144 of file program-controller.cpp.

References DALI_ASSERT_DEBUG, mShaderSaver, and Dali::Internal::ShaderSaver::SaveBinary().

Here is the call graph for this function:

Member Data Documentation

Program* Dali::Internal::ProgramController::mCurrentProgram
private

Definition at line 177 of file program-controller.h.

Referenced by GetCurrentProgram(), and SetCurrentProgram().

Integration::GlAbstraction& Dali::Internal::ProgramController::mGlAbstraction
private

Definition at line 176 of file program-controller.h.

Referenced by GetGlAbstraction(), and GlContextCreated().

GLint Dali::Internal::ProgramController::mNumberOfProgramBinaryFormats
private

Definition at line 184 of file program-controller.h.

Referenced by GlContextCreated(), GlContextDestroyed(), and IsBinarySupported().

GLint Dali::Internal::ProgramController::mProgramBinaryFormat
private

Definition at line 183 of file program-controller.h.

Referenced by GlContextCreated(), GlContextDestroyed(), and ProgramBinaryFormat().

ProgramContainer Dali::Internal::ProgramController::mProgramCache
private
ShaderSaver* Dali::Internal::ProgramController::mShaderSaver
private

Definition at line 175 of file program-controller.h.

Referenced by SetShaderSaver(), and StoreBinary().


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