From 9aefe34998bcd2320b09924d9a78e518627ddd79 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 11 Mar 2010 15:19:27 -0600 Subject: EXT-6276 Put in some gl flush calls to register combiner functions (why these are being used for UI now is beyond me) --- indra/llrender/llrender.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/llrender') diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 656f690db5..0ce6bdf398 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -150,6 +150,7 @@ void LLTexUnit::activate(void) if ((S32)gGL.mCurrTextureUnitIndex != mIndex || gGL.mDirty) { + gGL.flush(); glActiveTextureARB(GL_TEXTURE0_ARB + mIndex); gGL.mCurrTextureUnitIndex = mIndex; } @@ -567,6 +568,7 @@ void LLTexUnit::setTextureCombiner(eTextureBlendOp op, eTextureBlendSrc src1, eT if (mCurrBlendType != TB_COMBINE || gGL.mDirty) { mCurrBlendType = TB_COMBINE; + gGL.flush(); glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_COMBINE_ARB); } @@ -577,6 +579,8 @@ void LLTexUnit::setTextureCombiner(eTextureBlendOp op, eTextureBlendSrc src1, eT return; } + gGL.flush(); + // Get the gl source enums according to the eTextureBlendSrc sources passed in GLint source1 = getTextureSource(src1); GLint source2 = getTextureSource(src2); -- cgit v1.2.3 From f5c431aa7bce953503b33c957ba024bdd9104e63 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 11 Mar 2010 16:06:36 -0600 Subject: EXT-6276 Put in some gl flush calls to texture state functions. --- indra/llrender/llrender.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/llrender') diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 0ce6bdf398..9acfb6b0a8 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -387,6 +387,8 @@ void LLTexUnit::setTextureAddressMode(eTextureAddressMode mode) { if (mIndex < 0 || mCurrTexture == 0) return; + gGL.flush(); + activate(); glTexParameteri (sGLTextureType[mCurrTexType], GL_TEXTURE_WRAP_S, sGLAddressMode[mode]); @@ -401,6 +403,8 @@ void LLTexUnit::setTextureFilteringOption(LLTexUnit::eTextureFilterOptions optio { if (mIndex < 0 || mCurrTexture == 0) return; + gGL.flush(); + if (option == TFO_POINT) { glTexParameteri(sGLTextureType[mCurrTexType], GL_TEXTURE_MAG_FILTER, GL_NEAREST); -- cgit v1.2.3 From 58afe469f9d29aea0d3d974ac112725ddbaa3a19 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 12 Mar 2010 13:01:50 -0600 Subject: Bizarrely hacky fix for EXT-6276 (#if LL_DARWIN out copyFromPrimarySubstring) General gl state cleanup in llui. Make llrender more gGL.begin/end friendly. --- indra/llrender/llrender.cpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) (limited to 'indra/llrender') 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); -- cgit v1.2.3 From d2996b685972e2b066e6821d0bc258073d8ceb1d Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 12 Mar 2010 13:17:30 -0600 Subject: EXT-6276 Fix for UI going all wonky. --- indra/llrender/llrender.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'indra/llrender') diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 26282b0ee3..c3540a717c 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -866,7 +866,15 @@ void LLRender::scaleUI(F32 x, F32 y, F32 z) void LLRender::pushUIMatrix() { - mUIOffset.push_front(mUIOffset.front()); + if (mUIOffset.empty()) + { + mUIOffset.push_front(LLVector3(0,0,0)); + } + else + { + mUIOffset.push_front(mUIOffset.front()); + } + if (mUIScale.empty()) { mUIScale.push_front(LLVector3(1,1,1)); -- cgit v1.2.3 From 91b90b0a1749471a9016c4935b58c08a3dd66523 Mon Sep 17 00:00:00 2001 From: Richard Nelson Date: Tue, 23 Mar 2010 11:18:01 -0700 Subject: EXT-5549 Can't select last character in chat window --- indra/llrender/llfontgl.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llrender') diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index 768f042e69..d9e1976341 100644 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp @@ -673,7 +673,7 @@ S32 LLFontGL::charFromPixelOffset(const llwchar* wchars, S32 begin_offset, F32 t target_x *= sScaleX; // max_chars is S32_MAX by default, so make sure we don't get overflow - const S32 max_index = begin_offset + llmin(S32_MAX - begin_offset, max_chars); + const S32 max_index = begin_offset + llmin(S32_MAX - begin_offset, max_chars - 1); F32 scaled_max_pixels = max_pixels * sScaleX; -- cgit v1.2.3