OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
OgreGLSLSeparableProgram.h
Go to the documentation of this file.
1 /*
2  -----------------------------------------------------------------------------
3  This source file is part of OGRE
4  (Object-oriented Graphics Rendering Engine)
5  For the latest info, see http://www.ogre3d.org/
6 
7  Copyright (c) 2000-2014 Torus Knot Software Ltd
8 
9  Permission is hereby granted, free of charge, to any person obtaining a copy
10  of this software and associated documentation files (the "Software"), to deal
11  in the Software without restriction, including without limitation the rights
12  to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13  copies of the Software, and to permit persons to whom the Software is
14  furnished to do so, subject to the following conditions:
15 
16  The above copyright notice and this permission notice shall be included in
17  all copies or substantial portions of the Software.
18 
19  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20  IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21  FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
22  AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
23  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
24  OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
25  THE SOFTWARE.
26  -----------------------------------------------------------------------------
27 */
28 #ifndef __GLSLSeparableProgram_H__
29 #define __GLSLSeparableProgram_H__
30 
32 #include "OgreGLSLProgram.h"
33 
34 namespace Ogre
35 {
36  //TODO Need to check that the shaders are being reused rather than
37  // destroyed and then recompiled.
38 
74  {
75  public:
77  GLSLSeparableProgram(GLSLShader* vertexShader,
78  GLSLShader* hullShader,
79  GLSLShader* domainShader,
80  GLSLShader* geometryShader,
81  GLSLShader* fragmentShader,
82  GLSLShader* computeShader);
84 
86  GLuint getGLProgramPipelineHandle() const { return mGLProgramPipelineHandle; }
87 
93  void updateUniforms(GpuProgramParametersSharedPtr params,
94  uint16 mask, GpuProgramType fromProgType);
100  void updateAtomicCounters(GpuProgramParametersSharedPtr params,
101  uint16 mask, GpuProgramType fromProgType);
107  void updateUniformBlocks(GpuProgramParametersSharedPtr params,
108  uint16 mask, GpuProgramType fromProgType);
114  void updatePassIterationUniforms(GpuProgramParametersSharedPtr params);
115 
119  void activate(void);
120 
124  GLint getAttributeIndex(VertexElementSemantic semantic, uint index);
125 
126  protected:
129 
131  void compileAndLink(void);
132  void loadIndividualProgram(GLSLShader *program);
133  // /// Put a program pipeline in use.
134  // void _useProgram(void);
136  void buildGLUniformReferences(void);
137 
138  void getMicrocodeFromCache(void);
139  void getIndividualProgramMicrocodeFromCache(GLSLShader* program);
140  };
141 }
142 
143 #endif
GpuProgramType
Enumerates the types of programs which can run on the GPU.
C++ encapsulation of GLSL program object.
VertexElementSemantic
Vertex element semantics, used to identify the meaning of vertex buffer contents. ...
Specialisation of GLSLProgram to provide support for separable programs via the OpenGL program pipeli...
GLuint getGLProgramPipelineHandle() const
GL Program Pipeline Handle.
GLuint mGLProgramPipelineHandle
GL handle for pipeline object.
#define _OgreGL3PlusExport
unsigned short uint16
Definition: OgrePlatform.h:421
Specialisation of HighLevelGpuProgram to encapsulate shader objects obtained from compiled shaders wr...
unsigned int uint