diff options
author | Graham Linden <graham@lindenlab.com> | 2019-02-08 12:44:29 -0800 |
---|---|---|
committer | Graham Linden <graham@lindenlab.com> | 2019-02-08 12:44:29 -0800 |
commit | 5c5b625892a86dfa467225c059f7ef1188ba46ca (patch) | |
tree | 65773de98719a3e7e85f9ba4a76371f3a90ce444 /indra/llrender | |
parent | 9f2a0d2a082495ce878f0eb0d7348b181939d348 (diff) | |
parent | c909e496fd1a0710e5349441ef4e3cae5ff98de6 (diff) |
Merge SL-10501 fix
Diffstat (limited to 'indra/llrender')
-rw-r--r-- | indra/llrender/llrender.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 6e15f52866..de04ea601a 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -895,15 +895,6 @@ void LLLightState::setDiffuse(const LLColor4& diffuse) } } -void LLLightState::setDiffuseB(const LLColor4& diffuse) -{ - if (mDiffuseB != diffuse) - { - ++gGL.mLightHash; - mDiffuseB = diffuse; - } -} - void LLLightState::setAmbient(const LLColor4& ambient) { if (mAmbient != ambient) @@ -1162,7 +1153,6 @@ void LLRender::syncLightState() LLVector3 direction[8]; LLVector4 attenuation[8]; LLVector3 diffuse[8]; - LLVector3 diffuseB[8]; for (U32 i = 0; i < 8; i++) { @@ -1172,7 +1162,6 @@ void LLRender::syncLightState() direction[i] = light->mSpotDirection; attenuation[i].set(light->mLinearAtten, light->mQuadraticAtten, light->mSpecular.mV[2], light->mSpecular.mV[3]); diffuse[i].set(light->mDiffuse.mV); - diffuseB[i].set(light->mDiffuseB.mV); } shader->uniform4fv(LLShaderMgr::LIGHT_POSITION, 8, position[0].mV); @@ -1180,8 +1169,8 @@ void LLRender::syncLightState() shader->uniform4fv(LLShaderMgr::LIGHT_ATTENUATION, 8, attenuation[0].mV); shader->uniform3fv(LLShaderMgr::LIGHT_DIFFUSE, 8, diffuse[0].mV); shader->uniform4fv(LLShaderMgr::LIGHT_AMBIENT, 1, mAmbientLightColor.mV); + //HACK -- duplicate sunlight color for compatibility with drivers that can't deal with multiple shader objects referencing the same uniform shader->uniform4fv(LLShaderMgr::SUNLIGHT_COLOR, 1, diffuse[0].mV); - shader->uniform4fv(LLShaderMgr::MOONLIGHT_COLOR, 1, diffuseB[0].mV); } } @@ -1488,6 +1477,13 @@ void LLRender::matrixMode(U32 mode) { if (mode == MM_TEXTURE) { + U32 tex_index = gGL.getCurrentTexUnitIndex(); + // the shaders don't actually reference anything beyond texture_matrix0/1 + if (tex_index > 3) + { + LL_WARNS_ONCE("render") << "Cannot use texture matrix with texture unit " << tex_index << " forcing texture matrix 3!" << LL_ENDL; + tex_index = 3; + } mode = MM_TEXTURE0 + gGL.getCurrentTexUnitIndex(); } |