From e5cd4da823fe61e57c2d4bb829e39a587276af09 Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Thu, 14 Apr 2022 22:24:11 +0300 Subject: SL-17035 Crash at gl_debug_callback RenderDebugGL was avaliable from develop menu, but since it was persistent, caused slowdowns and crashes it could result in users crashing or lagging without knowing the cause. To resolve the issue it was made to last for a single session. --- indra/newview/app_settings/cmd_line.xml | 2 +- indra/newview/app_settings/settings.xml | 4 ++-- indra/newview/llappviewer.cpp | 11 ++++++++++- indra/newview/llface.cpp | 2 -- indra/newview/llviewercontrol.cpp | 8 -------- indra/newview/llvovolume.cpp | 2 -- indra/newview/skins/default/xui/en/menu_viewer.xml | 6 +++--- 7 files changed, 16 insertions(+), 19 deletions(-) (limited to 'indra/newview') diff --git a/indra/newview/app_settings/cmd_line.xml b/indra/newview/app_settings/cmd_line.xml index 4e186292f7..6da14b7599 100644 --- a/indra/newview/app_settings/cmd_line.xml +++ b/indra/newview/app_settings/cmd_line.xml @@ -55,7 +55,7 @@ debugsession desc - Run as if RenderDebugGL is TRUE, but log errors until end of session. + Run as if RenderDebugGLSession is TRUE, but log errors until end of session. map-to DebugSession diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 73efa16abe..f545a5d1f1 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -9163,10 +9163,10 @@ Value 0.5 - RenderDebugGL + RenderDebugGLSession Comment - Enable strict GL debugging. + Enable strict GL debugging on the start of next session. Persist 1 Type diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index e01d713501..af7c21706a 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -604,7 +604,7 @@ static void settings_modify() LLRenderTarget::sUseFBO = LLPipeline::sRenderDeferred && gSavedSettings.getBOOL("RenderAvatarVP"); LLVOSurfacePatch::sLODFactor = gSavedSettings.getF32("RenderTerrainLODFactor"); LLVOSurfacePatch::sLODFactor *= LLVOSurfacePatch::sLODFactor; //square lod factor to get exponential range of [1,4] - gDebugGL = gSavedSettings.getBOOL("RenderDebugGL") || gDebugSession; + gDebugGL = gDebugGLSession || gDebugSession; gDebugPipeline = gSavedSettings.getBOOL("RenderDebugPipeline"); } @@ -2708,6 +2708,15 @@ bool LLAppViewer::initConfiguration() ll_init_fail_log(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "test_failures.log")); } + if (gSavedSettings.getBOOL("RenderDebugGLSession")) + { + gDebugGLSession = TRUE; + gDebugGL = TRUE; + // gDebugGL can cause excessive logging + // so it's limited to a single session + gSavedSettings.setBOOL("RenderDebugGLSession", FALSE); + } + const LLControlVariable* skinfolder = gSavedSettings.getControl("SkinCurrent"); if(skinfolder && LLStringUtil::null != skinfolder->getValue().asString()) { diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index f1b64a5899..445615fdd5 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -63,7 +63,6 @@ #pragma GCC diagnostic ignored "-Wuninitialized" #endif -extern BOOL gGLDebugLoggingEnabled; #define LL_MAX_INDICES_COUNT 1000000 static LLStaticHashedString sTextureIndexIn("texture_index_in"); @@ -1522,7 +1521,6 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, !rebuild_weights && //TODO: add support for weights !volume.isUnique()) //source volume is NOT flexi { //use transform feedback to pack vertex buffer - //gGLDebugLoggingEnabled = TRUE; LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_FEEDBACK); LLGLEnable discard(GL_RASTERIZER_DISCARD); LLVertexBuffer* buff = (LLVertexBuffer*) vf.mVertexBuffer.get(); diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index bc425123e1..3d1f4e61cc 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -484,13 +484,6 @@ static bool handleRenderBumpChanged(const LLSD& newval) return true; } -static bool handleRenderDebugGLChanged(const LLSD& newvalue) -{ - gDebugGL = newvalue.asBoolean() || gDebugSession; - gGL.clearErrors(); - return true; -} - static bool handleRenderDebugPipelineChanged(const LLSD& newvalue) { gDebugPipeline = newvalue.asBoolean(); @@ -697,7 +690,6 @@ void settings_setup_listeners() gSavedSettings.getControl("RenderObjectBump")->getSignal()->connect(boost::bind(&handleRenderBumpChanged, _2)); gSavedSettings.getControl("RenderMaxVBOSize")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("RenderDeferredNoise")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); - gSavedSettings.getControl("RenderDebugGL")->getSignal()->connect(boost::bind(&handleRenderDebugGLChanged, _2)); 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)); diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 77f756a123..7da40bd504 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -107,8 +107,6 @@ static LLTrace::BlockTimerStatHandle FTM_GEN_TRIANGLES("Generate Triangles"); static LLTrace::BlockTimerStatHandle FTM_GEN_VOLUME("Generate Volumes"); static LLTrace::BlockTimerStatHandle FTM_VOLUME_TEXTURES("Volume Textures"); -extern BOOL gGLDebugLoggingEnabled; - // Implementation class of LLMediaDataClientObject. See llmediadataclient.h class LLMediaDataClientObjectImpl : public LLMediaDataClientObject { diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index bea06299da..1caa0908ea 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -3121,14 +3121,14 @@ function="World.EnvPreset" + parameter="RenderDebugGLSession" /> + parameter="RenderDebugGLSession" />