summaryrefslogtreecommitdiff
path: root/indra/newview/llvowater.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvowater.cpp')
-rw-r--r--indra/newview/llvowater.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp
index 089a7712c0..608d2cb799 100644
--- a/indra/newview/llvowater.cpp
+++ b/indra/newview/llvowater.cpp
@@ -35,7 +35,6 @@
#include "llface.h"
#include "llsky.h"
#include "llsurface.h"
-#include "llvosky.h"
#include "llviewercamera.h"
#include "llviewertexturelist.h"
#include "llviewerregion.h"
@@ -150,10 +149,14 @@ BOOL LLVOWater::updateGeometry(LLDrawable *drawable)
indices_per_quad * num_quads);
LLVertexBuffer* buff = face->getVertexBuffer();
- if (!buff || !buff->isWriteable())
+ if (!buff ||
+ buff->getNumIndices() != face->getIndicesCount() ||
+ buff->getNumVerts() != face->getGeomCount() ||
+ face->getIndicesStart() != 0 ||
+ face->getGeomIndex() != 0)
{
- buff = new LLVertexBuffer(LLDrawPoolWater::VERTEX_DATA_MASK, GL_DYNAMIC_DRAW_ARB);
- if (!buff->allocateBuffer(face->getGeomCount(), face->getIndicesCount(), TRUE))
+ buff = new LLVertexBuffer(LLDrawPoolWater::VERTEX_DATA_MASK);
+ if (!buff->allocateBuffer(face->getGeomCount(), face->getIndicesCount()))
{
LL_WARNS() << "Failed to allocate Vertex Buffer on water update to "
<< face->getGeomCount() << " vertices and "
@@ -163,13 +166,6 @@ BOOL LLVOWater::updateGeometry(LLDrawable *drawable)
face->setGeomIndex(0);
face->setVertexBuffer(buff);
}
- else
- {
- if (!buff->resizeBuffer(face->getGeomCount(), face->getIndicesCount()))
- {
- LL_WARNS() << "Failed to resize Vertex Buffer" << LL_ENDL;
- }
- }
index_offset = face->getGeometry(verticesp,normalsp,texCoordsp, indicesp);
@@ -230,7 +226,7 @@ BOOL LLVOWater::updateGeometry(LLDrawable *drawable)
}
}
- buff->flush();
+ buff->unmapBuffer();
mDrawable->movePartition();
LLPipeline::sCompiles++;
@@ -295,7 +291,7 @@ U32 LLVOVoidWater::getPartitionType() const
}
LLWaterPartition::LLWaterPartition(LLViewerRegion* regionp)
-: LLSpatialPartition(0, FALSE, GL_DYNAMIC_DRAW_ARB, regionp)
+: LLSpatialPartition(0, FALSE, regionp)
{
mInfiniteFarClip = TRUE;
mDrawableType = LLPipeline::RENDER_TYPE_WATER;