summaryrefslogtreecommitdiff
path: root/indra/llrender
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2010-03-12 13:01:50 -0600
committerDave Parks <davep@lindenlab.com>2010-03-12 13:01:50 -0600
commit58afe469f9d29aea0d3d974ac112725ddbaa3a19 (patch)
tree1b2205662a07c8e555ddecb9f09b2cdc3d74bb4e /indra/llrender
parentf5c431aa7bce953503b33c957ba024bdd9104e63 (diff)
Bizarrely hacky fix for EXT-6276 (#if LL_DARWIN out copyFromPrimarySubstring)
General gl state cleanup in llui. Make llrender more gGL.begin/end friendly.
Diffstat (limited to 'indra/llrender')
-rw-r--r--indra/llrender/llrender.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 9acfb6b0a8..26282b0ee3 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -121,6 +121,8 @@ void LLTexUnit::refreshState(void)
// We set dirty to true so that the tex unit knows to ignore caching
// and we reset the cached tex unit state
+ gGL.flush();
+
glActiveTextureARB(GL_TEXTURE0_ARB + mIndex);
if (mCurrTexType != TT_NONE)
{
@@ -182,6 +184,7 @@ void LLTexUnit::disable(void)
{
activate();
unbind(mCurrTexType);
+ gGL.flush();
glDisable(sGLTextureType[mCurrTexType]);
mCurrTexType = TT_NONE;
}
@@ -717,6 +720,7 @@ void LLTexUnit::setColorScale(S32 scale)
if (mCurrColorScale != scale || gGL.mDirty)
{
mCurrColorScale = scale;
+ gGL.flush();
glTexEnvi( GL_TEXTURE_ENV, GL_RGB_SCALE, scale );
}
}
@@ -726,6 +730,7 @@ void LLTexUnit::setAlphaScale(S32 scale)
if (mCurrAlphaScale != scale || gGL.mDirty)
{
mCurrAlphaScale = scale;
+ gGL.flush();
glTexEnvi( GL_TEXTURE_ENV, GL_ALPHA_SCALE, scale );
}
}
@@ -1113,6 +1118,33 @@ void LLRender::flush()
sUICalls++;
sUIVerts += mCount;
}
+
+ if (gDebugGL)
+ {
+ if (mMode == LLRender::QUADS)
+ {
+ if (mCount%4 != 0)
+ {
+ llerrs << "Incomplete quad rendered." << llendl;
+ }
+ }
+
+ if (mMode == LLRender::TRIANGLES)
+ {
+ if (mCount%3 != 0)
+ {
+ llerrs << "Incomplete triangle rendered." << llendl;
+ }
+ }
+
+ if (mMode == LLRender::LINES)
+ {
+ if (mCount%2 != 0)
+ {
+ llerrs << "Incomplete line rendered." << llendl;
+ }
+ }
+ }
mBuffer->setBuffer(immediate_mask);
mBuffer->drawArrays(mMode, 0, mCount);