Merge pull request #13115 from sethalves/fix-autoAdjustLOD-asan

fix divide-by-zero asan warning in LODManager::autoAdjustLOD
This commit is contained in:
Seth Alves 2018-05-15 10:58:00 -07:00 committed by GitHub
commit 24404afe26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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;
}