Permalink
Browse files

Avoid needless gl context re-creation. FBO change detection logic was…

… incorrect. Also, don't clobber fbo and skinned shader settings when deferred/shaders are toggled.
  • Loading branch information...
Shyotl committed Jun 10, 2016
1 parent 0773f29 commit ab01a68d92eecfef64408724ab84f12c70e16cb0
Showing with 12 additions and 13 deletions.
  1. +12 −13 indra/newview/llpaneldisplay.cpp
@@ -554,15 +554,16 @@ void LLPanelDisplay::refreshEnabledState()
if (render_deferred && wlatmos && shaders)
{
getChildView("fbo")->setEnabled(false);
- getChildView("fbo")->setValue(true);
+ //getChildView("fbo")->setValue(true);
mCtrlAvatarVP->setEnabled(false);
- gSavedSettings.setBOOL("RenderAvatarVP", true);
+ //gSavedSettings.setBOOL("RenderAvatarVP", true);
}
else
{
getChildView("fbo")->setEnabled(gGLManager.mHasFramebufferObject);
+ //getChildView("fbo")->setValue(gSavedSettings.getBOOL("RenderUseFBO"));
mCtrlAvatarVP->setEnabled(shaders);
- if (!shaders) gSavedSettings.setBOOL("RenderAvatarVP", false);
+ //if (!shaders) gSavedSettings.setBOOL("RenderAvatarVP", false);
}
// now turn off any features that are unavailable
@@ -718,25 +719,23 @@ void LLPanelDisplay::cancel()
void LLPanelDisplay::apply()
{
- U32 fsaa_value = childGetValue("fsaa").asInteger();
- S32 vsync_value = childGetValue("vsync").asInteger();
- bool fbo_value = childGetValue("fbo").asBoolean();
+ bool can_defer = LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred");
+ S32 vsync_value = childGetValue("vsync").asInteger();
+ bool fbo_value = childGetValue("fbo").asBoolean() || (can_defer && mCtrlDeferred->getValue().asBoolean());
+ bool fbo_prior_value = mUseFBO || (can_defer && mDeferred );
+ U8 fsaa_value = fbo_value ? 0 : childGetValue("fsaa").asInteger();
+ U8 fsaa_prior_value = fbo_prior_value ? 0 : mFSAASamples;
LLWindow* window = gViewerWindow->getWindow();
if(vsync_value == -1 && !gGLManager.mHasAdaptiveVsync)
vsync_value = 0;
- bool apply_fsaa_change = fbo_value ? false : (mFSAASamples != fsaa_value);
-
- if(!apply_fsaa_change && (bool)mUseFBO != fbo_value)
- {
- apply_fsaa_change = fsaa_value != 0 || mFSAASamples != 0 ;
- }
+ bool apply_fsaa_change = fsaa_value != fsaa_prior_value;
bool apply_vsync_change = vsync_value != mVsyncMode;
- gSavedSettings.setU32("RenderFSAASamples", fsaa_value);
+ gSavedSettings.setU32("RenderFSAASamples", childGetValue("fsaa").asInteger());
gSavedSettings.setS32("SHRenderVsyncMode", vsync_value);
applyResolution();

0 comments on commit ab01a68

Please sign in to comment.