From e2a0f801b9776a66ac12796e32aef4070d259a6a Mon Sep 17 00:00:00 2001 From: Shyotl Date: Thu, 8 May 2014 16:29:53 -0500 Subject: [PATCH] Have LLRender::color4ub fall back to uniform if bound vbo lacks color attribute. Fixed fixed-function call in LLFacePool::LLOverrideFaceColor::setColor. --- indra/llrender/llrender.cpp | 10 +++++++++- indra/newview/lldrawpool.cpp | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 85c5a0cb5..3eae47b8a 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -2199,7 +2199,15 @@ void LLRender::texCoord2fv(const GLfloat* tc) void LLRender::color4ub(const GLubyte& r, const GLubyte& g, const GLubyte& b, const GLubyte& a) { - mColorsp[mCount] = LLColor4U(r,g,b,a); + if (!LLGLSLShader::sCurBoundShaderPtr || + LLGLSLShader::sCurBoundShaderPtr->mAttributeMask & LLVertexBuffer::MAP_COLOR) + { + mColorsp[mCount] = LLColor4U(r,g,b,a); + } + else + { //not using shaders or shader reads color from a uniform + diffuseColor4ub(r,g,b,a); + } } void LLRender::color4ubv(const GLubyte* c) { diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index a2aa5abbf..90701c0f4 100644 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -356,7 +356,7 @@ void LLFacePool::LLOverrideFaceColor::setColor(const LLColor4& color) void LLFacePool::LLOverrideFaceColor::setColor(const LLColor4U& color) { - glColor4ubv(color.mV); + gGL.diffuseColor4ubv(color.mV); } void LLFacePool::LLOverrideFaceColor::setColor(F32 r, F32 g, F32 b, F32 a)