From d17fd56dc42fcd35ef8cf2fe9e4cd7a26ce8ba2a Mon Sep 17 00:00:00 2001 From: Rye Date: Tue, 10 Dec 2024 20:21:24 -0500 Subject: Fix crashes from shader load failures under RenderMaxOpenGLVersion 3.1/3.2/3.3 (#3184) --- indra/llrender/llshadermgr.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'indra/llrender') diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 47f1032c34..254ead2bd8 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -580,7 +580,8 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev } else { - if (type == GL_GEOMETRY_SHADER) + // OpenGL 3.2 had GLSL version 1.50. anything after that the version numbers match. + if (type == GL_GEOMETRY_SHADER || minor_version >= 50) { //set version to 1.50 shader_code_text[shader_code_count++] = strdup("#version 150\n"); -- cgit v1.2.3 From f8fad89dd00f5c5c0690dc5e2619b9a95026666c Mon Sep 17 00:00:00 2001 From: Rye Date: Tue, 10 Dec 2024 02:31:05 -0500 Subject: Fix mesa failing to link shaders due to missing vertex shader outputs --- indra/llrender/llshadermgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llrender') diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 254ead2bd8..0885740934 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -79,7 +79,7 @@ bool LLShaderMgr::attachShaderFeatures(LLGLSLShader * shader) ////////////////////////////////////// // NOTE order of shader object attaching is VERY IMPORTANT!!! - if (features->calculatesAtmospherics) + if (features->calculatesAtmospherics || features->hasGamma || features->isDeferred) { if (!shader->attachVertexObject("windlight/atmosphericsVarsV.glsl")) { -- cgit v1.2.3 From eff46262c8324ed4931cdd544a757f0c13f9ec0a Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 12 Dec 2024 13:46:01 -0800 Subject: #2590 Radeon mac optimization pass (#3277) - Skip updating of reflection probes that are not the default probe when probe coverage is set to "None" - enable RenderAppleUseMultGL and disable occlusion culling on Macs with AMD GPUs - Reduce the number of texture decode threads on Macs with intel cpus. - Move texture deletion to LLImageGL::updateClass and prevent textures from staying resident in vram longer than 3 frames - Disable SSAO by default on Macs with intel CPUs --- indra/llrender/llimagegl.cpp | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'indra/llrender') diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 84c61c790f..5ac3243fd4 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -1052,7 +1052,7 @@ U32 type_width_from_pixtype(U32 pixtype) bool should_stagger_image_set(bool compressed) { #if LL_DARWIN - return false; + return !compressed && on_main_thread() && gGLManager.mIsAMD; #else // glTexSubImage2D doesn't work with compressed textures on select tested Nvidia GPUs on Windows 10 -Cosmic,2023-03-08 // Setting media textures off-thread seems faster when not using sub_image_lines (Nvidia/Windows 10) -Cosmic,2023-03-31 @@ -1270,37 +1270,37 @@ void LLImageGL::generateTextures(S32 numTextures, U32 *textures) } } +constexpr int DELETE_DELAY = 3; // number of frames to wait before deleting textures +static std::vector sFreeList[DELETE_DELAY+1]; + // static void LLImageGL::updateClass() { sFrameCount++; + + // wait a few frames before actually deleting the textures to avoid + // synchronization issues with the GPU + U32 idx = (sFrameCount+DELETE_DELAY) % (DELETE_DELAY+1); + + if (!sFreeList[idx].empty()) + { + free_tex_images((GLsizei) sFreeList[idx].size(), sFreeList[idx].data()); + glDeleteTextures((GLsizei)sFreeList[idx].size(), sFreeList[idx].data()); + sFreeList[idx].resize(0); + } } // static void LLImageGL::deleteTextures(S32 numTextures, const U32 *textures) { - // wait a few frames before actually deleting the textures to avoid - // synchronization issues with the GPU - static std::vector sFreeList[4]; - if (gGLManager.mInited) { LL_PROFILE_ZONE_SCOPED_CATEGORY_TEXTURE; - U32 idx = sFrameCount % 4; - + U32 idx = sFrameCount % (DELETE_DELAY+1); for (S32 i = 0; i < numTextures; ++i) { sFreeList[idx].push_back(textures[i]); } - - idx = (sFrameCount + 3) % 4; - - if (!sFreeList[idx].empty()) - { - free_tex_images((GLsizei) sFreeList[idx].size(), sFreeList[idx].data()); - glDeleteTextures((GLsizei)sFreeList[idx].size(), sFreeList[idx].data()); - sFreeList[idx].resize(0); - } } } -- cgit v1.2.3