From 6cbbe493ddae08279597c58712c5133745f25b07 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Wed, 13 Apr 2011 02:47:49 -0500 Subject: [PATCH 1/4] Removed warning regarding 'RenderCubeMap' feature upon startup --- indra/newview/llappviewer.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 5a582678e..dff8e1b30 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -450,8 +450,6 @@ static void settings_to_globals() gShowObjectUpdates = gSavedSettings.getBOOL("ShowObjectUpdates"); LLWorldMapView::sMapScale = gSavedSettings.getF32("MapScale"); LLHoverView::sShowHoverTips = gSavedSettings.getBOOL("ShowHoverTips"); - - LLCubeMap::sUseCubeMaps = LLFeatureManager::getInstance()->isFeatureAvailable("RenderCubeMap"); } static void settings_modify() @@ -738,6 +736,9 @@ bool LLAppViewer::init() gGLActive = TRUE; initWindow(); + // initWindow also initializes the Feature List, so now we can initialize this global. + LLCubeMap::sUseCubeMaps = LLFeatureManager::getInstance()->isFeatureAvailable("RenderCubeMap"); + // call all self-registered classes LLInitClassList::instance().fireCallbacks(); From 8204ec5565bb7412153de0d7b0d9699ee7b90b4a Mon Sep 17 00:00:00 2001 From: Shyotl Date: Fri, 15 Apr 2011 01:21:33 -0500 Subject: [PATCH 2/4] New gpu_table entries --- indra/newview/gpu_table.txt | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) 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 From d2d53fec7fa73e1d276b0939fc241a164fd31f71 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Fri, 15 Apr 2011 02:42:30 -0500 Subject: [PATCH 3/4] Minor tweaks of little consequence. Nullcheck, overrun paranoia. --- indra/llprimitive/llprimitive.cpp | 5 ++--- indra/llrender/llglstates.h | 11 +++++++--- indra/llrender/llrender.cpp | 36 ++++++++++++++++++++----------- indra/newview/llface.cpp | 29 ++++++++++++++----------- 4 files changed, 49 insertions(+), 32 deletions(-) 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/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/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 From 3901893a3a9fcf067e8bfc42ce0cbbdf9ca391a6 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Sat, 16 Apr 2011 18:18:24 -0500 Subject: [PATCH 4/4] Resolved some unitialized variables. --- indra/llrender/llglslshader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); }