From 8419a692b5a3dc54e2fd440ef5ee925e7c6f45d3 Mon Sep 17 00:00:00 2001 From: "Nyx (Neal Orman)" Date: Thu, 2 Sep 2010 17:30:46 -0400 Subject: CTS-237 WIP analyze performance of rendering system to evaluate accuracy of ARC Added a debug setting to allow for the automatic disabling of non-essential rendering. Code reviewed by Davep --- indra/newview/app_settings/settings.xml | 13 +++++++++- indra/newview/llviewercontrol.cpp | 42 +++++++++++++++++++++++++++++++++ indra/newview/pipeline.cpp | 20 ++++++++++++++++ indra/newview/pipeline.h | 1 + 4 files changed, 75 insertions(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 86f1f7bbec..96d2fd05e5 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -6716,7 +6716,18 @@ Value 1 - + RenderPerformanceTest + + Comment + Disable rendering of everything but in-world content for + performance testing + Persist + 1 + Type + Boolean + Value + 0 + RenderLightingDetail Comment diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp index 8eeffb84b0..ebb5c1ce48 100644 --- a/indra/newview/llviewercontrol.cpp +++ b/indra/newview/llviewercontrol.cpp @@ -127,6 +127,47 @@ static bool handleSetShaderChanged(const LLSD& newvalue) return true; } +static bool handleRenderPerfTestChanged(const LLSD& newvalue) +{ + bool status = !newvalue.asBoolean(); + if (!status) + { + gPipeline.clearRenderTypeMask(LLPipeline::RENDER_TYPE_SKY, + LLPipeline::RENDER_TYPE_WL_SKY, + LLPipeline::RENDER_TYPE_GROUND, + LLPipeline::RENDER_TYPE_TERRAIN, + LLPipeline::RENDER_TYPE_GRASS, + LLPipeline::RENDER_TYPE_TREE, + LLPipeline::RENDER_TYPE_WATER, + LLPipeline::RENDER_TYPE_PASS_GRASS, + LLPipeline::RENDER_TYPE_HUD, + LLPipeline::RENDER_TYPE_PARTICLES, + LLPipeline::RENDER_TYPE_CLOUDS, + LLPipeline::RENDER_TYPE_HUD_PARTICLES, + LLPipeline::END_RENDER_TYPES); + gPipeline.setRenderDebugFeatureControl(LLPipeline::RENDER_DEBUG_FEATURE_UI, false); + } + else + { + gPipeline.andRenderTypeMask(LLPipeline::RENDER_TYPE_SKY, + LLPipeline::RENDER_TYPE_WL_SKY, + LLPipeline::RENDER_TYPE_GROUND, + LLPipeline::RENDER_TYPE_TERRAIN, + LLPipeline::RENDER_TYPE_GRASS, + LLPipeline::RENDER_TYPE_TREE, + LLPipeline::RENDER_TYPE_WATER, + LLPipeline::RENDER_TYPE_PASS_GRASS, + LLPipeline::RENDER_TYPE_HUD, + LLPipeline::RENDER_TYPE_PARTICLES, + LLPipeline::RENDER_TYPE_CLOUDS, + LLPipeline::RENDER_TYPE_HUD_PARTICLES, + LLPipeline::END_RENDER_TYPES); + gPipeline.setRenderDebugFeatureControl(LLPipeline::RENDER_DEBUG_FEATURE_UI, false); + } + + return true; +} + static bool handleReleaseGLBufferChanged(const LLSD& newvalue) { if (gPipeline.isInit()) @@ -500,6 +541,7 @@ void settings_setup_listeners() gSavedSettings.getControl("RenderBakeSunlight")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("RenderNoAlpha")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2)); gSavedSettings.getControl("RenderAvatarVP")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); + gSavedSettings.getControl("RenderPerformanceTest")->getSignal()->connect(boost::bind(&handleRenderPerfTestChanged, _2)); gSavedSettings.getControl("VertexShaderEnable")->getSignal()->connect(boost::bind(&handleSetShaderChanged, _2)); gSavedSettings.getControl("RenderUIBuffer")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); gSavedSettings.getControl("RenderSpecularResX")->getSignal()->connect(boost::bind(&handleReleaseGLBufferChanged, _2)); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index e8052aa5a0..61b1d049eb 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -402,6 +402,14 @@ void LLPipeline::init() toggleRenderType(RENDER_TYPE_GROUND); } + // make sure RenderPerformanceTest persists (hackity hack hack) + // disables non-object rendering (UI, sky, water, etc) + if (gSavedSettings.getBOOL("RenderPerformanceTest")) + { + gSavedSettings.setBOOL("RenderPerformanceTest", FALSE); + gSavedSettings.setBOOL("RenderPerformanceTest", TRUE); + } + mOldRenderDebugMask = mRenderDebugMask; mBackfaceCull = TRUE; @@ -5359,6 +5367,18 @@ BOOL LLPipeline::toggleRenderDebugFeatureControl(void* data) return gPipeline.hasRenderDebugFeatureMask(bit); } +void LLPipeline::setRenderDebugFeatureControl(U32 bit, bool value) +{ + if (value) + { + gPipeline.mRenderDebugFeatureMask |= bit; + } + else + { + gPipeline.mRenderDebugFeatureMask &= !bit; + } +} + // static void LLPipeline::setRenderScriptedBeacons(BOOL val) { diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index 3beb8abc3c..bed4155d15 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -327,6 +327,7 @@ public: static BOOL toggleRenderTypeControlNegated(void* data); static BOOL toggleRenderDebugControl(void* data); static BOOL toggleRenderDebugFeatureControl(void* data); + static void setRenderDebugFeatureControl(U32 bit, bool value); static void setRenderParticleBeacons(BOOL val); static void toggleRenderParticleBeacons(void* data); -- cgit v1.2.3