History

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

Seth Alves committed 8 years ago

Commit 30c5fa61 parent 6ec91cf1 file · +1 −1Browse files

Showing the changes to interface/src/LODManager.cpp (1 of 1 file). Show all

Unified · Split

interface/src/LODManager.cpp+1−1
@@ -70,7 +70,7 @@ void LODManager::autoAdjustLOD(float realTimeDelta) { · 69 unmodified lines
7070 // Note: we MUST clamp the blend to 1.0 for stability
7171 float blend = (realTimeDelta < LOD_ADJUST_RUNNING_AVG_TIMESCALE) ? realTimeDelta / LOD_ADJUST_RUNNING_AVG_TIMESCALE : 1.0f;
7272 _avgRenderTime = (1.0f - blend) * _avgRenderTime + blend * maxRenderTime; // msec
73− if (!_automaticLODAdjust) {
73+ if (!_automaticLODAdjust || _avgRenderTime == 0.0f) {
7474 // early exit
7575 return;
7676 }

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t