From Mike Weiblen, " Move update of shader values after shader rebuild opportunity, to ensure uniform

state of shaders is consistent"
This commit is contained in:
Robert Osfield 2005-03-23 20:31:42 +00:00
parent aee1e88f15
commit 58d60476f0

View File

@ -12,7 +12,7 @@
*/ */
/* file: src/osgGL2/ProgramObject.cpp /* file: src/osgGL2/ProgramObject.cpp
* author: Mike Weiblen 2004-11-09 * author: Mike Weiblen 2005-03-21
* *
* See http://www.3dlabs.com/opengl2/ for more information regarding * See http://www.3dlabs.com/opengl2/ for more information regarding
* the OpenGL Shading Language. * the OpenGL Shading Language.
@ -306,8 +306,6 @@ void ProgramObject::apply(osg::State& state) const
const osg::FrameStamp* frameStamp = state.getFrameStamp(); const osg::FrameStamp* frameStamp = state.getFrameStamp();
const int frameNumber = (frameStamp) ? frameStamp->getFrameNumber() : -1; const int frameNumber = (frameStamp) ? frameStamp->getFrameNumber() : -1;
updateUniforms( frameNumber );
PerContextProgObj* pcpo = getPCPO( contextID ); PerContextProgObj* pcpo = getPCPO( contextID );
if( pcpo->isDirty() ) if( pcpo->isDirty() )
@ -319,6 +317,7 @@ void ProgramObject::apply(osg::State& state) const
pcpo->build(); pcpo->build();
} }
updateUniforms( frameNumber );
// make this glProgramObject part of current GL state // make this glProgramObject part of current GL state
pcpo->use(); pcpo->use();