diff options
Diffstat (limited to 'indra/llrender/llrender.cpp')
-rw-r--r-- | indra/llrender/llrender.cpp | 61 |
1 files changed, 33 insertions, 28 deletions
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 5d26a69d7b..332d15f76c 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -1,4 +1,4 @@ -/** + /** * @file llrender.cpp * @brief LLRender implementation * @@ -139,21 +139,21 @@ U32 LLTexUnit::getInternalType(eTextureType type) 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 + // We set dirty to true so that the tex unit knows to ignore caching + // and we reset the cached tex unit state -gGL.flush(); + gGL.flush(); -glActiveTexture(GL_TEXTURE0 + mIndex); + glActiveTexture(GL_TEXTURE0 + mIndex); -if (mCurrTexType != TT_NONE) -{ - glBindTexture(sGLTextureType[mCurrTexType], mCurrTexture); -} -else -{ - glBindTexture(GL_TEXTURE_2D, 0); -} + if (mCurrTexType != TT_NONE) + { + glBindTexture(sGLTextureType[mCurrTexType], mCurrTexture); + } + else + { + glBindTexture(GL_TEXTURE_2D, 0); + } } void LLTexUnit::activate(void) @@ -662,12 +662,12 @@ void LLTexUnit::debugTextureUnit(void) LLLightState::LLLightState(S32 index) : mIndex(index), -mEnabled(false), -mConstantAtten(1.f), -mLinearAtten(0.f), -mQuadraticAtten(0.f), -mSpotExponent(0.f), -mSpotCutoff(180.f) + mEnabled(false), + mConstantAtten(1.f), + mLinearAtten(0.f), + mQuadraticAtten(0.f), + mSpotExponent(0.f), + mSpotCutoff(180.f) { if (mIndex == 0) { @@ -826,7 +826,7 @@ void LLLightState::setSpotDirection(const LLVector3& direction) } LLRender::LLRender() -: mDirty(false), + : mDirty(false), mCount(0), mMode(LLRender::TRIANGLES), mCurrTextureUnitIndex(0) @@ -1457,7 +1457,7 @@ void LLRender::blendFunc(eBlendFactor sfactor, eBlendFactor dfactor) } void LLRender::blendFunc(eBlendFactor color_sfactor, eBlendFactor color_dfactor, - eBlendFactor alpha_sfactor, eBlendFactor alpha_dfactor) + eBlendFactor alpha_sfactor, eBlendFactor alpha_dfactor) { llassert(color_sfactor < BF_UNDEF); llassert(color_dfactor < BF_UNDEF); @@ -1474,7 +1474,7 @@ void LLRender::blendFunc(eBlendFactor color_sfactor, eBlendFactor color_dfactor, flush(); glBlendFuncSeparate(sGLBlendFactor[color_sfactor], sGLBlendFactor[color_dfactor], - sGLBlendFactor[alpha_sfactor], sGLBlendFactor[alpha_dfactor]); + sGLBlendFactor[alpha_sfactor], sGLBlendFactor[alpha_dfactor]); } } @@ -1612,8 +1612,8 @@ void LLRender::flush(std::string comment_) { if (mCount%3 != 0) { - count -= (mCount % 3); - LL_WARNS() << "Incomplete triangle requested." << LL_ENDL; + count -= (mCount % 3); + LL_WARNS() << "Incomplete triangle requested." << LL_ENDL; } } @@ -1667,6 +1667,11 @@ void LLRender::flush(std::string comment_) } } +void LLRender::flush() +{ + flush(""); +} + LLVertexBuffer* LLRender::bufferfromCache(U32 attribute_mask, U32 count) { LLVertexBuffer *vb = nullptr; @@ -1763,7 +1768,7 @@ LLVertexBuffer* LLRender::genBuffer(U32 attribute_mask, S32 count) if(gGLManager.mIsApple && LLVertexBuffer::getVertexBufferMode() == 0) { - vb->unmapBuffer(); + vb->unmapBuffer(); } vb->unbind(); @@ -2132,9 +2137,9 @@ glm::vec3 mul_mat4_vec3(const glm::mat4& mat, const glm::vec3& vec) #if 1 // SIMD path results in strange crashes. Fall back to scalar for now. const float w = vec[0] * mat[0][3] + vec[1] * mat[1][3] + vec[2] * mat[2][3] + mat[3][3]; return glm::vec3( - (vec[0] * mat[0][0] + vec[1] * mat[1][0] + vec[2] * mat[2][0] + mat[3][0]) / w, - (vec[0] * mat[0][1] + vec[1] * mat[1][1] + vec[2] * mat[2][1] + mat[3][1]) / w, - (vec[0] * mat[0][2] + vec[1] * mat[1][2] + vec[2] * mat[2][2] + mat[3][2]) / w + (vec[0] * mat[0][0] + vec[1] * mat[1][0] + vec[2] * mat[2][0] + mat[3][0]) / w, + (vec[0] * mat[0][1] + vec[1] * mat[1][1] + vec[2] * mat[2][1] + mat[3][1]) / w, + (vec[0] * mat[0][2] + vec[1] * mat[1][2] + vec[2] * mat[2][2] + mat[3][2]) / w ); #else LLVector4a x, y, z, s, t, p, q; |