Fixed issues with changing AA and AF...
-AF change no longer reloads the window to apply. Doing such isn't needed anymore. -AA change no longer reloads the window to apply, IFF RenderUseFBO is true. -AA change, IFF RenderUseFBO is false, reloads window. Texture issues under this scenario should be resolved. -LLComboBox now updates control_name it's linked to, automatically. -New LLComboBox Behavor when paired with new AA/AF application changes renders LLFloaterHardwareSettings::apply() pointless, EXCEPT for when changing AA while FBOs are off.
This commit is contained in:
@@ -301,11 +301,13 @@ S32 LLImageGL::updateBoundTexMem()const
|
||||
//static
|
||||
void LLImageGL::destroyGL(BOOL save_state)
|
||||
{
|
||||
deleteDeadTextures(); //Dump unimportant textures.
|
||||
for (S32 stage = 0; stage < gGLManager.mNumTextureUnits; stage++)
|
||||
{
|
||||
gGL.getTexUnit(stage)->unbind(LLTexUnit::TT_TEXTURE);
|
||||
}
|
||||
|
||||
int stored_count = 0;
|
||||
sAllowReadBackRaw = true ;
|
||||
for (std::set<LLImageGL*>::iterator iter = sImageList.begin();
|
||||
iter != sImageList.end(); iter++)
|
||||
@@ -320,18 +322,24 @@ void LLImageGL::destroyGL(BOOL save_state)
|
||||
{
|
||||
glimage->mSaveData = NULL ;
|
||||
}
|
||||
else
|
||||
stored_count++;
|
||||
}
|
||||
|
||||
glimage->destroyGLTexture();
|
||||
stop_glerror();
|
||||
}
|
||||
}
|
||||
llinfos << "Storing " << stored_count << " images..." << llendl;
|
||||
sAllowReadBackRaw = false ;
|
||||
deleteDeadTextures();//Now, actually call glDeleteTextures for everything.
|
||||
}
|
||||
|
||||
//static
|
||||
void LLImageGL::restoreGL()
|
||||
{
|
||||
|
||||
int recovered_count = 0;
|
||||
for (std::set<LLImageGL*>::iterator iter = sImageList.begin();
|
||||
iter != sImageList.end(); iter++)
|
||||
{
|
||||
@@ -346,10 +354,12 @@ void LLImageGL::restoreGL()
|
||||
{
|
||||
glimage->createGLTexture(glimage->mCurrentDiscardLevel, glimage->mSaveData, 0, TRUE, glimage->getCategory());
|
||||
stop_glerror();
|
||||
recovered_count++;
|
||||
}
|
||||
glimage->mSaveData = NULL; // deletes data
|
||||
}
|
||||
}
|
||||
llinfos << "Restored " << recovered_count << " images" << llendl;
|
||||
}
|
||||
|
||||
//static
|
||||
@@ -1281,7 +1291,7 @@ BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compre
|
||||
llverify(gGL.getTexUnit(0)->bindManual(mBindTarget, mTexName));
|
||||
|
||||
//debug code, leave it there commented.
|
||||
//checkTexSize() ;
|
||||
checkTexSize() ;
|
||||
|
||||
LLGLint glwidth = 0;
|
||||
glGetTexLevelParameteriv(mTarget, gl_discard, GL_TEXTURE_WIDTH, (GLint*)&glwidth);
|
||||
|
||||
@@ -248,6 +248,8 @@ void LLComboBox::onCommit()
|
||||
mTextEntry->setValue(getSimple());
|
||||
mTextEntry->setTentative(FALSE);
|
||||
}
|
||||
|
||||
setControlValue(getValue());
|
||||
LLUICtrl::onCommit();
|
||||
}
|
||||
|
||||
|
||||
@@ -169,32 +169,20 @@ BOOL LLFloaterHardwareSettings::postBuild()
|
||||
}
|
||||
|
||||
|
||||
void LLFloaterHardwareSettings::apply()
|
||||
void LLFloaterHardwareSettings::apply()
|
||||
{
|
||||
// Anisotropic rendering
|
||||
BOOL old_anisotropic = LLImageGL::sGlobalUseAnisotropic;
|
||||
LLImageGL::sGlobalUseAnisotropic = childGetValue("ani");
|
||||
|
||||
U32 fsaa = (U32) childGetValue("fsaa").asInteger();
|
||||
U32 old_fsaa = gSavedSettings.getU32("RenderFSAASamples");
|
||||
|
||||
BOOL logged_in = (LLStartUp::getStartupState() >= STATE_STARTED);
|
||||
|
||||
if (old_fsaa != fsaa)
|
||||
//Still do a bit of voodoo here. V2 forces restart to change FSAA with FBOs off.
|
||||
//Let's not do that, and instead do pre-V2 FSAA change handling for that particular case
|
||||
if(!LLRenderTarget::sUseFBO && (mFSAASamples != (U32)childGetValue("fsaa").asInteger()))
|
||||
{
|
||||
gSavedSettings.setU32("RenderFSAASamples", fsaa);
|
||||
BOOL logged_in = (LLStartUp::getStartupState() >= STATE_STARTED);
|
||||
LLWindow* window = gViewerWindow->getWindow();
|
||||
LLCoordScreen size;
|
||||
window->getSize(&size);
|
||||
gViewerWindow->changeDisplaySettings(window->getFullscreen(),
|
||||
size,
|
||||
gSavedSettings.getBOOL("DisableVerticalSync"),
|
||||
logged_in);
|
||||
}
|
||||
else if (old_anisotropic != LLImageGL::sGlobalUseAnisotropic)
|
||||
{
|
||||
LLImageGL::dirtyTexOptions();
|
||||
gViewerWindow->restartDisplay(logged_in);
|
||||
size,
|
||||
gSavedSettings.getBOOL("DisableVerticalSync"),
|
||||
logged_in);
|
||||
}
|
||||
|
||||
refresh();
|
||||
|
||||
@@ -121,6 +121,14 @@ static bool handleTerrainDetailChanged(const LLSD& newvalue)
|
||||
|
||||
static bool handleSetShaderChanged(const LLSD& newvalue)
|
||||
{
|
||||
|
||||
// Changing shader also changes the terrain detail to high, reflect that change here
|
||||
if (newvalue.asBoolean())
|
||||
{
|
||||
// shaders enabled, set terrain detail to high
|
||||
gSavedSettings.setS32("RenderTerrainDetail", 1);
|
||||
}
|
||||
// else, leave terrain detail as is
|
||||
LLViewerShaderMgr::instance()->setShaders();
|
||||
return true;
|
||||
}
|
||||
@@ -184,6 +192,13 @@ static bool handleReleaseGLBufferChanged(const LLSD& newvalue)
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool handleAnisotropicChanged(const LLSD& newvalue)
|
||||
{
|
||||
LLImageGL::sGlobalUseAnisotropic = newvalue.asBoolean();
|
||||
LLImageGL::dirtyTexOptions();
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool handleVolumeLODChanged(const LLSD& newvalue)
|
||||
{
|
||||
LLVOVolume::sLODFactor = (F32) newvalue.asReal();
|
||||
@@ -549,6 +564,8 @@ void settings_setup_listeners()
|
||||
gSavedSettings.getControl("RenderAnimateTrees")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _1));
|
||||
gSavedSettings.getControl("RenderAvatarVP")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _1));
|
||||
gSavedSettings.getControl("VertexShaderEnable")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _1));
|
||||
gSavedSettings.getControl("RenderFSAASamples")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _1));
|
||||
gSavedSettings.getControl("RenderAnisotropic")->getSignal()->connect(boost::bind(&handleAnisotropicChanged, _1));
|
||||
gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _1));
|
||||
gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _1));
|
||||
gSavedSettings.getControl("EnableRippleWater")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _1));
|
||||
|
||||
Reference in New Issue
Block a user