From b2970a13ff701171ed72961b3d987c57b37396d1 Mon Sep 17 00:00:00 2001 From: Rye Cogtail Date: Thu, 3 Oct 2024 03:01:27 -0400 Subject: Fix AMD gpu detection under linux --- indra/llrender/llgl.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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? -- cgit v1.2.3 From 21cfd8c2f45cc11037583cf20b7ca3cef09dea88 Mon Sep 17 00:00:00 2001 From: Rye Cogtail Date: Thu, 3 Oct 2024 01:52:14 -0400 Subject: Fix GL init on Linux/SDL on various combinations of GPU driver --- indra/llwindow/llwindowsdl.cpp | 29 ++++++----------------------- 1 file changed, 6 insertions(+), 23 deletions(-) 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() -- cgit v1.2.3