Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
Ogre::GLSLProgramPipeline Class Reference

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

#include <OgreGLSLProgramPipeline.h>

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

Public Member Functions

 GLSLProgramPipeline (GLSLGpuProgram *vertexProgram, GLSLGpuProgram *geometryProgram, GLSLGpuProgram *fragmentProgram, GLSLGpuProgram *hullProgram, GLSLGpuProgram *domainProgram, GLSLGpuProgram *computeProgram)
 Constructor should only be used by GLSLProgramPipelineManager. More...
 
virtual ~GLSLProgramPipeline ()
 
void activate (void)
 Makes a program pipeline object active by making sure it is linked and then putting it in use. More...
 
virtual void extractLayoutQualifiers (void)
 Finds layout qualifiers in the shader source and sets attribute indices appropriately. More...
 
virtual GLint getAttributeIndex (VertexElementSemantic semantic, uint index)
 Get the index of a non-standard attribute bound in the linked code. More...
 
GLSLGpuProgramgetComputeProgram () const
 
GLSLGpuProgramgetDomainProgram () const
 
GLSLGpuProgramgetFragmentProgram () const
 
GLSLGpuProgramgetGeometryProgram () const
 
GLuint getGLProgramHandle (void) const
 Get the GL Handle for the program object. More...
 
GLuint getGLProgramPipelineHandle () const
 GL Program Pipeline Handle. More...
 
GLSLGpuProgramgetHullProgram () const
 
GL3PlusVertexArrayObjectgetVertexArrayObject ()
 
GLSLGpuProgramgetVertexProgram () 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

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 programs. More...
 
void compileIndividualProgram (GLSLGpuProgram *program)
 
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

GLSLGpuProgrammComputeProgram
 Linked compute program. More...
 
GLint mCustomAttributesIndexes [VES_COUNT][OGRE_MAX_TEXTURE_COORD_SETS]
 An array to hold the attributes indexes. More...
 
GLSLGpuProgrammDomainProgram
 Linked domain(evaluation) program. More...
 
GLSLGpuProgrammFragmentProgram
 Linked fragment program. More...
 
GLSLGpuProgrammGeometryProgram
 Linked geometry 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...
 
GLSLGpuProgrammHullProgram
 Linked hull(control) program. 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...
 
bool mUniformRefsBuilt
 Flag to indicate that uniform references have already been built. More...
 
GL3PlusVertexArrayObjectmVertexArrayObject
 GL handle for the vertex array object. More...
 
GLSLGpuProgrammVertexProgram
 Linked vertex program. More...
 

Detailed Description

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

Remarks
GLSL 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 also does not provide assembler low level output after compiling. The GL Render system assumes that the Gpu program is a GL Gpu program so GLSLProgramPipeline will create a GLSLGpuProgram that is subclassed from GLGpuProgram for the low level implementation. The GLProgram class will create a shader and program object and compile the source but will not create a pipeline object. It's up to GLGpuProgram class to request a program pipeline object to link the program object to.
Note
GLSL 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 OgreGLSLProgramPipeline.h.

Member Typedef Documentation

◆ AttributeSet

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

Definition at line 98 of file OgreGLSLProgramCommon.h.

◆ SemanticToStringMap

Definition at line 115 of file OgreGLSLProgramCommon.h.

Constructor & Destructor Documentation

◆ GLSLProgramPipeline()

Ogre::GLSLProgramPipeline::GLSLProgramPipeline ( GLSLGpuProgram vertexProgram,
GLSLGpuProgram geometryProgram,
GLSLGpuProgram fragmentProgram,
GLSLGpuProgram hullProgram,
GLSLGpuProgram domainProgram,
GLSLGpuProgram computeProgram 
)

Constructor should only be used by GLSLProgramPipelineManager.

◆ ~GLSLProgramPipeline()

virtual Ogre::GLSLProgramPipeline::~GLSLProgramPipeline ( )
virtual

Member Function Documentation

