Commits

David Rogers committed fe73054

Add GLSL ES program and pipeline validation to help catch errors.

  • Participants
  • Parent commits 0819c4d
  • Branches v1-8

Comments (0)

Files changed (2)

RenderSystems/GLES2/src/GLSLES/src/OgreGLSLESExtSupport.cpp

                 glGetShaderiv(obj, GL_INFO_LOG_LENGTH, &infologLength);
                 GL_CHECK_ERROR
             }
+#if GL_EXT_separate_shader_objects
+            else if(glIsProgramPipelineEXT(obj))
+            {
+                glValidateProgramPipelineEXT(obj);
+                glGetProgramPipelineivEXT(obj, GL_INFO_LOG_LENGTH, &infologLength);
+                GL_CHECK_ERROR
+            }
+#endif
             else if(glIsProgram(obj))
             {
+                glValidateProgram(obj);
                 glGetProgramiv(obj, GL_INFO_LOG_LENGTH, &infologLength);
                 GL_CHECK_ERROR
             }
 			{
 				GLint charsWritten  = 0;
 
-				//GLchar * infoLog = OGRE_NEW GLchar[infologLength];
 				char * infoLog = new char [infologLength];
 				infoLog[0] = 0;
 
                     glGetShaderInfoLog(obj, infologLength, &charsWritten, infoLog);
                     GL_CHECK_ERROR
                 }
+#if GL_EXT_separate_shader_objects
+                else if(glIsProgramPipelineEXT(obj))
+                {
+                    glGetProgramPipelineInfoLogEXT(obj, infologLength, &charsWritten, infoLog);
+                    GL_CHECK_ERROR
+                }
+#endif
                 else if(glIsProgram(obj))
                 {
                     glGetProgramInfoLog(obj, infologLength, &charsWritten, infoLog);
                     GL_CHECK_ERROR
                 }
+
 				if (strlen(infoLog) > 0)
 				{
 					logMessage += "\n" + String(infoLog);

RenderSystems/GLES2/src/GLSLES/src/OgreGLSLESProgramPipeline.cpp

                 glUseProgramStagesEXT(mGLProgramPipelineHandle, GL_FRAGMENT_SHADER_BIT_EXT, mFragmentProgram->getGLSLProgram()->getGLProgramHandle());
                 GL_CHECK_ERROR
             }
+
+            // Validate pipeline
+            logObjectInfo( getCombinedName() + String("GLSL program pipeline result : "), mGLProgramPipelineHandle );
 		}
 #endif
 	}
                             break;
                         case GCT_INT1:
                             glProgramUniform1ivEXT(progID, currentUniform->mLocation, glArraySize, 
-                                                   (GLint*)params->getIntPointer(def->physicalIndex));
+                                                   params->getIntPointer(def->physicalIndex));
                             break;
                         case GCT_INT2:
                             glProgramUniform2ivEXT(progID, currentUniform->mLocation, glArraySize, 
-                                                   (GLint*)params->getIntPointer(def->physicalIndex));
+                                                   params->getIntPointer(def->physicalIndex));
                             break;
                         case GCT_INT3:
                             glProgramUniform3ivEXT(progID, currentUniform->mLocation, glArraySize, 
-                                                   (GLint*)params->getIntPointer(def->physicalIndex));
+                                                   params->getIntPointer(def->physicalIndex));
                             break;
                         case GCT_INT4:
                             glProgramUniform4ivEXT(progID, currentUniform->mLocation, glArraySize, 
-                                                   (GLint*)params->getIntPointer(def->physicalIndex));
+                                                   params->getIntPointer(def->physicalIndex));
                             break;
                         case GCT_SAMPLER1D:
                         case GCT_SAMPLER1DSHADOW:
                         case GCT_SAMPLERCUBE:
                             // Samplers handled like 1-element ints
                             glProgramUniform1ivEXT(progID, currentUniform->mLocation, 1, 
-                                                   (GLint*)params->getIntPointer(def->physicalIndex));
+                                                   params->getIntPointer(def->physicalIndex));
                             break;
                         case GCT_MATRIX_2X3:
                         case GCT_MATRIX_2X4: