diff options
| author | Rye <rye@alchemyviewer.org> | 2025-02-27 19:28:01 -0500 |
|---|---|---|
| committer | Rye <rye@alchemyviewer.org> | 2025-08-22 12:14:15 -0400 |
| commit | 99ce597b54a9180cff0f8907e94833257b77e263 (patch) | |
| tree | c932dd8fe9c1d7d9806359ada7c99040b4fb7769 /indra/llrender/llrender.cpp | |
| parent | a46d4f0f6923080d7c6e7d5267206e8c8d7a6ff9 (diff) | |
Fix texture filtering and address mode not updating for vast majority of textures when dirtied
Diffstat (limited to 'indra/llrender/llrender.cpp')
| -rw-r--r-- | indra/llrender/llrender.cpp | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index c26e9b15b8..4f646cdc33 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -207,6 +207,12 @@ void LLTexUnit::bindFast(LLTexture* texture) } glBindTexture(sGLTextureType[gl_tex->getTarget()], mCurrTexture); mHasMipMaps = gl_tex->mHasMipMaps; + if (gl_tex->mTexOptionsDirty) + { + gl_tex->mTexOptionsDirty = false; + setTextureAddressModeFast(gl_tex->mAddressMode); + setTextureFilteringOptionFast(gl_tex->mFilterOption); + } } bool LLTexUnit::bind(LLTexture* texture, bool for_rendering, bool forceBind) @@ -461,11 +467,16 @@ void LLTexUnit::setTextureAddressMode(eTextureAddressMode mode) activate(); - glTexParameteri (sGLTextureType[mCurrTexType], GL_TEXTURE_WRAP_S, sGLAddressMode[mode]); - glTexParameteri (sGLTextureType[mCurrTexType], GL_TEXTURE_WRAP_T, sGLAddressMode[mode]); + setTextureAddressModeFast(mode); +} + +void LLTexUnit::setTextureAddressModeFast(eTextureAddressMode mode) +{ + glTexParameteri(sGLTextureType[mCurrTexType], GL_TEXTURE_WRAP_S, sGLAddressMode[mode]); + glTexParameteri(sGLTextureType[mCurrTexType], GL_TEXTURE_WRAP_T, sGLAddressMode[mode]); if (mCurrTexType == TT_CUBE_MAP) { - glTexParameteri (GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, sGLAddressMode[mode]); + glTexParameteri(GL_TEXTURE_CUBE_MAP, GL_TEXTURE_WRAP_R, sGLAddressMode[mode]); } } @@ -475,6 +486,11 @@ void LLTexUnit::setTextureFilteringOption(LLTexUnit::eTextureFilterOptions optio gGL.flush(); + setTextureFilteringOptionFast(option); +} + +void LLTexUnit::setTextureFilteringOptionFast(LLTexUnit::eTextureFilterOptions option) +{ if (option == TFO_POINT) { glTexParameteri(sGLTextureType[mCurrTexType], GL_TEXTURE_MAG_FILTER, GL_NEAREST); |
