From e394c0623d5b015ba5495b3c80559a7420186c5b Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 12 Feb 2018 19:31:53 +0200 Subject: [PATCH 01/24] MAINT-8146 Remade fix with streams to save memory --- indra/llrender/llfontfreetype.cpp | 114 ++++++++++++++++-------------- indra/llrender/llfontfreetype.h | 9 ++- 2 files changed, 69 insertions(+), 54 deletions(-) diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp index 5c1f4ff8b3..bd2eef7fd3 100644 --- a/indra/llrender/llfontfreetype.cpp +++ b/indra/llrender/llfontfreetype.cpp @@ -31,6 +31,9 @@ // Freetype stuff #include +#ifdef LL_WINDOWS +#include +#endif // For some reason, this won't work if it's not wrapped in the ifdef #ifdef FT_FREETYPE_H @@ -106,8 +109,10 @@ LLFontFreetype::LLFontFreetype() mAscender(0.f), mDescender(0.f), mLineHeight(0.f), - pFontBuffer(NULL), - mBufferSize(0), +#ifdef LL_WINDOWS + pFileStream(NULL), + pFtStream(NULL), +#endif mIsFallback(FALSE), mFTFace(NULL), mRenderGlyphCount(0), @@ -129,12 +134,29 @@ LLFontFreetype::~LLFontFreetype() std::for_each(mCharGlyphInfoMap.begin(), mCharGlyphInfoMap.end(), DeletePairedPointer()); mCharGlyphInfoMap.clear(); +#ifdef LL_WINDOWS + delete pFileStream; // closed by FT_Done_Face + delete pFtStream; +#endif delete mFontBitmapCachep; - delete pFontBuffer; - disclaimMem(mBufferSize); // mFallbackFonts cleaned up by LLPointer destructor } +#ifdef LL_WINDOWS +unsigned long ft_read_cb(FT_Stream stream, unsigned long offset, unsigned char *buffer, unsigned long count) { + if (count <= 0) return count; + llifstream *file_stream = static_cast(stream->descriptor.pointer); + file_stream->seekg(offset, std::ios::beg); + file_stream->read((char*)buffer, count); + return file_stream->gcount(); +} + +void ft_close_cb(FT_Stream stream) { + llifstream *file_stream = static_cast(stream->descriptor.pointer); + file_stream->close(); +} +#endif + BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 vert_dpi, F32 horz_dpi, S32 components, BOOL is_fallback) { // Don't leak face objects. This is also needed to deal with @@ -148,51 +170,37 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 v int error; #ifdef LL_WINDOWS - - if (mBufferSize > 0) + pFileStream = new llifstream(filename, std::ios::binary); + if (pFileStream->is_open()) { - delete pFontBuffer; - disclaimMem(mBufferSize); - pFontBuffer = NULL; - mBufferSize = 0; + std::streampos beg = pFileStream->tellg(); + pFileStream->seekg(0, std::ios::end); + std::streampos end = pFileStream->tellg(); + std::size_t file_size = end - beg; + pFileStream->seekg(0, std::ios::beg); + + pFtStream = new LLFT_Stream(); + pFtStream->base = 0; + pFtStream->pos = 0; + pFtStream->size = file_size; + pFtStream->descriptor.pointer = pFileStream; + pFtStream->read = ft_read_cb; + pFtStream->close = ft_close_cb; + + FT_Open_Args args; + args.flags = FT_OPEN_STREAM; + args.stream = (FT_StreamRec*)pFtStream; + + error = FT_Open_Face(gFTLibrary, + &args, + 0, + &mFTFace); } - - S32 file_size = 0; - LLFILE* file = LLFile::fopen(filename, "rb"); - if (!file) + else { + delete pFileStream; return FALSE; } - - if (!fseek(file, 0, SEEK_END)) - { - file_size = ftell(file); - fseek(file, 0, SEEK_SET); - } - - // Don't delete before FT_Done_Face - pFontBuffer = new(std::nothrow) U8[file_size]; - if (!pFontBuffer) - { - fclose(file); - return FALSE; - } - - mBufferSize = fread(pFontBuffer, 1, file_size, file); - fclose(file); - - if (mBufferSize != file_size) - { - delete pFontBuffer; - mBufferSize = 0; - return FALSE; - } - - error = FT_New_Memory_Face( gFTLibrary, - (FT_Byte*) pFontBuffer, - mBufferSize, - 0, - &mFTFace); #else error = FT_New_Face( gFTLibrary, filename.c_str(), @@ -202,9 +210,11 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 v if (error) { - delete pFontBuffer; - pFontBuffer = NULL; - mBufferSize = 0; +#ifdef LL_WINDOWS + pFileStream->close(); + delete pFileStream; + delete pFtStream; +#endif return FALSE; } @@ -219,17 +229,17 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 v if (error) { +#ifdef LL_WINDOWS + pFileStream->close(); + delete pFileStream; + delete pFtStream; +#endif // Clean up freetype libs. FT_Done_Face(mFTFace); - delete pFontBuffer; - pFontBuffer = NULL; - mBufferSize = 0; mFTFace = NULL; return FALSE; } - claimMem(mBufferSize); - F32 y_max, y_min, x_max, x_min; F32 ems_per_unit = 1.f/ mFTFace->units_per_EM; F32 pixels_per_unit = pixels_per_em * ems_per_unit; diff --git a/indra/llrender/llfontfreetype.h b/indra/llrender/llfontfreetype.h index 26ba695418..aadebf5e70 100644 --- a/indra/llrender/llfontfreetype.h +++ b/indra/llrender/llfontfreetype.h @@ -40,6 +40,8 @@ // We'll forward declare the struct here. JC struct FT_FaceRec_; typedef struct FT_FaceRec_* LLFT_Face; +struct FT_StreamRec_; +typedef struct FT_StreamRec_ LLFT_Stream; class LLFontManager { @@ -158,8 +160,11 @@ private: F32 mLineHeight; LLFT_Face mFTFace; - U8* pFontBuffer; - S32 mBufferSize; + +#ifdef LL_WINDOWS + llifstream *pFileStream; + LLFT_Stream *pFtStream; +#endif BOOL mIsFallback; font_vector_t mFallbackFonts; // A list of fallback fonts to look for glyphs in (for Unicode chars) From 8f65593786a4302a1ef7c95ce048bd658367a220 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 13 Feb 2018 14:45:09 +0200 Subject: [PATCH 02/24] MAINT-8146 Clearing pointers --- indra/llrender/llfontfreetype.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp index bd2eef7fd3..ab668dc192 100644 --- a/indra/llrender/llfontfreetype.cpp +++ b/indra/llrender/llfontfreetype.cpp @@ -199,6 +199,7 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 v else { delete pFileStream; + pFileStream = NULL; return FALSE; } #else @@ -214,6 +215,8 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 v pFileStream->close(); delete pFileStream; delete pFtStream; + pFileStream = NULL; + pFtStream = NULL; #endif return FALSE; } @@ -229,13 +232,15 @@ BOOL LLFontFreetype::loadFace(const std::string& filename, F32 point_size, F32 v if (error) { + // Clean up freetype libs. + FT_Done_Face(mFTFace); #ifdef LL_WINDOWS pFileStream->close(); delete pFileStream; delete pFtStream; + pFileStream = NULL; + pFtStream = NULL; #endif - // Clean up freetype libs. - FT_Done_Face(mFTFace); mFTFace = NULL; return FALSE; } From 23960d2d9491f756bb844529f85a8a612a2ddb90 Mon Sep 17 00:00:00 2001 From: AndreyL ProductEngine Date: Tue, 13 Feb 2018 19:01:07 +0200 Subject: [PATCH 03/24] MAINT-8290 Don't render particles attached to the muted avatars --- indra/newview/llviewerpartsource.cpp | 28 ++++++++++++++++++++++++++++ indra/newview/llviewerpartsource.h | 2 ++ 2 files changed, 30 insertions(+) diff --git a/indra/newview/llviewerpartsource.cpp b/indra/newview/llviewerpartsource.cpp index 814060f4f2..998ae52fe0 100644 --- a/indra/newview/llviewerpartsource.cpp +++ b/indra/newview/llviewerpartsource.cpp @@ -40,6 +40,25 @@ #include "llworld.h" #include "pipeline.h" + +static LLVOAvatar* find_avatar(const LLUUID& id) +{ + LLViewerObject *obj = gObjectList.findObject(id); + while (obj && obj->isAttachment()) + { + obj = (LLViewerObject *)obj->getParent(); + } + + if (obj && obj->isAvatar()) + { + return (LLVOAvatar*)obj; + } + else + { + return NULL; + } +} + LLViewerPartSource::LLViewerPartSource(const U32 type) : mType(type), mOwnerUUID(LLUUID::null), @@ -113,6 +132,15 @@ void LLViewerPartSourceScript::update(const F32 dt) if( mIsSuspended ) return; + if (mOwnerAvatarp.isNull() && mOwnerUUID != LLUUID::null) + { + mOwnerAvatarp = find_avatar(mOwnerUUID); + } + if (mOwnerAvatarp.notNull() && LLVOAvatar::AV_DO_NOT_RENDER == mOwnerAvatarp->getVisualMuteSettings()) + { + return; + } + F32 old_update_time = mLastUpdateTime; mLastUpdateTime += dt; diff --git a/indra/newview/llviewerpartsource.h b/indra/newview/llviewerpartsource.h index 12e926173b..504229e81f 100644 --- a/indra/newview/llviewerpartsource.h +++ b/indra/newview/llviewerpartsource.h @@ -42,6 +42,7 @@ class LLViewerTexture; class LLViewerObject; class LLViewerPart; +class LLVOAvatar; class LLViewerPartSource : public LLRefCount { @@ -85,6 +86,7 @@ protected: F32 mLastUpdateTime; F32 mLastPartTime; LLUUID mOwnerUUID; + LLPointer mOwnerAvatarp; LLPointer mImagep; // Particle information U32 mPartFlags; // Flags for the particle From 52eb540ccad5c1f70e867a5dd3a82c75d574ae5b Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Wed, 14 Feb 2018 11:37:07 +0200 Subject: [PATCH 04/24] MAINT-8287 FIXED [Mac] Crash when creating group role with 'Manage ban list' ability --- indra/llui/llscrolllistctrl.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/indra/llui/llscrolllistctrl.cpp b/indra/llui/llscrolllistctrl.cpp index 7c1f4a4dca..212e27477b 100644 --- a/indra/llui/llscrolllistctrl.cpp +++ b/indra/llui/llscrolllistctrl.cpp @@ -1964,6 +1964,10 @@ BOOL LLScrollListCtrl::handleClick(S32 x, S32 y, MASK mask) LLScrollListCell* cellp = item->getColumn(column_index); cellp->setValue(item_value); cellp->onCommit(); + if (mLastSelected == NULL) + { + break; + } } } //FIXME: find a better way to signal cell changes From 5ab314bb95efa02f50ee1f48bb61c518d185b7ea Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Wed, 14 Feb 2018 17:55:37 +0200 Subject: [PATCH 05/24] MAINT-8289 FIXED Deleting inventory directory while keeping [Delete] key pressed --- indra/llui/lllineeditor.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/llui/lllineeditor.cpp b/indra/llui/lllineeditor.cpp index becb45fa79..bd6b00d38b 100644 --- a/indra/llui/lllineeditor.cpp +++ b/indra/llui/lllineeditor.cpp @@ -1630,12 +1630,12 @@ BOOL LLLineEditor::handleUnicodeCharHere(llwchar uni_char) BOOL LLLineEditor::canDoDelete() const { - return ( !mReadOnly && mText.length() > 0 && (!mPassDelete || (hasSelection() || (getCursor() < mText.length()))) ); + return ( !mReadOnly && (!mPassDelete || (hasSelection() || (getCursor() < mText.length()))) ); } void LLLineEditor::doDelete() { - if (canDoDelete()) + if (canDoDelete() && mText.length() > 0) { // Prepare for possible rollback LLLineEditorRollback rollback( this ); From bbb516c5ae1b86c7f2ed3f2a92c2c177c4e26fd2 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 15 Feb 2018 15:47:31 +0200 Subject: [PATCH 06/24] MAINT-8291 Fixed Scripts memory usage returns incorrect values in estate tools --- indra/newview/llfloatertopobjects.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llfloatertopobjects.cpp b/indra/newview/llfloatertopobjects.cpp index e20360066e..3e6fc3dc0d 100644 --- a/indra/newview/llfloatertopobjects.cpp +++ b/indra/newview/llfloatertopobjects.cpp @@ -236,7 +236,7 @@ void LLFloaterTopObjects::handleReply(LLMessageSystem *msg, void** data) && have_extended_data) { columns[column_num]["column"] = "memory"; - columns[column_num]["value"] = llformat("%0.0f", (script_memory / 1000.f)); + columns[column_num]["value"] = llformat("%0.0f", (script_memory / 1024.f)); columns[column_num++]["font"] = "SANSSERIF"; columns[column_num]["column"] = "URLs"; From 86935443eb6d97bb8b37090417cb2da57c01db82 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Wed, 14 Feb 2018 20:17:55 +0200 Subject: [PATCH 07/24] MAINT-931 Fixed Sitting avatar's rotation is not updated correctly viewer side --- indra/newview/llpanelobject.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp index 73d08ec335..d0dea5d044 100644 --- a/indra/newview/llpanelobject.cpp +++ b/indra/newview/llpanelobject.cpp @@ -1587,9 +1587,14 @@ void LLPanelObject::sendRotation(BOOL btn_down) { rotation = rotation * ~mRootObject->getRotationRegion(); } + + // To include avatars into movements and rotation + // If false, all children are selected anyway - move avatar + // If true, not all children are selected - save positions + bool individual_selection = gSavedSettings.getBOOL("EditLinkedParts"); std::vector& child_positions = mObject->mUnselectedChildrenPositions ; std::vector child_rotations; - if (mObject->isRootEdit()) + if (mObject->isRootEdit() && individual_selection) { mObject->saveUnselectedChildrenRotation(child_rotations) ; mObject->saveUnselectedChildrenPosition(child_positions) ; @@ -1599,8 +1604,8 @@ void LLPanelObject::sendRotation(BOOL btn_down) LLManip::rebuild(mObject) ; // for individually selected roots, we need to counterrotate all the children - if (mObject->isRootEdit()) - { + if (mObject->isRootEdit() && individual_selection) + { mObject->resetChildrenRotationAndPosition(child_rotations, child_positions) ; } From b2f61c0e0b27b9c1dae33a85bfc4db6b3ce95dc0 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Thu, 15 Feb 2018 21:48:18 +0200 Subject: [PATCH 08/24] MAINT-8297 Fixed "Missing CA File" message when running under debugger on windows --- indra/llvfs/lldir_win32.cpp | 2 +- indra/newview/llsechandler_basic.cpp | 2 +- indra/newview/llviewermedia.cpp | 2 +- indra/newview/viewer_manifest.py | 9 +++++++++ 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/indra/llvfs/lldir_win32.cpp b/indra/llvfs/lldir_win32.cpp index c4a4c74d1e..cfbc5803c7 100644 --- a/indra/llvfs/lldir_win32.cpp +++ b/indra/llvfs/lldir_win32.cpp @@ -233,7 +233,7 @@ void LLDir_Win32::initAppDirs(const std::string &app_name, LL_WARNS() << "Couldn't create LL_PATH_CACHE dir " << getExpandedFilename(LL_PATH_CACHE,"") << LL_ENDL; } - mCAFile = getExpandedFilename(LL_PATH_APP_SETTINGS, "ca-bundle.crt"); + mCAFile = gDirUtilp->getExpandedFilename( LL_PATH_EXECUTABLE, "app_settings", "ca-bundle.crt" ); } U32 LLDir_Win32::countFilesInDir(const std::string &dirname, const std::string &mask) diff --git a/indra/newview/llsechandler_basic.cpp b/indra/newview/llsechandler_basic.cpp index 814cfde75d..a1dbbb307b 100644 --- a/indra/newview/llsechandler_basic.cpp +++ b/indra/newview/llsechandler_basic.cpp @@ -1275,7 +1275,7 @@ void LLSecAPIBasicHandler::init() // grab the application ca-bundle.crt file that contains the well-known certs shipped // with the product - std::string ca_file_path = gDirUtilp->getExpandedFilename(LL_PATH_APP_SETTINGS, "ca-bundle.crt"); + std::string ca_file_path = gDirUtilp->getExpandedFilename( LL_PATH_EXECUTABLE, "app_settings", "ca-bundle.crt" ); LL_INFOS("SECAPI") << "Loading application certificate store from " << ca_file_path << LL_ENDL; LLPointer app_ca_store = new LLBasicCertificateStore(ca_file_path); diff --git a/indra/newview/llviewermedia.cpp b/indra/newview/llviewermedia.cpp index 474f3de664..87ee2f4921 100644 --- a/indra/newview/llviewermedia.cpp +++ b/indra/newview/llviewermedia.cpp @@ -2029,7 +2029,7 @@ bool LLViewerMediaImpl::initializePlugin(const std::string& media_type) // the correct way to deal with certs it to load ours from ca-bundle.crt and append them to the ones // Qt/WebKit loads from your system location. - std::string ca_path = gDirUtilp->getExpandedFilename( LL_PATH_APP_SETTINGS, "ca-bundle.crt" ); + std::string ca_path = gDirUtilp->getExpandedFilename( LL_PATH_EXECUTABLE, "app_settings", "ca-bundle.crt" ); media_source->addCertificateFilePath( ca_path ); media_source->proxy_setup(gSavedSettings.getBOOL("BrowserProxyEnabled"), gSavedSettings.getString("BrowserProxyAddress"), gSavedSettings.getS32("BrowserProxyPort")); diff --git a/indra/newview/viewer_manifest.py b/indra/newview/viewer_manifest.py index e823228681..493bfac632 100755 --- a/indra/newview/viewer_manifest.py +++ b/indra/newview/viewer_manifest.py @@ -595,6 +595,9 @@ class WindowsManifest(ViewerManifest): self.path("featuretable.txt") self.path("ca-bundle.crt") + with self.prefix(src=pkgdir,dst="app_settings"): + self.path("ca-bundle.crt") + # Media plugins - CEF with self.prefix(src='../media_plugins/cef/%s' % self.args['configuration'], dst="llplugin"): self.path("media_plugin_cef.dll") @@ -1052,6 +1055,9 @@ open "%s" --args "$@" self.path("SecondLife.nib") self.path("ca-bundle.crt") + with self.prefix(src=pkgdir,dst="app_settings"): + self.path("ca-bundle.crt") + self.path("SecondLife.nib") # Translations @@ -1510,6 +1516,9 @@ class LinuxManifest(ViewerManifest): self.path("featuretable_linux.txt") self.path("ca-bundle.crt") + with self.prefix(src=pkgdir,dst="app_settings"): + self.path("ca-bundle.crt") + def package_finish(self): installer_name = self.installer_base_name() From 06bce2ddd0958cff3c2ee477a880e998dfc48be7 Mon Sep 17 00:00:00 2001 From: "Graham Linden graham@lindenlab.com" Date: Thu, 15 Feb 2018 21:55:24 +0000 Subject: [PATCH 09/24] Add debug setting and code to allow nVidia nSight graphics debugging to capture SL frames. These changes are only enabled if RenderNsightDebugSupport is true and eliminate use of some OpenGL legacy functionality which is incompatible with nSight capture (mostly glReadPixels and other fixed-function pipe rendering calls). --- indra/llappearance/lltexlayer.cpp | 7 +++- indra/llrender/llgl.cpp | 11 ++++++ indra/llrender/llrender.cpp | 1 + indra/llrender/llrender.h | 3 +- indra/llwindow/llwindowwin32.cpp | 5 ++- indra/newview/app_settings/settings.xml | 14 ++++++- indra/newview/llappviewer.cpp | 3 ++ indra/newview/llfasttimerview.cpp | 22 ++++++----- indra/newview/llviewerwindow.cpp | 50 +++++++++++++------------ 9 files changed, 80 insertions(+), 36 deletions(-) diff --git a/indra/llappearance/lltexlayer.cpp b/indra/llappearance/lltexlayer.cpp index 2cf86bb4fe..3f2fcce429 100644 --- a/indra/llappearance/lltexlayer.cpp +++ b/indra/llappearance/lltexlayer.cpp @@ -1577,7 +1577,12 @@ void LLTexLayer::renderMorphMasks(S32 x, S32 y, S32 width, S32 height, const LLC } alpha_data = new U8[width * height]; mAlphaCache[cache_index] = alpha_data; - glReadPixels(x, y, width, height, GL_ALPHA, GL_UNSIGNED_BYTE, alpha_data); + + // nSight doesn't support use of glReadPixels + if (!LLRender::sNsightDebugSupport) + { + glReadPixels(x, y, width, height, GL_ALPHA, GL_UNSIGNED_BYTE, alpha_data); + } } getTexLayerSet()->getAvatarAppearance()->dirtyMesh(); diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 155c2402bd..35b6951779 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -1348,8 +1348,19 @@ void LLGLManager::initExtensions() if (mHasVertexShader) { LL_INFOS() << "initExtensions() VertexShader-related procs..." << LL_ENDL; + + // nSight doesn't support use of ARB funcs that have been normalized in the API + if (!LLRender::sNsightDebugSupport) + { glGetAttribLocationARB = (PFNGLGETATTRIBLOCATIONARBPROC) GLH_EXT_GET_PROC_ADDRESS("glGetAttribLocationARB"); glBindAttribLocationARB = (PFNGLBINDATTRIBLOCATIONARBPROC) GLH_EXT_GET_PROC_ADDRESS("glBindAttribLocationARB"); + } + else + { + glGetAttribLocationARB = (PFNGLGETATTRIBLOCATIONARBPROC)GLH_EXT_GET_PROC_ADDRESS("glGetAttribLocation"); + glBindAttribLocationARB = (PFNGLBINDATTRIBLOCATIONARBPROC)GLH_EXT_GET_PROC_ADDRESS("glBindAttribLocation"); + } + glGetActiveAttribARB = (PFNGLGETACTIVEATTRIBARBPROC) GLH_EXT_GET_PROC_ADDRESS("glGetActiveAttribARB"); glVertexAttrib1dARB = (PFNGLVERTEXATTRIB1DARBPROC) GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib1dARB"); glVertexAttrib1dvARB = (PFNGLVERTEXATTRIB1DVARBPROC) GLH_EXT_GET_PROC_ADDRESS("glVertexAttrib1dvARB"); diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 76f28bb43f..65d6181920 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -49,6 +49,7 @@ U32 LLRender::sUICalls = 0; U32 LLRender::sUIVerts = 0; U32 LLTexUnit::sWhiteTexture = 0; bool LLRender::sGLCoreProfile = false; +bool LLRender::sNsightDebugSupport = false; static const U32 LL_NUM_TEXTURE_LAYERS = 32; static const U32 LL_NUM_LIGHT_UNITS = 8; diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index a67fb8da52..2573129fd3 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -438,7 +438,8 @@ public: static U32 sUICalls; static U32 sUIVerts; static bool sGLCoreProfile; - + static bool sNsightDebugSupport; + private: friend class LLLightState; diff --git a/indra/llwindow/llwindowwin32.cpp b/indra/llwindow/llwindowwin32.cpp index 38f8989797..6e3aba51cf 100644 --- a/indra/llwindow/llwindowwin32.cpp +++ b/indra/llwindow/llwindowwin32.cpp @@ -1549,7 +1549,10 @@ BOOL LLWindowWin32::switchContext(BOOL fullscreen, const LLCoordScreen &size, BO (LLRender::sGLCoreProfile ? " core" : " compatibility") << " context." << LL_ENDL; done = true; - if (LLRender::sGLCoreProfile) + // force sNoFixedFunction iff we're trying to use nsight debugging which does not support many legacy API uses + + // nSight doesn't support use of legacy API funcs in the fixed function pipe + if (LLRender::sGLCoreProfile || LLRender::sNsightDebugSupport) { LLGLSLShader::sNoFixedFunction = true; } diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 3b518515cb..0cce614a1f 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -8631,7 +8631,19 @@ Value 0 - + RenderNsightDebugSupport + + Comment + + Disable features which prevent nVidia nSight from being usable with SL + + Persist + 1 + Type + Boolean + Value + 0 + RenderLocalLights Comment diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index d9273dfcb5..2b0b8064bd 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -583,6 +583,7 @@ static void settings_to_globals() LLSurface::setTextureSize(gSavedSettings.getU32("RegionTextureSize")); LLRender::sGLCoreProfile = gSavedSettings.getBOOL("RenderGLCoreProfile"); + LLRender::sNsightDebugSupport = gSavedSettings.getBOOL("RenderNsightDebugSupport"); LLVertexBuffer::sUseVAO = gSavedSettings.getBOOL("RenderUseVAO"); LLImageGL::sGlobalUseAnisotropic = gSavedSettings.getBOOL("RenderAnisotropic"); LLImageGL::sCompressTextures = gSavedSettings.getBOOL("RenderCompressTextures"); @@ -1100,6 +1101,7 @@ bool LLAppViewer::init() } } +#if LL_RELEASE_FOR_DOWNLOAD char* PARENT = getenv("PARENT"); if (! (PARENT && std::string(PARENT) == "SL_Launcher")) { @@ -1112,6 +1114,7 @@ bool LLAppViewer::init() // him/herself in the foot. LLNotificationsUtil::add("RunLauncher"); } +#endif #if LL_WINDOWS if (gGLManager.mGLVersion < LLFeatureManager::getInstance()->getExpectedGLVersion()) diff --git a/indra/newview/llfasttimerview.cpp b/indra/newview/llfasttimerview.cpp index 9219dd0279..34d0972d72 100644 --- a/indra/newview/llfasttimerview.cpp +++ b/indra/newview/llfasttimerview.cpp @@ -435,18 +435,22 @@ void LLFastTimerView::onClose(bool app_quitting) void saveChart(const std::string& label, const char* suffix, LLImageRaw* scratch) { - //read result back into raw image - glReadPixels(0, 0, 1024, 512, GL_RGB, GL_UNSIGNED_BYTE, scratch->getData()); + // disable use of glReadPixels which messes up nVidia nSight graphics debugging + if (!LLRender::sNsightDebugSupport) + { + //read result back into raw image + glReadPixels(0, 0, 1024, 512, GL_RGB, GL_UNSIGNED_BYTE, scratch->getData()); - //write results to disk - LLPointer result = new LLImagePNG(); - result->encode(scratch, 0.f); + //write results to disk + LLPointer result = new LLImagePNG(); + result->encode(scratch, 0.f); - std::string ext = result->getExtension(); - std::string filename = llformat("%s_%s.%s", label.c_str(), suffix, ext.c_str()); + std::string ext = result->getExtension(); + std::string filename = llformat("%s_%s.%s", label.c_str(), suffix, ext.c_str()); - std::string out_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, filename); - result->save(out_file); + std::string out_file = gDirUtilp->getExpandedFilename(LL_PATH_LOGS, filename); + result->save(out_file); + } } //static diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index c057954606..e0309a4546 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -731,7 +731,8 @@ public: addText(xpos, ypos, "View Matrix"); ypos += y_inc; } - if (gSavedSettings.getBOOL("DebugShowColor")) + // disable use of glReadPixels which messes up nVidia nSight graphics debugging + if (gSavedSettings.getBOOL("DebugShowColor") && !LLRender::sNsightDebugSupport) { U8 color[4]; LLCoordGL coord = gViewerWindow->getCurrentMouse(); @@ -4717,36 +4718,39 @@ BOOL LLViewerWindow::rawSnapshot(LLImageRaw *raw, S32 image_width, S32 image_hei { LLAppViewer::instance()->pingMainloopTimeout("LLViewerWindow::rawSnapshot"); } - - if (type == LLSnapshotModel::SNAPSHOT_TYPE_COLOR) + // disable use of glReadPixels when doing nVidia nSight graphics debugging + if (!LLRender::sNsightDebugSupport) { - glReadPixels( + if (type == LLSnapshotModel::SNAPSHOT_TYPE_COLOR) + { + glReadPixels( subimage_x_offset, out_y + subimage_y_offset, read_width, 1, GL_RGB, GL_UNSIGNED_BYTE, raw->getData() + output_buffer_offset ); - } - else // LLSnapshotModel::SNAPSHOT_TYPE_DEPTH - { - LLPointer depth_line_buffer = new LLImageRaw(read_width, 1, sizeof(GL_FLOAT)); // need to store floating point values - glReadPixels( - subimage_x_offset, out_y + subimage_y_offset, - read_width, 1, - GL_DEPTH_COMPONENT, GL_FLOAT, - depth_line_buffer->getData()// current output pixel is beginning of buffer... - ); - - for (S32 i = 0; i < (S32)read_width; i++) + } + else // LLSnapshotModel::SNAPSHOT_TYPE_DEPTH { - F32 depth_float = *(F32*)(depth_line_buffer->getData() + (i * sizeof(F32))); - - F32 linear_depth_float = 1.f / (depth_conversion_factor_1 - (depth_float * depth_conversion_factor_2)); - U8 depth_byte = F32_to_U8(linear_depth_float, LLViewerCamera::getInstance()->getNear(), LLViewerCamera::getInstance()->getFar()); - // write converted scanline out to result image - for (S32 j = 0; j < raw->getComponents(); j++) + LLPointer depth_line_buffer = new LLImageRaw(read_width, 1, sizeof(GL_FLOAT)); // need to store floating point values + glReadPixels( + subimage_x_offset, out_y + subimage_y_offset, + read_width, 1, + GL_DEPTH_COMPONENT, GL_FLOAT, + depth_line_buffer->getData()// current output pixel is beginning of buffer... + ); + + for (S32 i = 0; i < (S32)read_width; i++) { - *(raw->getData() + output_buffer_offset + (i * raw->getComponents()) + j) = depth_byte; + F32 depth_float = *(F32*)(depth_line_buffer->getData() + (i * sizeof(F32))); + + F32 linear_depth_float = 1.f / (depth_conversion_factor_1 - (depth_float * depth_conversion_factor_2)); + U8 depth_byte = F32_to_U8(linear_depth_float, LLViewerCamera::getInstance()->getNear(), LLViewerCamera::getInstance()->getFar()); + // write converted scanline out to result image + for (S32 j = 0; j < raw->getComponents(); j++) + { + *(raw->getData() + output_buffer_offset + (i * raw->getComponents()) + j) = depth_byte; + } } } } From f6b770d062d4a1c88ada3ddded88bd60168751e7 Mon Sep 17 00:00:00 2001 From: "Graham Linden graham@lindenlab.com" Date: Thu, 15 Feb 2018 23:23:46 +0000 Subject: [PATCH 10/24] Mark RenderNsightDebugSupport as requiring restart (because it does). Remove nerfing of message to run SL_Launcher. --- indra/newview/app_settings/settings.xml | 2 +- indra/newview/llappviewer.cpp | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 0cce614a1f..756e4b6616 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -8635,7 +8635,7 @@ Comment - Disable features which prevent nVidia nSight from being usable with SL + Disable features which prevent nVidia nSight from being usable with SL. Requires restart. Persist 1 diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 2b0b8064bd..a0750214a8 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1101,7 +1101,6 @@ bool LLAppViewer::init() } } -#if LL_RELEASE_FOR_DOWNLOAD char* PARENT = getenv("PARENT"); if (! (PARENT && std::string(PARENT) == "SL_Launcher")) { @@ -1114,7 +1113,6 @@ bool LLAppViewer::init() // him/herself in the foot. LLNotificationsUtil::add("RunLauncher"); } -#endif #if LL_WINDOWS if (gGLManager.mGLVersion < LLFeatureManager::getInstance()->getExpectedGLVersion()) From caa60a57310a01041cca74be789935ae6135f4eb Mon Sep 17 00:00:00 2001 From: "Graham Linden graham@lindenlab.com" Date: Thu, 15 Feb 2018 16:58:44 -0800 Subject: [PATCH 11/24] Fix batch display in avatar render info (%d is not for doubles). --- indra/newview/llviewerwindow.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index e0309a4546..e90b4ac86c 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -614,7 +614,7 @@ public: if (last_frame_recording.getSampleCount(LLPipeline::sStatBatchSize) > 0) { - addText(xpos, ypos, llformat("Batch min/max/mean: %d/%d/%d", last_frame_recording.getMin(LLPipeline::sStatBatchSize), last_frame_recording.getMax(LLPipeline::sStatBatchSize), last_frame_recording.getMean(LLPipeline::sStatBatchSize))); + addText(xpos, ypos, llformat("Batch min/max/mean: %d/%d/%d", (U32)last_frame_recording.getMin(LLPipeline::sStatBatchSize), (U32)last_frame_recording.getMax(LLPipeline::sStatBatchSize), (U32)last_frame_recording.getMean(LLPipeline::sStatBatchSize))); } ypos += y_inc; From f22c1bcf2014346211ecc32c21d48cc88aca8e07 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 19 Feb 2018 21:30:48 +0200 Subject: [PATCH 12/24] MAINT-8022 Handling memory errors in unzip_llsdNavMesh --- indra/llcommon/llsdserialize.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/indra/llcommon/llsdserialize.cpp b/indra/llcommon/llsdserialize.cpp index 580e87954b..26a4967659 100644 --- a/indra/llcommon/llsdserialize.cpp +++ b/indra/llcommon/llsdserialize.cpp @@ -2262,13 +2262,24 @@ LLUZipHelper::EZipRresult LLUZipHelper::unzip_llsd(LLSD& data, std::istream& is, //and trailers are different for the formats. U8* unzip_llsdNavMesh( bool& valid, unsigned int& outsize, std::istream& is, S32 size ) { + if (size == 0) + { + LL_WARNS() << "No data to unzip." << LL_ENDL; + return NULL; + } + U8* result = NULL; U32 cur_size = 0; z_stream strm; const U32 CHUNK = 0x4000; - U8 *in = new U8[size]; + U8 *in = new(std::nothrow) U8[size]; + if (in == NULL) + { + LL_WARNS() << "Memory allocation failure." << LL_ENDL; + return NULL; + } is.read((char*) in, size); U8 out[CHUNK]; From 3e2734ccbc7a47c313bf874c2c91e00f1abab6b1 Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Tue, 20 Feb 2018 17:52:36 +0200 Subject: [PATCH 13/24] MAINT-5165 Hide Inbox and Outbox despite "Show Filters..." settings --- indra/newview/llinventoryfilter.cpp | 2 +- indra/newview/llinventorymodel.cpp | 11 +++++++++++ indra/newview/llinventorymodel.h | 4 +++- 3 files changed, 15 insertions(+), 2 deletions(-) diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 9193613e9f..f64c39c3ad 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -153,7 +153,7 @@ bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const // we're showing all folders, overriding filter if (mFilterOps.mShowFolderState == LLInventoryFilter::SHOW_ALL_FOLDERS) { - return true; + return !gInventory.isCategoryHidden(folder_id); } // when applying a filter, matching folders get their contents downloaded first diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 6a1ec9f991..60f470a938 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -342,6 +342,17 @@ LLViewerInventoryCategory* LLInventoryModel::getCategory(const LLUUID& id) const return category; } +bool LLInventoryModel::isCategoryHidden(const LLUUID& id) const +{ + const LLViewerInventoryCategory* category = getCategory(id); + if (category) + { + LLFolderType::EType cat_type = category->getPreferredType(); + return (cat_type == LLFolderType::FT_INBOX || cat_type == LLFolderType::FT_OUTBOX); + } + return false; +} + S32 LLInventoryModel::getItemCount() const { return mItemMap.size(); diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h index 01e0ed7e9b..576c5e9e20 100644 --- a/indra/newview/llinventorymodel.h +++ b/indra/newview/llinventorymodel.h @@ -316,7 +316,9 @@ public: // Copy content of all folders of type "type" into folder "id" and delete/purge the empty folders // Note : This method has been designed for FT_OUTBOX (aka Merchant Outbox) but can be used for other categories void consolidateForType(const LLUUID& id, LLFolderType::EType type); - + + bool isCategoryHidden(const LLUUID& id) const; + private: mutable LLPointer mLastItem; // cache recent lookups From 71e8aebc736d497a559c7ab399692417ab923c13 Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Tue, 20 Feb 2018 18:31:26 +0200 Subject: [PATCH 14/24] MAINT-6260 Fixed Rezing from trash causes dupes after restart --- indra/newview/lltooldraganddrop.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/indra/newview/lltooldraganddrop.cpp b/indra/newview/lltooldraganddrop.cpp index bd68d8c999..9fb53dc9ab 100644 --- a/indra/newview/lltooldraganddrop.cpp +++ b/indra/newview/lltooldraganddrop.cpp @@ -1278,7 +1278,6 @@ void LLToolDragAndDrop::dropObject(LLViewerObject* raycast_target, if (gInventory.isObjectDescendentOf(item->getUUID(), trash_id)) { is_in_trash = true; - remove_from_inventory = TRUE; } LLUUID source_id = from_task_inventory ? mSourceID : LLUUID::null; @@ -1806,7 +1805,6 @@ EAcceptance LLToolDragAndDrop::dad3dRezObjectOnLand( if(gInventory.isObjectDescendentOf(item->getUUID(), trash_id)) { accept = ACCEPT_YES_SINGLE; - remove_inventory = TRUE; } if(drop) From 2cd1460763090bcf6e7f408caf11c0ecd596520f Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Wed, 21 Feb 2018 15:10:40 +0200 Subject: [PATCH 15/24] MAINT-2564 FIXED Alpha mask does not hide hair in the Outfit Editor --- indra/newview/llpaneleditwearable.cpp | 2 +- indra/newview/llvoavatar.cpp | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/indra/newview/llpaneleditwearable.cpp b/indra/newview/llpaneleditwearable.cpp index a46fb3dfeb..3a8378f8df 100644 --- a/indra/newview/llpaneleditwearable.cpp +++ b/indra/newview/llpaneleditwearable.cpp @@ -1624,7 +1624,7 @@ void LLPanelEditWearable::initPreviousAlphaTextures() initPreviousAlphaTextureEntry(TEX_UPPER_ALPHA); initPreviousAlphaTextureEntry(TEX_HEAD_ALPHA); initPreviousAlphaTextureEntry(TEX_EYES_ALPHA); - initPreviousAlphaTextureEntry(TEX_LOWER_ALPHA); + initPreviousAlphaTextureEntry(TEX_HAIR_ALPHA); } void LLPanelEditWearable::initPreviousAlphaTextureEntry(LLAvatarAppearanceDefines::ETextureIndex te) diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 652a447545..966fe45e34 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -7366,11 +7366,13 @@ void LLVOAvatar::updateMeshTextures() debugColorizeSubMeshes(i,LLColor4::blue); } } + static LLUUID default_alpha_uuid = LLUUID(gSavedSettings.getString("UIImgDefaultAlphaUUID")); + bool hair_alpha_exists = (getImage(TEX_HAIR_ALPHA, 0) && getImage(TEX_HAIR_ALPHA, 0)->getID() != default_alpha_uuid); // set texture and color of hair manually if we are not using a baked image. // This can happen while loading hair for yourself, or for clients that did not // bake a hair texture. Still needed for yourself after 1.22 is depricated. - if (!is_layer_baked[BAKED_HAIR] || isEditingAppearance()) + if (!is_layer_baked[BAKED_HAIR] || (isEditingAppearance() && !hair_alpha_exists)) { const LLColor4 color = mTexHairColor ? mTexHairColor->getColor() : LLColor4(1,1,1,1); LLViewerTexture* hair_img = getImage( TEX_HAIR, 0 ); From e32b4f481a3da183607cfd02f873e41e2a77214e Mon Sep 17 00:00:00 2001 From: andreykproductengine Date: Mon, 19 Feb 2018 21:01:34 +0200 Subject: [PATCH 16/24] MAINT-8308 Additional logging for mesh processing --- indra/llcommon/llsdserialize.cpp | 5 ++- indra/newview/llmeshrepository.cpp | 59 ++++++++++++++++++++---------- indra/newview/llmeshrepository.h | 11 +++++- 3 files changed, 54 insertions(+), 21 deletions(-) diff --git a/indra/llcommon/llsdserialize.cpp b/indra/llcommon/llsdserialize.cpp index 26a4967659..1aaff5628f 100644 --- a/indra/llcommon/llsdserialize.cpp +++ b/indra/llcommon/llsdserialize.cpp @@ -2323,7 +2323,10 @@ U8* unzip_llsdNavMesh( bool& valid, unsigned int& outsize, std::istream& is, S32 U8* new_result = (U8*) realloc(result, cur_size + have); if (new_result == NULL) { - LL_WARNS() << "Failed to unzip LLSD NavMesh block: can't reallocate memory, current size: " << cur_size << " bytes; requested " << cur_size + have << " bytes." << LL_ENDL; + LL_WARNS() << "Failed to unzip LLSD NavMesh block: can't reallocate memory, current size: " << cur_size + << " bytes; requested " << cur_size + have + << " bytes; total syze: ." << size << " bytes." + << LL_ENDL; inflateEnd(&strm); if (result) { diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index fdaa28b22b..69e69b134a 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -1618,7 +1618,7 @@ bool LLMeshRepoThread::fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod) if (!zero) { //attempt to parse - if (lodReceived(mesh_params, lod, buffer, size)) + if (lodReceived(mesh_params, lod, buffer, size) == MESH_OK) { delete[] buffer; return true; @@ -1734,11 +1734,11 @@ bool LLMeshRepoThread::headerReceived(const LLVolumeParams& mesh_params, U8* dat return true; } -bool LLMeshRepoThread::lodReceived(const LLVolumeParams& mesh_params, S32 lod, U8* data, S32 data_size) +EMeshProcessingResult LLMeshRepoThread::lodReceived(const LLVolumeParams& mesh_params, S32 lod, U8* data, S32 data_size) { if (data == NULL || data_size == 0) { - return false; + return MESH_NO_DATA; } LLPointer volume = new LLVolume(mesh_params, LLVolumeLODGroup::getVolumeScaleFromDetail(lod)); @@ -1751,7 +1751,7 @@ bool LLMeshRepoThread::lodReceived(const LLVolumeParams& mesh_params, S32 lod, U catch (std::bad_alloc) { // out of memory, we won't be able to process this mesh - return false; + return MESH_OUT_OF_MEMORY; } if (volume->unpackVolumeFaces(stream, data_size)) @@ -1763,11 +1763,11 @@ bool LLMeshRepoThread::lodReceived(const LLVolumeParams& mesh_params, S32 lod, U LLMutexLock lock(mMutex); mLoadedQ.push(mesh); } - return true; + return MESH_OK; } } - return false; + return MESH_UNKNOWN; } bool LLMeshRepoThread::skinInfoReceived(const LLUUID& mesh_id, U8* data, S32 data_size) @@ -2952,6 +2952,11 @@ void LLMeshHandlerBase::onCompleted(LLCore::HttpHandle handle, LLCore::HttpRespo body->read(body_offset, (char *) data, data_size - body_offset); LLMeshRepository::sBytesReceived += data_size; } + else + { + LL_WARNS(LOG_MESH) << "Failed to allocate " << data_size - body_offset << " memory for mesh response" << LL_ENDL; + processFailure(LLCore::HttpStatus(LLCore::HttpStatus::LLCORE, LLCore::HE_BAD_ALLOC)); + } } processData(body, body_offset, data, data_size - body_offset); @@ -3127,27 +3132,43 @@ void LLMeshLODHandler::processData(LLCore::BufferArray * /* body */, S32 /* body U8 * data, S32 data_size) { if ((!MESH_LOD_PROCESS_FAILED) - && ((data != NULL) == (data_size > 0)) // if we have data but no size or have size but no data, something is wrong - && gMeshRepo.mThread->lodReceived(mMeshParams, mLOD, data, data_size)) + && ((data != NULL) == (data_size > 0))) // if we have data but no size or have size but no data, something is wrong { - // good fetch from sim, write to VFS for caching - LLVFile file(gVFS, mMeshParams.getSculptID(), LLAssetType::AT_MESH, LLVFile::WRITE); - - S32 offset = mOffset; - S32 size = mRequestedBytes; - - if (file.getSize() >= offset+size) + EMeshProcessingResult result = gMeshRepo.mThread->lodReceived(mMeshParams, mLOD, data, data_size); + if (result == MESH_OK) { - file.seek(offset); - file.write(data, size); - LLMeshRepository::sCacheBytesWritten += size; - ++LLMeshRepository::sCacheWrites; + // good fetch from sim, write to VFS for caching + LLVFile file(gVFS, mMeshParams.getSculptID(), LLAssetType::AT_MESH, LLVFile::WRITE); + + S32 offset = mOffset; + S32 size = mRequestedBytes; + + if (file.getSize() >= offset+size) + { + file.seek(offset); + file.write(data, size); + LLMeshRepository::sCacheBytesWritten += size; + ++LLMeshRepository::sCacheWrites; + } + } + else + { + LL_WARNS(LOG_MESH) << "Error during mesh LOD processing. ID: " << mMeshParams.getSculptID() + << ", Reason: " << result + << " LOD: " << mLOD + << " Data size: " << data_size + << " Not retrying." + << LL_ENDL; + LLMutexLock lock(gMeshRepo.mThread->mMutex); + gMeshRepo.mThread->mUnavailableQ.push(LLMeshRepoThread::LODRequest(mMeshParams, mLOD)); } } else { LL_WARNS(LOG_MESH) << "Error during mesh LOD processing. ID: " << mMeshParams.getSculptID() << ", Unknown reason. Not retrying." + << " LOD: " << mLOD + << " Data size: " << data_size << LL_ENDL; LLMutexLock lock(gMeshRepo.mThread->mMutex); gMeshRepo.mThread->mUnavailableQ.push(LLMeshRepoThread::LODRequest(mMeshParams, mLOD)); diff --git a/indra/newview/llmeshrepository.h b/indra/newview/llmeshrepository.h index 23af837f6f..e07a00bf03 100644 --- a/indra/newview/llmeshrepository.h +++ b/indra/newview/llmeshrepository.h @@ -51,6 +51,15 @@ class LLCondition; class LLVFS; class LLMeshRepository; +typedef enum e_mesh_processing_result_enum +{ + MESH_OK = 0, + MESH_NO_DATA = 1, + MESH_OUT_OF_MEMORY, + MESH_HTTP_REQUEST_FAILED, + MESH_UNKNOWN +} EMeshProcessingResult; + class LLMeshUploadData { public: @@ -298,7 +307,7 @@ public: bool fetchMeshHeader(const LLVolumeParams& mesh_params); bool fetchMeshLOD(const LLVolumeParams& mesh_params, S32 lod); bool headerReceived(const LLVolumeParams& mesh_params, U8* data, S32 data_size); - bool lodReceived(const LLVolumeParams& mesh_params, S32 lod, U8* data, S32 data_size); + EMeshProcessingResult lodReceived(const LLVolumeParams& mesh_params, S32 lod, U8* data, S32 data_size); bool skinInfoReceived(const LLUUID& mesh_id, U8* data, S32 data_size); bool decompositionReceived(const LLUUID& mesh_id, U8* data, S32 data_size); bool physicsShapeReceived(const LLUUID& mesh_id, U8* data, S32 data_size); From 2a359ac282a8daf26cac10bd697031f44152808c Mon Sep 17 00:00:00 2001 From: maxim_productengine Date: Wed, 21 Feb 2018 16:01:40 +0200 Subject: [PATCH 17/24] MAINT-8315 Move purchase button to avoid overlapping --- .../skins/default/xui/en/floater_buy_land.xml | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/indra/newview/skins/default/xui/en/floater_buy_land.xml b/indra/newview/skins/default/xui/en/floater_buy_land.xml index 22cc058e46..9fe56e447e 100644 --- a/indra/newview/skins/default/xui/en/floater_buy_land.xml +++ b/indra/newview/skins/default/xui/en/floater_buy_land.xml @@ -702,16 +702,6 @@ This parcel is 512 m² of land. right="400"> You have L$ 2,100. -