summaryrefslogtreecommitdiff
path: root/indra/newview/llvovolume.cpp
diff options
context:
space:
mode:
authorLeslie Linden <leslie@lindenlab.com>2011-11-28 17:13:42 -0800
committerLeslie Linden <leslie@lindenlab.com>2011-11-28 17:13:42 -0800
commit06a2d4eb274b1cd02b82bf2e5ffb458880ae8517 (patch)
tree68a41dcf082bf6b5093e67c535cc562ada500be0 /indra/newview/llvovolume.cpp
parent2878b6d1da2820efb2ab50ff77a9f31f25ed5f6b (diff)
SH-2038 PROGRESS -- Hacked the code to not render alpha using VBO's on OS X since everything renders faster using VBO's except alpha for some mysterious reason.
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rw-r--r--indra/newview/llvovolume.cpp21
1 files changed, 16 insertions, 5 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index 3d013f286c..20f8674655 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -4624,6 +4624,19 @@ struct CompareBatchBreakerModified
void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::vector<LLFace*>& faces, BOOL distance_sort, BOOL batch_textures)
{
+ U32 buffer_usage = group->mBufferUsage;
+
+#if LL_DARWIN
+ // HACK from Leslie:
+ // Disable VBO usage for alpha on Mac OS X because it kills the framerate
+ // due to implicit calls to glTexSubImage that are beyond our control.
+ // (this works because the only calls here that sort by distance are alpha)
+ if (distance_sort)
+ {
+ buffer_usage = 0x0;
+ }
+#endif
+
//calculate maximum number of vertices to store in a single buffer
U32 max_vertices = (gSavedSettings.getS32("RenderMaxVBOSize")*1024)/LLVertexBuffer::calcVertexSize(group->mSpatialPartition->mVertexDataMask);
max_vertices = llmin(max_vertices, (U32) 65535);
@@ -4805,17 +4818,15 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::
if (!buffer)
{ //create new buffer if needed
- buffer = createVertexBuffer(mask,
- group->mBufferUsage);
+ buffer = createVertexBuffer(mask, buffer_usage);
buffer->allocateBuffer(geom_count, index_count, TRUE);
}
else
{ //resize pre-existing buffer
- if (LLVertexBuffer::sEnableVBOs && buffer->getUsage() != group->mBufferUsage ||
+ if (LLVertexBuffer::sEnableVBOs && buffer->getUsage() != buffer_usage ||
buffer->getTypeMask() != mask)
{
- buffer = createVertexBuffer(mask,
- group->mBufferUsage);
+ buffer = createVertexBuffer(mask, buffer_usage);
buffer->allocateBuffer(geom_count, index_count, TRUE);
}
else