From d849574a931064bc0d90551e140b2db6c2ceed08 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 1 Jun 2009 11:22:42 +0000 Subject: [PATCH] From Wojciech Lewandowski, Fixed handling of empty Program. --- src/osgUtil/GLObjectsVisitor.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/osgUtil/GLObjectsVisitor.cpp b/src/osgUtil/GLObjectsVisitor.cpp index 845a77e0f..df0286e74 100644 --- a/src/osgUtil/GLObjectsVisitor.cpp +++ b/src/osgUtil/GLObjectsVisitor.cpp @@ -111,7 +111,12 @@ void GLObjectsVisitor::apply(osg::StateSet& stateset) stateset.compileGLObjects(*_renderInfo.getState()); osg::Program* program = dynamic_cast(stateset.getAttribute(osg::StateAttribute::PROGRAM)); - if (program) _lastCompiledProgram = program; + if (program) { + if( program->isFixedFunction() ) + _lastCompiledProgram = NULL; // It does not make sense to apply uniforms on fixed pipe + else + _lastCompiledProgram = program; + } if (_lastCompiledProgram.valid() && !stateset.getUniformList().empty()) {