Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes
Ogre::GLSLESProgramPipeline Class Reference

Specialisation of HighLevelGpuProgram to provide support for OpenGL Shader Language (GLSL ES) for OpenGL ES 2.0. More...

#include <OgreGLSLESProgramPipeline.h>

Inheritance diagram for Ogre::GLSLESProgramPipeline:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 GLSLESProgramPipeline (GLSLESGpuProgram *vertexProgram, GLSLESGpuProgram *fragmentProgram)
 Constructor should only be used by GLSLESProgramPipelineManager.
virtual ~GLSLESProgramPipeline ()
GLuint getGLProgramPipelineHandle () const
 GL Program Pipeline Handle.
virtual void updateUniforms (GpuProgramParametersSharedPtr params, uint16 mask, GpuProgramType fromProgType)
 Updates program pipeline object uniforms using data from GpuProgramParameters.
virtual void updatePassIterationUniforms (GpuProgramParametersSharedPtr params)
 Updates program pipeline object uniforms using data from pass iteration GpuProgramParameters.
void activate (void)
 Makes a program pipeline object active by making sure it is linked and then putting it in use.
virtual GLint getAttributeIndex (VertexElementSemantic semantic, uint index)
 Get the index of a non-standard attribute bound in the linked code.
GLuint getGLProgramHandle (void) const
 Get the GL Handle for the program object.
void setSkeletalAnimationIncluded (bool included)
 Sets whether the linked program includes the required instructions to perform skeletal animation.
bool isSkeletalAnimationIncluded (void) const
 Returns whether the linked program includes the required instructions to perform skeletal animation.
bool isAttributeValid (VertexElementSemantic semantic, uint index)
 Is a non-standard attribute bound in the linked code?
GLSLESGpuProgramgetVertexProgram (void) const
GLSLESGpuProgramgetFragmentProgram (void) const

Protected Types

enum  { VERTEX_PROGRAM_LINKED = 0x01, FRAGMENT_PROGRAM_LINKED = 0x10, ALL_PROGRAMS_LINKED = 0x11 }
typedef set< GLuint >::type AttributeSet
typedef map< String,
VertexElementSemantic >::type 
SemanticToStringMap

Protected Member Functions

virtual void compileAndLink (void)
 Compiles and links the separate vertex and fragment programs.
virtual void _useProgram (void)
 Put a program pipeline in use.
virtual void extractLayoutQualifiers (void)
 Finds layout qualifiers in the shader source and sets attribute indices appropriately.
virtual void buildGLUniformReferences (void)
 Build uniform references from active named uniforms.
Ogre::String getCombinedName (void)
void getMicrocodeFromCache (void)
 Get the the binary data of a program from the microcode cache.
VertexElementSemantic getAttributeSemanticEnum (String type)
const char * getAttributeSemanticString (VertexElementSemantic semantic)

Protected Attributes

GLuint mGLProgramPipelineHandle
 GL handle for pipeline object.
GLUniformReferenceList mGLUniformReferences
 Container of uniform references that are active in the program object.
GLSLESGpuProgrammVertexProgram
 Linked vertex program.
GLSLESGpuProgrammFragmentProgram
 Linked fragment program.
bool mUniformRefsBuilt
 Flag to indicate that uniform references have already been built.
GLuint mGLProgramHandle
 GL handle for the program object.
GLint mLinked
 Flag indicating that the program or pipeline object has been successfully linked.
bool mTriedToLinkAndFailed
 Flag indicating that the program or pipeline object has tried to link and failed.
bool mSkeletalAnimation
 Flag indicating skeletal animation is being performed.
GLint mCustomAttributesIndexes [VES_COUNT][OGRE_MAX_TEXTURE_COORD_SETS]
 An array to hold the attributes indexes.
SemanticToStringMap mSemanticTypeMap

Detailed Description

Specialisation of HighLevelGpuProgram to provide support for OpenGL Shader Language (GLSL ES) for OpenGL ES 2.0.

Remarks:
GLSL ES has no target assembler or entry point specification like DirectX 9 HLSL. Vertex and Fragment shaders only have one entry point called "main". When a shader is compiled, microcode is generated but can not be accessed by the application. GLSL ES also does not provide assembler low level output after compiling. The GL ES Render system assumes that the Gpu program is a GL Gpu program so GLSLESProgramPipeline will create a GLSLESGpuProgram that is subclassed from GLES2GpuProgram for the low level implementation. The GLES2Program class will create a shader and program object and compile the source but will not create a pipeline object. It's up to GLES2GpuProgram class to request a program pipeline object to link the program object to.
Note:
GLSL ES supports multiple modular shader objects that can be attached to one program object to form a single shader. This is supported through the "attach" material script command. All the modules to be attached are listed on the same line as the attach command separated by white space.

Definition at line 56 of file OgreGLSLESProgramPipeline.h.


Member Typedef Documentation

typedef set<GLuint>::type Ogre::GLSLESProgramCommon::AttributeSet [protected, inherited]

Definition at line 80 of file OgreGLSLESProgramCommon.h.

Definition at line 97 of file OgreGLSLESProgramCommon.h.


Member Enumeration Documentation

anonymous enum [protected]
Enumerator:
VERTEX_PROGRAM_LINKED 
FRAGMENT_PROGRAM_LINKED 
ALL_PROGRAMS_LINKED 

Definition at line 83 of file OgreGLSLESProgramPipeline.h.


Constructor & Destructor Documentation

