Fixed LLGLState::checkStates() failing upon context re-creation:

-After new context creation, immediately call LLRender::refreshState() after LLViewerWindow::initGLDefaults() in order to force states to apply.
--LLRender::initGLDefaults optimizes out gl calls by caching states, but the cached values are only applicable to the old context, not the new, so this optimization must be skipped (LLRender::mDirty).
-LLViewerWindow::mStatesDirty also triggered a redundant shader reload, since restoreGL also called setShaders().
Fixed somewhat annoying flicker of a single frame whilst recovering from screen resizing.
-Skip frame if LLViewerWindow::checkSettings() called LLViewerWindow::reshape. (reshape will set gWindowResized to true)
--True optimal fix will require some refactoring.
Reworked how window position is saved in LLViewerWindow::changeDisplaySettings. Hopefully reduces chances of odd behavior (had WindowX and WindowY get stuck at massive negative values before)
This commit is contained in:
Shyotl
2012-10-25 20:42:58 -05:00
parent 67ee544231
commit 1a741b97d2
5 changed files with 47 additions and 19 deletions

View File

@@ -320,6 +320,11 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot, boo
}
gViewerWindow->checkSettings();
if(gWindowResized) //Singu Note: gViewerWindow->checkSettings() can call LLViewerWindow::reshape(). If it has then skip this frame.
{
return;
}
{
LLFastTimer ftm(FTM_PICK);