summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRye Mutt <rye@lindenlab.com>2024-10-03 13:10:49 -0400
committerGitHub <noreply@github.com>2024-10-03 13:10:49 -0400
commitd9810fbe50431d44de4df2ad7b9db37ddaf640c1 (patch)
treec651afdad221601571fed0396bb29c351b84d2a0
parent49c661f6cf9ae0a75b93c870a00edba59df54189 (diff)
parent21cfd8c2f45cc11037583cf20b7ca3cef09dea88 (diff)
Merge pull request #2773 from RyeMutt/linux-ogl-fixes
Fix OpenGL init failure on SDL/Linux on certain combinations of mesa drivers
-rw-r--r--indra/llrender/llgl.cpp6
-rw-r--r--indra/llwindow/llwindowsdl.cpp29
2 files changed, 11 insertions, 24 deletions
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index a9627a87d3..b4fe711859 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -1140,7 +1140,11 @@ bool LLGLManager::initGL()
// Trailing space necessary to keep "nVidia Corpor_ati_on" cards
// from being recognized as ATI.
// NOTE: AMD has been pretty good about not breaking this check, do not rename without good reason
- if (mGLVendor.substr(0,4) == "ATI ")
+ if (mGLVendor.substr(0,4) == "ATI "
+#if LL_LINUX
+ || mGLVendor.find("AMD") != std::string::npos
+#endif //LL_LINUX
+ )
{
mGLVendorShort = "AMD";
// *TODO: Fix this?
diff --git a/indra/llwindow/llwindowsdl.cpp b/indra/llwindow/llwindowsdl.cpp
index ec0972eaae..eb8e2dbc3c 100644
--- a/indra/llwindow/llwindowsdl.cpp
+++ b/indra/llwindow/llwindowsdl.cpp
@@ -322,34 +322,17 @@ bool LLWindowSDL::createContext(int x, int y, int width, int height, int bits, b
// Setup default backing colors
GLint redBits{8}, greenBits{8}, blueBits{8}, alphaBits{8};
- GLint depthBits{(bits <= 16) ? 16 : 24}, stencilBits{8};
-
- if (getenv("LL_GL_NO_STENCIL"))
- stencilBits = 0;
+ GLint depthBits{24}, stencilBits{8};
SDL_GL_SetAttribute(SDL_GL_RED_SIZE, redBits);
SDL_GL_SetAttribute(SDL_GL_GREEN_SIZE, greenBits);
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, blueBits);
SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, alphaBits);
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, depthBits);
-
- // We need stencil support for a few (minor) things.
- if (stencilBits)
- SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, stencilBits);
+ SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, stencilBits);
SDL_GL_SetAttribute(SDL_GL_DOUBLEBUFFER, 1);
- if (LLRender::sGLCoreProfile)
- {
- SDL_GL_SetAttribute(SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE);
- }
-
- // This is requesting a minimum context version
- int major_gl_version = 3;
- int minor_gl_version = 2;
- SDL_GL_SetAttribute(SDL_GL_CONTEXT_MAJOR_VERSION, major_gl_version);
- SDL_GL_SetAttribute(SDL_GL_CONTEXT_MINOR_VERSION, minor_gl_version);
-
U32 context_flags = 0;
if (gDebugGL)
{
@@ -380,7 +363,7 @@ bool LLWindowSDL::createContext(int x, int y, int width, int height, int bits, b
{
LL_WARNS() << "Failed to make context current. SDL: " << SDL_GetError() << LL_ENDL;
setupFailure("GL Context failed to set current failure", "Error", OSMB_OK);
- return FALSE;
+ return false;
}
mSurface = SDL_GetWindowSurface(mWindow);
@@ -695,7 +678,7 @@ bool LLWindowSDL::getVisible()
Uint32 flags = SDL_GetWindowFlags(mWindow);
if (flags & SDL_WINDOW_SHOWN)
{
- result = TRUE;
+ result = true;
}
}
return result;
@@ -735,9 +718,9 @@ bool LLWindowSDL::maximize()
if (mWindow)
{
SDL_MaximizeWindow(mWindow);
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
bool LLWindowSDL::getFullscreen()