Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
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]

Public Member Functions

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

Protected Types

enum  { VERTEX_PROGRAM_LINKED = 1, FRAGMENT_PROGRAM_LINKED = 2, ALL_PROGRAMS_LINKED = 3 }
 
typedef set< GLuint >::type AttributeSet
 
typedef map< String, VertexElementSemantic >::type SemanticToStringMap
 

Protected Member Functions

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

Protected Attributes

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

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

◆ AttributeSet

typedef set<GLuint>::type Ogre::GLSLESProgramCommon::AttributeSet
protectedinherited

Definition at line 88 of file OgreGLSLESProgramCommon.h.

◆ SemanticToStringMap

Definition at line 105 of file OgreGLSLESProgramCommon.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
protected
Enumerator
VERTEX_PROGRAM_LINKED 
FRAGMENT_PROGRAM_LINKED 
ALL_PROGRAMS_LINKED 

Definition at line 87 of file OgreGLSLESProgramPipeline.h.

Constructor & Destructor Documentation

◆ GLSLESProgramPipeline()

Ogre::GLSLESProgramPipeline::GLSLESProgramPipeline ( GLSLESGpuProgram vertexProgram,
GLSLESGpuProgram fragmentProgram 
)

Constructor should only be used by GLSLESProgramPipelineManager.

◆ ~GLSLESProgramPipeline()

virtual Ogre::GLSLESProgramPipeline::~GLSLESProgramPipeline ( )
virtual

Member Function Documentation

◆ _useProgram()

virtual void Ogre::GLSLESProgramPipeline::_useProgram ( void  )
protectedvirtual

Put a program pipeline in use.

Implements Ogre::GLSLESProgramCommon.

◆ activate()

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.

◆ buildGLUniformReferences()

virtual void Ogre::GLSLESProgramPipeline::buildGLUniformReferences ( void  )
protectedvirtual

Build uniform references from active named uniforms.

◆ compileAndLink()

virtual void Ogre::GLSLESProgramPipeline::compileAndLink ( void  )
protectedvirtual

Compiles and links the separate vertex and fragment programs.

Implements Ogre::GLSLESProgramCommon.

◆ extractLayoutQualifiers()

virtual void Ogre::GLSLESProgramPipeline::extractLayoutQualifiers ( void  )
protectedvirtual

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

◆ getAttributeIndex()

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.

◆ getAttributeSemanticEnum()

VertexElementSemantic Ogre::GLSLESProgramCommon::getAttributeSemanticEnum ( String  type)
protectedinherited

◆ getAttributeSemanticString()

const char* Ogre::GLSLESProgramCommon::getAttributeSemanticString ( VertexElementSemantic  semantic)
protectedinherited

◆ getCombinedName()

Ogre::String Ogre::GLSLESProgramCommon::getCombinedName ( void  )
protectedinherited

◆ getFragmentProgram()

GLSLESGpuProgram* Ogre::GLSLESProgramCommon::getFragmentProgram ( void  ) const
inherited

Definition at line 156 of file OgreGLSLESProgramCommon.h.

◆ getGLProgramHandle()

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

Get the GL Handle for the program object.

Definition at line 133 of file OgreGLSLESProgramCommon.h.

◆ getGLProgramPipelineHandle()

GLuint Ogre::GLSLESProgramPipeline::getGLProgramPipelineHandle ( ) const

GL Program Pipeline Handle.

Definition at line 64 of file OgreGLSLESProgramPipeline.h.

◆ getMicrocodeFromCache()

void Ogre::GLSLESProgramCommon::getMicrocodeFromCache ( void  )
protectedinherited

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

◆ getUniformCache()

GLES2UniformCache* Ogre::GLSLESProgramCommon::getUniformCache ( void  )
inherited

Definition at line 157 of file OgreGLSLESProgramCommon.h.

◆ getVertexProgram()

GLSLESGpuProgram* Ogre::GLSLESProgramCommon::getVertexProgram ( void  ) const
inherited

