Skip to content

Commit

Permalink
VP: disable stack-memory optimization when data variance is DYNAMIC
Browse files Browse the repository at this point in the history
  • Loading branch information
gwaldron committed Feb 10, 2015
1 parent 75b7e9e commit d4c9567
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/osgEarth/VirtualProgram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1203,7 +1203,10 @@ VirtualProgram::apply( osg::State& state ) const
#ifdef USE_STACK_MEMORY
// remember this program selection in case this VP is applied again
// during the same frame.
if ( !programRecalled && !acceptCallbacksPresent && stack != 0L )
if (programRecalled == false && // recalled a program? not necessary
getDataVariance() != DYNAMIC && // DYNAMIC variance? might change during ST cull; no memory
acceptCallbacksPresent == false && // accept callbacks? cannot use memory
stack != 0L )
{
_vpStackMemory.remember(state, *stack, program.get());
}
Expand Down

0 comments on commit d4c9567

Please sign in to comment.