fix divide-by-zero asan warning in LODManager::autoAdjustLOD

This commit is contained in:
Seth Alves 2018-05-05 20:45:06 -07:00
parent 6ec91cfa82
commit 30c5fa6fa1

View file

@ -70,7 +70,7 @@ void LODManager::autoAdjustLOD(float realTimeDelta) {
// Note: we MUST clamp the blend to 1.0 for stability
float blend = (realTimeDelta < LOD_ADJUST_RUNNING_AVG_TIMESCALE) ? realTimeDelta / LOD_ADJUST_RUNNING_AVG_TIMESCALE : 1.0f;
_avgRenderTime = (1.0f - blend) * _avgRenderTime + blend * maxRenderTime; // msec
if (!_automaticLODAdjust) {
if (!_automaticLODAdjust || _avgRenderTime == 0.0f) {
// early exit
return;
}