summaryrefslogtreecommitdiff
path: root/indra/llrender
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-12-15 12:34:37 +0800
committerErik Kundiman <erik@megapahit.org>2024-12-15 12:34:37 +0800
commit3316ffb3b571b8730d26d6e8b2ee00fc9cbdf7c0 (patch)
tree200cd8497a4fdd782ac4dbfd2ad5fb1632e03275 /indra/llrender
parentd4e433b37af94ee11880deeede74a87a728f4775 (diff)
parent5b77436cf0ad749d36e8f0c60077eeb24698d644 (diff)
Merge remote-tracking branch 'secondlife/release/2024.09-ExtraFPS' into 2024.09-ExtraFPS
Diffstat (limited to 'indra/llrender')
-rw-r--r--indra/llrender/llimagegl.cpp32
-rw-r--r--indra/llrender/llshadermgr.cpp3
2 files changed, 18 insertions, 17 deletions
diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp
index d0d55b8526..18fafa201c 100644
--- a/indra/llrender/llimagegl.cpp
+++ b/indra/llrender/llimagegl.cpp
@@ -1103,7 +1103,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
@@ -1325,37 +1325,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 7c14a53c78..0885740934 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");