diff options
author | Runitai Linden <davep@lindenlab.com> | 2021-10-13 10:35:39 -0500 |
---|---|---|
committer | Runitai Linden <davep@lindenlab.com> | 2021-10-13 10:35:39 -0500 |
commit | a1e6cbe4a802f92182163171e6743e7f63d89ace (patch) | |
tree | 0e2bf172b1dec9ca0a8c88fd91cb763c68f3f197 /indra/llrender | |
parent | 74a2354353813db529ae123858bafba86cd12110 (diff) |
SL-16166 Apply LLRenderPass::pushBatch optimizations to LLDrawPoolBump::pushBatch
Diffstat (limited to 'indra/llrender')
-rw-r--r-- | indra/llrender/llrender.cpp | 22 | ||||
-rw-r--r-- | indra/llrender/llrender.h | 3 |
2 files changed, 25 insertions, 0 deletions
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 34c5b77944..91d3c96fbe 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -472,6 +472,28 @@ void LLTexUnit::unbind(eTextureType type) } } +void LLTexUnit::unbindFast(eTextureType type) +{ + activate(); + + // Disabled caching of binding state. + if (mCurrTexType == type) + { + mCurrTexture = 0; + + // Always make sure our texture color space is reset to linear. SRGB sampling should be opt-in in the vast majority of cases. Also prevents color space "popping". + mTexColorSpace = TCS_LINEAR; + if (type == LLTexUnit::TT_TEXTURE) + { + glBindTexture(sGLTextureType[type], sWhiteTexture); + } + else + { + glBindTexture(sGLTextureType[type], 0); + } + } +} + void LLTexUnit::setTextureAddressMode(eTextureAddressMode mode) { if (mIndex < 0 || mCurrTexture == 0) return; diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index 658cdda504..6e2647a16b 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -188,6 +188,9 @@ public: // (only if there's a texture of the given type currently bound) void unbind(eTextureType type); + // Fast but unsafe version of unbind + void unbindFast(eTextureType type); + // Sets the addressing mode used to sample the texture // Warning: this stays set for the bound texture forever, // make sure you want to permanently change the address mode for the bound texture. |