summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeslie Linden <leslie@lindenlab.com>2011-08-23 11:19:04 -0700
committerLeslie Linden <leslie@lindenlab.com>2011-08-23 11:19:04 -0700
commit11d7a7f197d31617602ff9c109674a783fd6fa71 (patch)
tree2b5e80597f3a8e586bb8018fd117e39da031ec5b
parent764b7a1ec0a92bd9948010ac76a7c4362d66acf6 (diff)
Mac crash fixes.
Reviewed by davep.
-rw-r--r--indra/newview/app_settings/shaders/class1/environment/waterV.glsl7
-rw-r--r--indra/newview/llspatialpartition.cpp2
2 files changed, 5 insertions, 4 deletions
diff --git a/indra/newview/app_settings/shaders/class1/environment/waterV.glsl b/indra/newview/app_settings/shaders/class1/environment/waterV.glsl
index b99fab2c0f..831a7de0ea 100644
--- a/indra/newview/app_settings/shaders/class1/environment/waterV.glsl
+++ b/indra/newview/app_settings/shaders/class1/environment/waterV.glsl
@@ -57,19 +57,20 @@ void main()
float d = length(oEyeVec.xy);
float ld = min(d, 2560.0);
- position.xy = eyeVec.xy + oEyeVec.xy/d*ld;
+ vec3 lpos = position;
+ lpos.xy = eyeVec.xy + oEyeVec.xy/d*ld;
view.xyz = oEyeVec;
d = clamp(ld/1536.0-0.5, 0.0, 1.0);
d *= d;
- oPosition = vec4(position, 1.0);
+ oPosition = vec4(lpos, 1.0);
oPosition.z = mix(oPosition.z, max(eyeVec.z*0.75, 0.0), d);
oPosition = modelViewProj * oPosition;
refCoord.xyz = oPosition.xyz + vec3(0,0,0.2);
//get wave position parameter (create sweeping horizontal waves)
- vec3 v = position.xyz;
+ vec3 v = lpos;
v.x += (cos(v.x*0.08/*+time*0.01*/)+sin(v.y*0.02))*6.0;
//push position for further horizon effect.
diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp
index d7d5e5f432..78b2db2bde 100644
--- a/indra/newview/llspatialpartition.cpp
+++ b/indra/newview/llspatialpartition.cpp
@@ -2416,7 +2416,7 @@ void pushVerts(LLFace* face, U32 mask)
LLVertexBuffer* buffer = face->getVertexBuffer();
- if (buffer)
+ if (buffer && (face->getGeomCount() >= 3))
{
buffer->setBuffer(mask);
U16 start = face->getGeomStart();