SL-16841 Skip rendering shadows when decreasing shadow detail setting to avoid stalls
parent
7af2d51f57
commit
95f7b552ad
|
|
@ -166,6 +166,12 @@ static bool handleSetShaderChanged(const LLSD& newvalue)
|
|||
return true;
|
||||
}
|
||||
|
||||
static bool handleShadowDetailChanged(const LLSD& newvalue)
|
||||
{
|
||||
gPipeline.handleShadowDetailChanged();
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool handleRenderPerfTestChanged(const LLSD& newvalue)
|
||||
{
|
||||
bool status = !newvalue.asBoolean();
|
||||
|
|
@ -695,7 +701,7 @@ void settings_setup_listeners()
|
|||
gSavedSettings.getControl("RenderDebugPipeline")->getSignal()->connect(boost::bind(&handleRenderDebugPipelineChanged, _2));
|
||||
gSavedSettings.getControl("RenderResolutionDivisor")->getSignal()->connect(boost::bind(&handleRenderResolutionDivisorChanged, _2));
|
||||
gSavedSettings.getControl("RenderDeferred")->getSignal()->connect(boost::bind(&handleRenderDeferredChanged, _2));
|
||||
gSavedSettings.getControl("RenderShadowDetail")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
|
||||
gSavedSettings.getControl("RenderShadowDetail")->getSignal()->connect(boost::bind(&handleShadowDetailChanged, _2));
|
||||
gSavedSettings.getControl("RenderDeferredSSAO")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2));
|
||||
gSavedSettings.getControl("RenderPerformanceTest")->getSignal()->connect(boost::bind(&handleRenderPerfTestChanged, _2));
|
||||
gSavedSettings.getControl("TextureMemory")->getSignal()->connect(boost::bind(&handleVideoMemoryChanged, _2));
|
||||
|
|
|
|||
|
|
@ -10215,14 +10215,7 @@ void LLPipeline::generateSunShadow(LLCamera& camera)
|
|||
|
||||
if (mSunDiffuse == LLColor4::black)
|
||||
{ //sun diffuse is totally black, shadows don't matter
|
||||
LLGLDepthTest depth(GL_TRUE);
|
||||
|
||||
for (S32 j = 0; j < 4; j++)
|
||||
{
|
||||
mShadow[j].bindTarget();
|
||||
mShadow[j].clear();
|
||||
mShadow[j].flush();
|
||||
}
|
||||
skipRenderingShadows();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -11430,6 +11423,30 @@ void LLPipeline::restoreHiddenObject( const LLUUID& id )
|
|||
}
|
||||
}
|
||||
|
||||
void LLPipeline::skipRenderingShadows()
|
||||
{
|
||||
LLGLDepthTest depth(GL_TRUE);
|
||||
|
||||
for (S32 j = 0; j < 4; j++)
|
||||
{
|
||||
mShadow[j].bindTarget();
|
||||
mShadow[j].clear();
|
||||
mShadow[j].flush();
|
||||
}
|
||||
}
|
||||
|
||||
void LLPipeline::handleShadowDetailChanged()
|
||||
{
|
||||
if (RenderShadowDetail > gSavedSettings.getS32("RenderShadowDetail"))
|
||||
{
|
||||
skipRenderingShadows();
|
||||
}
|
||||
else
|
||||
{
|
||||
LLViewerShaderMgr::instance()->setShaders();
|
||||
}
|
||||
}
|
||||
|
||||
const F32 MIN_DRAW_DISTANCE = 64;
|
||||
const F32 MAX_DRAW_DISTANCE = 256;
|
||||
|
||||
|
|
|
|||
|
|
@ -423,6 +423,7 @@ public:
|
|||
void skipRenderingOfTerrain( bool flag );
|
||||
void hideObject( const LLUUID& id );
|
||||
void restoreHiddenObject( const LLUUID& id );
|
||||
void handleShadowDetailChanged();
|
||||
|
||||
void autoAdjustSettings();
|
||||
void setAdjustmentTimerExpiry(F32 expiration);
|
||||
|
|
@ -437,6 +438,7 @@ private:
|
|||
void connectRefreshCachedSettingsSafe(const std::string name);
|
||||
void hideDrawable( LLDrawable *pDrawable );
|
||||
void unhideDrawable( LLDrawable *pDrawable );
|
||||
void skipRenderingShadows();
|
||||
public:
|
||||
enum {GPU_CLASS_MAX = 3 };
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue