diff options
author | Graham Linden <graham@lindenlab.com> | 2019-08-22 10:11:59 -0700 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2019-08-22 10:11:59 -0700 |
commit | 01e6839f21becca6ade3fe723cebc26a7f10de8e (patch) | |
tree | 3cdada832eed8bd2d84fa96c051359207be2951a | |
parent | 98d926afd7fba39cac373a89705851ad8bb2258e (diff) |
SL-11779
Make changing shadow res scale not instantly drop/realloc buffers but wait until display gets to it.
-rw-r--r-- | indra/newview/llviewercontrol.cpp | 11 | ||||
-rw-r--r-- | indra/newview/llviewerdisplay.cpp | 2 | ||||
-rw-r--r-- | indra/newview/pipeline.cpp | 5 | ||||
-rw-r--r-- | indra/newview/pipeline.h | 1 |
4 files changed, 16 insertions, 3 deletions
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index a699491e1b..b1d47b7d75 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -190,6 +190,13 @@ bool handleRenderTransparentWaterChanged(const LLSD& newvalue) return true; } + +static bool handleWindowResized(const LLSD& newvalue) +{ + gPipeline.requestResizeScreenTexture(); + return true; +} + static bool handleReleaseGLBufferChanged(const LLSD& newvalue) { if (gPipeline.isInit()) @@ -609,14 +616,14 @@ void settings_setup_listeners() gSavedSettings.getControl("RenderUseTriStrips")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("RenderAvatarVP")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("VertexShaderEnable")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); - gSavedSettings.getControl("RenderUIBuffer")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); + gSavedSettings.getControl("RenderUIBuffer")->getSignal()->connect(boost::bind(&handleWindowResized, _2)); gSavedSettings.getControl("RenderDepthOfField")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderFSAASamples")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderSpecularResX")->getSignal()->connect(boost::bind(&handleLUTBufferChanged, _2)); gSavedSettings.getControl("RenderSpecularResY")->getSignal()->connect(boost::bind(&handleLUTBufferChanged, _2)); gSavedSettings.getControl("RenderSpecularExponent")->getSignal()->connect(boost::bind(&handleLUTBufferChanged, _2)); gSavedSettings.getControl("RenderAnisotropic")->getSignal()->connect(boost::bind(&handleAnisotropicChanged, _2)); - gSavedSettings.getControl("RenderShadowResolutionScale")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); + gSavedSettings.getControl("RenderShadowResolutionScale")->getSignal()->connect(boost::bind(&handleWindowResized, _2)); gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderGlow")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("RenderGlowResolutionPow")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index ddce419f19..0fb687aead 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -249,7 +249,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) { LL_RECORD_BLOCK_TIME(FTM_RENDER); - if (gWindowResized) + if (gWindowResized || gResizeScreenTexture) { //skip render on frames where window has been resized LL_RECORD_BLOCK_TIME(FTM_RESIZE_WINDOW); gGL.flush(); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 448b65272b..9b6bf9bfc3 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -735,6 +735,11 @@ void LLPipeline::throttleNewMemoryAllocation(bool disable) } } +void LLPipeline::requestResizeScreenTexture() +{ + gResizeScreenTexture = TRUE; +} + void LLPipeline::resizeScreenTexture() { LL_RECORD_BLOCK_TIME(FTM_RESIZE_SCREEN_TEXTURE); diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index cc9ec06f80..44aa9d85fa 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -100,6 +100,7 @@ public: void restoreGL(); void resetVertexBuffers(); void doResetVertexBuffers(bool forced = false); + void requestResizeScreenTexture(); // set flag only, no work, safer for callbacks... void resizeScreenTexture(); void releaseGLBuffers(); void releaseLUTBuffers(); |