From e2f826b8fcfc49b9ce07577af15ad4a3fd2c158e Mon Sep 17 00:00:00 2001 From: Mathieu MARACHE Date: Tue, 29 Aug 2017 11:34:27 +0200 Subject: [PATCH] Under macOS the glValidateProgram reports too many false negatives (errors) about missing buffers, etc.. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From the internet https://stackoverflow.com/questions/15335510/opengl-glvalidateprogram-error-on-mac-os-x : « […] The purpose of glValidateProgram is not to use it as an added "check" step after linking the program, because the GL and application state is hardly ready for actually using that program at this point, probably it's even before we get around to initializing the default framebuffer (its bitdepth, its multisample buffers, etc), and that's what the error hints at. An appropriate place to call glValidateProgram would be right before you make a real render call. » --- src/osg/Program.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/osg/Program.cpp b/src/osg/Program.cpp index 7092a565a..85c49a37d 100644 --- a/src/osg/Program.cpp +++ b/src/osg/Program.cpp @@ -517,9 +517,10 @@ void Program::apply( osg::State& state ) const // for shader debugging: to minimize performance impact, // optionally validate based on notify level. // TODO: enable this using notify level, or perhaps its own getenv()? +#ifndef __APPLE__ if( osg::isNotifyEnabled(osg::INFO) ) pcp->validateProgram(); - +#endif pcp->useProgram(); state.setLastAppliedProgramObject(pcp); }