summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorXiaohong Bao <bao@lindenlab.com>2012-11-21 13:29:15 -0700
committerXiaohong Bao <bao@lindenlab.com>2012-11-21 13:29:15 -0700
commit6ae6abae26200c80a15d2e2d899ae6970602ff04 (patch)
tree20474eb36d9604db80c397cbec4fc7f4e49b380b /indra/newview
parentced00c47328f69a5426e6c69dce59c8f29856c51 (diff)
more for SH-3571: display frame-to-frame pixel differences on screen
Diffstat (limited to 'indra/newview')
-rwxr-xr-xindra/newview/app_settings/settings.xml2
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/twotexturecompareF.glsl2
-rw-r--r--indra/newview/llscenemonitor.cpp43
-rw-r--r--indra/newview/llscenemonitor.h4
-rw-r--r--indra/newview/llviewerdisplay.cpp9
5 files changed, 33 insertions, 27 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index c6cfe3b616..7fc7a7ad3b 100755
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -9474,7 +9474,7 @@
<key>Comment</key>
<string>Enabled scene loading monitor if set</string>
<key>Persist</key>
- <integer>0</integer>
+ <integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
diff --git a/indra/newview/app_settings/shaders/class1/interface/twotexturecompareF.glsl b/indra/newview/app_settings/shaders/class1/interface/twotexturecompareF.glsl
index 92aa7602a4..336ca21b96 100644
--- a/indra/newview/app_settings/shaders/class1/interface/twotexturecompareF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/twotexturecompareF.glsl
@@ -51,5 +51,5 @@ void main()
{
frag_color[2] = -frag_color[2];
}
- frag_color[3] = 1.f;
+ frag_color[3] = 0.95f;
}
diff --git a/indra/newview/llscenemonitor.cpp b/indra/newview/llscenemonitor.cpp
index 8597767c61..0730281d85 100644
--- a/indra/newview/llscenemonitor.cpp
+++ b/indra/newview/llscenemonitor.cpp
@@ -39,7 +39,12 @@
LLSceneMonitorView* gSceneMonitorView = NULL;
-LLSceneMonitor::LLSceneMonitor() : mEnabled(false), mDiff(NULL), mNeedsUpdateDiff(FALSE)
+LLSceneMonitor::LLSceneMonitor() :
+ mEnabled(FALSE),
+ mDiff(NULL),
+ mCurTarget(NULL),
+ mNeedsUpdateDiff(FALSE),
+ mDebugViewerVisible(FALSE)
{
mFrames[0] = NULL;
mFrames[1] = NULL;
@@ -66,18 +71,14 @@ void LLSceneMonitor::reset()
mDiff = NULL;
}
-void LLSceneMonitor::setEnabled(bool enabled)
+void LLSceneMonitor::setDebugViewerVisible(BOOL visible)
{
- if(enabled == (bool)gSavedSettings.getBOOL("SceneLoadingMonitorEnabled"))
- {
- return;
- }
- gSavedSettings.setBOOL("SceneLoadingMonitorEnabled", enabled);
+ mDebugViewerVisible = visible;
}
bool LLSceneMonitor::preCapture()
{
- static LLCachedControl<bool> enabled(gSavedSettings,"SceneLoadingMonitorEnabled");
+ static LLCachedControl<bool> monitor_enabled(gSavedSettings,"SceneLoadingMonitorEnabled");
static LLFrameTimer timer;
mCurTarget = NULL;
@@ -85,7 +86,9 @@ bool LLSceneMonitor::preCapture()
{
return false;
}
- if(mEnabled != (BOOL)enabled)
+
+ BOOL enabled = (BOOL)monitor_enabled || mDebugViewerVisible;
+ if(mEnabled != enabled)
{
if(mEnabled)
{
@@ -97,7 +100,7 @@ bool LLSceneMonitor::preCapture()
freezeScene();
}
- mEnabled = (BOOL)enabled;
+ mEnabled = enabled;
}
if(!mEnabled)
@@ -260,8 +263,8 @@ void LLSceneMonitor::compare()
return;
}
- S32 width = mFrames[0]->getWidth();
- S32 height = mFrames[0]->getHeight();
+ S32 width = gViewerWindow->getWindowWidthRaw();
+ S32 height = gViewerWindow->getWindowHeightRaw();
if(!mDiff)
{
mDiff = new LLRenderTarget();
@@ -288,7 +291,6 @@ void LLSceneMonitor::compare()
gl_rect_2d_simple_tex(width, height);
- gGL.flush();
mDiff->flush();
gTwoTextureCompareProgram.unbind();
@@ -321,10 +323,7 @@ void LLSceneMonitorView::onClickCloseBtn()
void LLSceneMonitorView::setVisible(BOOL visible)
{
- if(visible != (BOOL)LLSceneMonitor::getInstance()->isEnabled())
- {
- LLSceneMonitor::getInstance()->setEnabled(visible);
- }
+ LLSceneMonitor::getInstance()->setDebugViewerVisible(visible);
LLView::setVisible(visible);
}
@@ -341,17 +340,17 @@ void LLSceneMonitorView::draw()
return;
}
- S32 height = (S32) (gViewerWindow->getWindowRectScaled().getHeight()*0.75f);
- S32 width = (S32) (gViewerWindow->getWindowRectScaled().getWidth() * 0.75f);
+ S32 height = (S32) (gViewerWindow->getWindowRectScaled().getHeight()*0.5f);
+ S32 width = (S32) (gViewerWindow->getWindowRectScaled().getWidth() * 0.5f);
LLRect new_rect;
new_rect.setLeftTopAndSize(getRect().mLeft, getRect().mTop, width, height);
setRect(new_rect);
- gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
- gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, LLColor4(0.f, 0.f, 0.f, 0.25f));
+ //gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE);
+ //gl_rect_2d(0, getRect().getHeight(), getRect().getWidth(), 0, LLColor4(0.f, 0.f, 0.f, 0.25f));
- gl_draw_scaled_target(0, 0, getRect().getWidth(), getRect().getHeight(), target);//, LLColor4(0.f, 0.f, 0.f, 0.25f));
+ gl_draw_scaled_target(0, 0, getRect().getWidth(), getRect().getHeight(), target);
LLView::draw();
}
diff --git a/indra/newview/llscenemonitor.h b/indra/newview/llscenemonitor.h
index 941039cefd..648429f97b 100644
--- a/indra/newview/llscenemonitor.h
+++ b/indra/newview/llscenemonitor.h
@@ -44,7 +44,7 @@ public:
void destroyClass();
void freezeAvatar(LLCharacter* avatarp);
- void setEnabled(bool enabled);
+ void setDebugViewerVisible(BOOL visible);
void capture(); //capture the main frame buffer
void compare(); //compare the stored two buffers.
@@ -62,6 +62,8 @@ private:
private:
BOOL mEnabled;
BOOL mNeedsUpdateDiff;
+ BOOL mDebugViewerVisible;
+
LLRenderTarget* mFrames[2];
LLRenderTarget* mDiff;
LLRenderTarget* mCurTarget;
diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp
index c12144df6f..270ab26149 100644
--- a/indra/newview/llviewerdisplay.cpp
+++ b/indra/newview/llviewerdisplay.cpp
@@ -1229,6 +1229,13 @@ void render_ui(F32 zoom_factor, int subfield)
}
{
+ gGL.pushMatrix();
+ gViewerWindow->setup2DRender();
+ LLSceneMonitor::getInstance()->compare();
+ gGL.popMatrix();
+ }
+
+ {
BOOL to_texture = gPipeline.canUseVertexShaders() &&
LLPipeline::sRenderGlow;
@@ -1409,8 +1416,6 @@ void render_ui_2d()
// Menu overlays, HUD, etc
gViewerWindow->setup2DRender();
- LLSceneMonitor::getInstance()->compare();
-
F32 zoom_factor = LLViewerCamera::getInstance()->getZoomFactor();
S16 sub_region = LLViewerCamera::getInstance()->getZoomSubRegion();