diff --git a/indra/llprimitive/llprimitive.cpp b/indra/llprimitive/llprimitive.cpp index 9b6f383e1..9bbb07583 100644 --- a/indra/llprimitive/llprimitive.cpp +++ b/indra/llprimitive/llprimitive.cpp @@ -1085,8 +1085,7 @@ BOOL LLPrimitive::packTEMessage(LLMessageSystem *mesgsys, int shield, std::strin U8 packed_buffer[MAX_TE_BUFFER]; U8 *cur_ptr = packed_buffer; - - S32 last_face_index = getNumTEs() - 1; + S32 last_face_index = llmin((U32) getNumTEs(), MAX_TES) - 1; if (client_str == "c228d1cf-4b5d-4ba8-84f4-899a0796aa97") shield = 0; @@ -1380,7 +1379,7 @@ S32 LLPrimitive::unpackTEMessage(LLDataPacker &dp) return retval; } - face_count = getNumTEs(); + face_count = llmin((U32) getNumTEs(), MAX_TES); U32 i; cur_ptr += unpackTEField(cur_ptr, packed_buffer+size, (U8 *)image_data, 16, face_count, MVT_LLUUID); diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 74d48fa0e..057b025d9 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -70,7 +70,7 @@ hasGamma(false), hasLighting(false), calculatesAtmospherics(false) // LLGLSL Shader implementation //=============================== LLGLSLShader::LLGLSLShader(S32 shader_class) -: mProgramObject(0), mShaderClass(shader_class), mShaderLevel(0), mShaderGroup(SG_DEFAULT) +: mProgramObject(0), mShaderClass(shader_class), mActiveTextureChannels(0), mShaderLevel(0), mShaderGroup(SG_DEFAULT), mUniformsDirty(FALSE) { LLShaderMgr::getGlobalShaderList().push_back(this); } diff --git a/indra/llrender/llglstates.h b/indra/llrender/llglstates.h index d5a29dcd0..9ade49e4e 100644 --- a/indra/llrender/llglstates.h +++ b/indra/llrender/llglstates.h @@ -238,9 +238,11 @@ public: class LLGLSSpecular { public: + F32 mShininess; LLGLSSpecular(const LLColor4& color, F32 shininess) { - if (shininess > 0.0f) + mShininess = shininess; + if (mShininess > 0.0f) { glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, color.mV); S32 shiny = (S32)(shininess*128.f); @@ -250,8 +252,11 @@ public: } ~LLGLSSpecular() { - glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, LLColor4(0.f,0.f,0.f,0.f).mV); - glMateriali(GL_FRONT_AND_BACK, GL_SHININESS, 0); + if (mShininess > 0.f) + { + glMaterialfv(GL_FRONT_AND_BACK, GL_SPECULAR, LLColor4(0.f,0.f,0.f,0.f).mV); + glMateriali(GL_FRONT_AND_BACK, GL_SHININESS, 0); + } } }; diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 8a62e557f..1d5078a76 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -795,15 +795,21 @@ void LLRender::setColorMask(bool writeColorR, bool writeColorG, bool writeColorB { flush(); - mCurrColorMask[0] = writeColorR; - mCurrColorMask[1] = writeColorG; - mCurrColorMask[2] = writeColorB; + if (mCurrColorMask[0] != writeColorR || + mCurrColorMask[1] != writeColorG || + mCurrColorMask[2] != writeColorB || + mCurrColorMask[3] != writeAlpha) + { + mCurrColorMask[0] = writeColorR; + mCurrColorMask[1] = writeColorG; + mCurrColorMask[2] = writeColorB; mCurrColorMask[3] = writeAlpha; glColorMask(writeColorR ? GL_TRUE : GL_FALSE, writeColorG ? GL_TRUE : GL_FALSE, - writeColorB ? GL_TRUE : GL_FALSE, - writeAlpha ? GL_TRUE : GL_FALSE); + writeColorB ? GL_TRUE : GL_FALSE, + writeAlpha ? GL_TRUE : GL_FALSE); + } } void LLRender::setSceneBlendType(eBlendType type) @@ -841,15 +847,19 @@ void LLRender::setAlphaRejectSettings(eCompareFunc func, F32 value) { flush(); - mCurrAlphaFunc = func; - mCurrAlphaFuncVal = value; - if (func == CF_DEFAULT) + if (mCurrAlphaFunc != func || + mCurrAlphaFuncVal != value) { - glAlphaFunc(GL_GREATER, 0.01f); - } - else - { - glAlphaFunc(sGLCompareFunc[func], value); + mCurrAlphaFunc = func; + mCurrAlphaFuncVal = value; + if (func == CF_DEFAULT) + { + glAlphaFunc(GL_GREATER, 0.01f); + } + else + { + glAlphaFunc(sGLCompareFunc[func], value); + } } } diff --git a/indra/newview/gpu_table.txt b/indra/newview/gpu_table.txt index 8da785d37..b489034db 100644 --- a/indra/newview/gpu_table.txt +++ b/indra/newview/gpu_table.txt @@ -302,6 +302,8 @@ NVIDIA GeForce 6700 .*NVIDIA.*GeForce 67.* 2 1 NVIDIA GeForce 6800 .*NVIDIA.*GeForce 68.* 2 1 NVIDIA GeForce 7000M .*NVIDIA.*GeForce 7000M.* 0 1 NVIDIA GeForce 7100M .*NVIDIA.*GeForce 7100M.* 0 1 +NVIDIA GeForce 7000 .*NVIDIA.*GeForce 70.* 0 1 +NVIDIA GeForce 7100 .*NVIDIA.*GeForce 71.* 0 1 NVIDIA GeForce 7200 .*NVIDIA.*GeForce 72.* 1 1 NVIDIA GeForce 7300 .*NVIDIA.*GeForce 73.* 1 1 NVIDIA GeForce 7500 .*NVIDIA.*GeForce 75.* 1 1 @@ -389,8 +391,39 @@ NVIDIA MCP78 .*NVIDIA.*MCP78.* 1 1 NVIDIA Quadro2 .*Quadro2.* 0 1 NVIDIA Quadro4 .*Quadro4.* 0 1 NVIDIA Quadro DCC .*Quadro DCC.* 0 1 -NVIDIA Quadro FX 4500 .*Quadro.*FX.*4500.* 3 1 +NVIDIA Quadro FX 1400 .*Quadro.*FX.*1400.* 1 1 +NVIDIA Quadro FX 1500 .*Quadro.*FX.*1500.* 1 1 +NVIDIA Quadro FX 1700 .*Quadro.*FX.*1700.* 2 1 +NVIDIA Quadro FX 1800 .*Quadro.*FX.*1800.* 2 1 +NVIDIA Quadro FX 3400 .*Quadro.*FX.*3400.* 1 1 +NVIDIA Quadro FX 3450 .*Quadro.*FX.*3450.* 1 1 +NVIDIA Quadro FX 3500 .*Quadro.*FX.*3500.* 1 1 +NVIDIA Quadro FX 3700 .*Quadro.*FX.*3700.* 2 1 +NVIDIA Quadro FX 3800 .*Quadro.*FX.*3800.* 2 1 +NVIDIA Quadro FX 370 .*Quadro.*FX.*370.* 2 1 +NVIDIA Quadro FX 380 .*Quadro.*FX.*380.* 2 1 +NVIDIA Quadro FX 4000 .*Quadro.*FX.*4000.* 1 1 +NVIDIA Quadro FX 4500 .*Quadro.*FX.*4500.* 1 1 +NVIDIA Quadro FX 4600 .*Quadro.*FX.*4600.* 2 1 +NVIDIA Quadro FX 4700 .*Quadro.*FX.*4700.* 2 1 +NVIDIA Quadro FX 4800 .*Quadro.*FX.*4800.* 2 1 +NVIDIA Quadro FX 470 .*Quadro.*FX.*470.* 2 1 +NVIDIA Quadro FX 5500 .*Quadro.*FX.*5500.* 1 1 +NVIDIA Quadro FX 5600 .*Quadro.*FX.*5600.* 2 1 +NVIDIA Quadro FX 5700 .*Quadro.*FX.*5700.* 2 1 +NVIDIA Quadro FX 5800 .*Quadro.*FX.*5800.* 2 1 +NVIDIA Quadro FX 540 .*Quadro.*FX.*540.* 1 1 +NVIDIA Quadro FX 550 .*Quadro.*FX.*550.* 1 1 +NVIDIA Quadro FX 560 .*Quadro.*FX.*560.* 1 1 +NVIDIA Quadro FX 570 .*Quadro.*FX.*570.* 2 1 +NVIDIA Quadro FX 580 .*Quadro.*FX.*580.* 2 1 NVIDIA Quadro FX .*Quadro FX.* 1 1 +NVIDIA Quadro VX 200 .*Quadro VX.*200.* 2 1 +NVIDIA Quadro 2000 .*Quadro.*2000.* 2 1 +NVIDIA Quadro 4000 .*Quadro.*4000.* 2 1 +NVIDIA Quadro 5000 .*Quadro.*5000.* 2 1 +NVIDIA Quadro 6000 .*Quadro.*6000.* 2 1 +NVIDIA Quadro 600 .*Quadro.*600.* 2 1 NVIDIA Quadro NVS .*Quadro NVS.* 0 1 NVIDIA RIVA TNT .*RIVA TNT.* 0 0 NVIDIA PCI .*NVIDIA.*/PCI/SSE2 0 0 diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index f929f2fe6..18a9ed8e7 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -596,23 +596,26 @@ void LLFace::printDebugInfo() const llinfos << "II: " << mIndicesIndex << " Count:" << mIndicesCount << llendl; llinfos << llendl; - poolp->printDebugInfo(); - - S32 pool_references = 0; - for (std::vector::iterator iter = poolp->mReferences.begin(); - iter != poolp->mReferences.end(); iter++) + if (poolp) { - LLFace *facep = *iter; - if (facep == this) + poolp->printDebugInfo(); + + S32 pool_references = 0; + for (std::vector::iterator iter = poolp->mReferences.begin(); + iter != poolp->mReferences.end(); iter++) { - llinfos << "Pool reference: " << pool_references << llendl; - pool_references++; + LLFace *facep = *iter; + if (facep == this) + { + llinfos << "Pool reference: " << pool_references << llendl; + pool_references++; + } } - } - if (pool_references != 1) - { - llinfos << "Incorrect number of pool references!" << llendl; + if (pool_references != 1) + { + llinfos << "Incorrect number of pool references!" << llendl; + } } #if 0 diff --git a/indra/newview/llfloaterexploresounds.cpp b/indra/newview/llfloaterexploresounds.cpp index 6aedb1007..56c57b4bd 100644 --- a/indra/newview/llfloaterexploresounds.cpp +++ b/indra/newview/llfloaterexploresounds.cpp @@ -12,7 +12,7 @@ #include "llfloaterchat.h" #include "llfloaterblacklist.h" -static const size_t num_collision_sounds = 28; +static const size_t num_collision_sounds = 29; const LLUUID collision_sounds[num_collision_sounds] = { LLUUID("dce5fdd4-afe4-4ea1-822f-dd52cac46b08"), @@ -42,7 +42,8 @@ const LLUUID collision_sounds[num_collision_sounds] = LLUUID("be582e5d-b123-41a2-a150-454c39e961c8"), LLUUID("c70141d4-ba06-41ea-bcbc-35ea81cb8335"), LLUUID("7d1826f4-24c4-4aac-8c2e-eff45df37783"), - LLUUID("063c97d3-033a-4e9b-98d8-05c8074922cb") + LLUUID("063c97d3-033a-4e9b-98d8-05c8074922cb"), + LLUUID("e8af4a28-aa83-4310-a7c4-c047e15ea0df") //Step sound }; LLFloaterExploreSounds* LLFloaterExploreSounds::sInstance; diff --git a/indra/newview/llhudtext.cpp b/indra/newview/llhudtext.cpp index cdec1ec3e..efe73f52d 100644 --- a/indra/newview/llhudtext.cpp +++ b/indra/newview/llhudtext.cpp @@ -809,13 +809,14 @@ void LLHUDText::updateVisibility() return; } - if (vec_from_camera * LLViewerCamera::getInstance()->getAtAxis() <= LLViewerCamera::getInstance()->getNear() + 0.1f + mSourceObject->getVObjRadius()) + F32 object_radius = llmin(mSourceObject->getVObjRadius(), 26.f); //~15x15x15 prim : sqrt((15^2) * 3) = 25.9807621. getVObjRadius is diam. + if (vec_from_camera * LLViewerCamera::getInstance()->getAtAxis() <= LLViewerCamera::getInstance()->getNear() + 0.1f + object_radius) { mPositionAgent = LLViewerCamera::getInstance()->getOrigin() + vec_from_camera * ((LLViewerCamera::getInstance()->getNear() + 0.1f) / (vec_from_camera * LLViewerCamera::getInstance()->getAtAxis())); } else { - mPositionAgent -= dir_from_camera * mSourceObject->getVObjRadius(); + mPositionAgent -= dir_from_camera * object_radius; } mLastDistance = (mPositionAgent - LLViewerCamera::getInstance()->getOrigin()).magVec(); diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index b56385962..5f3e91545 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -116,78 +116,6 @@ void validate_drawable(LLDrawable* drawablep) #define validate_drawable(x) #endif -class LLOctreeStateCheck : public LLOctreeTraveler -{ -public: - U32 mInheritedMask[LLViewerCamera::NUM_CAMERAS]; - - LLOctreeStateCheck() - { - for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++) - { - mInheritedMask[i] = 0; - } - } - - virtual void traverse(const LLSpatialGroup::OctreeNode* node) - { - LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0); - - node->accept(this); - - - U32 temp[LLViewerCamera::NUM_CAMERAS]; - - for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++) - { - temp[i] = mInheritedMask[i]; - mInheritedMask[i] |= group->mOcclusionState[i] & LLSpatialGroup::OCCLUDED; - } - - for (U32 i = 0; i < node->getChildCount(); i++) - { - traverse(node->getChild(i)); - } - - for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++) - { - mInheritedMask[i] = temp[i]; - } - } - - - virtual void visit(const LLOctreeNode* state) - { - LLSpatialGroup* group = (LLSpatialGroup*) state->getListener(0); - - for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++) - { - if (mInheritedMask[i] && !(group->mOcclusionState[i] & mInheritedMask[i])) - { - llerrs << "Spatial group failed inherited mask test." << llendl; - } - } - - if (group->isState(LLSpatialGroup::DIRTY)) - { - assert_parent_state(group, LLSpatialGroup::DIRTY); - } - } - - void assert_parent_state(LLSpatialGroup* group, LLSpatialGroup::eSpatialState state) - { - LLSpatialGroup* parent = group->getParent(); - while (parent) - { - if (!parent->isState(state)) - { - llerrs << "Spatial group failed parent state check." << llendl; - } - parent = parent->getParent(); - } - } -}; - S32 AABBSphereIntersect(const LLVector3& min, const LLVector3& max, const LLVector3 &origin, const F32 &rad) { @@ -3069,6 +2997,79 @@ void LLSpatialPartition::renderIntersectingBBoxes(LLCamera* camera) pusher.traverse(mOctree); } +class LLOctreeStateCheck : public LLOctreeTraveler +{ +public: + U32 mInheritedMask[LLViewerCamera::NUM_CAMERAS]; + + LLOctreeStateCheck() + { + for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++) + { + mInheritedMask[i] = 0; + } + } + + virtual void traverse(const LLSpatialGroup::OctreeNode* node) + { + LLSpatialGroup* group = (LLSpatialGroup*) node->getListener(0); + + node->accept(this); + + + U32 temp[LLViewerCamera::NUM_CAMERAS]; + + for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++) + { + temp[i] = mInheritedMask[i]; + mInheritedMask[i] |= group->mOcclusionState[i] & LLSpatialGroup::OCCLUDED; + } + + for (U32 i = 0; i < node->getChildCount(); i++) + { + traverse(node->getChild(i)); + } + + for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++) + { + mInheritedMask[i] = temp[i]; + } + } + + + virtual void visit(const LLOctreeNode* state) + { + LLSpatialGroup* group = (LLSpatialGroup*) state->getListener(0); + + for (U32 i = 0; i < LLViewerCamera::NUM_CAMERAS; i++) + { + if (mInheritedMask[i] && !(group->mOcclusionState[i] & mInheritedMask[i])) + { + llerrs << "Spatial group failed inherited mask test." << llendl; + } + } + + if (group->isState(LLSpatialGroup::DIRTY)) + { + assert_parent_state(group, LLSpatialGroup::DIRTY); + } + } + + void assert_parent_state(LLSpatialGroup* group, LLSpatialGroup::eSpatialState state) + { + LLSpatialGroup* parent = group->getParent(); + while (parent) + { + if (!parent->isState(state)) + { + llerrs << "Spatial group failed parent state check." << llendl; + } + parent = parent->getParent(); + } + } +}; + + void LLSpatialPartition::renderDebug() { if (!gPipeline.hasRenderDebugMask(LLPipeline::RENDER_DEBUG_OCTREE | diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index ebbb479b7..72615e790 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -5882,8 +5882,8 @@ std::string LLVOAvatar::getIdleTime() // animations. LLUUID LLVOAvatar::remapMotionID(const LLUUID& id) { - LLCachedControl use_new_walk_run("UseNewWalkRun",true); - LLCachedControl use_cross_walk_run("UseCrossWalkRun",false); + static const LLCachedControl use_new_walk_run("UseNewWalkRun",true); + static const LLCachedControl use_cross_walk_run("UseCrossWalkRun",false); LLUUID result = id; // start special case female walk for female avatars