summaryrefslogtreecommitdiff
path: root/indra/newview/llface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llface.cpp')
-rwxr-xr-xindra/newview/llface.cpp288
1 files changed, 143 insertions, 145 deletions
diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp
index d69c185a2b..32b510b21a 100755
--- a/indra/newview/llface.cpp
+++ b/indra/newview/llface.cpp
@@ -220,7 +220,7 @@ void LLFace::destroy()
}
setDrawInfo(NULL);
-
+
mDrawablep = NULL;
mVObjp = NULL;
}
@@ -233,7 +233,7 @@ void LLFace::initClass()
void LLFace::setWorldMatrix(const LLMatrix4 &mat)
{
- llerrs << "Faces on this drawable are not independently modifiable\n" << llendl;
+ LL_ERRS() << "Faces on this drawable are not independently modifiable\n" << LL_ENDL;
}
void LLFace::setPool(LLFacePool* pool)
@@ -245,7 +245,7 @@ void LLFace::setPool(LLFacePool* new_pool, LLViewerTexture *texturep)
{
if (!new_pool)
{
- llerrs << "Setting pool to null!" << llendl;
+ LL_ERRS() << "Setting pool to null!" << LL_ENDL;
}
if (new_pool != mDrawPoolp)
@@ -355,7 +355,7 @@ void LLFace::switchTexture(U32 ch, LLViewerTexture* new_texture)
if(!new_texture)
{
- llerrs << "Can not switch to a null texture." << llendl;
+ LL_ERRS() << "Can not switch to a null texture." << LL_ENDL;
return;
}
@@ -365,7 +365,7 @@ void LLFace::switchTexture(U32 ch, LLViewerTexture* new_texture)
if (ch == LLRender::DIFFUSE_MAP)
{
- getViewerObject()->changeTEImage(mTEOffset, new_texture) ;
+ getViewerObject()->changeTEImage(mTEOffset, new_texture) ;
}
setTexture(ch, new_texture) ;
@@ -437,7 +437,7 @@ void LLFace::setTextureIndex(U8 index)
{
if (mDrawInfo && !mDrawInfo->mTextureList.empty())
{
- llerrs << "Face with no texture index references indexed texture draw info." << llendl;
+ LL_ERRS() << "Face with no texture index references indexed texture draw info." << LL_ENDL;
}
}
}
@@ -629,29 +629,29 @@ void LLFace::setDrawInfo(LLDrawInfo* draw_info)
void LLFace::printDebugInfo() const
{
LLFacePool *poolp = getPool();
- llinfos << "Object: " << getViewerObject()->mID << llendl;
+ LL_INFOS() << "Object: " << getViewerObject()->mID << LL_ENDL;
if (getDrawable())
{
- llinfos << "Type: " << LLPrimitive::pCodeToString(getDrawable()->getVObj()->getPCode()) << llendl;
+ LL_INFOS() << "Type: " << LLPrimitive::pCodeToString(getDrawable()->getVObj()->getPCode()) << LL_ENDL;
}
if (getTexture())
{
- llinfos << "Texture: " << getTexture() << " Comps: " << (U32)getTexture()->getComponents() << llendl;
+ LL_INFOS() << "Texture: " << getTexture() << " Comps: " << (U32)getTexture()->getComponents() << LL_ENDL;
}
else
{
- llinfos << "No texture: " << llendl;
+ LL_INFOS() << "No texture: " << LL_ENDL;
}
- llinfos << "Face: " << this << llendl;
- llinfos << "State: " << getState() << llendl;
- llinfos << "Geom Index Data:" << llendl;
- llinfos << "--------------------" << llendl;
- llinfos << "GI: " << mGeomIndex << " Count:" << mGeomCount << llendl;
- llinfos << "Face Index Data:" << llendl;
- llinfos << "--------------------" << llendl;
- llinfos << "II: " << mIndicesIndex << " Count:" << mIndicesCount << llendl;
- llinfos << llendl;
+ LL_INFOS() << "Face: " << this << LL_ENDL;
+ LL_INFOS() << "State: " << getState() << LL_ENDL;
+ LL_INFOS() << "Geom Index Data:" << LL_ENDL;
+ LL_INFOS() << "--------------------" << LL_ENDL;
+ LL_INFOS() << "GI: " << mGeomIndex << " Count:" << mGeomCount << LL_ENDL;
+ LL_INFOS() << "Face Index Data:" << LL_ENDL;
+ LL_INFOS() << "--------------------" << LL_ENDL;
+ LL_INFOS() << "II: " << mIndicesIndex << " Count:" << mIndicesCount << LL_ENDL;
+ LL_INFOS() << LL_ENDL;
if (poolp)
{
@@ -664,20 +664,20 @@ void LLFace::printDebugInfo() const
LLFace *facep = *iter;
if (facep == this)
{
- llinfos << "Pool reference: " << pool_references << llendl;
+ LL_INFOS() << "Pool reference: " << pool_references << LL_ENDL;
pool_references++;
}
}
if (pool_references != 1)
{
- llinfos << "Incorrect number of pool references!" << llendl;
+ LL_INFOS() << "Incorrect number of pool references!" << LL_ENDL;
}
}
#if 0
- llinfos << "Indices:" << llendl;
- llinfos << "--------------------" << llendl;
+ LL_INFOS() << "Indices:" << LL_ENDL;
+ LL_INFOS() << "--------------------" << LL_ENDL;
const U32 *indicesp = getRawIndices();
S32 indices_count = getIndicesCount();
@@ -685,17 +685,17 @@ void LLFace::printDebugInfo() const
for (S32 i = 0; i < indices_count; i++)
{
- llinfos << i << ":" << indicesp[i] << ":" << (S32)(indicesp[i] - geom_start) << llendl;
+ LL_INFOS() << i << ":" << indicesp[i] << ":" << (S32)(indicesp[i] - geom_start) << LL_ENDL;
}
- llinfos << llendl;
+ LL_INFOS() << LL_ENDL;
- llinfos << "Vertices:" << llendl;
- llinfos << "--------------------" << llendl;
+ LL_INFOS() << "Vertices:" << LL_ENDL;
+ LL_INFOS() << "--------------------" << LL_ENDL;
for (S32 i = 0; i < mGeomCount; i++)
{
- llinfos << mGeomIndex + i << ":" << poolp->getVertex(mGeomIndex + i) << llendl;
+ LL_INFOS() << mGeomIndex + i << ":" << poolp->getVertex(mGeomIndex + i) << LL_ENDL;
}
- llinfos << llendl;
+ LL_INFOS() << LL_ENDL;
#endif
}
@@ -798,7 +798,7 @@ BOOL LLFace::genVolumeBBoxes(const LLVolume &volume, S32 f,
if (f >= volume.getNumVolumeFaces())
{
- llwarns << "Generating bounding box for invalid face index!" << llendl;
+ LL_WARNS() << "Generating bounding box for invalid face index!" << LL_ENDL;
f = 0;
}
@@ -828,7 +828,7 @@ BOOL LLFace::genVolumeBBoxes(const LLVolume &volume, S32 f,
mask[4].setElement<2>();
mask[5].setElement<0>(); //110
mask[5].setElement<1>();
-
+
LLVector4a v[8];
v[6] = min;
@@ -928,7 +928,7 @@ LLVector2 LLFace::surfaceToTexture(LLVector2 surface_coord, const LLVector4a& po
if (texgen == LLTextureEntry::TEX_GEN_PLANAR)
{
planarProjection(tc, volume_normal, center, volume_position);
- }
+ }
}
if (mTextureMatrix) // if we have a texture matrix, use it
@@ -1081,12 +1081,12 @@ bool LLFace::canRenderAsMask()
}
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_VOLUME("Volume VB Cache");
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_VOLUME("Volume VB Cache");
//static
void LLFace::cacheFaceInVRAM(const LLVolumeFace& vf)
{
- LLFastTimer t(FTM_FACE_GEOM_VOLUME);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_VOLUME);
U32 mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 |
LLVertexBuffer::MAP_TANGENT | LLVertexBuffer::MAP_NORMAL;
@@ -1148,33 +1148,33 @@ void push_for_transform(LLVertexBuffer* buff, U32 source_count, U32 dest_count)
}
}
-static LLFastTimer::DeclareTimer FTM_FACE_GET_GEOM("Face Geom");
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_POSITION("Position");
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_NORMAL("Normal");
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_TEXTURE("Texture");
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_COLOR("Color");
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_EMISSIVE("Emissive");
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_WEIGHTS("Weights");
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_TANGENT("Binormal");
-
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_FEEDBACK("Face Feedback");
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_FEEDBACK_POSITION("Feedback Position");
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_FEEDBACK_NORMAL("Feedback Normal");
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_FEEDBACK_TEXTURE("Feedback Texture");
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_FEEDBACK_COLOR("Feedback Color");
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_FEEDBACK_EMISSIVE("Feedback Emissive");
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_FEEDBACK_BINORMAL("Feedback Binormal");
-
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_INDEX("Index");
-static LLFastTimer::DeclareTimer FTM_FACE_GEOM_INDEX_TAIL("Tail");
-static LLFastTimer::DeclareTimer FTM_FACE_POSITION_STORE("Pos");
-static LLFastTimer::DeclareTimer FTM_FACE_TEXTURE_INDEX_STORE("TexIdx");
-static LLFastTimer::DeclareTimer FTM_FACE_POSITION_PAD("Pad");
-static LLFastTimer::DeclareTimer FTM_FACE_TEX_DEFAULT("Default");
-static LLFastTimer::DeclareTimer FTM_FACE_TEX_QUICK("Quick");
-static LLFastTimer::DeclareTimer FTM_FACE_TEX_QUICK_NO_XFORM("No Xform");
-static LLFastTimer::DeclareTimer FTM_FACE_TEX_QUICK_XFORM("Xform");
-static LLFastTimer::DeclareTimer FTM_FACE_TEX_QUICK_PLANAR("Quick Planar");
+static LLTrace::BlockTimerStatHandle FTM_FACE_GET_GEOM("Face Geom");
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_POSITION("Position");
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_NORMAL("Normal");
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_TEXTURE("Texture");
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_COLOR("Color");
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_EMISSIVE("Emissive");
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_WEIGHTS("Weights");
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_TANGENT("Binormal");
+
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_FEEDBACK("Face Feedback");
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_FEEDBACK_POSITION("Feedback Position");
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_FEEDBACK_NORMAL("Feedback Normal");
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_FEEDBACK_TEXTURE("Feedback Texture");
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_FEEDBACK_COLOR("Feedback Color");
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_FEEDBACK_EMISSIVE("Feedback Emissive");
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_FEEDBACK_BINORMAL("Feedback Binormal");
+
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_INDEX("Index");
+static LLTrace::BlockTimerStatHandle FTM_FACE_GEOM_INDEX_TAIL("Tail");
+static LLTrace::BlockTimerStatHandle FTM_FACE_POSITION_STORE("Pos");
+static LLTrace::BlockTimerStatHandle FTM_FACE_TEXTURE_INDEX_STORE("TexIdx");
+static LLTrace::BlockTimerStatHandle FTM_FACE_POSITION_PAD("Pad");
+static LLTrace::BlockTimerStatHandle FTM_FACE_TEX_DEFAULT("Default");
+static LLTrace::BlockTimerStatHandle FTM_FACE_TEX_QUICK("Quick");
+static LLTrace::BlockTimerStatHandle FTM_FACE_TEX_QUICK_NO_XFORM("No Xform");
+static LLTrace::BlockTimerStatHandle FTM_FACE_TEX_QUICK_XFORM("Xform");
+static LLTrace::BlockTimerStatHandle FTM_FACE_TEX_QUICK_PLANAR("Quick Planar");
BOOL LLFace::getGeometryVolume(const LLVolume& volume,
const S32 &f,
@@ -1182,7 +1182,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
const U16 &index_offset,
bool force_rebuild)
{
- LLFastTimer t(FTM_FACE_GET_GEOM);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_GET_GEOM);
llassert(verify());
const LLVolumeFace &vf = volume.getVolumeFace(f);
S32 num_vertices = (S32)vf.mNumVertices;
@@ -1203,13 +1203,13 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
{
if (gDebugGL)
{
- llwarns << "Index buffer overflow!" << llendl;
- llwarns << "Indices Count: " << mIndicesCount
+ LL_WARNS() << "Index buffer overflow!" << LL_ENDL;
+ LL_WARNS() << "Indices Count: " << mIndicesCount
<< " VF Num Indices: " << num_indices
<< " Indices Index: " << mIndicesIndex
- << " VB Num Indices: " << mVertexBuffer->getNumIndices() << llendl;
- llwarns << " Face Index: " << f
- << " Pool Type: " << mPoolType << llendl;
+ << " VB Num Indices: " << mVertexBuffer->getNumIndices() << LL_ENDL;
+ LL_WARNS() << " Face Index: " << f
+ << " Pool Type: " << mPoolType << LL_ENDL;
}
return FALSE;
}
@@ -1218,7 +1218,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
{
if (gDebugGL)
{
- llwarns << "Vertex buffer overflow!" << llendl;
+ LL_WARNS() << "Vertex buffer overflow!" << LL_ENDL;
}
return FALSE;
}
@@ -1278,7 +1278,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
{ //decide if shiny goes in alpha channel of color
if (tep &&
getPoolType() != LLDrawPool::POOL_ALPHA) // <--- alpha channel MUST contain transparency, not shiny
- {
+ {
LLMaterial* mat = tep->getMaterialParams().get();
bool shiny_in_alpha = false;
@@ -1299,15 +1299,15 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
}
if (shiny_in_alpha)
- {
+ {
- GLfloat alpha[4] =
- {
- 0.00f,
- 0.25f,
- 0.5f,
- 0.75f
- };
+ GLfloat alpha[4] =
+ {
+ 0.00f,
+ 0.25f,
+ 0.5f,
+ 0.75f
+ };
llassert(tep->getShiny() <= 3);
color.mV[3] = U8 (alpha[tep->getShiny()] * 255);
@@ -1318,7 +1318,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
// INDICES
if (full_rebuild)
{
- LLFastTimer t(FTM_FACE_GEOM_INDEX);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_INDEX);
mVertexBuffer->getIndexStrider(indicesp, mIndicesIndex, mIndicesCount, map_range);
volatile __m128i* dst = (__m128i*) indicesp.get();
@@ -1334,7 +1334,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
}
{
- LLFastTimer t(FTM_FACE_GEOM_INDEX_TAIL);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_INDEX_TAIL);
U16* idx = (U16*) dst;
for (S32 i = end*8; i < num_indices; ++i)
@@ -1397,7 +1397,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
!volume.isUnique()) //source volume is NOT flexi
{ //use transform feedback to pack vertex buffer
//gGLDebugLoggingEnabled = TRUE;
- LLFastTimer t(FTM_FACE_GEOM_FEEDBACK);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_FEEDBACK);
LLGLEnable discard(GL_RASTERIZER_DISCARD);
LLVertexBuffer* buff = (LLVertexBuffer*) vf.mVertexBuffer.get();
@@ -1415,7 +1415,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (rebuild_pos)
{
- LLFastTimer t(FTM_FACE_GEOM_FEEDBACK_POSITION);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_FEEDBACK_POSITION);
gTransformPositionProgram.bind();
mVertexBuffer->bindForFeedback(0, LLVertexBuffer::TYPE_VERTEX, mGeomIndex, mGeomCount);
@@ -1440,7 +1440,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (rebuild_color)
{
- LLFastTimer t(FTM_FACE_GEOM_FEEDBACK_COLOR);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_FEEDBACK_COLOR);
gTransformColorProgram.bind();
mVertexBuffer->bindForFeedback(0, LLVertexBuffer::TYPE_COLOR, mGeomIndex, mGeomCount);
@@ -1456,7 +1456,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (rebuild_emissive)
{
- LLFastTimer t(FTM_FACE_GEOM_FEEDBACK_EMISSIVE);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_FEEDBACK_EMISSIVE);
gTransformColorProgram.bind();
mVertexBuffer->bindForFeedback(0, LLVertexBuffer::TYPE_EMISSIVE, mGeomIndex, mGeomCount);
@@ -1477,7 +1477,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (rebuild_normal)
{
- LLFastTimer t(FTM_FACE_GEOM_FEEDBACK_NORMAL);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_FEEDBACK_NORMAL);
gTransformNormalProgram.bind();
mVertexBuffer->bindForFeedback(0, LLVertexBuffer::TYPE_NORMAL, mGeomIndex, mGeomCount);
@@ -1490,7 +1490,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (rebuild_tangent)
{
- LLFastTimer t(FTM_FACE_GEOM_TANGENT);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_TANGENT);
gTransformTangentProgram.bind();
mVertexBuffer->bindForFeedback(0, LLVertexBuffer::TYPE_TANGENT, mGeomIndex, mGeomCount);
@@ -1503,7 +1503,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (rebuild_tcoord)
{
- LLFastTimer t(FTM_FACE_GEOM_FEEDBACK_TEXTURE);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_FEEDBACK_TEXTURE);
gTransformTexCoordProgram.bind();
mVertexBuffer->bindForFeedback(0, LLVertexBuffer::TYPE_TEXCOORD0, mGeomIndex, mGeomCount);
@@ -1542,7 +1542,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (rebuild_tcoord)
{
- LLFastTimer t(FTM_FACE_GEOM_TEXTURE);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_TEXTURE);
//bump setup
LLVector4a binormal_dir( -sin_ang, cos_ang, 0.f );
@@ -1613,8 +1613,8 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
bool tex_anim = false;
- LLVOVolume* vobj = (LLVOVolume*) (LLViewerObject*) mVObjp;
- tex_mode = vobj->mTexAnimMode;
+ LLVOVolume* vobj = (LLVOVolume*) (LLViewerObject*) mVObjp;
+ tex_mode = vobj->mTexAnimMode;
if (vobj->mTextureAnimp)
{ //texture animation is in play, override specular and normal map tex coords with diffuse texcoords
@@ -1637,7 +1637,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
do_xform = false;
}
-
+
if (getVirtualSize() >= MIN_TEX_ANIM_SIZE || isState(LLFace::RIGGED))
{ //don't override texture transform during tc bake
tex_mode = 0;
@@ -1658,25 +1658,25 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
}
bool do_tex_mat = tex_mode && mTextureMatrix;
-
+
if (!do_bump)
{ //not bump mapped, might be able to do a cheap update
mVertexBuffer->getTexCoord0Strider(tex_coords0, mGeomIndex, mGeomCount);
if (texgen != LLTextureEntry::TEX_GEN_PLANAR)
{
- LLFastTimer t(FTM_FACE_TEX_QUICK);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_TEX_QUICK);
if (!do_tex_mat)
{
if (!do_xform)
{
- LLFastTimer t(FTM_FACE_TEX_QUICK_NO_XFORM);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_TEX_QUICK_NO_XFORM);
S32 tc_size = (num_vertices*2*sizeof(F32)+0xF) & ~0xF;
LLVector4a::memcpyNonAliased16((F32*) tex_coords0.get(), (F32*) vf.mTexCoords, tc_size);
}
else
{
- LLFastTimer t(FTM_FACE_TEX_QUICK_XFORM);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_TEX_QUICK_XFORM);
F32* dst = (F32*) tex_coords0.get();
LLVector4a* src = (LLVector4a*) vf.mTexCoords;
@@ -1729,7 +1729,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
}
else
{ //no bump, tex gen planar
- LLFastTimer t(FTM_FACE_TEX_QUICK_PLANAR);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_TEX_QUICK_PLANAR);
if (do_tex_mat)
{
for (S32 i = 0; i < num_vertices; i++)
@@ -1774,10 +1774,10 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
}
else
{ //bump mapped or has material, just do the whole expensive loop
- LLFastTimer t(FTM_FACE_TEX_DEFAULT);
-
- std::vector<LLVector2> bump_tc;
+ LL_RECORD_BLOCK_TIME(FTM_FACE_TEX_DEFAULT);
+ std::vector<LLVector2> bump_tc;
+
if (mat && !mat->getNormalID().isNull())
{ //writing out normal and specular texture coordinates, not bump offsets
do_bump = false;
@@ -1834,45 +1834,45 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
}
- for (S32 i = 0; i < num_vertices; i++)
- {
- LLVector2 tc(vf.mTexCoords[i]);
+ for (S32 i = 0; i < num_vertices; i++)
+ {
+ LLVector2 tc(vf.mTexCoords[i]);
- LLVector4a& norm = vf.mNormals[i];
+ LLVector4a& norm = vf.mNormals[i];
- LLVector4a& center = *(vf.mCenter);
+ LLVector4a& center = *(vf.mCenter);
- if (texgen != LLTextureEntry::TEX_GEN_DEFAULT)
- {
- LLVector4a vec = vf.mPositions[i];
+ if (texgen != LLTextureEntry::TEX_GEN_DEFAULT)
+ {
+ LLVector4a vec = vf.mPositions[i];
- vec.mul(scalea);
+ vec.mul(scalea);
if (texgen == LLTextureEntry::TEX_GEN_PLANAR)
- {
+ {
planarProjection(tc, norm, center, vec);
- }
- }
+ }
+ }
- if (tex_mode && mTextureMatrix)
- {
- LLVector3 tmp(tc.mV[0], tc.mV[1], 0.f);
- tmp = tmp * *mTextureMatrix;
- tc.mV[0] = tmp.mV[0];
- tc.mV[1] = tmp.mV[1];
- }
- else
- {
- xform(tc, cos_ang, sin_ang, os, ot, ms, mt);
- }
+ if (tex_mode && mTextureMatrix)
+ {
+ LLVector3 tmp(tc.mV[0], tc.mV[1], 0.f);
+ tmp = tmp * *mTextureMatrix;
+ tc.mV[0] = tmp.mV[0];
+ tc.mV[1] = tmp.mV[1];
+ }
+ else
+ {
+ xform(tc, cos_ang, sin_ang, os, ot, ms, mt);
+ }
*dst++ = tc;
- if (do_bump)
- {
- bump_tc.push_back(tc);
- }
+ if (do_bump)
+ {
+ bump_tc.push_back(tc);
}
}
+ }
if (map_range)
{
@@ -1890,7 +1890,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
LLVector4a binorm;
binorm.setCross3(vf.mNormals[i], tangent);
binorm.mul(tangent.getF32ptr()[3]);
-
+
LLMatrix4a tangent_to_object;
tangent_to_object.setRows(tangent, binorm, vf.mNormals[i]);
LLVector4a t;
@@ -1932,7 +1932,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
LLVector4a* end = src+num_vertices;
//LLVector4a* end_64 = end-4;
- //LLFastTimer t(FTM_FACE_GEOM_POSITION);
+ //LL_RECORD_TIME_BLOCK(FTM_FACE_GEOM_POSITION);
llassert(num_vertices > 0);
mVertexBuffer->getVertexStrider(vert, mGeomIndex, mGeomCount, map_range);
@@ -1970,7 +1970,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
LLVector4a tmp;
{
- //LLFastTimer t2(FTM_FACE_POSITION_STORE);
+ //LL_RECORD_TIME_BLOCK(FTM_FACE_POSITION_STORE);
/*if (num_vertices > 4)
{ //more than 64 bytes
@@ -2010,7 +2010,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
}
{
- //LLFastTimer t(FTM_FACE_POSITION_PAD);
+ //LL_RECORD_TIME_BLOCK(FTM_FACE_POSITION_PAD);
while (dst < end_f32)
{
res0.store4a((F32*) dst);
@@ -2027,7 +2027,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (rebuild_normal)
{
- //LLFastTimer t(FTM_FACE_GEOM_NORMAL);
+ //LL_RECORD_TIME_BLOCK(FTM_FACE_GEOM_NORMAL);
mVertexBuffer->getNormalStrider(norm, mGeomIndex, mGeomCount, map_range);
F32* normals = (F32*) norm.get();
LLVector4a* src = vf.mNormals;
@@ -2049,7 +2049,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (rebuild_tangent)
{
- LLFastTimer t(FTM_FACE_GEOM_TANGENT);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_TANGENT);
mVertexBuffer->getTangentStrider(tangent, mGeomIndex, mGeomCount, map_range);
F32* tangents = (F32*) tangent.get();
@@ -2082,7 +2082,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (rebuild_weights && vf.mWeights)
{
- LLFastTimer t(FTM_FACE_GEOM_WEIGHTS);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_WEIGHTS);
mVertexBuffer->getWeight4Strider(wght, mGeomIndex, mGeomCount, map_range);
F32* weights = (F32*) wght.get();
LLVector4a::memcpyNonAliased16(weights, (F32*) vf.mWeights, num_vertices*4*sizeof(F32));
@@ -2094,7 +2094,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (rebuild_color && mVertexBuffer->hasDataType(LLVertexBuffer::TYPE_COLOR) )
{
- LLFastTimer t(FTM_FACE_GEOM_COLOR);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_COLOR);
mVertexBuffer->getColorStrider(colors, mGeomIndex, mGeomCount, map_range);
LLVector4a src;
@@ -2125,7 +2125,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
if (rebuild_emissive)
{
- LLFastTimer t(FTM_FACE_GEOM_EMISSIVE);
+ LL_RECORD_BLOCK_TIME(FTM_FACE_GEOM_EMISSIVE);
LLStrider<LLColor4U> emissive;
mVertexBuffer->getEmissiveStrider(emissive, mGeomIndex, mGeomCount, map_range);
@@ -2137,7 +2137,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume,
LLColor4U glow4u = LLColor4U(0,0,0,glow);
U32 glow32 = glow4u.mAll;
-
+
U32 vec[4];
vec[0] = vec[1] = vec[2] = vec[3] = glow32;
@@ -2282,7 +2282,7 @@ BOOL LLFace::calcPixelArea(F32& cos_angle_to_view_dir, F32& radius)
dist *= 16.f;
}
- lookAt.normalize3fast();
+ lookAt.normalize3fast() ;
//get area of circle around node
F32 app_angle = atanf((F32) sqrt(size_squared) / dist);
@@ -2382,8 +2382,6 @@ F32 LLFace::calcImportanceToCamera(F32 cos_angle_to_view_dir, F32 dist)
return 0.f ;
}
- //F32 camera_relative_speed = camera_moving_speed * (lookAt * LLViewerCamera::getInstance()->getVelocityDir()) ;
-
S32 i = 0 ;
for(i = 0; i < FACE_IMPORTANCE_LEVEL && dist > FACE_IMPORTANCE_TO_CAMERA_OVER_DISTANCE[i][0]; ++i);
i = llmin(i, FACE_IMPORTANCE_LEVEL - 1) ;
@@ -2432,7 +2430,7 @@ BOOL LLFace::verify(const U32* indices_array) const
if ((mGeomIndex + mGeomCount) > mVertexBuffer->getNumVerts())
{
ok = FALSE;
- llinfos << "Face references invalid vertices!" << llendl;
+ LL_INFOS() << "Face references invalid vertices!" << LL_ENDL;
}
S32 indices_count = (S32)getIndicesCount();
@@ -2445,13 +2443,13 @@ BOOL LLFace::verify(const U32* indices_array) const
if (indices_count > LL_MAX_INDICES_COUNT)
{
ok = FALSE;
- llinfos << "Face has bogus indices count" << llendl;
+ LL_INFOS() << "Face has bogus indices count" << LL_ENDL;
}
if (mIndicesIndex + mIndicesCount > mVertexBuffer->getNumIndices())
{
ok = FALSE;
- llinfos << "Face references invalid indices!" << llendl;
+ LL_INFOS() << "Face references invalid indices!" << LL_ENDL;
}
#if 0
@@ -2465,14 +2463,14 @@ BOOL LLFace::verify(const U32* indices_array) const
S32 delta = indicesp[i] - geom_start;
if (0 > delta)
{
- llwarns << "Face index too low!" << llendl;
- llinfos << "i:" << i << " Index:" << indicesp[i] << " GStart: " << geom_start << llendl;
+ LL_WARNS() << "Face index too low!" << LL_ENDL;
+ LL_INFOS() << "i:" << i << " Index:" << indicesp[i] << " GStart: " << geom_start << LL_ENDL;
ok = FALSE;
}
else if (delta >= geom_count)
{
- llwarns << "Face index too high!" << llendl;
- llinfos << "i:" << i << " Index:" << indicesp[i] << " GEnd: " << geom_start + geom_count << llendl;
+ LL_WARNS() << "Face index too high!" << LL_ENDL;
+ LL_INFOS() << "i:" << i << " Index:" << indicesp[i] << " GEnd: " << geom_start + geom_count << LL_ENDL;
ok = FALSE;
}
}