◆ _useProgram()

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

Put a program pipeline in use.

Implements Ogre::GLSLProgramCommon.

◆ activate()

void Ogre::GLSLProgramPipeline::activate ( void  )
virtual

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

Implements Ogre::GLSLProgramCommon.

◆ buildGLUniformReferences()

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

Build uniform references from active named uniforms.

◆ compileAndLink()

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

Compiles and links the separate programs.

Implements Ogre::GLSLProgramCommon.

◆ compileIndividualProgram()

void Ogre::GLSLProgramPipeline::compileIndividualProgram ( GLSLGpuProgram program)
protected

◆ extractLayoutQualifiers()

virtual void Ogre::GLSLProgramCommon::extractLayoutQualifiers ( void  )
virtualinherited

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

◆ getAttributeIndex()

virtual GLint Ogre::GLSLProgramPipeline::getAttributeIndex ( VertexElementSemantic  semantic,
uint  index 
)
virtual

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

Reimplemented from Ogre::GLSLProgramCommon.

◆ getAttributeSemanticEnum()

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

◆ getAttributeSemanticString()

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

◆ getCombinedName()

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

◆ getComputeProgram()

GLSLGpuProgram* Ogre::GLSLProgramCommon::getComputeProgram ( ) const
inherited

Definition at line 172 of file OgreGLSLProgramCommon.h.

◆ getDomainProgram()

GLSLGpuProgram* Ogre::GLSLProgramCommon::getDomainProgram ( ) const
inherited

Definition at line 171 of file OgreGLSLProgramCommon.h.

◆ getFragmentProgram()

GLSLGpuProgram* Ogre::GLSLProgramCommon::getFragmentProgram ( ) const
inherited

Definition at line 168 of file OgreGLSLProgramCommon.h.

◆ getGeometryProgram()

GLSLGpuProgram* Ogre::GLSLProgramCommon::getGeometryProgram ( ) const
inherited

Definition at line 169 of file OgreGLSLProgramCommon.h.

◆ getGLProgramHandle()

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

Get the GL Handle for the program object.

Definition at line 145 of file OgreGLSLProgramCommon.h.

◆ getGLProgramPipelineHandle()

GLuint Ogre::GLSLProgramPipeline::getGLProgramPipelineHandle ( ) const

GL Program Pipeline Handle.

Definition at line 64 of file OgreGLSLProgramPipeline.h.

◆ getHullProgram()

GLSLGpuProgram* Ogre::GLSLProgramCommon::getHullProgram ( ) const
inherited

Definition at line 170 of file OgreGLSLProgramCommon.h.

◆ getMicrocodeFromCache()

void Ogre::GLSLProgramCommon::getMicrocodeFromCache ( void  )
protectedinherited

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

◆ getVertexArrayObject()

GL3PlusVertexArrayObject* Ogre::GLSLProgramCommon::getVertexArrayObject ( )
inherited

Definition at line 173 of file OgreGLSLProgramCommon.h.

◆ getVertexProgram()

GLSLGpuProgram* Ogre::GLSLProgramCommon::getVertexProgram ( ) const
inherited

Definition at line 167 of file OgreGLSLProgramCommon.h.

◆ isAttributeValid()

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

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

◆ isSkeletalAnimationIncluded()

bool Ogre::GLSLProgramCommon::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 160 of file OgreGLSLProgramCommon.h.

◆ setSkeletalAnimationIncluded()

void Ogre::GLSLProgramCommon::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 152 of file OgreGLSLProgramCommon.h.

◆ updatePassIterationUniforms()

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

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

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

Implements Ogre::GLSLProgramCommon.

◆ updateUniformBlocks()

virtual void Ogre::GLSLProgramPipeline::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::GLSLProgramCommon.

◆ updateUniforms()

virtual void Ogre::GLSLProgramPipeline::updateUniforms ( GpuProgramParametersSharedPtr  params,
uint16  mask,
GpuProgramType  fromProgType 
)
virtual

