From 25c20f98a88a457b5fa865e8dc302b24378bc842 Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Fri, 5 Aug 2016 17:21:22 +0300 Subject: MAINT-5018 crashing when touching mesh Fix #1 Disable FSAA for drawing selected objects (it help to avoid crash on old ATI cards (in my case it's a HD3800)). --- indra/llrender/llvertexbuffer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llrender') diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 0fae600a90..31dffdd545 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -448,7 +448,7 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask) else { - GLenum array[] = + static const GLenum array[] = { GL_VERTEX_ARRAY, GL_NORMAL_ARRAY, @@ -456,7 +456,7 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask) GL_COLOR_ARRAY, }; - GLenum mask[] = + static const GLenum mask[] = { MAP_VERTEX, MAP_NORMAL, -- cgit v1.2.3 From 3c9181867f151d8bc076b10160348bcde7d8d184 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 4 Nov 2016 16:18:35 +0200 Subject: MAINT-6905 reducing log spam --- indra/llrender/llrender.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'indra/llrender') diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 69420dd0bb..3e7c69611d 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -267,7 +267,14 @@ bool LLTexUnit::bind(LLTexture* texture, bool for_rendering, bool forceBind) } else { - LL_WARNS() << "NULL LLTexUnit::bind texture" << LL_ENDL; + if (texture) + { + LL_DEBUGS() << "NULL LLTexUnit::bind GL image" << LL_ENDL; + } + else + { + LL_DEBUGS() << "NULL LLTexUnit::bind texture" << LL_ENDL; + } return false; } } @@ -286,7 +293,7 @@ bool LLTexUnit::bind(LLImageGL* texture, bool for_rendering, bool forceBind) if(!texture) { - LL_WARNS() << "NULL LLTexUnit::bind texture" << LL_ENDL; + LL_DEBUGS() << "NULL LLTexUnit::bind texture" << LL_ENDL; return false; } -- cgit v1.2.3 From a65b586b184d9837e0586b4df0d2e758ccce63f6 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Thu, 8 Dec 2016 17:21:05 +0200 Subject: MAINT-6729 Additional fix for crash in LLImageGL::analyzeAlpha() --- indra/llrender/llimagegl.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'indra/llrender') diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 81a5537f78..20cba68f84 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -1267,6 +1267,12 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, S llassert(gGLManager.mInited); stop_glerror(); + if (!imageraw || imageraw->isBufferInvalid()) + { + LL_WARNS() << "Trying to create a texture from invalid image data" << LL_ENDL; + return FALSE; + } + if (discard_level < 0) { llassert(mCurrentDiscardLevel >= 0); -- cgit v1.2.3 From 5cc716dbf9470f7be454588b5402408bafa225bb Mon Sep 17 00:00:00 2001 From: ruslantproductengine Date: Mon, 12 Dec 2016 18:24:46 +0200 Subject: MAINT-6125 - Mesh avatar deforms constantly MAINT-6910 - [MAINT-RC] Some mesh turns invisible when camera is moved on the Maint-RC viewer only - caused by fix for MAINT-6125. Commulative fix. Fixed for booth ticket's in indra/newview/llvovolume.cpp Remained fixed, it's a small code improvements which is not related to MAINT-6125, MAINT-6910 --- indra/llrender/llvertexbuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llrender') diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 31dffdd545..1c325f5e5d 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -509,7 +509,7 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask) } } - U32 map_tc[] = + static const U32 map_tc[] = { MAP_TEXCOORD1, MAP_TEXCOORD2, -- cgit v1.2.3 From 71269ac1fc4ab19d46fd33c82b1df7a887b918bc Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Thu, 15 Dec 2016 02:40:51 +0200 Subject: Backed out changeset: ebe10b4b1197 --- indra/llrender/llvertexbuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llrender') diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 1c325f5e5d..31dffdd545 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -509,7 +509,7 @@ void LLVertexBuffer::setupClientArrays(U32 data_mask) } } - static const U32 map_tc[] = + U32 map_tc[] = { MAP_TEXCOORD1, MAP_TEXCOORD2, -- cgit v1.2.3 From cf865bb5962a85e2da3414468d6a99ecb5423f97 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Wed, 9 Aug 2017 00:04:25 +0300 Subject: MAINT-7652 Fix for crash in LLVertexBuffer::~LLVertexBuffer() destructor --- indra/llrender/llvertexbuffer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llrender') diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 31dffdd545..607bbf3b3b 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -1234,7 +1234,7 @@ void LLVertexBuffer::createGLIndices(U32 size) void LLVertexBuffer::destroyGLBuffer() { - if (mGLBuffer) + if (mGLBuffer || mMappedData) { if (mMappedDataUsingVBOs) { @@ -1254,7 +1254,7 @@ void LLVertexBuffer::destroyGLBuffer() void LLVertexBuffer::destroyGLIndices() { - if (mGLIndices) + if (mGLIndices || mMappedIndexData) { if (mMappedIndexDataUsingVBOs) { -- cgit v1.2.3 From f8254a9d787ab6235c8fb076bd65dc7cd978dce9 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 30 Aug 2017 19:57:02 +0300 Subject: MAINT-7758 Fixed freeze on loading lsl scripts from unicode named windows folder. --- indra/llrender/llgl.cpp | 2 +- indra/llrender/llgl.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'indra/llrender') diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 7757198af5..1847c661d7 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -65,7 +65,7 @@ static const std::string HEADLESS_VENDOR_STRING("Linden Lab"); static const std::string HEADLESS_RENDERER_STRING("Headless"); static const std::string HEADLESS_VERSION_STRING("1.0"); -std::ofstream gFailLog; +llofstream gFailLog; #if GL_ARB_debug_output diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h index 75e5fe86ec..aa98b3f6bc 100644 --- a/indra/llrender/llgl.h +++ b/indra/llrender/llgl.h @@ -47,7 +47,7 @@ extern BOOL gDebugGL; extern BOOL gDebugSession; -extern std::ofstream gFailLog; +extern llofstream gFailLog; #define LL_GL_ERRS LL_ERRS("RenderState") -- cgit v1.2.3 From 149b2d88dd75bddf1cb3e9927c4e8fcc84e263e1 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 1 Nov 2017 19:36:13 +0200 Subject: MAINT-7228 Vertex buffer allocation failure handling --- indra/llrender/llvertexbuffer.cpp | 64 +++++++++++++++++++++++++++++---------- indra/llrender/llvertexbuffer.h | 12 ++++---- 2 files changed, 54 insertions(+), 22 deletions(-) (limited to 'indra/llrender') diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 607bbf3b3b..d4dfb373f0 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -1167,7 +1167,7 @@ void LLVertexBuffer::releaseIndices() sGLCount--; } -void LLVertexBuffer::createGLBuffer(U32 size) +bool LLVertexBuffer::createGLBuffer(U32 size) { if (mGLBuffer) { @@ -1176,9 +1176,11 @@ void LLVertexBuffer::createGLBuffer(U32 size) if (size == 0) { - return; + return true; } + bool sucsess = true; + mEmpty = true; mMappedDataUsingVBOs = useVBOs(); @@ -1196,9 +1198,15 @@ void LLVertexBuffer::createGLBuffer(U32 size) mSize = size; claimMem(mSize); } + + if (!mMappedData) + { + sucsess = false; + } + return sucsess; } -void LLVertexBuffer::createGLIndices(U32 size) +bool LLVertexBuffer::createGLIndices(U32 size) { if (mGLIndices) { @@ -1207,9 +1215,11 @@ void LLVertexBuffer::createGLIndices(U32 size) if (size == 0) { - return; + return true; } + bool sucsess = true; + mEmpty = true; //pad by 16 bytes for aligned copies @@ -1230,6 +1240,12 @@ void LLVertexBuffer::createGLIndices(U32 size) mGLIndices = ++gl_buffer_idx; mIndicesSize = size; } + + if (!mMappedIndexData) + { + sucsess = false; + } + return sucsess; } void LLVertexBuffer::destroyGLBuffer() @@ -1272,10 +1288,12 @@ void LLVertexBuffer::destroyGLIndices() //unbind(); } -void LLVertexBuffer::updateNumVerts(S32 nverts) +bool LLVertexBuffer::updateNumVerts(S32 nverts) { llassert(nverts >= 0); + bool sucsess = true; + if (nverts > 65536) { LL_WARNS() << "Vertex buffer overflow!" << LL_ENDL; @@ -1286,31 +1304,37 @@ void LLVertexBuffer::updateNumVerts(S32 nverts) if (needed_size > mSize || needed_size <= mSize/2) { - createGLBuffer(needed_size); + sucsess &= createGLBuffer(needed_size); } sVertexCount -= mNumVerts; mNumVerts = nverts; sVertexCount += mNumVerts; + + return sucsess; } -void LLVertexBuffer::updateNumIndices(S32 nindices) +bool LLVertexBuffer::updateNumIndices(S32 nindices) { llassert(nindices >= 0); + bool sucsess = true; + U32 needed_size = sizeof(U16) * nindices; if (needed_size > mIndicesSize || needed_size <= mIndicesSize/2) { - createGLIndices(needed_size); + sucsess &= createGLIndices(needed_size); } sIndexCount -= mNumIndices; mNumIndices = nindices; sIndexCount += mNumIndices; + + return sucsess; } -void LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create) +bool LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create) { stop_glerror(); @@ -1320,10 +1344,12 @@ void LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create) LL_ERRS() << "Bad vertex buffer allocation: " << nverts << " : " << nindices << LL_ENDL; } - updateNumVerts(nverts); - updateNumIndices(nindices); + bool sucsess = true; + + sucsess &= updateNumVerts(nverts); + sucsess &= updateNumIndices(nindices); - if (create && (nverts || nindices)) + if (sucsess && create && (nverts || nindices)) { //actually allocate space for the vertex buffer if using VBO mapping flush(); @@ -1336,6 +1362,8 @@ void LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create) setupVertexArray(); } } + + return sucsess; } static LLTrace::BlockTimerStatHandle FTM_SETUP_VERTEX_ARRAY("Setup VAO"); @@ -1457,15 +1485,17 @@ void LLVertexBuffer::setupVertexArray() unbind(); } -void LLVertexBuffer::resizeBuffer(S32 newnverts, S32 newnindices) +bool LLVertexBuffer::resizeBuffer(S32 newnverts, S32 newnindices) { llassert(newnverts >= 0); llassert(newnindices >= 0); - updateNumVerts(newnverts); - updateNumIndices(newnindices); + bool sucsess = true; + + sucsess &= updateNumVerts(newnverts); + sucsess &= updateNumIndices(newnindices); - if (useVBOs()) + if (sucsess && useVBOs()) { flush(); @@ -1474,6 +1504,8 @@ void LLVertexBuffer::resizeBuffer(S32 newnverts, S32 newnindices) setupVertexArray(); } } + + return sucsess; } bool LLVertexBuffer::useVBOs() const diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index c05fd01595..bd27296eb6 100644 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -214,12 +214,12 @@ protected: bool bindGLArray(); void releaseBuffer(); void releaseIndices(); - void createGLBuffer(U32 size); - void createGLIndices(U32 size); + bool createGLBuffer(U32 size); + bool createGLIndices(U32 size); void destroyGLBuffer(); void destroyGLIndices(); - void updateNumVerts(S32 nverts); - void updateNumIndices(S32 nindices); + bool updateNumVerts(S32 nverts); + bool updateNumIndices(S32 nindices); void unmapBuffer(); public: @@ -235,8 +235,8 @@ public: virtual void setBuffer(U32 data_mask); // calls setupVertexBuffer() if data_mask is not 0 void flush(); //flush pending data to GL memory // allocate buffer - void allocateBuffer(S32 nverts, S32 nindices, bool create); - virtual void resizeBuffer(S32 newnverts, S32 newnindices); + bool allocateBuffer(S32 nverts, S32 nindices, bool create); + virtual bool resizeBuffer(S32 newnverts, S32 newnindices); // Only call each getVertexPointer, etc, once before calling unmapBuffer() // call unmapBuffer() after calls to getXXXStrider() before any cals to setBuffer() -- cgit v1.2.3 From e848127f232ee902bb7b6b9be5a6aedb68180cac Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Fri, 3 Nov 2017 19:27:09 +0200 Subject: MAINT-7228 Substituted assert with error --- indra/llrender/llvertexbuffer.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'indra/llrender') diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index d4dfb373f0..6de2a973d2 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -1065,7 +1065,14 @@ LLVertexBuffer::~LLVertexBuffer() sVertexCount -= mNumVerts; sIndexCount -= mNumIndices; - llassert_always(!mMappedData && !mMappedIndexData); + if (mMappedData) + { + LL_ERRS() << "Failed to clear vertex buffer's vertices" << LL_ENDL; + } + if (mMappedIndexData) + { + LL_ERRS() << "Failed to clear vertex buffer's indices" << LL_ENDL; + } }; void LLVertexBuffer::placeFence() const -- cgit v1.2.3 From 5a402dbc1f90d3a6fa6a4581cdd7bcf8f0484b8e Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 16 Nov 2017 17:11:48 +0200 Subject: MAINT-7228 Vertex buffer allocation failure handling --- indra/llrender/llvertexbuffer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'indra/llrender') diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 6de2a973d2..0b4427a31a 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -1356,10 +1356,10 @@ bool LLVertexBuffer::allocateBuffer(S32 nverts, S32 nindices, bool create) sucsess &= updateNumVerts(nverts); sucsess &= updateNumIndices(nindices); - if (sucsess && create && (nverts || nindices)) + if (create && (nverts || nindices)) { //actually allocate space for the vertex buffer if using VBO mapping - flush(); + flush(); //unmap if (gGLManager.mHasVertexArrayObject && useVBOs() && sUseVAO) { @@ -1502,9 +1502,9 @@ bool LLVertexBuffer::resizeBuffer(S32 newnverts, S32 newnindices) sucsess &= updateNumVerts(newnverts); sucsess &= updateNumIndices(newnindices); - if (sucsess && useVBOs()) + if (useVBOs()) { - flush(); + flush(); //unmap if (mGLArray) { //if size changed, offsets changed -- cgit v1.2.3