Definition at line 155 of file OgreGLSLESProgramCommon.h.

◆ isAttributeValid()

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

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

◆ isSkeletalAnimationIncluded()

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 148 of file OgreGLSLESProgramCommon.h.

◆ setSkeletalAnimationIncluded()

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 140 of file OgreGLSLESProgramCommon.h.

◆ updatePassIterationUniforms()

virtual void Ogre::GLSLESProgramPipeline::updatePassIterationUniforms ( GpuProgramParametersSharedPtr  params)
virtual

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.

◆ updateUniformBlocks()

virtual void Ogre::GLSLESProgramPipeline::updateUniformBlocks ( GpuProgramParametersSharedPtr  params,
uint16  mask,
GpuProgramType  fromProgType 
)
virtual

Updates program object uniform blocks using data from GpuProgramParameters.

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

Implements Ogre::GLSLESProgramCommon.

◆ updateUniforms()

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

◆ mCustomAttributesIndexes

GLint Ogre::GLSLESProgramCommon::mCustomAttributesIndexes[VES_COUNT][OGRE_MAX_TEXTURE_COORD_SETS]
protectedinherited

An array to hold the attributes indexes.

Definition at line 91 of file OgreGLSLESProgramCommon.h.

◆ mFragmentProgram

GLSLESGpuProgram* Ogre::GLSLESProgramCommon::mFragmentProgram
protectedinherited

Linked fragment program.

Definition at line 73 of file OgreGLSLESProgramCommon.h.

◆ mGLProgramHandle

GLuint Ogre::GLSLESProgramCommon::mGLProgramHandle
protectedinherited

GL handle for the program object.

Definition at line 78 of file OgreGLSLESProgramCommon.h.

◆ mGLProgramPipelineHandle

GLuint Ogre::GLSLESProgramPipeline::mGLProgramPipelineHandle
protected

GL handle for pipeline object.

Definition at line 93 of file OgreGLSLESProgramPipeline.h.

◆ mGLUniformBufferReferences

GLUniformBufferList Ogre::GLSLESProgramCommon::mGLUniformBufferReferences
protectedinherited

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

Definition at line 68 of file OgreGLSLESProgramCommon.h.

◆ mGLUniformReferences

GLUniformReferenceList Ogre::GLSLESProgramCommon::mGLUniformReferences
protectedinherited

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

Definition at line 66 of file OgreGLSLESProgramCommon.h.

◆ mLinked

GLint Ogre::GLSLESProgramCommon::mLinked
protectedinherited

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

Definition at line 80 of file OgreGLSLESProgramCommon.h.

◆ mSemanticTypeMap

SemanticToStringMap Ogre::GLSLESProgramCommon::mSemanticTypeMap
protectedinherited

Definition at line 106 of file OgreGLSLESProgramCommon.h.

◆ mSkeletalAnimation

bool Ogre::GLSLESProgramCommon::mSkeletalAnimation
protectedinherited

Flag indicating skeletal animation is being performed.

Definition at line 84 of file OgreGLSLESProgramCommon.h.

◆ mTriedToLinkAndFailed

bool Ogre::GLSLESProgramCommon::mTriedToLinkAndFailed
protectedinherited

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

Definition at line 82 of file OgreGLSLESProgramCommon.h.

◆ mUniformCache

GLES2UniformCache* Ogre::GLSLESProgramCommon::mUniformCache
protectedinherited

Definition at line 74 of file OgreGLSLESProgramCommon.h.

◆ mUniformRefsBuilt

bool Ogre::GLSLESProgramCommon::mUniformRefsBuilt
protectedinherited

Flag to indicate that uniform references have already been built.

Definition at line 76 of file OgreGLSLESProgramCommon.h.

◆ mVertexProgram

GLSLESGpuProgram* Ogre::GLSLESProgramCommon::mVertexProgram
protectedinherited

Linked vertex program.

Definition at line 71 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 Sun Oct 22 2017 04:04:15