Updates program pipeline object uniforms using data from GpuProgramParameters.

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

Implements Ogre::GLSLProgramCommon.

Member Data Documentation

◆ mComputeProgram

GLSLGpuProgram* Ogre::GLSLProgramCommon::mComputeProgram
protectedinherited

Linked compute program.

Definition at line 81 of file OgreGLSLProgramCommon.h.

◆ mCustomAttributesIndexes

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

An array to hold the attributes indexes.

Definition at line 101 of file OgreGLSLProgramCommon.h.

◆ mDomainProgram

GLSLGpuProgram* Ogre::GLSLProgramCommon::mDomainProgram
protectedinherited

Linked domain(evaluation) program.

Definition at line 79 of file OgreGLSLProgramCommon.h.

◆ mFragmentProgram

GLSLGpuProgram* Ogre::GLSLProgramCommon::mFragmentProgram
protectedinherited

Linked fragment program.

Definition at line 73 of file OgreGLSLProgramCommon.h.

◆ mGeometryProgram

GLSLGpuProgram* Ogre::GLSLProgramCommon::mGeometryProgram
protectedinherited

Linked geometry program.

Definition at line 75 of file OgreGLSLProgramCommon.h.

◆ mGLProgramHandle

GLuint Ogre::GLSLProgramCommon::mGLProgramHandle
protectedinherited

GL handle for the program object.

Definition at line 88 of file OgreGLSLProgramCommon.h.

◆ mGLProgramPipelineHandle

GLuint Ogre::GLSLProgramPipeline::mGLProgramPipelineHandle
protected

GL handle for pipeline object.

Definition at line 88 of file OgreGLSLProgramPipeline.h.

◆ mGLUniformBufferReferences

GLUniformBufferList Ogre::GLSLProgramCommon::mGLUniformBufferReferences
protectedinherited

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

Definition at line 68 of file OgreGLSLProgramCommon.h.

◆ mGLUniformReferences

GLUniformReferenceList Ogre::GLSLProgramCommon::mGLUniformReferences
protectedinherited

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

Definition at line 65 of file OgreGLSLProgramCommon.h.

◆ mHullProgram

GLSLGpuProgram* Ogre::GLSLProgramCommon::mHullProgram
protectedinherited

Linked hull(control) program.

Definition at line 77 of file OgreGLSLProgramCommon.h.

◆ mLinked

GLint Ogre::GLSLProgramCommon::mLinked
protectedinherited

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

Definition at line 90 of file OgreGLSLProgramCommon.h.

◆ mSemanticTypeMap

SemanticToStringMap Ogre::GLSLProgramCommon::mSemanticTypeMap
protectedinherited

Definition at line 116 of file OgreGLSLProgramCommon.h.

◆ mSkeletalAnimation

bool Ogre::GLSLProgramCommon::mSkeletalAnimation
protectedinherited

Flag indicating skeletal animation is being performed.

Definition at line 94 of file OgreGLSLProgramCommon.h.

◆ mTriedToLinkAndFailed

bool Ogre::GLSLProgramCommon::mTriedToLinkAndFailed
protectedinherited

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

Definition at line 92 of file OgreGLSLProgramCommon.h.

◆ mUniformRefsBuilt

bool Ogre::GLSLProgramCommon::mUniformRefsBuilt
protectedinherited

Flag to indicate that uniform references have already been built.

Definition at line 86 of file OgreGLSLProgramCommon.h.

◆ mVertexArrayObject

GL3PlusVertexArrayObject* Ogre::GLSLProgramCommon::mVertexArrayObject
protectedinherited

GL handle for the vertex array object.

Definition at line 83 of file OgreGLSLProgramCommon.h.

◆ mVertexProgram

GLSLGpuProgram* Ogre::GLSLProgramCommon::mVertexProgram
protectedinherited

Linked vertex program.

Definition at line 71 of file OgreGLSLProgramCommon.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