From 897a4668bd385fe73237c163284a6bc63353bf26 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 8 Apr 2011 01:24:17 -0500 Subject: SH-1320 Fix for flickering objects in water distortion/reflection maps. --- indra/llrender/llgl.cpp | 22 +++++++++++++++------- indra/llrender/llgl.h | 4 +++- 2 files changed, 18 insertions(+), 8 deletions(-) (limited to 'indra/llrender') diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index d5f0b81830..b508705759 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -1858,12 +1858,17 @@ void parse_gl_version( S32* major, S32* minor, S32* release, std::string* vendor } } -LLGLUserClipPlane::LLGLUserClipPlane(const LLPlane& p, const glh::matrix4f& modelview, const glh::matrix4f& projection) +LLGLUserClipPlane::LLGLUserClipPlane(const LLPlane& p, const glh::matrix4f& modelview, const glh::matrix4f& projection, bool apply) { - mModelview = modelview; - mProjection = projection; + mApply = apply; - setPlane(p[0], p[1], p[2], p[3]); + if (mApply) + { + mModelview = modelview; + mProjection = projection; + + setPlane(p[0], p[1], p[2], p[3]); + } } void LLGLUserClipPlane::setPlane(F32 a, F32 b, F32 c, F32 d) @@ -1894,9 +1899,12 @@ void LLGLUserClipPlane::setPlane(F32 a, F32 b, F32 c, F32 d) LLGLUserClipPlane::~LLGLUserClipPlane() { - glMatrixMode(GL_PROJECTION); - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); + if (mApply) + { + glMatrixMode(GL_PROJECTION); + glPopMatrix(); + glMatrixMode(GL_MODELVIEW); + } } LLGLNamePool::LLGLNamePool() diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h index 0d7ba15b12..43992d51cb 100644 --- a/indra/llrender/llgl.h +++ b/indra/llrender/llgl.h @@ -301,12 +301,14 @@ class LLGLUserClipPlane { public: - LLGLUserClipPlane(const LLPlane& plane, const glh::matrix4f& modelview, const glh::matrix4f& projection); + LLGLUserClipPlane(const LLPlane& plane, const glh::matrix4f& modelview, const glh::matrix4f& projection, bool apply = true); ~LLGLUserClipPlane(); void setPlane(F32 a, F32 b, F32 c, F32 d); private: + bool mApply; + glh::matrix4f mProjection; glh::matrix4f mModelview; }; -- cgit v1.2.3 From 8275820df01e9918f254f1a2cd373eb723b88715 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 15 Apr 2011 14:11:48 -0500 Subject: SH-1301 Add some extra asserts around VBO usage to try and narrow down a crash. --- indra/llrender/llvertexbuffer.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'indra/llrender') diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index 6c0895512e..a9f22193f8 100644 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -56,13 +56,17 @@ protected: virtual GLuint allocateName() { GLuint name; + stop_glerror(); glGenBuffersARB(1, &name); + stop_glerror(); return name; } virtual void releaseName(GLuint name) { + stop_glerror(); glDeleteBuffersARB(1, &name); + stop_glerror(); } }; -- cgit v1.2.3