summaryrefslogtreecommitdiff
path: root/indra/llrender/llrender.cpp
diff options
context:
space:
mode:
authorRye <rye@alchemyviewer.org>2025-09-29 12:23:29 -0400
committerGitHub <noreply@github.com>2025-09-29 09:23:29 -0700
commit79909b8a335b9fdeaefe384528284538e8dae6a4 (patch)
treeceefd6a36ac81f7eb66662dccd01c1b99f168944 /indra/llrender/llrender.cpp
parent6dba35d74e27125b39860f9a3df176d7f3a087b5 (diff)
Fix rendering differences observed in 2025.07 (#4747)
* Fix calling setTextureAddressModeFast and setTextureFilteringOptionFast with invalid tex type during fast binds * Restore mRT->screen to GL_RGBA16F to fix lighting banding
Diffstat (limited to 'indra/llrender/llrender.cpp')
-rw-r--r--indra/llrender/llrender.cpp38
1 files changed, 19 insertions, 19 deletions
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 4f646cdc33..57be8570af 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -210,8 +210,8 @@ void LLTexUnit::bindFast(LLTexture* texture)
if (gl_tex->mTexOptionsDirty)
{
gl_tex->mTexOptionsDirty = false;
- setTextureAddressModeFast(gl_tex->mAddressMode);
- setTextureFilteringOptionFast(gl_tex->mFilterOption);
+ setTextureAddressModeFast(gl_tex->mAddressMode, gl_tex->getTarget());
+ setTextureFilteringOptionFast(gl_tex->mFilterOption, gl_tex->getTarget());
}
}
@@ -467,16 +467,16 @@ void LLTexUnit::setTextureAddressMode(eTextureAddressMode mode)
activate();
- setTextureAddressModeFast(mode);
+ setTextureAddressModeFast(mode, mCurrTexType);
}
-void LLTexUnit::setTextureAddressModeFast(eTextureAddressMode mode)
+void LLTexUnit::setTextureAddressModeFast(eTextureAddressMode mode, eTextureType tex_type)
{
- glTexParameteri(sGLTextureType[mCurrTexType], GL_TEXTURE_WRAP_S, sGLAddressMode[mode]);
- glTexParameteri(sGLTextureType[mCurrTexType], GL_TEXTURE_WRAP_T, sGLAddressMode[mode]);
- if (mCurrTexType == TT_CUBE_MAP)
+ glTexParameteri(sGLTextureType[tex_type], GL_TEXTURE_WRAP_S, sGLAddressMode[mode]);
+ glTexParameteri(sGLTextureType[tex_type], GL_TEXTURE_WRAP_T, sGLAddressMode[mode]);
+ if (tex_type == TT_CUBE_MAP || tex_type == TT_CUBE_MAP_ARRAY || tex_type == TT_TEXTURE_3D)
{
- glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, sGLAddressMode[mode]);
+ glTexParameteri(sGLTextureType[tex_type], GL_TEXTURE_WRAP_R, sGLAddressMode[mode]);
}
}
@@ -486,44 +486,44 @@ void LLTexUnit::setTextureFilteringOption(LLTexUnit::eTextureFilterOptions optio
gGL.flush();
- setTextureFilteringOptionFast(option);
+ setTextureFilteringOptionFast(option, mCurrTexType);
}
-void LLTexUnit::setTextureFilteringOptionFast(LLTexUnit::eTextureFilterOptions option)
+void LLTexUnit::setTextureFilteringOptionFast(LLTexUnit::eTextureFilterOptions option, eTextureType tex_type)
{
if (option == TFO_POINT)
{
- glTexParameteri(sGLTextureType[mCurrTexType], GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ glTexParameteri(sGLTextureType[tex_type], GL_TEXTURE_MAG_FILTER, GL_NEAREST);
}
else
{
- glTexParameteri(sGLTextureType[mCurrTexType], GL_TEXTURE_MAG_FILTER, GL_LINEAR);
+ glTexParameteri(sGLTextureType[tex_type], GL_TEXTURE_MAG_FILTER, GL_LINEAR);
}
if (option >= TFO_TRILINEAR && mHasMipMaps)
{
- glTexParameteri(sGLTextureType[mCurrTexType], GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
+ glTexParameteri(sGLTextureType[tex_type], GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);
}
else if (option >= TFO_BILINEAR)
{
if (mHasMipMaps)
{
- glTexParameteri(sGLTextureType[mCurrTexType], GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
+ glTexParameteri(sGLTextureType[tex_type], GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST);
}
else
{
- glTexParameteri(sGLTextureType[mCurrTexType], GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri(sGLTextureType[tex_type], GL_TEXTURE_MIN_FILTER, GL_LINEAR);
}
}
else
{
if (mHasMipMaps)
{
- glTexParameteri(sGLTextureType[mCurrTexType], GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
+ glTexParameteri(sGLTextureType[tex_type], GL_TEXTURE_MIN_FILTER, GL_NEAREST_MIPMAP_NEAREST);
}
else
{
- glTexParameteri(sGLTextureType[mCurrTexType], GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameteri(sGLTextureType[tex_type], GL_TEXTURE_MIN_FILTER, GL_NEAREST);
}
}
@@ -531,11 +531,11 @@ void LLTexUnit::setTextureFilteringOptionFast(LLTexUnit::eTextureFilterOptions o
{
if (LLImageGL::sGlobalUseAnisotropic && option == TFO_ANISOTROPIC)
{
- glTexParameterf(sGLTextureType[mCurrTexType], GL_TEXTURE_MAX_ANISOTROPY, gGLManager.mMaxAnisotropy);
+ glTexParameterf(sGLTextureType[tex_type], GL_TEXTURE_MAX_ANISOTROPY, gGLManager.mMaxAnisotropy);
}
else
{
- glTexParameterf(sGLTextureType[mCurrTexType], GL_TEXTURE_MAX_ANISOTROPY, 1.f);
+ glTexParameterf(sGLTextureType[tex_type], GL_TEXTURE_MAX_ANISOTROPY, 1.f);
}
}
}