Don't validate shader programs on MacOS X

If the paint event is called before the view is visible, validation
of the shader program will cause an error on MacOS X 10.8 and forward,
stating that the operation was ignored.
This commit is contained in:
Roland Kaufmann
2014-12-01 10:17:40 +01:00
parent 4378f4886a
commit 6d38344261
2 changed files with 6 additions and 0 deletions

View File

@@ -200,7 +200,11 @@ void OpenGL::cvf_check_ogl(OpenGLContext* oglContext, const CodeLocation& codeLo
CVF_ASSERT(oglContext->isCurrent());
Logger* logger = oglContext->group()->logger();
#if defined(CVF_OSX)
if (logger && (err != GL_INVALID_FRAMEBUFFER_OPERATION))
#else
if (logger)
#endif /* defined(CVF_OSX) */
{
String errCodeStr = mapOpenGLErrorToString(err);
String msg = "OGL(" + errCodeStr + "): ";

View File

@@ -286,7 +286,9 @@ bool ShaderProgram::useProgram(OpenGLContext* oglContext) const
}
CVF_ASSERT(OglRc::safeOglId(m_oglRcProgram.p()) != 0);
#ifndef CVF_OSX
CVF_ASSERT(validateProgram(oglContext));
#endif
// Need this check to clear any "hanging" errors that is not produced by glUseProgram below, but still
// will make this method return false.