Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 264 vs 265 for /trunk/Source Code/Hardware/Video/OpenGL/Shaders/glShaderProgram.cpp

Diff revisions: vs.
  @@ -23,14 +23,6 @@
23 23 _tessellationEvaluationShader = nullptr;
24 24 _computeShader = nullptr;
25 25 _shaderProgramId = Divide::GLUtil::_invalidObjectID;
26 - //3 buffers: Matrices, Materials and Lights
27 - _UBOLocation.resize(UBO_PLACEHOLDER,-1);
28 - _uniformBufferObjects.resize(UBO_PLACEHOLDER, nullptr);
29 - GL_API& glApi = GL_API::getInstance();
30 - _uniformBufferObjects[Shadow_UBO] = glApi.getUBO(Shadow_UBO);
31 - _uniformBufferObjects[Lights_UBO] = glApi.getUBO(Lights_UBO);
32 - _uniformBufferObjects[Matrices_UBO] = glApi.getUBO(Matrices_UBO);
33 - _uniformBufferObjects[Materials_UBO] = glApi.getUBO(Materials_UBO);
34 26
35 27 _shaderStageTable[VERTEX_SHADER] = GL_VERTEX_SHADER;
36 28 _shaderStageTable[FRAGMENT_SHADER] = GL_FRAGMENT_SHADER;
  @@ -49,9 +41,6 @@
49 41 }
50 42 glDeleteProgram(_shaderProgramId);
51 43 }
52 -
53 - _UBOLocation.clear();
54 - _uniformBufferObjects.clear();
55 44 }
56 45
57 46 void glShaderProgram::validateInternal() {
  @@ -163,28 +152,6 @@
163 152 _refreshVert = _refreshFrag = _refreshGeom = _refreshTess = _refreshComp = false;
164 153 link();
165 154 }
166 - // Init UBOs
167 - _UBOLocation[Matrices_UBO] = glGetUniformBlockIndex(_shaderProgramIDTemp, "dvd_MatrixBlock");
168 - _UBOLocation[Materials_UBO] = glGetUniformBlockIndex(_shaderProgramIDTemp, "dvd_MaterialBlock");
169 - _UBOLocation[Lights_UBO] = glGetUniformBlockIndex(_shaderProgramIDTemp, "dvd_LightBlock");
170 - _UBOLocation[Shadow_UBO] = glGetUniformBlockIndex(_shaderProgramIDTemp, "dvd_ShadowBlock");
171 -
172 - if (_UBOLocation[Matrices_UBO] != GL_INVALID_INDEX){
173 - _uniformBufferObjects[Matrices_UBO]->bindUniform(_shaderProgramIDTemp, _UBOLocation[Matrices_UBO]);
174 - _uniformBufferObjects[Matrices_UBO]->bindBufferBase();
175 - }
176 - if (_UBOLocation[Materials_UBO] != GL_INVALID_INDEX){
177 - _uniformBufferObjects[Materials_UBO]->bindUniform(_shaderProgramIDTemp, _UBOLocation[Materials_UBO]);
178 - _uniformBufferObjects[Materials_UBO]->bindBufferBase();
179 - }
180 - if (_UBOLocation[Lights_UBO] != GL_INVALID_INDEX){
181 - _uniformBufferObjects[Lights_UBO]->bindUniform(_shaderProgramIDTemp, _UBOLocation[Lights_UBO]);
182 - _uniformBufferObjects[Lights_UBO]->bindBufferBase();
183 - }
184 - if (_UBOLocation[Shadow_UBO] != GL_INVALID_INDEX){
185 - _uniformBufferObjects[Shadow_UBO]->bindUniform(_shaderProgramIDTemp, _UBOLocation[Shadow_UBO]);
186 - _uniformBufferObjects[Shadow_UBO]->bindBufferBase();
187 - }
188 155
189 156 validate();
190 157 _shaderProgramId = _shaderProgramIDTemp;
  @@ -264,8 +231,8 @@
264 231 //Use the specified shader path
265 232 glswSetPath(std::string(getResourceLocation() + "GLSL/").c_str(), ".glsl");
266 233 //Mirror initial shader defines to match line count
267 - GLint lineCountOffset = 8;
268 - GLint lineCountOffsetFrag = 1;
234 + GLint lineCountOffset = 11;
235 + GLint lineCountOffsetFrag = 9;
269 236 GLint lineCountOffsetVert = 8;
270 237 GLint lineCountOffsetGeom = 0;
271 238 if (GFX_DEVICE.getGPUVendor() == GPU_VENDOR_NVIDIA){ //nVidia specific
  @@ -473,7 +440,6 @@
473 440 assert(_shaderProgramId != Divide::GLUtil::_invalidObjectID);
474 441
475 442 GL_API::setActiveProgram(this);
476 - //_uniformBufferObjects[Lights_UBO]->printUniformBlockInfo(this->_shaderProgramId, _UBOLocation[Lights_UBO]);
477 443 //send default uniforms to GPU for every shader
478 444 return ShaderProgram::bind();
479 445 }