summaryrefslogtreecommitdiff
path: root/indra/llwindow
diff options
context:
space:
mode:
authormobserveur <mobserveur@gmail.com>2024-07-05 20:13:59 +0200
committermobserveur <mobserveur@gmail.com>2024-07-05 20:13:59 +0200
commit9f62ef6cb34ebc91aa82715ce8b036c0af7affef (patch)
tree8d7afa7a264f32a84031caf7a393416f81efefd0 /indra/llwindow
parent6369047dcb74323b248de59bc8187db0d315548a (diff)
Tuning floater and buffer mapping improvements
This commit adds the tuning floater accessible via the fps button, and improvements to the buffer mapping optimisation modes.
Diffstat (limited to 'indra/llwindow')
-rw-r--r--indra/llwindow/llwindow.h4
-rw-r--r--indra/llwindow/llwindowmacosx.cpp17
-rw-r--r--indra/llwindow/llwindowsdl.cpp12
3 files changed, 33 insertions, 0 deletions
diff --git a/indra/llwindow/llwindow.h b/indra/llwindow/llwindow.h
index aff9334cb6..5bb538f892 100644
--- a/indra/llwindow/llwindow.h
+++ b/indra/llwindow/llwindow.h
@@ -34,6 +34,8 @@
#include "llinstancetracker.h"
#include "llsd.h"
+#include "../llrender/llglheaders.h"
+
class LLSplashScreen;
class LLPreeditor;
class LLWindowCallbacks;
@@ -243,6 +245,8 @@ protected:
S32 mMinWindowHeight;
S32 mRefreshRate;
+ GLsync swapFense;
+
// Handle a UTF-16 encoding unit received from keyboard.
// Converting the series of UTF-16 encoding units to UTF-32 data,
// this method passes the resulting UTF-32 data to mCallback's
diff --git a/indra/llwindow/llwindowmacosx.cpp b/indra/llwindow/llwindowmacosx.cpp
index 453905b19b..1b8ab27f23 100644
--- a/indra/llwindow/llwindowmacosx.cpp
+++ b/indra/llwindow/llwindowmacosx.cpp
@@ -38,6 +38,8 @@
#include "lldir.h"
#include "indra_constants.h"
+#include "../newview/llviewercontrol.h"
+
#include <OpenGL/OpenGL.h>
#include <Carbon/Carbon.h>
#include <CoreServices/CoreServices.h>
@@ -50,6 +52,8 @@
#include <IOKit/hid/IOHIDLib.h>
#include <IOKit/usb/IOUSBLib.h>
+
+
extern BOOL gDebugWindowProc;
BOOL gHiDPISupport = TRUE;
@@ -1009,6 +1013,19 @@ BOOL LLWindowMacOSX::setSizeImpl(const LLCoordWindow size)
void LLWindowMacOSX::swapBuffers()
{
CGLFlushDrawable(mContext);
+
+ U32 mode = gSavedSettings.getU32("MPVBufferOptiMode");
+ if (mode == 0)
+ {
+ if(gGLManager.mIsApple) mode = 2;
+ else mode = 1;
+ }
+ if (mode > 2)
+ {
+ glClientWaitSync(swapFense, GL_SYNC_FLUSH_COMMANDS_BIT, GL_TIMEOUT_IGNORED);
+ glDeleteSync(swapFense);
+ swapFense = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
+ }
}
void LLWindowMacOSX::restoreGLContext()
diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index 98484419f9..110a28ca48 100644
--- a/indra/llwindow/llwindowsdl.cpp
+++ b/indra/llwindow/llwindowsdl.cpp
@@ -1098,6 +1098,18 @@ void LLWindowSDL::swapBuffers()
if (mWindow)
{
SDL_GL_SwapWindow(mWindow);
+ U32 mode = gSavedSettings.getU32("MPVBuffMapMode");
+ if (mode == 0)
+ {
+ if(gGLManager.mIsApple) mode = 2;
+ else mode = 1;
+ }
+ if (mode > 2)
+ {
+ glClientWaitSync(swapFense, GL_SYNC_FLUSH_COMMANDS_BIT, GL_TIMEOUT_IGNORED);
+ glDeleteSync(swapFense);
+ swapFense = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0);
+ }
}
}