Reasonably safe changes.

Using accessor for vertexbuffer in LLFace
Extra occlusion query lookup in llgl (unused)
Const changes.
This commit is contained in:
Shyotl
2011-05-18 14:35:27 -05:00
parent b314172533
commit 62e3aa10c1
39 changed files with 594 additions and 249 deletions

View File

@@ -172,17 +172,19 @@ BOOL LLVOWater::updateGeometry(LLDrawable *drawable)
const S32 num_quads = size * size;
face->setSize(vertices_per_quad * num_quads,
indices_per_quad * num_quads);
if (face->mVertexBuffer.isNull())
LLVertexBuffer* buff = face->getVertexBuffer();
if (!buff)
{
face->mVertexBuffer = new LLVertexBuffer(LLDrawPoolWater::VERTEX_DATA_MASK, GL_DYNAMIC_DRAW_ARB);
face->mVertexBuffer->allocateBuffer(face->getGeomCount(), face->getIndicesCount(), TRUE);
buff = new LLVertexBuffer(LLDrawPoolWater::VERTEX_DATA_MASK, GL_DYNAMIC_DRAW_ARB);
buff->allocateBuffer(face->getGeomCount(), face->getIndicesCount(), TRUE);
face->setIndicesIndex(0);
face->setGeomIndex(0);
face->setVertexBuffer(buff);
}
else
{
face->mVertexBuffer->resizeBuffer(face->getGeomCount(), face->getIndicesCount());
buff->resizeBuffer(face->getGeomCount(), face->getIndicesCount());
}
index_offset = face->getGeometry(verticesp,normalsp,texCoordsp, indicesp);
@@ -236,7 +238,7 @@ BOOL LLVOWater::updateGeometry(LLDrawable *drawable)
}
}
face->mVertexBuffer->setBuffer(0);
buff->setBuffer(0);
mDrawable->movePartition();
LLPipeline::sCompiles++;
@@ -290,7 +292,7 @@ U32 LLVOVoidWater::getPartitionType() const
}
LLWaterPartition::LLWaterPartition()
: LLSpatialPartition(0, FALSE, 0)
: LLSpatialPartition(0, FALSE, GL_DYNAMIC_DRAW_ARB)
{
mInfiniteFarClip = TRUE;
mDrawableType = LLPipeline::RENDER_TYPE_WATER;