diff options
author | Tofu Linden <tofu.linden@lindenlab.com> | 2010-02-13 13:55:41 +0000 |
---|---|---|
committer | Tofu Linden <tofu.linden@lindenlab.com> | 2010-02-13 13:55:41 +0000 |
commit | 848f0ad183180ef5860038b1b709a3fdaa31aa3e (patch) | |
tree | c38379a2cb52c91b8787ff3688d4615a84384256 /indra | |
parent | b55c9b9db6ef1e548ebb77d5e24d2ddc6eb5324e (diff) |
a better fix for the blend-factor init problem. I think.
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llrender/llrender.cpp | 10 | ||||
-rw-r--r-- | indra/llrender/llrender.h | 8 |
2 files changed, 12 insertions, 6 deletions
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 0a1053abc2..e701b96a1e 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -93,7 +93,9 @@ static GLenum sGLBlendFactor[] = GL_DST_ALPHA, GL_SRC_ALPHA, GL_ONE_MINUS_DST_ALPHA, - GL_ONE_MINUS_SRC_ALPHA + GL_ONE_MINUS_SRC_ALPHA, + + GL_ZERO // 'BF_UNDEF' }; LLTexUnit::LLTexUnit(S32 index) @@ -765,8 +767,8 @@ LLRender::LLRender() mCurrAlphaFuncVal = 0.01f; mCurrSceneBlendType = BT_ALPHA; - mCurrBlendSFactor = BF_ONE; - mCurrBlendDFactor = BF_ZERO; + mCurrBlendSFactor = BF_UNDEF; + mCurrBlendDFactor = BF_UNDEF; } LLRender::~LLRender() @@ -979,6 +981,8 @@ void LLRender::setAlphaRejectSettings(eCompareFunc func, F32 value) void LLRender::blendFunc(eBlendFactor sfactor, eBlendFactor dfactor) { + llassert(sfactor < BF_UNDEF); + llassert(dfactor < BF_UNDEF); if (mCurrBlendSFactor != sfactor || mCurrBlendDFactor != dfactor) { mCurrBlendSFactor = sfactor; diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index ef18b556e6..e9ffba9efe 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -270,7 +270,9 @@ public: BF_DEST_ALPHA, BF_SOURCE_ALPHA, BF_ONE_MINUS_DEST_ALPHA, - BF_ONE_MINUS_SOURCE_ALPHA + BF_ONE_MINUS_SOURCE_ALPHA, + + BF_UNDEF } eBlendFactor; LLRender(); @@ -364,8 +366,8 @@ private: F32 mMaxAnisotropy; - U32 mCurrBlendSFactor; - U32 mCurrBlendDFactor; + eBlendFactor mCurrBlendSFactor; + eBlendFactor mCurrBlendDFactor; std::list<LLVector3> mUIOffset; std::list<LLVector3> mUIScale; |