summaryrefslogtreecommitdiff
path: root/indra/newview/lldrawpoolavatar.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/lldrawpoolavatar.cpp')
-rw-r--r--indra/newview/lldrawpoolavatar.cpp48
1 files changed, 7 insertions, 41 deletions
diff --git a/indra/newview/lldrawpoolavatar.cpp b/indra/newview/lldrawpoolavatar.cpp
index ccc060f3fa..e09e40671d 100644
--- a/indra/newview/lldrawpoolavatar.cpp
+++ b/indra/newview/lldrawpoolavatar.cpp
@@ -105,7 +105,6 @@ S32 normal_channel = -1;
S32 specular_channel = -1;
S32 cube_channel = -1;
-#if LL_MESH_ENABLED
static const U32 rigged_data_mask[] = {
LLDrawPoolAvatar::RIGGED_SIMPLE_MASK,
LLDrawPoolAvatar::RIGGED_FULLBRIGHT_MASK,
@@ -117,7 +116,6 @@ static const U32 rigged_data_mask[] = {
LLDrawPoolAvatar::RIGGED_DEFERRED_BUMP_MASK,
LLDrawPoolAvatar::RIGGED_DEFERRED_SIMPLE_MASK,
};
-#endif
static LLFastTimer::DeclareTimer FTM_SHADOW_AVATAR("Avatar Shadow");
@@ -198,14 +196,12 @@ void LLDrawPoolAvatar::beginDeferredPass(S32 pass)
case 2:
beginDeferredSkinned();
break;
-#if LL_MESH_ENABLED
case 3:
beginDeferredRiggedSimple();
break;
case 4:
beginDeferredRiggedBump();
break;
-#endif
}
}
@@ -232,14 +228,12 @@ void LLDrawPoolAvatar::endDeferredPass(S32 pass)
case 2:
endDeferredSkinned();
break;
-#if LL_MESH_ENABLED
case 3:
endDeferredRiggedSimple();
break;
case 4:
endDeferredRiggedBump();
break;
-#endif
}
}
@@ -250,11 +244,7 @@ void LLDrawPoolAvatar::renderDeferred(S32 pass)
S32 LLDrawPoolAvatar::getNumPostDeferredPasses()
{
-#if LL_MESH_ENABLED
return 6;
-#else
- return 1;
-#endif
}
void LLDrawPoolAvatar::beginPostDeferredPass(S32 pass)
@@ -264,7 +254,6 @@ void LLDrawPoolAvatar::beginPostDeferredPass(S32 pass)
case 0:
beginPostDeferredAlpha();
break;
-#if LL_MESH_ENABLED
case 1:
beginRiggedFullbright();
break;
@@ -280,7 +269,6 @@ void LLDrawPoolAvatar::beginPostDeferredPass(S32 pass)
case 5:
beginRiggedGlow();
break;
-#endif
}
}
@@ -298,7 +286,6 @@ void LLDrawPoolAvatar::beginPostDeferredAlpha()
enable_vertex_weighting(sVertexProgram->mAttribute[LLViewerShaderMgr::AVATAR_WEIGHT]);
}
-#if LL_MESH_ENABLED
void LLDrawPoolAvatar::beginDeferredRiggedAlpha()
{
sVertexProgram = &gDeferredSkinnedAlphaProgram;
@@ -316,7 +303,6 @@ void LLDrawPoolAvatar::endDeferredRiggedAlpha()
LLVertexBuffer::sWeight4Loc = -1;
sVertexProgram = NULL;
}
-#endif
void LLDrawPoolAvatar::endPostDeferredPass(S32 pass)
{
@@ -325,7 +311,6 @@ void LLDrawPoolAvatar::endPostDeferredPass(S32 pass)
case 0:
endPostDeferredAlpha();
break;
-#if LL_MESH_ENABLED
case 1:
endRiggedFullbright();
break;
@@ -341,7 +326,6 @@ void LLDrawPoolAvatar::endPostDeferredPass(S32 pass)
case 5:
endRiggedGlow();
break;
-#endif
}
}
@@ -375,11 +359,7 @@ void LLDrawPoolAvatar::renderPostDeferred(S32 pass)
S32 LLDrawPoolAvatar::getNumShadowPasses()
{
-#if LL_MESH_ENABLED
return 2;
-#else
- return 1;
-#endif
}
void LLDrawPoolAvatar::beginShadowPass(S32 pass)
@@ -470,7 +450,6 @@ void LLDrawPoolAvatar::renderShadow(S32 pass)
avatarp->renderSkinned(AVATAR_RENDER_PASS_SINGLE);
}
-#if LL_MESH_ENABLED
else
{
renderRigged(avatarp, RIGGED_SIMPLE);
@@ -480,12 +459,10 @@ void LLDrawPoolAvatar::renderShadow(S32 pass)
renderRigged(avatarp, RIGGED_SHINY);
renderRigged(avatarp, RIGGED_FULLBRIGHT_ALPHA);
}
-#endif
}
S32 LLDrawPoolAvatar::getNumPasses()
{
-#if LL_MESH_ENABLED
if (LLPipeline::sImpostorRender)
{
return 8;
@@ -494,7 +471,6 @@ S32 LLDrawPoolAvatar::getNumPasses()
{
return 10;
}
-#else
if (LLPipeline::sImpostorRender)
{
return 1;
@@ -503,7 +479,6 @@ S32 LLDrawPoolAvatar::getNumPasses()
{
return 3;
}
-#endif
}
@@ -554,7 +529,6 @@ void LLDrawPoolAvatar::beginRenderPass(S32 pass)
case 2:
beginSkinned();
break;
-#if LL_MESH_ENABLED
case 3:
beginRiggedSimple();
break;
@@ -576,7 +550,6 @@ void LLDrawPoolAvatar::beginRenderPass(S32 pass)
case 9:
beginRiggedGlow();
break;
-#endif
}
}
@@ -600,7 +573,6 @@ void LLDrawPoolAvatar::endRenderPass(S32 pass)
case 2:
endSkinned();
break;
-#if LL_MESH_ENABLED
case 3:
endRiggedSimple();
break;
@@ -622,7 +594,6 @@ void LLDrawPoolAvatar::endRenderPass(S32 pass)
case 9:
endRiggedGlow();
break;
-#endif
}
}
@@ -808,7 +779,6 @@ void LLDrawPoolAvatar::endSkinned()
gGL.getTexUnit(0)->activate();
}
-#if LL_MESH_ENABLED
void LLDrawPoolAvatar::beginRiggedSimple()
{
if (sShaderLevel > 0)
@@ -1056,7 +1026,6 @@ void LLDrawPoolAvatar::endDeferredRiggedBump()
sDiffuseChannel = 0;
sVertexProgram = NULL;
}
-#endif
void LLDrawPoolAvatar::beginDeferredSkinned()
{
@@ -1202,7 +1171,6 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
return;
}
-#if LL_MESH_ENABLED
if (pass == 3)
{
if (is_deferred_render)
@@ -1284,7 +1252,6 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
gGL.setSceneBlendType(LLRender::BT_ALPHA);
return;
}
-#endif
if (sShaderLevel > 0)
{
@@ -1322,9 +1289,14 @@ void LLDrawPoolAvatar::renderAvatars(LLVOAvatar* single_avatar, S32 pass)
}
}
-#if LL_MESH_ENABLED
void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace* face, const LLMeshSkinInfo* skin, LLVolume* volume, const LLVolumeFace& vol_face)
{
+ LLVector4a* weight = vol_face.mWeights;
+ if (!weight)
+ {
+ return;
+ }
+
LLVertexBuffer* buffer = face->mVertexBuffer;
U32 data_mask = 0;
@@ -1403,8 +1375,6 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace*
}
}
- LLVector4a* weight = vol_face.mWeights;
-
LLMatrix4a bind_shape_matrix;
bind_shape_matrix.loadu(skin->mBindShapeMatrix);
@@ -1422,7 +1392,7 @@ void LLDrawPoolAvatar::updateRiggedFaceVertexBuffer(LLVOAvatar* avatar, LLFace*
{
F32 w = weight[j][k];
- idx[k] = (S32) floorf(w);
+ idx[k] = llclamp((S32) floorf(w), 0, 63);
wght[k] = w - floorf(w);
scale += wght[k];
}
@@ -1627,8 +1597,6 @@ void LLDrawPoolAvatar::renderRiggedGlow(LLVOAvatar* avatar)
{
renderRigged(avatar, RIGGED_GLOW, true);
}
-#endif
-
//-----------------------------------------------------------------------------
@@ -1729,7 +1697,6 @@ LLColor3 LLDrawPoolAvatar::getDebugColor() const
return LLColor3(0.f, 1.f, 0.f);
}
-#if LL_MESH_ENABLED
void LLDrawPoolAvatar::addRiggedFace(LLFace* facep, U32 type)
{
if (facep->mRiggedIndex.empty())
@@ -1784,7 +1751,6 @@ void LLDrawPoolAvatar::removeRiggedFace(LLFace* facep)
}
}
}
-#endif
LLVertexBufferAvatar::LLVertexBufferAvatar()
: LLVertexBuffer(sDataMask,