diff options
author | Dave Parks <davep@lindenlab.com> | 2023-03-10 10:52:35 -0600 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2023-03-10 10:52:35 -0600 |
commit | 25ede8638209fac8dde5b71bece4bc1dfa30ea16 (patch) | |
tree | ce5deda0c12a9e157c07cb72001eda396b1a542e /indra/llrender/llrender.cpp | |
parent | cf72c8ec614fcfc2811f10dfacdc51ed3f477e31 (diff) |
SL-19172 Texture streaming tune up. Incidental decruft.
Diffstat (limited to 'indra/llrender/llrender.cpp')
-rw-r--r-- | indra/llrender/llrender.cpp | 34 |
1 files changed, 8 insertions, 26 deletions
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 5b814f03cb..8430d13093 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -70,9 +70,6 @@ bool LLRender::sGLCoreProfile = false; bool LLRender::sNsightDebugSupport = false; LLVector2 LLRender::sUIGLScaleFactor = LLVector2(1.f, 1.f); -static const U32 LL_NUM_TEXTURE_LAYERS = 32; -static const U32 LL_NUM_LIGHT_UNITS = 8; - struct LLVBCache { LLPointer<LLVertexBuffer> vb; @@ -823,16 +820,14 @@ LLRender::LLRender() mMode(LLRender::TRIANGLES), mCurrTextureUnitIndex(0) { - mTexUnits.reserve(LL_NUM_TEXTURE_LAYERS); for (U32 i = 0; i < LL_NUM_TEXTURE_LAYERS; i++) { - mTexUnits.push_back(new LLTexUnit(i)); + mTexUnits[i].mIndex = i; } - mDummyTexUnit = new LLTexUnit(-1); for (U32 i = 0; i < LL_NUM_LIGHT_UNITS; ++i) { - mLightState.push_back(new LLLightState(i)); + mLightState[i].mIndex = i; } for (U32 i = 0; i < 4; i++) @@ -915,19 +910,6 @@ void LLRender::resetVertexBuffer() void LLRender::shutdown() { - for (U32 i = 0; i < mTexUnits.size(); i++) - { - delete mTexUnits[i]; - } - mTexUnits.clear(); - delete mDummyTexUnit; - mDummyTexUnit = NULL; - - for (U32 i = 0; i < mLightState.size(); ++i) - { - delete mLightState[i]; - } - mLightState.clear(); resetVertexBuffer(); } @@ -939,10 +921,10 @@ void LLRender::refreshState(void) for (U32 i = 0; i < mTexUnits.size(); i++) { - mTexUnits[i]->refreshState(); + mTexUnits[i].refreshState(); } - mTexUnits[active_unit]->activate(); + mTexUnits[active_unit].activate(); setColorMask(mCurrColorMask[0], mCurrColorMask[1], mCurrColorMask[2], mCurrColorMask[3]); @@ -974,7 +956,7 @@ void LLRender::syncLightState() for (U32 i = 0; i < LL_NUM_LIGHT_UNITS; i++) { - LLLightState *light = mLightState[i]; + LLLightState *light = &mLightState[i]; position[i] = light->mPosition; direction[i] = light->mSpotDirection; @@ -1501,12 +1483,12 @@ LLTexUnit* LLRender::getTexUnit(U32 index) { if (index < mTexUnits.size()) { - return mTexUnits[index]; + return &mTexUnits[index]; } else { LL_DEBUGS() << "Non-existing texture unit layer requested: " << index << LL_ENDL; - return mDummyTexUnit; + return &mDummyTexUnit; } } @@ -1514,7 +1496,7 @@ LLLightState* LLRender::getLight(U32 index) { if (index < mLightState.size()) { - return mLightState[index]; + return &mLightState[index]; } return NULL; |