From ac2d16b15cb961248eff5362b9c89f3a743c1171 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Wed, 3 Apr 2019 13:55:41 -0500 Subject: [PATCH 1/5] Fix potential lod bug in mdodel decode. --- indra/llprimitive/llmodel.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index 74bbcd793..fa39a3789 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -1132,9 +1132,7 @@ bool LLModel::loadModel(std::istream& is) "physics_mesh", }}; - const S32 MODEL_LODS = lod_name.size(); - - S32 lod = llclamp((S32) mDetail, 0, MODEL_LODS); + S32 lod = llclamp((S32) mDetail, 0, (S32)lod_name.size() - 1); if (header[lod_name[lod]]["offset"].asInteger() == -1 || header[lod_name[lod]]["size"].asInteger() == 0 ) From af8bb2a99222d0ca6d6a3b2bbfff950e05f283ee Mon Sep 17 00:00:00 2001 From: Shyotl Date: Wed, 3 Apr 2019 13:56:26 -0500 Subject: [PATCH 2/5] Trivial cleanup. --- indra/newview/lldrawpoolsky.h | 3 --- indra/newview/pipeline.cpp | 4 ++-- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/indra/newview/lldrawpoolsky.h b/indra/newview/lldrawpoolsky.h index 3da493cc9..09b77f0c1 100644 --- a/indra/newview/lldrawpoolsky.h +++ b/indra/newview/lldrawpoolsky.h @@ -68,9 +68,6 @@ public: void setSkyTex(LLSkyTex* const st) { mSkyTex = st; } void renderSkyCubeFace(U8 side); - void renderHeavenlyBody(U8 hb, LLFace* face); - void renderSunHalo(LLFace* face); - }; #endif // LL_LLDRAWPOOLSKY_H diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 08e7bd77e..e5adf2b71 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -222,12 +222,12 @@ std::string gPoolNames[] = { // Correspond to LLDrawpool enum render type "NONE", - "POOL_SIMPLE", "POOL_GROUND", + "POOL_TERRAIN", + "POOL_SIMPLE", "POOL_FULLBRIGHT", "POOL_BUMP", "POOL_MATERIALS", - "POOL_TERRAIN", "POOL_TREE", // Singu Note: Before sky for zcull. "POOL_ALPHA_MASK", "POOL_FULLBRIGHT_ALPHA_MASK", From e2cc2d600bb36ff24f4e6ce8b23b96a1a2a8f158 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Mon, 8 Apr 2019 15:18:10 -0500 Subject: [PATCH 3/5] Update event poll to work with expected server changes. Timeout now behaves like status 502 (which is being removed by LL). Keeping 502 handling as well to maintain opensim support. --- indra/newview/lleventpoll.cpp | 13 +++++++++---- indra/newview/llselectmgr.cpp | 1 - 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/indra/newview/lleventpoll.cpp b/indra/newview/lleventpoll.cpp index b804b81be..b1a412b49 100644 --- a/indra/newview/lleventpoll.cpp +++ b/indra/newview/lleventpoll.cpp @@ -183,10 +183,15 @@ namespace { if (mDone) return; - // A HTTP_BAD_GATEWAY (502) error is our standard timeout response - // we get this when there are no events. - if ( mStatus == HTTP_BAD_GATEWAY ) - { + // Timeout + if (is_internal_http_error_that_warrants_a_retry(mStatus)) + { // A standard timeout response we get this when there are no events. + mErrorCount = 0; + makeRequest(); + } + else if ( mStatus == HTTP_BAD_GATEWAY ) + { // LEGACY: A HTTP_BAD_GATEWAY (502) error is our standard timeout response + // we get this when there are no events. mErrorCount = 0; makeRequest(); } diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp index 6fa3882ea..994f3cd66 100644 --- a/indra/newview/llselectmgr.cpp +++ b/indra/newview/llselectmgr.cpp @@ -6850,7 +6850,6 @@ void LLSelectMgr::pauseAssociatedAvatars() } else { - object->print(); // Is a regular attachment. Pause the avatar it's attached to. LLVOAvatar* avatar = object->getAvatar(); if (avatar) From 99f9b98258816d25cdcbb85b3dfd13683a6cb264 Mon Sep 17 00:00:00 2001 From: Shyotl Date: Mon, 8 Apr 2019 15:18:36 -0500 Subject: [PATCH 4/5] Keep llthread.h out of the precompiled header. Thanks. --- indra/llmath/llvolumemgr.cpp | 1 + indra/llmath/llvolumemgr.h | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llmath/llvolumemgr.cpp b/indra/llmath/llvolumemgr.cpp index 07df1ccaa..a8c2766cb 100644 --- a/indra/llmath/llvolumemgr.cpp +++ b/indra/llmath/llvolumemgr.cpp @@ -27,6 +27,7 @@ #include "llvolumemgr.h" #include "llvolume.h" +#include "llthread.h" const F32 BASE_THRESHOLD = 0.03f; diff --git a/indra/llmath/llvolumemgr.h b/indra/llmath/llvolumemgr.h index c242ca68c..c2953655a 100644 --- a/indra/llmath/llvolumemgr.h +++ b/indra/llmath/llvolumemgr.h @@ -31,7 +31,6 @@ #include "llvolume.h" #include "llpointer.h" -#include "llthread.h" class LLVolumeParams; class LLVolumeLODGroup; From 8ed9934a87d07a7d37af3399dc6b1af6ac8d662e Mon Sep 17 00:00:00 2001 From: Shyotl Date: Mon, 8 Apr 2019 18:13:28 -0500 Subject: [PATCH 5/5] Fix memory tracking bug with vertex buffers. (Cosmetic. Only affects debug stats) --- indra/llrender/llvertexbuffer.cpp | 14 +++++++------- indra/llrender/llvertexbuffer.h | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index e46fc679f..46705d1d6 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -74,10 +74,10 @@ U32 vbo_block_size(U32 size) U32 vbo_block_index(U32 size) { - return vbo_block_size(size)/LL_VBO_BLOCK_SIZE; + return ((vbo_block_size(size)-1)/LL_VBO_BLOCK_SIZE); } -const U32 LL_VBO_POOL_SEED_COUNT = vbo_block_index(LL_VBO_POOL_MAX_SEED_SIZE); +const U32 LL_VBO_POOL_SEED_COUNT = vbo_block_index(LL_VBO_POOL_MAX_SEED_SIZE)+1; //============================================================================ @@ -88,14 +88,14 @@ LLVBOPool LLVertexBuffer::sDynamicVBOPool(GL_DYNAMIC_DRAW_ARB, GL_ARRAY_BUFFER_A LLVBOPool LLVertexBuffer::sStreamIBOPool(GL_STREAM_DRAW_ARB, GL_ELEMENT_ARRAY_BUFFER_ARB); LLVBOPool LLVertexBuffer::sDynamicIBOPool(GL_DYNAMIC_DRAW_ARB, GL_ELEMENT_ARRAY_BUFFER_ARB); -U32 LLVBOPool::sBytesPooled = 0; -U32 LLVBOPool::sIndexBytesPooled = 0; +U64 LLVBOPool::sBytesPooled = 0; +U64 LLVBOPool::sIndexBytesPooled = 0; std::vector LLVBOPool::sPendingDeletions; std::list LLVertexBuffer::sAvailableVAOName; U32 LLVertexBuffer::sCurVAOName = 1; -U32 LLVertexBuffer::sAllocatedIndexBytes = 0; +U64 LLVertexBuffer::sAllocatedIndexBytes = 0; U32 LLVertexBuffer::sIndexCount = 0; U32 LLVertexBuffer::sBindCount = 0; @@ -111,7 +111,7 @@ U32 LLVertexBuffer::sGLRenderIndices = 0; U32 LLVertexBuffer::sLastMask = 0; bool LLVertexBuffer::sVBOActive = false; bool LLVertexBuffer::sIBOActive = false; -U32 LLVertexBuffer::sAllocatedBytes = 0; +U64 LLVertexBuffer::sAllocatedBytes = 0; U32 LLVertexBuffer::sVertexCount = 0; bool LLVertexBuffer::sMapped = false; bool LLVertexBuffer::sUseStreamDraw = true; @@ -341,7 +341,7 @@ void LLVBOPool::seedPool() { if (mMissCount[i] > mFreeList[i].size()) { - U32 size = i * LL_VBO_BLOCK_SIZE; + U32 size = i * LL_VBO_BLOCK_SIZE + LL_VBO_BLOCK_SIZE; S32 count = mMissCount[i] - mFreeList[i].size(); for (S32 j = 0; j < count; ++j) diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index a993bb98a..d61420abc 100644 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -54,8 +54,8 @@ class LLVBOPool { public: - static U32 sBytesPooled; - static U32 sIndexBytesPooled; + static U64 sBytesPooled; + static U64 sIndexBytesPooled; static std::vector sPendingDeletions; // Periodically call from render loop. Batches VBO deletions together in a single call. @@ -347,8 +347,8 @@ public: static bool sVBOActive; static bool sIBOActive; static U32 sLastMask; - static U32 sAllocatedBytes; - static U32 sAllocatedIndexBytes; + static U64 sAllocatedBytes; + static U64 sAllocatedIndexBytes; static U32 sVertexCount; static U32 sIndexCount; static U32 sBindCount;