diff options
author | Dave Parks <davep@lindenlab.com> | 2013-07-01 10:59:46 -0500 |
---|---|---|
committer | Dave Parks <davep@lindenlab.com> | 2013-07-01 10:59:46 -0500 |
commit | d262ca32d3b80803595fcc3f61f008786125250d (patch) | |
tree | ab7b8e13920b309321390f41c663b775f162b0c7 /indra/llrender/llrender.cpp | |
parent | bd41392b7ec1dd90cd0039d87bbbef8beda1796a (diff) | |
parent | 1c9a4fc080bee955b5b18750fe8de7c24a3f912f (diff) |
Automated merge with https://bitbucket.org/lindenlab/viewer-cat
Diffstat (limited to 'indra/llrender/llrender.cpp')
-rwxr-xr-x | indra/llrender/llrender.cpp | 45 |
1 files changed, 23 insertions, 22 deletions
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 18ca5b35f0..c4585936ee 100755 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -1150,7 +1150,7 @@ void LLRender::syncLightState() position[i] = light->mPosition; direction[i] = light->mSpotDirection; - attenuation[i].set(light->mLinearAtten, light->mQuadraticAtten, light->mSpecular.mV[3]); + attenuation[i].set(1.f/light->mLinearAtten, light->mQuadraticAtten, light->mSpecular.mV[3]); diffuse[i].set(light->mDiffuse.mV); } @@ -1869,35 +1869,36 @@ void LLRender::flush() sUIVerts += mCount; } - if (gDebugGL) + //store mCount in a local variable to avoid re-entrance (drawArrays may call flush) + U32 count = mCount; + + if (mMode == LLRender::QUADS && !sGLCoreProfile) { - if (mMode == LLRender::QUADS && !sGLCoreProfile) + if (mCount%4 != 0) { - if (mCount%4 != 0) - { - llerrs << "Incomplete quad rendered." << llendl; - } + count -= (mCount % 4); + llwarns << "Incomplete quad requested." << llendl; } - - if (mMode == LLRender::TRIANGLES) + } + + if (mMode == LLRender::TRIANGLES) + { + if (mCount%3 != 0) { - if (mCount%3 != 0) - { - llerrs << "Incomplete triangle rendered." << llendl; - } + count -= (mCount % 3); + llwarns << "Incomplete triangle requested." << llendl; } - - if (mMode == LLRender::LINES) + } + + if (mMode == LLRender::LINES) + { + if (mCount%2 != 0) { - if (mCount%2 != 0) - { - llerrs << "Incomplete line rendered." << llendl; - } + count -= (mCount % 2); + llwarns << "Incomplete line requested." << llendl; } } - - //store mCount in a local variable to avoid re-entrance (drawArrays may call flush) - U32 count = mCount; + mCount = 0; if (mBuffer->useVBOs() && !mBuffer->isLocked()) |