diff options
author | Runitai Linden <davep@lindenlab.com> | 2021-10-12 14:46:19 -0500 |
---|---|---|
committer | Runitai Linden <davep@lindenlab.com> | 2021-10-12 14:46:19 -0500 |
commit | 52e1a45659341df68eca01822f189e0883afe66d (patch) | |
tree | 22095098abd56e6e30bac91b6f3e6838e6b55e82 /indra/llrender/llrender.cpp | |
parent | 75cf90723f63d1d80b2a3b4b8aa9536cadcda8cb (diff) |
SL-16166 Optimization pass on LLRenderPass::pushBatch
Diffstat (limited to 'indra/llrender/llrender.cpp')
-rw-r--r-- | indra/llrender/llrender.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index b6711e44e3..34c5b77944 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -169,6 +169,7 @@ void LLTexUnit::refreshState(void) void LLTexUnit::activate(void) { + LL_PROFILE_ZONE_SCOPED; if (mIndex < 0) return; if ((S32)gGL.mCurrTextureUnitIndex != mIndex || gGL.mDirty) @@ -229,8 +230,20 @@ void LLTexUnit::disable(void) } } +void LLTexUnit::bindFast(LLTexture* texture) +{ + LLImageGL* gl_tex = texture->getGLTexture(); + + glActiveTextureARB(GL_TEXTURE0_ARB + mIndex); + gGL.mCurrTextureUnitIndex = mIndex; + mCurrTexture = gl_tex->getTexName(); + glBindTexture(sGLTextureType[gl_tex->getTarget()], mCurrTexture); + mHasMipMaps = gl_tex->mHasMipMaps; +} + bool LLTexUnit::bind(LLTexture* texture, bool for_rendering, bool forceBind) { + LL_PROFILE_ZONE_SCOPED; stop_glerror(); if (mIndex >= 0) { @@ -1243,8 +1256,6 @@ void LLRender::syncLightState() void LLRender::syncMatrices() { - stop_glerror(); - static const U32 name[] = { LLShaderMgr::MODELVIEW_MATRIX, @@ -1415,8 +1426,6 @@ void LLRender::syncMatrices() } } } - - stop_glerror(); } void LLRender::translatef(const GLfloat& x, const GLfloat& y, const GLfloat& z) @@ -1925,6 +1934,7 @@ void LLRender::end() } void LLRender::flush() { + LL_PROFILE_ZONE_SCOPED; if (mCount > 0) { if (!mUIOffset.empty()) |