A singleton manager class that manages shader based programs. More...
#include <OgreShaderProgramManager.h>
Public Member Functions | |
ProgramManager () | |
Class default constructor. | |
~ProgramManager () | |
Class destructor. | |
void | acquirePrograms (Pass *pass, TargetRenderState *renderState) |
Acquire CPU/GPU programs set associated with the given render state and bind them to the pass. | |
void | releasePrograms (Pass *pass, TargetRenderState *renderState) |
Release CPU/GPU programs set associated with the given render state and pass. | |
void | flushGpuProgramsCache () |
Flush the local GPU programs cache. | |
void * | operator new (size_t sz, const char *file, int line, const char *func) |
operator new, with debug line info | |
void * | operator new (size_t sz) |
void * | operator new (size_t sz, void *ptr) |
placement operator new | |
void * | operator new[] (size_t sz, const char *file, int line, const char *func) |
array operator new, with debug line info | |
void * | operator new[] (size_t sz) |
void | operator delete (void *ptr) |
void | operator delete (void *ptr, void *) |
void | operator delete (void *ptr, const char *, int, const char *) |
void | operator delete[] (void *ptr) |
void | operator delete[] (void *ptr, const char *, int, const char *) |
Static Public Member Functions | |
static ProgramManager & | getSingleton () |
Override standard Singleton retrieval. | |
static ProgramManager * | getSingletonPtr () |
Override standard Singleton retrieval. | |
Protected Types | |
typedef map< String, GpuProgramPtr >::type | GpuProgramsMap |
typedef GpuProgramsMap::iterator | GpuProgramsMapIterator |
typedef GpuProgramsMap::const_iterator | GpuProgramsMapConstIterator |
typedef set< Program * >::type | ProgramList |
typedef ProgramList::iterator | ProgramListIterator |
typedef map< String, ProgramWriter * >::type | ProgramWriterMap |
typedef ProgramWriterMap::iterator | ProgramWriterIterator |
typedef vector < ProgramWriterFactory * > ::type | ProgramWriterFactoryList |
typedef map< String, ProgramProcessor * >::type | ProgramProcessorMap |
typedef ProgramProcessorMap::iterator | ProgramProcessorIterator |
typedef ProgramProcessorMap::const_iterator | ProgramProcessorConstIterator |
typedef vector < ProgramProcessor * >::type | ProgramProcessorList |
Protected Member Functions | |
void | createDefaultProgramProcessors () |
Create default program processors. | |
void | destroyDefaultProgramProcessors () |
Destroy default program processors. | |
void | createDefaultProgramWriterFactories () |
Create default program processors. | |
void | destroyDefaultProgramWriterFactories () |
Destroy default program processors. | |
void | destroyProgramWriters () |
Destroy all program writers. | |
Program * | createCpuProgram (GpuProgramType type) |
Create CPU program . | |
void | destroyCpuProgram (Program *shaderProgram) |
Destroy a CPU program by name. | |
bool | createGpuPrograms (ProgramSet *programSet) |
Create GPU programs for the given program set based on the CPU programs it contains. | |
GpuProgramPtr | createGpuProgram (Program *shaderProgram, ProgramWriter *programWriter, const String &language, const String &profiles, const StringVector &profilesList, const String &cachePath) |
Create GPU program based on the give CPU program. | |
void | addProgramProcessor (ProgramProcessor *processor) |
Add program processor instance to this manager. | |
void | removeProgramProcessor (ProgramProcessor *processor) |
Remove program processor instance from this manager. | |
void | destroyGpuProgram (GpuProgramPtr &gpuProgram) |
Destroy a GPU program by name. | |
void | flushGpuProgramsCache (GpuProgramsMap &gpuProgramsMap) |
Flush the local GPU programs cache. | |
size_t | getVertexShaderCount () const |
Return the number of created vertex shaders. | |
size_t | getFragmentShaderCount () const |
Return the number of created fragment shaders. | |
void | synchronizePixelnToBeVertexOut (ProgramSet *programSet) |
Fix the input of the pixel shader to be the same as the output of the vertex shader. | |
void | bindUniformParameters (Program *pCpuProgram, const GpuProgramParametersSharedPtr &passParams) |
Bind the uniform parameters of a given CPU and GPU program set. | |
Protected Attributes | |
ProgramList | mCpuProgramsList |
ProgramWriterMap | mProgramWritersMap |
ProgramProcessorMap | mProgramProcessorsMap |
ProgramWriterFactoryList | mProgramWriterFactories |
GpuProgramsMap | mVertexShaderMap |
GpuProgramsMap | mFragmentShaderMap |
ProgramProcessorList | mDefaultProgramProcessors |
Static Protected Attributes | |
static ProgramManager * | msSingleton |
Friends | |
class | ProgramSet |
class | TargetRenderState |
class | ShaderGenerator |
A singleton manager class that manages shader based programs.
Definition at line 46 of file OgreShaderProgramManager.h.
typedef map<String, GpuProgramPtr>::type Ogre::RTShader::ProgramManager::GpuProgramsMap [protected] |
Definition at line 111 of file OgreShaderProgramManager.h.
typedef GpuProgramsMap::const_iterator Ogre::RTShader::ProgramManager::GpuProgramsMapConstIterator [protected] |
Definition at line 113 of file OgreShaderProgramManager.h.
typedef GpuProgramsMap::iterator Ogre::RTShader::ProgramManager::GpuProgramsMapIterator [protected] |
Definition at line 112 of file OgreShaderProgramManager.h.
typedef set<Program*>::type Ogre::RTShader::ProgramManager::ProgramList [protected] |
Definition at line 116 of file OgreShaderProgramManager.h.
typedef ProgramList::iterator Ogre::RTShader::ProgramManager::ProgramListIterator [protected] |
Definition at line 117 of file OgreShaderProgramManager.h.
typedef ProgramProcessorMap::const_iterator Ogre::RTShader::ProgramManager::ProgramProcessorConstIterator [protected] |
Definition at line 125 of file OgreShaderProgramManager.h.
typedef ProgramProcessorMap::iterator Ogre::RTShader::ProgramManager::ProgramProcessorIterator [protected] |
Definition at line 124 of file OgreShaderProgramManager.h.
typedef vector<ProgramProcessor*>::type Ogre::RTShader::ProgramManager::ProgramProcessorList [protected] |
Definition at line 126 of file OgreShaderProgramManager.h.
typedef map<String, ProgramProcessor*>::type Ogre::RTShader::ProgramManager::ProgramProcessorMap [protected] |
Definition at line 123 of file OgreShaderProgramManager.h.
typedef vector<ProgramWriterFactory*>::type Ogre::RTShader::ProgramManager::ProgramWriterFactoryList [protected] |
Definition at line 120 of file OgreShaderProgramManager.h.
typedef ProgramWriterMap::iterator Ogre::RTShader::ProgramManager::ProgramWriterIterator [protected] |
Definition at line 119 of file OgreShaderProgramManager.h.
typedef map<String, ProgramWriter*>::type Ogre::RTShader::ProgramManager::ProgramWriterMap [protected] |
Definition at line 118 of file OgreShaderProgramManager.h.
Ogre::RTShader::ProgramManager::ProgramManager | ( | ) |
Class default constructor.
Ogre::RTShader::ProgramManager::~ProgramManager | ( | ) |
Class destructor.
void Ogre::RTShader::ProgramManager::acquirePrograms | ( | Pass * | pass, | |
TargetRenderState * | renderState | |||
) |
Acquire CPU/GPU programs set associated with the given render state and bind them to the pass.
pass | The pass to bind the programs to. | |
renderState | The render state that describes the program that need to be generated. |
void Ogre::RTShader::ProgramManager::addProgramProcessor | ( | ProgramProcessor * | processor | ) | [protected] |
Add program processor instance to this manager.
processor | The instance to add. |
void Ogre::RTShader::ProgramManager::bindUniformParameters | ( | Program * | pCpuProgram, | |
const GpuProgramParametersSharedPtr & | passParams | |||
) | [protected] |
Bind the uniform parameters of a given CPU and GPU program set.
Program* Ogre::RTShader::ProgramManager::createCpuProgram | ( | GpuProgramType | type | ) | [protected] |
Create CPU program .
type | The type of the program to create. |
void Ogre::RTShader::ProgramManager::createDefaultProgramProcessors | ( | ) | [protected] |
Create default program processors.
void Ogre::RTShader::ProgramManager::createDefaultProgramWriterFactories | ( | ) | [protected] |
Create default program processors.
GpuProgramPtr Ogre::RTShader::ProgramManager::createGpuProgram | ( | Program * | shaderProgram, | |
ProgramWriter * | programWriter, | |||
const String & | language, | |||
const String & | profiles, | |||
const StringVector & | profilesList, | |||
const String & | cachePath | |||
) | [protected] |
Create GPU program based on the give CPU program.
shaderProgram | The CPU program instance. | |
programWriter | The program writer instance. | |
language | The target shader language. | |
profiles | The profiles string for program compilation. | |
profiles | The profiles string for program compilation as string list. | |
cachePath | The output path to write the program into. |
bool Ogre::RTShader::ProgramManager::createGpuPrograms | ( | ProgramSet * | programSet | ) | [protected] |
Create GPU programs for the given program set based on the CPU programs it contains.
programSet | The program set container. |
void Ogre::RTShader::ProgramManager::destroyCpuProgram | ( | Program * | shaderProgram | ) | [protected] |
Destroy a CPU program by name.
shaderProgram | The CPU program instance to destroy. |
void Ogre::RTShader::ProgramManager::destroyDefaultProgramProcessors | ( | ) | [protected] |
Destroy default program processors.
void Ogre::RTShader::ProgramManager::destroyDefaultProgramWriterFactories | ( | ) | [protected] |
Destroy default program processors.
void Ogre::RTShader::ProgramManager::destroyGpuProgram | ( | GpuProgramPtr & | gpuProgram | ) | [protected] |
Destroy a GPU program by name.
name | The name of the program to destroy. | |
type | The type of the program to destroy. |
void Ogre::RTShader::ProgramManager::destroyProgramWriters | ( | ) | [protected] |
Destroy all program writers.
void Ogre::RTShader::ProgramManager::flushGpuProgramsCache | ( | GpuProgramsMap & | gpuProgramsMap | ) | [protected] |
Flush the local GPU programs cache.
gpuProgramsMap | The GPU programs cache. |
void Ogre::RTShader::ProgramManager::flushGpuProgramsCache | ( | ) |
Flush the local GPU programs cache.
size_t Ogre::RTShader::ProgramManager::getFragmentShaderCount | ( | ) | const [protected] |
Return the number of created fragment shaders.
Definition at line 202 of file OgreShaderProgramManager.h.
static ProgramManager& Ogre::RTShader::ProgramManager::getSingleton | ( | ) | [static] |
Override standard Singleton retrieval.
Reimplemented from Ogre::Singleton< ProgramManager >.
static ProgramManager* Ogre::RTShader::ProgramManager::getSingletonPtr | ( | ) | [static] |
Override standard Singleton retrieval.
Reimplemented from Ogre::Singleton< ProgramManager >.
size_t Ogre::RTShader::ProgramManager::getVertexShaderCount | ( | ) | const [protected] |
Return the number of created vertex shaders.
Definition at line 199 of file OgreShaderProgramManager.h.
void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr, | |
const char * | , | |||
int | , | |||
const char * | ||||
) | [inherited] |
Definition at line 107 of file OgreMemoryAllocatedObject.h.
void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr, | |
void * | ||||
) | [inherited] |
Definition at line 101 of file OgreMemoryAllocatedObject.h.
void Ogre::AllocatedObject< Alloc >::operator delete | ( | void * | ptr | ) | [inherited] |
Definition at line 95 of file OgreMemoryAllocatedObject.h.
void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr, | |
const char * | , | |||
int | , | |||
const char * | ||||
) | [inherited] |
Definition at line 118 of file OgreMemoryAllocatedObject.h.
void Ogre::AllocatedObject< Alloc >::operator delete[] | ( | void * | ptr | ) | [inherited] |
Definition at line 112 of file OgreMemoryAllocatedObject.h.
void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz, | |
void * | ptr | |||
) | [inherited] |
placement operator new
Definition at line 78 of file OgreMemoryAllocatedObject.h.
void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz | ) | [inherited] |
Definition at line 72 of file OgreMemoryAllocatedObject.h.
void* Ogre::AllocatedObject< Alloc >::operator new | ( | size_t | sz, | |
const char * | file, | |||
int | line, | |||
const char * | func | |||
) | [inherited] |
operator new, with debug line info
Definition at line 67 of file OgreMemoryAllocatedObject.h.
void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz | ) | [inherited] |
Definition at line 90 of file OgreMemoryAllocatedObject.h.
void* Ogre::AllocatedObject< Alloc >::operator new[] | ( | size_t | sz, | |
const char * | file, | |||
int | line, | |||
const char * | func | |||
) | [inherited] |
array operator new, with debug line info
Definition at line 85 of file OgreMemoryAllocatedObject.h.
void Ogre::RTShader::ProgramManager::releasePrograms | ( | Pass * | pass, | |
TargetRenderState * | renderState | |||
) |
Release CPU/GPU programs set associated with the given render state and pass.
pass | The pass to release the programs from. | |
renderState | The render state holds the programs. |
void Ogre::RTShader::ProgramManager::removeProgramProcessor | ( | ProgramProcessor * | processor | ) | [protected] |
Remove program processor instance from this manager.
processor | The instance to remove. |
void Ogre::RTShader::ProgramManager::synchronizePixelnToBeVertexOut | ( | ProgramSet * | programSet | ) | [protected] |
Fix the input of the pixel shader to be the same as the output of the vertex shader.
friend class ProgramSet [friend] |
Definition at line 224 of file OgreShaderProgramManager.h.
friend class ShaderGenerator [friend] |
Definition at line 226 of file OgreShaderProgramManager.h.
friend class TargetRenderState [friend] |
Definition at line 225 of file OgreShaderProgramManager.h.
Definition at line 215 of file OgreShaderProgramManager.h.
Definition at line 221 of file OgreShaderProgramManager.h.
Definition at line 220 of file OgreShaderProgramManager.h.
Definition at line 217 of file OgreShaderProgramManager.h.
Definition at line 218 of file OgreShaderProgramManager.h.
Definition at line 216 of file OgreShaderProgramManager.h.
ProgramManager * Ogre::Singleton< ProgramManager >::msSingleton [static, protected, inherited] |
Definition at line 75 of file OgreSingleton.h.
Definition at line 219 of file OgreShaderProgramManager.h.
Copyright © 2012 Torus Knot Software Ltd
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Fri May 25 23:43:06 2012