Skip to content
Snippets Groups Projects
Commit 1762cc49 authored by David Parks's avatar David Parks
Browse files

SH-2570 Don't minimize viewer when reloading shaders (revert hack that didn't...

SH-2570 Don't minimize viewer when reloading shaders (revert hack that didn't work) and pause shader loading until after all feature masks have been applied when switching detail levels
parent 7fef84ca
No related branches found
No related tags found
No related merge requests found
......@@ -51,6 +51,7 @@
#include "llcontrol.h"
#include "llboost.h"
#include "llweb.h"
#include "llviewershadermgr.h"
#if LL_WINDOWS
#include "lldxhardware.h"
......@@ -662,8 +663,10 @@ void LLFeatureManager::applyFeatures(bool skipFeatures)
void LLFeatureManager::setGraphicsLevel(S32 level, bool skipFeatures)
{
applyBaseMasks();
LLViewerShaderMgr::sSkipReload = true;
applyBaseMasks();
switch (level)
{
case 0:
......@@ -684,6 +687,9 @@ void LLFeatureManager::setGraphicsLevel(S32 level, bool skipFeatures)
}
applyFeatures(skipFeatures);
LLViewerShaderMgr::sSkipReload = false;
LLViewerShaderMgr::instance()->setShaders();
}
void LLFeatureManager::applyBaseMasks()
......
......@@ -59,6 +59,7 @@ using std::make_pair;
using std::string;
BOOL LLViewerShaderMgr::sInitialized = FALSE;
bool LLViewerShaderMgr::sSkipReload = false;
LLVector4 gShinyOrigin;
......@@ -350,7 +351,7 @@ void LLViewerShaderMgr::setShaders()
//setShaders might be called redundantly by gSavedSettings, so return on reentrance
static bool reentrance = false;
if (!gPipeline.mInitialized || !sInitialized || reentrance)
if (!gPipeline.mInitialized || !sInitialized || reentrance || sSkipReload)
{
return;
}
......@@ -401,9 +402,6 @@ void LLViewerShaderMgr::setShaders()
if (gViewerWindow)
{
gViewerWindow->setCursor(UI_CURSOR_WAIT);
//VICIOUS HACK -- some drivers will time out if we don't redraw the window within 2 seconds, and this operation can take awhile
//minimizing tells the driver we won't be updating the window for a bit
gViewerWindow->getWindow()->minimize();
}
// Lighting
......
......@@ -33,6 +33,7 @@ class LLViewerShaderMgr: public LLShaderMgr
{
public:
static BOOL sInitialized;
static bool sSkipReload;
LLViewerShaderMgr();
/* virtual */ ~LLViewerShaderMgr();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment