summaryrefslogtreecommitdiff
path: root/indra/llrender/llrender.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llrender/llrender.cpp')
-rw-r--r--indra/llrender/llrender.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 70df1dd1d1..d72918b15d 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -1168,6 +1168,11 @@ void LLRender::setAlphaRejectSettings(eCompareFunc func, F32 value)
{
flush();
+ if (LLGLSLShader::sNoFixedFunction)
+ { //glAlphaFunc is deprecated in OpenGL 3.3
+ return;
+ }
+
if (mCurrAlphaFunc != func ||
mCurrAlphaFuncVal != value)
{
@@ -1182,6 +1187,30 @@ void LLRender::setAlphaRejectSettings(eCompareFunc func, F32 value)
glAlphaFunc(sGLCompareFunc[func], value);
}
}
+
+ if (gDebugGL)
+ { //make sure cached state is correct
+ GLint cur_func = 0;
+ glGetIntegerv(GL_ALPHA_TEST_FUNC, &cur_func);
+
+ if (func == CF_DEFAULT)
+ {
+ func = CF_GREATER;
+ }
+
+ if (cur_func != sGLCompareFunc[func])
+ {
+ llerrs << "Alpha test function corrupted!" << llendl;
+ }
+
+ F32 ref = 0.f;
+ glGetFloatv(GL_ALPHA_TEST_REF, &ref);
+
+ if (ref != value)
+ {
+ llerrs << "Alpha test value corrupted!" << llendl;
+ }
+ }
}
void LLRender::blendFunc(eBlendFactor sfactor, eBlendFactor dfactor)