summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorNat Goodspeed <nat@lindenlab.com>2021-11-10 10:28:58 -0500
committerNat Goodspeed <nat@lindenlab.com>2021-11-10 10:28:58 -0500
commit1a39a8f7d953a28b03bad0921a8877e21e1e2c61 (patch)
treef586c675b9a575fe5b46a1b94ea2555023289169 /indra
parent214d8d40c12c0a39dffdd837c861abe4c005caf1 (diff)
parent7c561ca1c7732d1d95562069565f605f46e8c9e3 (diff)
Merge branch 'DRTVWR-546' into glthread
Diffstat (limited to 'indra')
-rw-r--r--indra/llwindow/llwindow.cpp12
-rw-r--r--indra/llwindow/llwindow.h5
-rw-r--r--indra/llwindow/llwindowheadless.cpp2
-rw-r--r--indra/llwindow/llwindowheadless.h5
-rw-r--r--indra/llwindow/llwindowmacosx.cpp12
-rw-r--r--indra/llwindow/llwindowmacosx.h6
-rw-r--r--indra/llwindow/llwindowwin32.cpp42
-rw-r--r--indra/llwindow/llwindowwin32.h5
-rw-r--r--indra/newview/app_settings/settings.xml6
-rw-r--r--indra/newview/lldrawpoolwater.cpp8
-rw-r--r--indra/newview/llviewercontrol.cpp7
-rw-r--r--indra/newview/llviewerwindow.cpp4
-rw-r--r--indra/newview/llviewerwindow.h2
-rw-r--r--indra/newview/pipeline.cpp33
-rw-r--r--indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml24
15 files changed, 99 insertions, 74 deletions
diff --git a/indra/llwindow/llwindow.cpp b/indra/llwindow/llwindow.cpp
index 67ef98d7b3..f4678a70c5 100644
--- a/indra/llwindow/llwindow.cpp
+++ b/indra/llwindow/llwindow.cpp
@@ -403,7 +403,7 @@ LLWindow* LLWindowManager::createWindow(
const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height, U32 flags,
BOOL fullscreen,
BOOL clearBg,
- BOOL disable_vsync,
+ BOOL enable_vsync,
BOOL use_gl,
BOOL ignore_pixel_depth,
U32 fsaa_samples)
@@ -415,26 +415,26 @@ LLWindow* LLWindowManager::createWindow(
#if LL_MESA_HEADLESS
new_window = new LLWindowMesaHeadless(callbacks,
title, name, x, y, width, height, flags,
- fullscreen, clearBg, disable_vsync, use_gl, ignore_pixel_depth);
+ fullscreen, clearBg, enable_vsync, use_gl, ignore_pixel_depth);
#elif LL_SDL
new_window = new LLWindowSDL(callbacks,
title, x, y, width, height, flags,
- fullscreen, clearBg, disable_vsync, use_gl, ignore_pixel_depth, fsaa_samples);
+ fullscreen, clearBg, enable_vsync, use_gl, ignore_pixel_depth, fsaa_samples);
#elif LL_WINDOWS
new_window = new LLWindowWin32(callbacks,
title, name, x, y, width, height, flags,
- fullscreen, clearBg, disable_vsync, use_gl, ignore_pixel_depth, fsaa_samples);
+ fullscreen, clearBg, enable_vsync, use_gl, ignore_pixel_depth, fsaa_samples);
#elif LL_DARWIN
new_window = new LLWindowMacOSX(callbacks,
title, name, x, y, width, height, flags,
- fullscreen, clearBg, disable_vsync, use_gl, ignore_pixel_depth, fsaa_samples);
+ fullscreen, clearBg, enable_vsync, use_gl, ignore_pixel_depth, fsaa_samples);
#endif
}
else
{
new_window = new LLWindowHeadless(callbacks,
title, name, x, y, width, height, flags,
- fullscreen, clearBg, disable_vsync, use_gl, ignore_pixel_depth);
+ fullscreen, clearBg, enable_vsync, use_gl, ignore_pixel_depth);
}
if (FALSE == new_window->isValid())
diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h
index b76d313011..43d81e4d59 100644
--- a/indra/llwindow/llwindow.h
+++ b/indra/llwindow/llwindow.h
@@ -77,7 +77,7 @@ public:
BOOL setSize(LLCoordScreen size);
BOOL setSize(LLCoordWindow size);
virtual void setMinSize(U32 min_width, U32 min_height, bool enforce_immediately = true);
- virtual BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL) = 0;
+ virtual BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL enable_vsync, const LLCoordScreen * const posp = NULL) = 0;
//create a new GL context that shares a namespace with this Window's main GL context and make it current on the current thread
// returns a pointer to be handed back to destroySharedConext/makeContextCurrent
@@ -92,6 +92,7 @@ public:
virtual BOOL setCursorPosition(LLCoordWindow position) = 0;
virtual BOOL getCursorPosition(LLCoordWindow *position) = 0;
#if LL_WINDOWS
+ virtual void toggleVSync(bool enable_vsync) = 0;
virtual BOOL getCursorDelta(LLCoordCommon* delta) = 0;
#endif
virtual void showCursor() = 0;
@@ -295,7 +296,7 @@ public:
U32 flags = 0,
BOOL fullscreen = FALSE,
BOOL clearBg = FALSE,
- BOOL disable_vsync = TRUE,
+ BOOL enable_vsync = FALSE,
BOOL use_gl = TRUE,
BOOL ignore_pixel_depth = FALSE,
U32 fsaa_samples = 0);
diff --git a/indra/llwindow/llwindowheadless.cpp b/indra/llwindow/llwindowheadless.cpp
index 70f473281b..c3738af6ca 100644
--- a/indra/llwindow/llwindowheadless.cpp
+++ b/indra/llwindow/llwindowheadless.cpp
@@ -35,7 +35,7 @@
//
LLWindowHeadless::LLWindowHeadless(LLWindowCallbacks* callbacks, const std::string& title, const std::string& name, S32 x, S32 y, S32 width, S32 height,
U32 flags, BOOL fullscreen, BOOL clear_background,
- BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth)
+ BOOL enable_vsync, BOOL use_gl, BOOL ignore_pixel_depth)
: LLWindow(callbacks, fullscreen, flags)
{
// Initialize a headless keyboard.
diff --git a/indra/llwindow/llwindowheadless.h b/indra/llwindow/llwindowheadless.h
index f8ba9bbed4..78c5e4bae4 100644
--- a/indra/llwindow/llwindowheadless.h
+++ b/indra/llwindow/llwindowheadless.h
@@ -48,13 +48,14 @@ public:
/*virtual*/ BOOL setPosition(LLCoordScreen position) {return FALSE;};
/*virtual*/ BOOL setSizeImpl(LLCoordScreen size) {return FALSE;};
/*virtual*/ BOOL setSizeImpl(LLCoordWindow size) {return FALSE;};
- /*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL) {return FALSE;};
+ /*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL enable_vsync, const LLCoordScreen * const posp = NULL) {return FALSE;};
void* createSharedContext() { return nullptr; }
void makeContextCurrent(void*) {}
void destroySharedContext(void*) {}
/*virtual*/ BOOL setCursorPosition(LLCoordWindow position) {return FALSE;};
/*virtual*/ BOOL getCursorPosition(LLCoordWindow *position) {return FALSE;};
#if LL_WINDOWS
+ /*virtual*/ virtual void toggleVSync(bool enable_vsync) { }
/*virtual*/ BOOL getCursorDelta(LLCoordCommon* delta) { return FALSE; }
#endif
/*virtual*/ void showCursor() {};
@@ -103,7 +104,7 @@ public:
S32 x, S32 y,
S32 width, S32 height,
U32 flags, BOOL fullscreen, BOOL clear_background,
- BOOL disable_vsync, BOOL use_gl, BOOL ignore_pixel_depth);
+ BOOL enable_vsync, BOOL use_gl, BOOL ignore_pixel_depth);
virtual ~LLWindowHeadless();
private:
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index 23830dd24e..a74fa78388 100644
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -111,7 +111,7 @@ LLWindowMacOSX::LLWindowMacOSX(LLWindowCallbacks* callbacks,
const std::string& title, const std::string& name, S32 x, S32 y, S32 width,
S32 height, U32 flags,
BOOL fullscreen, BOOL clearBg,
- BOOL disable_vsync, BOOL use_gl,
+ BOOL enable_vsync, BOOL use_gl,
BOOL ignore_pixel_depth,
U32 fsaa_samples)
: LLWindow(NULL, fullscreen, flags)
@@ -165,7 +165,7 @@ LLWindowMacOSX::LLWindowMacOSX(LLWindowCallbacks* callbacks,
// Stash an object pointer for OSMessageBox()
gWindowImplementation = this;
// Create the GL context and set it up for windowed or fullscreen, as appropriate.
- if(createContext(x, y, width, height, 32, fullscreen, disable_vsync))
+ if(createContext(x, y, width, height, 32, fullscreen, enable_vsync))
{
if(mWindow != NULL)
{
@@ -610,7 +610,7 @@ void LLWindowMacOSX::getMouseDeltas(float* delta)
delta[1] = mCursorLastEventDeltaY;
}
-BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits, BOOL fullscreen, BOOL disable_vsync)
+BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits, BOOL fullscreen, BOOL enable_vsync)
{
BOOL glNeedsInit = FALSE;
@@ -625,7 +625,7 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits
{
// Our OpenGL view is already defined within SecondLife.xib.
// Get the view instead.
- mGLView = createOpenGLView(mWindow, mFSAASamples, !disable_vsync);
+ mGLView = createOpenGLView(mWindow, mFSAASamples, enable_vsync);
mContext = getCGLContextObj(mGLView);
// Since we just created the context, it needs to be set up.
@@ -653,7 +653,7 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits
// Disable vertical sync for swap
GLint frames_per_swap = 0;
- if (disable_vsync)
+ if (!enable_vsync)
{
frames_per_swap = 0;
}
@@ -689,7 +689,7 @@ BOOL LLWindowMacOSX::createContext(int x, int y, int width, int height, int bits
// We only support OS X 10.7's fullscreen app mode which is literally a full screen window that fills a virtual desktop.
// This makes this method obsolete.
-BOOL LLWindowMacOSX::switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp)
+BOOL LLWindowMacOSX::switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL enable_vsync, const LLCoordScreen * const posp)
{
return FALSE;
}
diff --git a/indra/llwindow/llwindowmacosx.h b/indra/llwindow/llwindowmacosx.h
index ede2b453d5..18fa86930f 100644
--- a/indra/llwindow/llwindowmacosx.h
+++ b/indra/llwindow/llwindowmacosx.h
@@ -60,7 +60,7 @@ public:
BOOL setPosition(LLCoordScreen position) override;
BOOL setSizeImpl(LLCoordScreen size) override;
BOOL setSizeImpl(LLCoordWindow size) override;
- BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL) override;
+ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL enable_vsync, const LLCoordScreen * const posp = NULL) override;
BOOL setCursorPosition(LLCoordWindow position) override;
BOOL getCursorPosition(LLCoordWindow *position) override;
void showCursor() override;
@@ -143,7 +143,7 @@ public:
protected:
LLWindowMacOSX(LLWindowCallbacks* callbacks,
const std::string& title, const std::string& name, int x, int y, int width, int height, U32 flags,
- BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, BOOL use_gl,
+ BOOL fullscreen, BOOL clearBg, BOOL enable_vsync, BOOL use_gl,
BOOL ignore_pixel_depth,
U32 fsaa_samples);
~LLWindowMacOSX();
@@ -176,7 +176,7 @@ protected:
//
// create or re-create the GL context/window. Called from the constructor and switchContext().
- BOOL createContext(int x, int y, int width, int height, int bits, BOOL fullscreen, BOOL disable_vsync);
+ BOOL createContext(int x, int y, int width, int height, int bits, BOOL fullscreen, BOOL enable_vsync);
void destroyContext();
void setupFailure(const std::string& text, const std::string& caption, U32 type);
void adjustCursorDecouple(bool warpingMouse = false);
diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp
index 736887e286..3f3dd43daf 100644
--- a/indra/llwindow/llwindowwin32.cpp
+++ b/indra/llwindow/llwindowwin32.cpp
@@ -357,7 +357,7 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks,
const std::string& title, const std::string& name, S32 x, S32 y, S32 width,
S32 height, U32 flags,
BOOL fullscreen, BOOL clearBg,
- BOOL disable_vsync, BOOL use_gl,
+ BOOL enable_vsync, BOOL use_gl,
BOOL ignore_pixel_depth,
U32 fsaa_samples)
: LLWindow(callbacks, fullscreen, flags)
@@ -682,7 +682,7 @@ LLWindowWin32::LLWindowWin32(LLWindowCallbacks* callbacks,
LLCoordScreen windowPos(x,y);
LLCoordScreen windowSize(window_rect.right - window_rect.left,
window_rect.bottom - window_rect.top);
- if (!switchContext(mFullscreen, windowSize, disable_vsync, &windowPos))
+ if (!switchContext(mFullscreen, windowSize, enable_vsync, &windowPos))
{
return;
}
@@ -1004,7 +1004,7 @@ BOOL LLWindowWin32::setSizeImpl(const LLCoordWindow size)
}
// changing fullscreen resolution
-BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen& size, BOOL disable_vsync, const LLCoordScreen* const posp)
+BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen& size, BOOL enable_vsync, const LLCoordScreen* const posp)
{
//called from main thread
GLuint pixel_format;
@@ -1595,16 +1595,7 @@ const S32 max_format = (S32)num_formats - 1;
}
// Disable vertical sync for swap
- if (disable_vsync && wglSwapIntervalEXT)
- {
- LL_DEBUGS("Window") << "Disabling vertical sync" << LL_ENDL;
- wglSwapIntervalEXT(0);
- }
- else
- {
- LL_DEBUGS("Window") << "Keeping vertical sync" << LL_ENDL;
- wglSwapIntervalEXT(1);
- }
+ toggleVSync(enable_vsync);
SetWindowLongPtr(mWindowHandle, GWLP_USERDATA, (LONG_PTR)this);
@@ -1757,6 +1748,20 @@ void LLWindowWin32::destroySharedContext(void* contextPtr)
wglDeleteContext((HGLRC)contextPtr);
}
+void LLWindowWin32::toggleVSync(bool enable_vsync)
+{
+ if (!enable_vsync && wglSwapIntervalEXT)
+ {
+ LL_INFOS("Window") << "Disabling vertical sync" << LL_ENDL;
+ wglSwapIntervalEXT(0);
+ }
+ else
+ {
+ LL_INFOS("Window") << "Enabling vertical sync" << LL_ENDL;
+ wglSwapIntervalEXT(1);
+ }
+}
+
void LLWindowWin32::moveWindow( const LLCoordScreen& position, const LLCoordScreen& size )
{
if( mIsMouseClipping )
@@ -2056,6 +2061,17 @@ void LLWindowWin32::gatherInput()
}
{
+ LL_PROFILE_ZONE_NAMED("gi - PeekMessage");
+ S32 msg_count = 0;
+ while ((msg_count < MAX_MESSAGE_PER_UPDATE) && PeekMessage(&msg, NULL, WM_USER, WM_USER, PM_REMOVE))
+ {
+ TranslateMessage(&msg);
+ DispatchMessage(&msg);
+ msg_count++;
+ }
+ }
+
+ {
LL_PROFILE_ZONE_NAMED("gi - function queue");
//process any pending functions
std::function<void()> curFunc;
diff --git a/indra/llwindow/llwindowwin32.h b/indra/llwindow/llwindowwin32.h
index c3ce1e25a9..5966061177 100644
--- a/indra/llwindow/llwindowwin32.h
+++ b/indra/llwindow/llwindowwin32.h
@@ -61,11 +61,12 @@ public:
/*virtual*/ BOOL setPosition(LLCoordScreen position);
/*virtual*/ BOOL setSizeImpl(LLCoordScreen size);
/*virtual*/ BOOL setSizeImpl(LLCoordWindow size);
- /*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL disable_vsync, const LLCoordScreen * const posp = NULL);
+ /*virtual*/ BOOL switchContext(BOOL fullscreen, const LLCoordScreen &size, BOOL enable_vsync, const LLCoordScreen * const posp = NULL);
/*virtual*/ void setTitle(const std::string title);
void* createSharedContext() override;
void makeContextCurrent(void* context) override;
void destroySharedContext(void* context) override;
+ /*virtual*/ void toggleVSync(bool enable_vsync);
/*virtual*/ BOOL setCursorPosition(LLCoordWindow position);
/*virtual*/ BOOL getCursorPosition(LLCoordWindow *position);
/*virtual*/ BOOL getCursorDelta(LLCoordCommon* delta);
@@ -132,7 +133,7 @@ public:
protected:
LLWindowWin32(LLWindowCallbacks* callbacks,
const std::string& title, const std::string& name, int x, int y, int width, int height, U32 flags,
- BOOL fullscreen, BOOL clearBg, BOOL disable_vsync, BOOL use_gl,
+ BOOL fullscreen, BOOL clearBg, BOOL enable_vsync, BOOL use_gl,
BOOL ignore_pixel_depth, U32 fsaa_samples);
~LLWindowWin32();
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index fb503f4f4a..607e531e62 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -3352,16 +3352,16 @@
<key>Value</key>
<integer>0</integer>
</map>
- <key>DisableVerticalSync</key>
+ <key>RenderVSyncEnable</key>
<map>
<key>Comment</key>
- <string>Update frames as fast as possible (FALSE = update frames between display scans). Requires restart.</string>
+ <string>Update frames between display scans (FALSE = Update frames as fast as possible).</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
- <integer>0</integer>
+ <integer>1</integer>
</map>
<key>EnableGroupChatPopups</key>
<map>
diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp
index aa426cd785..5f9e623b4c 100644
--- a/indra/newview/lldrawpoolwater.cpp
+++ b/indra/newview/lldrawpoolwater.cpp
@@ -337,7 +337,8 @@ void LLDrawPoolWater::render(S32 pass)
// for low end hardware
void LLDrawPoolWater::renderOpaqueLegacyWater()
{
- LLVOSky *voskyp = gSky.mVOSkyp;
+ LL_PROFILE_ZONE_SCOPED;
+ LLVOSky *voskyp = gSky.mVOSkyp;
LLGLSLShader* shader = NULL;
if (LLGLSLShader::sNoFixedFunction)
@@ -444,6 +445,7 @@ void LLDrawPoolWater::renderOpaqueLegacyWater()
void LLDrawPoolWater::renderReflection(LLFace* face)
{
+ LL_PROFILE_ZONE_SCOPED;
LLVOSky *voskyp = gSky.mVOSkyp;
if (!voskyp)
@@ -472,6 +474,7 @@ void LLDrawPoolWater::renderReflection(LLFace* face)
void LLDrawPoolWater::shade2(bool edge, LLGLSLShader* shader, const LLColor3& light_diffuse, const LLVector3& light_dir, F32 light_exp)
{
+ LL_PROFILE_ZONE_SCOPED;
F32 water_height = LLEnvironment::instance().getWaterHeight();
F32 camera_height = LLViewerCamera::getInstance()->getOrigin().mV[2];
F32 eyedepth = camera_height - water_height;
@@ -680,7 +683,8 @@ void LLDrawPoolWater::shade2(bool edge, LLGLSLShader* shader, const LLColor3& li
void LLDrawPoolWater::shade()
{
- if (!deferred_render)
+ LL_PROFILE_ZONE_SCOPED;
+ if (!deferred_render)
{
gGL.setColorMask(true, true);
}
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index 76dc9a6790..3e7459ee8a 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -241,6 +241,12 @@ static bool handleAnisotropicChanged(const LLSD& newvalue)
return true;
}
+static bool handleVSyncChanged(const LLSD& newvalue)
+{
+ gViewerWindow->getWindow()->toggleVSync(newvalue.asBoolean());
+ return true;
+}
+
static bool handleVolumeLODChanged(const LLSD& newvalue)
{
LLVOVolume::sLODFactor = llclamp((F32) newvalue.asReal(), 0.01f, MAX_LOD_FACTOR);
@@ -665,6 +671,7 @@ void settings_setup_listeners()
gSavedSettings.getControl("RenderAutoMaskAlphaNonDeferred")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2));
gSavedSettings.getControl("RenderObjectBump")->getSignal()->connect(boost::bind(&handleRenderBumpChanged, _2));
gSavedSettings.getControl("RenderMaxVBOSize")->getSignal()->connect(boost::bind(&handleResetVertexBuffersChanged, _2));
+ gSavedSettings.getControl("RenderVSyncEnable")->getSignal()->connect(boost::bind(&handleVSyncChanged, _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));
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index 7dc7b33938..a35ad55cf7 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1903,7 +1903,7 @@ LLViewerWindow::LLViewerWindow(const Params& p)
p.title, p.name, p.x, p.y, p.width, p.height, 0,
p.fullscreen,
gHeadlessClient,
- gSavedSettings.getBOOL("DisableVerticalSync"),
+ gSavedSettings.getBOOL("RenderVSyncEnable"),
!gHeadlessClient,
p.ignore_pixel_depth,
gSavedSettings.getBOOL("RenderDeferred") ? 0 : gSavedSettings.getU32("RenderFSAASamples")); //don't use window level anti-aliasing if FBOs are enabled
@@ -5569,7 +5569,7 @@ void LLViewerWindow::restartDisplay(BOOL show_progress_bar)
}
}
-BOOL LLViewerWindow::changeDisplaySettings(LLCoordScreen size, BOOL disable_vsync, BOOL show_progress_bar)
+BOOL LLViewerWindow::changeDisplaySettings(LLCoordScreen size, BOOL enable_vsync, BOOL show_progress_bar)
{
//BOOL was_maximized = gSavedSettings.getBOOL("WindowMaximized");
diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h
index 8a6df613dc..93194b1884 100644
--- a/indra/newview/llviewerwindow.h
+++ b/indra/newview/llviewerwindow.h
@@ -424,7 +424,7 @@ public:
void requestResolutionUpdate();
void checkSettings();
void restartDisplay(BOOL show_progress_bar);
- BOOL changeDisplaySettings(LLCoordScreen size, BOOL disable_vsync, BOOL show_progress_bar);
+ BOOL changeDisplaySettings(LLCoordScreen size, BOOL enable_vsync, BOOL show_progress_bar);
BOOL getIgnoreDestroyWindow() { return mIgnoreActivate; }
F32 getWorldViewAspectRatio() const;
const LLVector2& getDisplayScale() const { return mDisplayScale; }
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 6ed6e20b03..71a438302a 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -1231,7 +1231,8 @@ void LLPipeline::releaseShadowTargets()
void LLPipeline::createGLBuffers()
{
- stop_glerror();
+ LL_PROFILE_ZONE_SCOPED;
+ stop_glerror();
assertInitialized();
updateRenderDeferred();
@@ -1384,7 +1385,7 @@ void LLPipeline::restoreGL()
if (part)
{
part->restoreGL();
- }
+ }
}
}
}
@@ -2428,8 +2429,7 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl
LLVOCachePartition* vo_part = region->getVOCachePartition();
if(vo_part)
{
- bool do_occlusion_cull = can_use_occlusion && use_occlusion && !gUseWireframe && 0 > water_clip /* && !gViewerWindow->getProgressView()->getVisible()*/;
- do_occlusion_cull &= !sReflectionRender;
+ bool do_occlusion_cull = can_use_occlusion && use_occlusion && !gUseWireframe; // && 0 > water_clip
vo_part->cull(camera, do_occlusion_cull);
}
}
@@ -2629,7 +2629,8 @@ void LLPipeline::doOcclusion(LLCamera& camera, LLRenderTarget& source, LLRenderT
void LLPipeline::doOcclusion(LLCamera& camera)
{
- if (LLPipeline::sUseOcclusion > 1 && !LLSpatialPartition::sTeleportRequested &&
+ LL_PROFILE_ZONE_SCOPED;
+ if (LLPipeline::sUseOcclusion > 1 && !LLSpatialPartition::sTeleportRequested &&
(sCull->hasOcclusionGroups() || LLVOCachePartition::sNeedsOcclusionCheck))
{
LLVertexBuffer::unbind();
@@ -3422,7 +3423,8 @@ void LLPipeline::stateSort(LLSpatialGroup* group, LLCamera& camera)
void LLPipeline::stateSort(LLSpatialBridge* bridge, LLCamera& camera, BOOL fov_changed)
{
- if (bridge->getSpatialGroup()->changeLOD() || fov_changed)
+ LL_PROFILE_ZONE_SCOPED;
+ if (bridge->getSpatialGroup()->changeLOD() || fov_changed)
{
bool force_update = false;
bridge->updateDistance(camera, force_update);
@@ -3431,7 +3433,8 @@ void LLPipeline::stateSort(LLSpatialBridge* bridge, LLCamera& camera, BOOL fov_c
void LLPipeline::stateSort(LLDrawable* drawablep, LLCamera& camera)
{
- if (!drawablep
+ LL_PROFILE_ZONE_SCOPED;
+ if (!drawablep
|| drawablep->isDead()
|| !hasRenderType(drawablep->getRenderType()))
{
@@ -4708,7 +4711,8 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera, bool do_occlusion)
void LLPipeline::renderGeomShadow(LLCamera& camera)
{
- U32 cur_type = 0;
+ LL_PROFILE_ZONE_SCOPED;
+ U32 cur_type = 0;
LLGLEnable cull(GL_CULL_FACE);
@@ -8384,15 +8388,13 @@ LLVector4 pow4fsrgb(LLVector4 v, F32 f)
return v;
}
-static LLTrace::BlockTimerStatHandle FTM_DEFERRED_LIGHTING("Deferred Lighting");
-
void LLPipeline::renderDeferredLighting(LLRenderTarget *screen_target)
{
+ LL_PROFILE_ZONE_SCOPED;
if (!sCull)
{
return;
}
- LL_RECORD_BLOCK_TIME(FTM_DEFERRED_LIGHTING);
LLRenderTarget *deferred_target = &mDeferredScreen;
LLRenderTarget *deferred_depth_target = &mDeferredDepth;
@@ -9200,6 +9202,7 @@ inline float sgn(float a)
void LLPipeline::generateWaterReflection(LLCamera& camera_in)
{
+ LL_PROFILE_ZONE_SCOPED;
if (LLPipeline::sWaterReflections && assertInitialized() && LLDrawPoolWater::sNeedsReflectionUpdate)
{
bool skip_avatar_update = false;
@@ -9254,11 +9257,6 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
water_clip = -1;
}
- S32 occlusion = LLPipeline::sUseOcclusion;
-
- //disable occlusion culling for reflection map for now
- LLPipeline::sUseOcclusion = 0;
-
if (!camera_is_underwater)
{
//generate planar reflection map
@@ -9374,8 +9372,6 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
set_current_modelview(saved_modelview);
}
- //LLPipeline::sUseOcclusion = occlusion;
-
camera.setOrigin(camera_in.getOrigin());
//render distortion map
static bool last_update = true;
@@ -9470,7 +9466,6 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in)
gPipeline.popRenderTypeMask();
- LLPipeline::sUseOcclusion = occlusion;
LLPipeline::sUnderWaterRender = false;
LLPipeline::sReflectionRender = false;
diff --git a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml
index 7786ba8a1c..4f355cce00 100644
--- a/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml
+++ b/indra/newview/skins/default/xui/en/floater_preferences_graphics_advanced.xml
@@ -102,6 +102,18 @@
Low
</text>
+ <check_box
+ control_name="RenderVSyncEnable"
+ height="16"
+ initial_value="true"
+ label="Enable VSync"
+ layout="topleft"
+ left="30"
+ top_delta="16"
+ name="vsync"
+ tool_tip="Synchronizes the frame rate to the refresh rate of the monitor, which results in smooth performance."
+ width="315" />
+
<text
type="string"
length="1"
@@ -334,18 +346,6 @@
width="256" />
<check_box
- control_name="RenderVBOEnable"
- height="16"
- initial_value="true"
- label="Enable OpenGL Vertex Buffer Objects"
- layout="topleft"
- left="30"
- top_delta="16"
- name="vbo"
- tool_tip="Enabling this on modern hardware gives a performance gain. However, older hardware often has poor implementations of VBOs and you may get crashes when this is enabled."
- width="315" />
-
- <check_box
control_name="RenderCompressTextures"
height="16"
initial_value="true"