Constructor should only be used by GLSLESProgramPipelineManager.


Member Function Documentation

virtual void Ogre::GLSLESProgramPipeline::_useProgram ( void  ) [protected, virtual]

Put a program pipeline in use.

Implements Ogre::GLSLESProgramCommon.

void Ogre::GLSLESProgramPipeline::activate ( void  ) [virtual]

Makes a program pipeline object active by making sure it is linked and then putting it in use.

Implements Ogre::GLSLESProgramCommon.

virtual void Ogre::GLSLESProgramPipeline::buildGLUniformReferences ( void  ) [protected, virtual]

Build uniform references from active named uniforms.

Reimplemented from Ogre::GLSLESProgramCommon.

virtual void Ogre::GLSLESProgramPipeline::compileAndLink ( void  ) [protected, virtual]

Compiles and links the separate vertex and fragment programs.

Implements Ogre::GLSLESProgramCommon.

virtual void Ogre::GLSLESProgramPipeline::extractLayoutQualifiers ( void  ) [protected, virtual]

Finds layout qualifiers in the shader source and sets attribute indices appropriately.

virtual GLint Ogre::GLSLESProgramPipeline::getAttributeIndex ( VertexElementSemantic  semantic,
uint  index 
) [virtual]

Get the index of a non-standard attribute bound in the linked code.

Reimplemented from Ogre::GLSLESProgramCommon.

const char* Ogre::GLSLESProgramCommon::getAttributeSemanticString ( VertexElementSemantic  semantic) [protected, inherited]
Ogre::String Ogre::GLSLESProgramCommon::getCombinedName ( void  ) [protected, inherited]

Definition at line 144 of file OgreGLSLESProgramCommon.h.

GLuint Ogre::GLSLESProgramCommon::getGLProgramHandle ( void  ) const [inherited]

Get the GL Handle for the program object.

Definition at line 121 of file OgreGLSLESProgramCommon.h.

GL Program Pipeline Handle.

Definition at line 64 of file OgreGLSLESProgramPipeline.h.

void Ogre::GLSLESProgramCommon::getMicrocodeFromCache ( void  ) [protected, inherited]

Get the the binary data of a program from the microcode cache.

Definition at line 143 of file OgreGLSLESProgramCommon.h.

bool Ogre::GLSLESProgramCommon::isAttributeValid ( VertexElementSemantic  semantic,
uint  index 
) [inherited]

Is a non-standard attribute bound in the linked code?

bool Ogre::GLSLESProgramCommon::isSkeletalAnimationIncluded ( void  ) const [inherited]

Returns whether the linked program includes the required instructions to perform skeletal animation.

Remarks:
If this returns true, OGRE will not blend the geometry according to skeletal animation, it will expect the vertex program to do it.

Definition at line 136 of file OgreGLSLESProgramCommon.h.

void Ogre::GLSLESProgramCommon::setSkeletalAnimationIncluded ( bool  included) [inherited]

Sets whether the linked program includes the required instructions to perform skeletal animation.

Remarks:
If this is set to true, OGRE will not blend the geometry according to skeletal animation, it will expect the vertex program to do it.

Definition at line 128 of file OgreGLSLESProgramCommon.h.

Updates program pipeline object uniforms using data from pass iteration GpuProgramParameters.

normally called by GLSLESGpuProgram::bindMultiPassParameters() just before multi pass rendering occurs.

Implements Ogre::GLSLESProgramCommon.

virtual void Ogre::GLSLESProgramPipeline::updateUniforms ( GpuProgramParametersSharedPtr  params,
uint16  mask,
GpuProgramType  fromProgType 
) [virtual]

Updates program pipeline object uniforms using data from GpuProgramParameters.

normally called by GLSLESGpuProgram::bindParameters() just before rendering occurs.

Implements Ogre::GLSLESProgramCommon.


Member Data Documentation

An array to hold the attributes indexes.

Definition at line 83 of file OgreGLSLESProgramCommon.h.

Linked fragment program.

Definition at line 66 of file OgreGLSLESProgramCommon.h.

GLuint Ogre::GLSLESProgramCommon::mGLProgramHandle [protected, inherited]

GL handle for the program object.

Definition at line 70 of file OgreGLSLESProgramCommon.h.

GL handle for pipeline object.

Definition at line 89 of file OgreGLSLESProgramPipeline.h.

Container of uniform references that are active in the program object.

Definition at line 61 of file OgreGLSLESProgramCommon.h.

GLint Ogre::GLSLESProgramCommon::mLinked [protected, inherited]

Flag indicating that the program or pipeline object has been successfully linked.

Definition at line 72 of file OgreGLSLESProgramCommon.h.

Definition at line 98 of file OgreGLSLESProgramCommon.h.

bool Ogre::GLSLESProgramCommon::mSkeletalAnimation [protected, inherited]

Flag indicating skeletal animation is being performed.

Definition at line 76 of file OgreGLSLESProgramCommon.h.

Flag indicating that the program or pipeline object has tried to link and failed.

Definition at line 74 of file OgreGLSLESProgramCommon.h.

bool Ogre::GLSLESProgramCommon::mUniformRefsBuilt [protected, inherited]

Flag to indicate that uniform references have already been built.

Definition at line 68 of file OgreGLSLESProgramCommon.h.

Linked vertex program.

Definition at line 64 of file OgreGLSLESProgramCommon.h.


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

Copyright © 2012 Torus Knot Software Ltd
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Unported License.
Last modified Fri May 25 2012 21:49:31