summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorLeslie Linden <leslie@lindenlab.com>2011-11-16 17:14:41 -0800
committerLeslie Linden <leslie@lindenlab.com>2011-11-16 17:14:41 -0800
commit9d1228b5388ce4c39be8a9f156634bd63a608cf2 (patch)
treee84e5c9424f0c53f263fb53724f60281e30f29d5 /indra
parentc79c4f1477cae232a033e33cc1722b4658cf6634 (diff)
parente822ecc8035fe2624270c0c81ace9f74dcc8a8e1 (diff)
Merge with latest
Diffstat (limited to 'indra')
-rw-r--r--indra/llrender/llrender.cpp11
-rw-r--r--indra/newview/llselectmgr.cpp13
-rw-r--r--indra/newview/llvosurfacepatch.cpp2
3 files changed, 26 insertions, 0 deletions
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 97aeae548a..812fa7024b 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -1887,6 +1887,17 @@ void LLRender::flush()
void LLRender::vertex3f(const GLfloat& x, const GLfloat& y, const GLfloat& z)
{
//the range of mVerticesp, mColorsp and mTexcoordsp is [0, 4095]
+ if (mCount > 2048)
+ { //break when buffer gets reasonably full to keep GL command buffers happy and avoid overflow below
+ switch (mMode)
+ {
+ case LLRender::POINTS: flush(); break;
+ case LLRender::TRIANGLES: if (mCount%3==0) flush(); break;
+ case LLRender::QUADS: if(mCount%4 == 0) flush(); break;
+ case LLRender::LINES: if (mCount%2 == 0) flush(); break;
+ }
+ }
+
if (mCount > 4094)
{
// llwarns << "GL immediate mode overflow. Some geometry not drawn." << llendl;
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 830a7778ac..5d0d1ef9a3 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -5713,6 +5713,14 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color)
return;
}
+
+ LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr;
+
+ if (shader)
+ { //switch to "solid color" program for SH-2690 -- works around driver bug causing bad triangles when rendering silhouettes
+ gSolidColorProgram.bind();
+ }
+
gGL.matrixMode(LLRender::MM_MODELVIEW);
gGL.pushMatrix();
gGL.pushUIMatrix();
@@ -5835,6 +5843,11 @@ void LLSelectNode::renderOneSilhouette(const LLColor4 &color)
}
gGL.popMatrix();
gGL.popUIMatrix();
+
+ if (shader)
+ {
+ shader->bind();
+ }
}
//
diff --git a/indra/newview/llvosurfacepatch.cpp b/indra/newview/llvosurfacepatch.cpp
index 0108690538..c3a2e6a712 100644
--- a/indra/newview/llvosurfacepatch.cpp
+++ b/indra/newview/llvosurfacepatch.cpp
@@ -1035,6 +1035,8 @@ void LLVOSurfacePatch::updateSpatialExtents(LLVector4a& newMin, LLVector4a &newM
{
LLVector3 posAgent = getPositionAgent();
LLVector3 scale = getScale();
+ //make z-axis scale at least 1 to avoid shadow artifacts on totally flat land
+ scale.mV[VZ] = llmax(scale.mV[VZ], 1.f);
newMin.load3( (posAgent-scale*0.5f).mV); // Changing to 2.f makes the culling a -little- better, but still wrong
newMax.load3( (posAgent+scale*0.5f).mV);
LLVector4a pos;