diff options
Diffstat (limited to 'indra/llrender')
-rw-r--r-- | indra/llrender/llimagegl.cpp | 32 | ||||
-rw-r--r-- | indra/llrender/llshadermgr.cpp | 3 |
2 files changed, 18 insertions, 17 deletions
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<U32> 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<U32> 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); - } } } 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"); |