summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpoolbump.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lldrawpoolbump.cpp')
-rw-r--r--indra/newview/lldrawpoolbump.cpp55
1 files changed, 22 insertions, 33 deletions
diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp
index 4379fdc603..9c871514f7 100644
--- a/indra/newview/lldrawpoolbump.cpp
+++ b/indra/newview/lldrawpoolbump.cpp
@@ -353,22 +353,22 @@ void LLDrawPoolBump::renderShiny()
{
if (mRigged)
{
- LLRenderPass::pushRiggedBatches(LLRenderPass::PASS_SHINY_RIGGED, sVertexMask | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE);
+ LLRenderPass::pushRiggedBatches(LLRenderPass::PASS_SHINY_RIGGED, true, true);
}
else
{
- LLRenderPass::pushBatches(LLRenderPass::PASS_SHINY, sVertexMask | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE);
+ LLRenderPass::pushBatches(LLRenderPass::PASS_SHINY, true, true);
}
}
else
{
if (mRigged)
{
- gPipeline.renderRiggedGroups(this, LLRenderPass::PASS_SHINY_RIGGED, sVertexMask, TRUE);
+ gPipeline.renderRiggedGroups(this, LLRenderPass::PASS_SHINY_RIGGED, true);
}
else
{
- gPipeline.renderGroups(this, LLRenderPass::PASS_SHINY, sVertexMask, TRUE);
+ gPipeline.renderGroups(this, LLRenderPass::PASS_SHINY, true);
}
}
}
@@ -508,22 +508,22 @@ void LLDrawPoolBump::renderFullbrightShiny()
{
if (mRigged)
{
- LLRenderPass::pushRiggedBatches(LLRenderPass::PASS_FULLBRIGHT_SHINY_RIGGED, sVertexMask | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE);
+ LLRenderPass::pushRiggedBatches(LLRenderPass::PASS_FULLBRIGHT_SHINY_RIGGED, true, true);
}
else
{
- LLRenderPass::pushBatches(LLRenderPass::PASS_FULLBRIGHT_SHINY, sVertexMask | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE);
+ LLRenderPass::pushBatches(LLRenderPass::PASS_FULLBRIGHT_SHINY, true, true);
}
}
else
{
if (mRigged)
{
- LLRenderPass::pushRiggedBatches(LLRenderPass::PASS_FULLBRIGHT_SHINY_RIGGED, sVertexMask);
+ LLRenderPass::pushRiggedBatches(LLRenderPass::PASS_FULLBRIGHT_SHINY_RIGGED);
}
else
{
- LLRenderPass::pushBatches(LLRenderPass::PASS_FULLBRIGHT_SHINY, sVertexMask);
+ LLRenderPass::pushBatches(LLRenderPass::PASS_FULLBRIGHT_SHINY);
}
}
}
@@ -549,7 +549,7 @@ void LLDrawPoolBump::endFullbrightShiny()
mShiny = FALSE;
}
-void LLDrawPoolBump::renderGroup(LLSpatialGroup* group, U32 type, U32 mask, BOOL texture = TRUE)
+void LLDrawPoolBump::renderGroup(LLSpatialGroup* group, U32 type, bool texture = true)
{
LLSpatialGroup::drawmap_elem_t& draw_info = group->mDrawMap[type];
@@ -559,11 +559,7 @@ void LLDrawPoolBump::renderGroup(LLSpatialGroup* group, U32 type, U32 mask, BOOL
applyModelMatrix(params);
- if (params.mGroup)
- {
- params.mGroup->rebuildMesh();
- }
- params.mVertexBuffer->setBuffer(mask);
+ params.mVertexBuffer->setBuffer();
params.mVertexBuffer->drawRange(LLRender::TRIANGLES, params.mStart, params.mEnd, params.mCount, params.mOffset);
}
}
@@ -574,7 +570,7 @@ BOOL LLDrawPoolBump::bindBumpMap(LLDrawInfo& params, S32 channel)
{
U8 bump_code = params.mBump;
- return bindBumpMap(bump_code, params.mTexture, params.mVSize, channel);
+ return bindBumpMap(bump_code, params.mTexture, channel);
}
//static
@@ -584,14 +580,14 @@ BOOL LLDrawPoolBump::bindBumpMap(LLFace* face, S32 channel)
if (te)
{
U8 bump_code = te->getBumpmap();
- return bindBumpMap(bump_code, face->getTexture(), face->getVirtualSize(), channel);
+ return bindBumpMap(bump_code, face->getTexture(), channel);
}
return FALSE;
}
//static
-BOOL LLDrawPoolBump::bindBumpMap(U8 bump_code, LLViewerTexture* texture, F32 vsize, S32 channel)
+BOOL LLDrawPoolBump::bindBumpMap(U8 bump_code, LLViewerTexture* texture, S32 channel)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL;
//Note: texture atlas does not support bump texture now.
@@ -617,7 +613,7 @@ BOOL LLDrawPoolBump::bindBumpMap(U8 bump_code, LLViewerTexture* texture, F32 vsi
if( bump_code < LLStandardBumpmap::sStandardBumpmapCount )
{
bump = gStandardBumpmapList[bump_code].mImage;
- gBumpImageList.addTextureStats(bump_code, tex->getID(), vsize);
+ gBumpImageList.addTextureStats(bump_code, tex->getID(), tex->getMaxVirtualSize());
}
break;
}
@@ -674,7 +670,7 @@ void LLDrawPoolBump::renderBump(U32 pass)
/// Get rid of z-fighting with non-bump pass.
LLGLEnable polyOffset(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(-1.0f, -1.0f);
- renderBump(pass, sVertexMask);
+ pushBumpBatches(pass);
}
//static
@@ -719,8 +715,6 @@ void LLDrawPoolBump::renderDeferred(S32 pass)
LLCullResult::drawinfo_iterator begin = gPipeline.beginRenderMap(type);
LLCullResult::drawinfo_iterator end = gPipeline.endRenderMap(type);
- U32 mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_TANGENT | LLVertexBuffer::MAP_NORMAL | LLVertexBuffer::MAP_COLOR;
-
LLVOAvatar* avatar = nullptr;
U64 skin = 0;
@@ -741,11 +735,11 @@ void LLDrawPoolBump::renderDeferred(S32 pass)
avatar = params.mAvatar;
skin = params.mSkinInfo->mHash;
}
- pushBatch(params, mask | LLVertexBuffer::MAP_WEIGHT4, TRUE, FALSE);
+ pushBatch(params, true, false);
}
else
{
- pushBatch(params, mask, TRUE, FALSE);
+ pushBatch(params, true, false);
}
}
@@ -1342,7 +1336,7 @@ void LLBumpImageList::onSourceLoaded( BOOL success, LLViewerTexture *src_vi, LLI
}
}
-void LLDrawPoolBump::renderBump(U32 type, U32 mask)
+void LLDrawPoolBump::pushBumpBatches(U32 type)
{
LLVOAvatar* avatar = nullptr;
U64 skin = 0;
@@ -1350,7 +1344,6 @@ void LLDrawPoolBump::renderBump(U32 type, U32 mask)
if (mRigged)
{ // nudge type enum and include skinweights for rigged pass
type += 1;
- mask |= LLVertexBuffer::MAP_WEIGHT4;
}
LLCullResult::drawinfo_iterator begin = gPipeline.beginRenderMap(type);
@@ -1377,12 +1370,12 @@ void LLDrawPoolBump::renderBump(U32 type, U32 mask)
}
}
}
- pushBatch(params, mask, FALSE);
+ pushBatch(params, false);
}
}
}
-void LLDrawPoolBump::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL batch_textures)
+void LLDrawPoolBump::pushBatch(LLDrawInfo& params, bool texture, bool batch_textures)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_DRAWPOOL;
applyModelMatrix(params);
@@ -1435,12 +1428,8 @@ void LLDrawPoolBump::pushBatch(LLDrawInfo& params, U32 mask, BOOL texture, BOOL
}
}
- if (params.mGroup)
- {
- params.mGroup->rebuildMesh();
- }
- params.mVertexBuffer->setBufferFast(mask);
- params.mVertexBuffer->drawRangeFast(LLRender::TRIANGLES, params.mStart, params.mEnd, params.mCount, params.mOffset);
+ params.mVertexBuffer->setBuffer();
+ params.mVertexBuffer->drawRange(LLRender::TRIANGLES, params.mStart, params.mEnd, params.mCount, params.mOffset);
if (tex_setup)
{