From f8d46d105e5d137890b98fd18bdf26fa797e22d3 Mon Sep 17 00:00:00 2001 From: thickbrick Date: Thu, 24 Mar 2011 17:06:27 +0200 Subject: Fix #824/SNOW-466: Window Creation Error related to FSAA - Linux only: Retry window creation with lower FSAA samples if it fails. - All platforms: save actual FSAA level into RenderFSAASamples after window is created. This exapnds on the patch from SNOW-466 by Robin Cornelius. --- linden/doc/contributions.txt | 1 + linden/indra/llwindow/llwindowsdl.cpp | 9 +++++++++ linden/indra/newview/llviewerwindow.cpp | 7 +++++++ 3 files changed, 17 insertions(+) (limited to 'linden') diff --git a/linden/doc/contributions.txt b/linden/doc/contributions.txt index 8aab5c8..6a41ddf 100644 --- a/linden/doc/contributions.txt +++ b/linden/doc/contributions.txt @@ -528,6 +528,7 @@ Robin Cornelius SNOW-108 SNOW-196 SNOW-422 + SNOW-466 SNOW-485 VWR-2488 VWR-9557 diff --git a/linden/indra/llwindow/llwindowsdl.cpp b/linden/indra/llwindow/llwindowsdl.cpp index edfe33b..2f9de6b 100644 --- a/linden/indra/llwindow/llwindowsdl.cpp +++ b/linden/indra/llwindow/llwindowsdl.cpp @@ -632,6 +632,15 @@ BOOL LLWindowSDL::createContext(int x, int y, int width, int height, int bits, B mWindow = SDL_SetVideoMode(width, height, bits, sdlflags); } + while (!mWindow && mFSAASamples > 0) + { + llwarns << "Window creating failed with " << mFSAASamples << "x FSAA."<>1; + SDL_GL_SetAttribute(SDL_GL_MULTISAMPLEBUFFERS, mFSAASamples ? 1 : 0); + SDL_GL_SetAttribute(SDL_GL_MULTISAMPLESAMPLES, mFSAASamples); + mWindow = SDL_SetVideoMode(width, height, bits, sdlflags); + } + if (!mWindow) { llwarns << "createContext: window creation failure. SDL: " << SDL_GetError() << llendl; diff --git a/linden/indra/newview/llviewerwindow.cpp b/linden/indra/newview/llviewerwindow.cpp index 57580cf..e6b207b 100644 --- a/linden/indra/newview/llviewerwindow.cpp +++ b/linden/indra/newview/llviewerwindow.cpp @@ -1278,6 +1278,13 @@ LLViewerWindow::LLViewerWindow( LLAppViewer::instance()->forceExit(1); } + const U32 real_fsaa = mWindow->getFSAASamples(); + if (real_fsaa != gSavedSettings.getU32("RenderFSAASamples")) + { + LL_WARNS("Window") << "Window created with reduced anti-aliasing samples: " << real_fsaa << "x FSAA." << LL_ENDL; + gSavedSettings.setU32("RenderFSAASamples", real_fsaa); + } + // Get the real window rect the window was created with (since there are various OS-dependent reasons why // the size of a window or fullscreen context may have been adjusted slightly...) F32 ui_scale_factor = gSavedSettings.getF32("UIScaleFactor"); -- cgit v1.1