diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp index 923b29be7..37eeff76a 100644 --- a/indra/llwindow/llwindowsdl.cpp +++ b/indra/llwindow/llwindowsdl.cpp @@ -235,8 +235,6 @@ LLWindowSDL::LLWindowSDL(LLWindowCallbacks* callbacks, // Create the GL context and set it up for windowed or fullscreen, as appropriate. if(createContext(x, y, width, height, 32, fullscreen, vsync_mode)) { - gGLManager.initGL(); - //start with arrow cursor initCursors(); setCursor( UI_CURSOR_ARROW ); @@ -721,9 +719,11 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B } #endif // LL_X11 + gGLManager.initGL(); + #if SDL_VERSION_ATLEAST(1,3,0) // Disable vertical sync for swap - if (vsync_mode == 0) + if (vsync_mode == 0 || (!gGLManager.mHasAdaptiveVsync && vsync_mode == -1)) { LL_DEBUGS("Window") << "Disabling vertical sync" << LL_ENDL; SDL_GL_SetSwapInterval(0); @@ -744,25 +744,17 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B } #else // SDL_VERSION_ATLEAST(1,3,0) #ifdef SDL_GL_SWAP_CONTROL - if (vsync_mode == 0) + if (vsync_mode <= 0) { LL_DEBUGS("Window") << "Disabling vertical sync" << LL_ENDL; SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 0); } - else if(vsync_mode == -1) - { - LL_DEBUGS("Window") << "Enabling adaptive vertical sync" << LL_ENDL; - if(SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, -1) == -1) - { - LL_DEBUGS("Window") << "Failed to enable adaptive vertical sync. Disabling vsync." << LL_ENDL; - SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 0); - } - } else { LL_DEBUGS("Window") << "Enabling vertical sync" << LL_ENDL; SDL_GL_SetAttribute(SDL_GL_SWAP_CONTROL, 1); } +#endif #endif // SDL_GL_SWAP_CONTROL #endif // SDL_VERSION_ATLEAST(1,3,0) @@ -793,8 +785,6 @@ BOOL LLWindowSDL::switchContext(BOOL fullscreen, const LLCoordScreen &size, cons result = createContext(0, 0, size.mX, size.mY, 0, fullscreen, vsync_mode); if (result) { - gGLManager.initGL(); - //start with arrow cursor initCursors(); setCursor( UI_CURSOR_ARROW ); diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 6b8a1a45b..008c92e0c 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -1652,7 +1652,7 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, co // Disable vertical sync for swap if(wglSwapIntervalEXT) { - if (vsync_mode == 0) + if (vsync_mode == 0 || (!gGLManager.mHasAdaptiveVsync && vsync_mode == -1)) { LL_INFOS("Window") << "Disabling vertical sync" << LL_ENDL; wglSwapIntervalEXT(0); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index 69be5d90d..1b9f340e8 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -1641,10 +1641,6 @@ LLViewerWindow::LLViewerWindow( resetSnapshotLoc(); S32 vsync_mode = gSavedSettings.getS32("SHRenderVsyncMode"); - if(vsync_mode == -1 && !gGLManager.mHasAdaptiveVsync) - { - vsync_mode = 0; //Disable vsync if adaptive is desired yet isn't supported. - } // create window mWindow = LLWindowManager::createWindow(this,