summaryrefslogtreecommitdiff
path: root/indra/newview/llvovolume.cpp
diff options
context:
space:
mode:
authorNyx (Neal Orman) <nyx@lindenlab.com>2011-08-15 11:41:00 -0400
committerNyx (Neal Orman) <nyx@lindenlab.com>2011-08-15 11:41:00 -0400
commit402a2de7651105d63693deb2872dd6646dd1bd85 (patch)
tree5b0935f876e954a024227355c34a2c23eebe1b8d /indra/newview/llvovolume.cpp
parent60d15f78e17a2203d73d58c3f1c2af941d599277 (diff)
parent6b70273603e4aa807662c301179d05a1f2f5a224 (diff)
merging latest viewer-mesh into nyx's sidebranch
Diffstat (limited to 'indra/newview/llvovolume.cpp')
-rwxr-xr-x[-rw-r--r--]indra/newview/llvovolume.cpp45
1 files changed, 25 insertions, 20 deletions
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index bc94748002..2882e644c8 100644..100755
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -1021,6 +1021,7 @@ BOOL LLVOVolume::setVolume(const LLVolumeParams &params_in, const S32 detail, bo
setIcon(LLViewerTextureManager::getFetchedTextureFromFile("icons/Inv_Mesh.png", TRUE, LLViewerTexture::BOOST_UI));
//render prim proxy when mesh loading attempts give up
volume_params.setSculptID(LLUUID::null, LL_SCULPT_TYPE_NONE);
+
}
if ((LLPrimitive::setVolume(volume_params, lod, (mVolumeImpl && mVolumeImpl->isVolumeUnique()))) || mSculptChanged)
@@ -3886,6 +3887,11 @@ bool can_batch_texture(LLFace* facep)
return false;
}
+ if (facep->getTexture() && facep->getTexture()->getPrimaryFormat() == GL_ALPHA)
+ { //can't batch invisiprims
+ return false;
+ }
+
if (facep->isState(LLFace::TEXTURE_ANIM) && facep->getVirtualSize() > MIN_TEX_ANIM_SIZE)
{ //texture animation breaks batches
return false;
@@ -4504,6 +4510,8 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group)
group->mBuilt = 1.f;
+ std::set<LLVertexBuffer*> mapped_buffers;
+
for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter)
{
LLFastTimer t(FTM_VOLUME_GEOM_PARTIAL);
@@ -4518,35 +4526,31 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group)
for (S32 i = 0; i < drawablep->getNumFaces(); ++i)
{
LLFace* face = drawablep->getFace(i);
- if (face && face->getVertexBuffer())
+ if (face)
{
- face->getGeometryVolume(*volume, face->getTEOffset(),
- vobj->getRelativeXform(), vobj->getRelativeXformInvTrans(), face->getGeomIndex());
+ LLVertexBuffer* buff = face->getVertexBuffer();
+ if (buff)
+ {
+ face->getGeometryVolume(*volume, face->getTEOffset(),
+ vobj->getRelativeXform(), vobj->getRelativeXformInvTrans(), face->getGeomIndex());
+
+ if (buff->isLocked())
+ {
+ mapped_buffers.insert(buff);
+ }
+ }
}
}
-
+
drawablep->clearState(LLDrawable::REBUILD_ALL);
}
}
- //unmap all the buffers
- for (LLSpatialGroup::buffer_map_t::iterator i = group->mBufferMap.begin(); i != group->mBufferMap.end(); ++i)
+ for (std::set<LLVertexBuffer*>::iterator iter = mapped_buffers.begin(); iter != mapped_buffers.end(); ++iter)
{
- LLSpatialGroup::buffer_texture_map_t& map = i->second;
- for (LLSpatialGroup::buffer_texture_map_t::iterator j = map.begin(); j != map.end(); ++j)
- {
- LLSpatialGroup::buffer_list_t& list = j->second;
- for (LLSpatialGroup::buffer_list_t::iterator k = list.begin(); k != list.end(); ++k)
- {
- LLVertexBuffer* buffer = *k;
- if (buffer->isLocked())
- {
- buffer->setBuffer(0);
- }
- }
- }
+ (*iter)->setBuffer(0);
}
-
+
// don't forget alpha
if(group != NULL &&
!group->mVertexBuffer.isNull() &&
@@ -4856,6 +4860,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std::
}
const LLTextureEntry* te = facep->getTextureEntry();
+ tex = facep->getTexture();
BOOL is_alpha = (facep->getPoolType() == LLDrawPool::POOL_ALPHA) ? TRUE : FALSE;