summaryrefslogtreecommitdiff
path: root/indra/llrender/llgl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/llrender/llgl.cpp')
-rw-r--r--indra/llrender/llgl.cpp27
1 files changed, 9 insertions, 18 deletions
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index ac66faaf5a..b002d183ef 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -1123,17 +1123,6 @@ bool LLGLManager::initGL()
if (mGLVersion >= 2.f)
{
parse_glsl_version(mGLSLVersionMajor, mGLSLVersionMinor);
-
-#if 0 && LL_DARWIN
- // TODO maybe switch to using a core profile for GL 3.2?
- // https://stackoverflow.com/a/19868861
- //never use GLSL greater than 1.20 on OSX
- if (mGLSLVersionMajor > 1 || mGLSLVersionMinor > 30)
- {
- mGLSLVersionMajor = 1;
- mGLSLVersionMinor = 30;
- }
-#endif
}
#if GL_VERSION_1_3
@@ -2279,26 +2268,28 @@ void rotate_quat(LLQuaternion& rotation)
void flush_glerror()
{
+ if(!gDebugGL) return;
glGetError();
}
-//this function outputs gl error to the log file, does not crash the code.
-void log_glerror()
+void log_glerror(std::string comment)
{
+ if(!gDebugGL) return;
+
if (LL_UNLIKELY(!gGLManager.mInited))
{
return ;
}
- // Create or update texture to be used with this data
+
GLenum error;
error = glGetError();
- while (LL_UNLIKELY(error))
+ if (error != GL_NO_ERROR)
{
#if GLU_VERSION_1_1
GLubyte const * gl_error_msg = gluErrorString(error);
if (NULL != gl_error_msg)
{
- LL_WARNS() << "GL Error: " << error << " GL Error String: " << gl_error_msg << LL_ENDL ;
+ LL_WARNS() << "GL Error (" << comment << ")" << error << ": " << gl_error_msg << LL_ENDL;
}
else
#endif // GLU_VERSION_1_1
@@ -2307,7 +2298,6 @@ void log_glerror()
// you'll probably have to grep for the number in glext.h.
LL_WARNS() << "GL Error: UNKNOWN 0x" << std::hex << error << std::dec << LL_ENDL;
}
- error = glGetError();
}
}
@@ -2385,6 +2375,7 @@ void assert_glerror()
void clear_glerror()
{
+ if(!gDebugGL) return;
glGetError();
glGetError();
}
@@ -2746,7 +2737,7 @@ void LLGLUserClipPlane::setPlane(F32 a, F32 b, F32 c, F32 d)
if(cplane[2] < 0)
cplane *= -1;
- glm::mat4 suffix;
+ glm::mat4 suffix = glm::identity<glm::mat4>();
suffix = glm::row(suffix, 2, cplane);
glm::mat4 newP = suffix * P;
gGL.matrixMode(LLRender::MM_PROJECTION);