diff --git a/indra/llcommon/fstelemetry.h b/indra/llcommon/fstelemetry.h index 87ec75b00a..9a0cdd5e18 100644 --- a/indra/llcommon/fstelemetry.h +++ b/indra/llcommon/fstelemetry.h @@ -45,6 +45,7 @@ #define FSZoneNC( name, color ) ZoneNamedNC( ___tracy_scoped_zone, name, color, FSTelemetry::active) #define FSPlot( name, value ) TracyPlot( name, value) #define FSFrameMark FrameMark +#define FSThreadName( name ) tracy::SetThreadName( name ) #define FSTelemetryIsConnected TracyIsConnected #else // (no telemetry) @@ -58,6 +59,7 @@ #define FSZoneNC( name, color ) #define FSPlot( name, value ) #define FSFrameMark +#define FSThreadName( name ) #define FSTelemetryIsConnected #endif // TRACY_ENABLE diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp index e58baba304..a56c3f7a51 100644 --- a/indra/llcommon/llthread.cpp +++ b/indra/llcommon/llthread.cpp @@ -35,6 +35,7 @@ #include "lltrace.h" #include "lltracethreadrecorder.h" #include "llexception.h" +#include "fstelemetry.h" // allow thread naming #if LL_LINUX #include @@ -140,7 +141,10 @@ void LLThread::threadRun() // for now, hard code all LLThreads to report to single master thread recorder, which is known to be running on main thread mRecorder = new LLTrace::ThreadRecorder(*LLTrace::get_master_thread_recorder()); - + // - Add threadnames to telemetry + LL_INFOS("THREAD") << "Started thread " << mName << LL_ENDL; + FSThreadName( mName.c_str() ); + // // Run the user supplied function do { diff --git a/indra/llfilesystem/lldiskcache.h b/indra/llfilesystem/lldiskcache.h index f2cc53d025..42a02a68e4 100644 --- a/indra/llfilesystem/lldiskcache.h +++ b/indra/llfilesystem/lldiskcache.h @@ -197,7 +197,7 @@ class LLDiskCache : class FSPurgeDiskCacheThread : public LLThread { public: - FSPurgeDiskCacheThread::FSPurgeDiskCacheThread(); + FSPurgeDiskCacheThread(); protected: void run() override; diff --git a/indra/llimage/llimageworker.cpp b/indra/llimage/llimageworker.cpp index 0f44df12f2..468140e408 100644 --- a/indra/llimage/llimageworker.cpp +++ b/indra/llimage/llimageworker.cpp @@ -25,7 +25,7 @@ */ #include "linden_common.h" - +#include "fstelemetry.h" // add telemetry support. #include "llimageworker.h" #include "llimagedxt.h" @@ -135,7 +135,12 @@ LLImageDecodeThread::~LLImageDecodeThread() // virtual S32 LLImageDecodeThread::update(F32 max_time_ms) { + FSZoneC(tracy::Color::Blue); // instrument image decodes LLMutexLock lock(mCreationMutex); + // instrument image decodes + { + FSZoneC(tracy::Color::Blue1); + // for (creation_list_t::iterator iter = mCreationList.begin(); iter != mCreationList.end(); ++iter) { @@ -155,16 +160,49 @@ S32 LLImageDecodeThread::update(F32 max_time_ms) } } mCreationList.clear(); + // instrument image decodes + } + { + FSZoneC(tracy::Color::Blue2); + // S32 res = LLQueuedThread::update(max_time_ms); + // FSPlot("img_decode_pending", (int64_t)res); // instrument image decodes return res; + } // instrument image decodes } LLImageDecodeThread::handle_t LLImageDecodeThread::decodeImage(LLImageFormatted* image, U32 priority, S32 discard, BOOL needs_aux, Responder* responder) { - LLMutexLock lock(mCreationMutex); + FSZoneC(tracy::Color::Orange); // instrument the image decode pipeline + // De-couple texture threading from mainloop + // LLMutexLock lock(mCreationMutex); + // handle_t handle = generateHandle(); + // mCreationList.push_back(creation_info(handle, image, priority, discard, needs_aux, responder)); handle_t handle = generateHandle(); - mCreationList.push_back(creation_info(handle, image, priority, discard, needs_aux, responder)); + // If we have a thread pool dispatch this directly. + // Note: addRequest could cause the handling to take place on the fetch thread, this is unlikely to be an issue. + // if this is an actual problem we move the fallback to here and place the unfulfilled request into the legacy queue + if (s_ChildThreads > 0) + { + FSZoneNC("DecodeDecoupled", tracy::Color::Orange); // instrument the image decode pipeline + ImageRequest* req = new ImageRequest(handle, image, + priority, discard, needs_aux, + responder, this); + bool res = addRequest(req); + if (!res) + { + LL_WARNS() << "Decode request not added because we are exiting." << LL_ENDL; + return 0; + } + } + else + { + FSZoneNC("DecodeQueued", tracy::Color::Orange); // instrument the image decode pipeline + LLMutexLock lock(mCreationMutex); + mCreationList.push_back(creation_info(handle, image, priority, discard, needs_aux, responder)); + } + // return handle; } @@ -230,10 +268,19 @@ bool LLImageDecodeThread::ImageRequest::processRequest() bool LLImageDecodeThread::ImageRequest::processRequestIntern() { - const F32 decode_time_slice = .1f; + // allow longer timeout for async and add instrumentation + // const F32 decode_time_slice = .1f; + FSZoneC(tracy::Color::DarkOrange); + F32 decode_time_slice = .1f; + if(mFlags & FLAG_ASYNC) + { + decode_time_slice = 10.0f;// long time out as this is not an issue with async + } + // bool done = true; if (!mDecodedRaw && mFormattedImage.notNull()) { + FSZoneC(tracy::Color::DarkOrange1); // instrument the image decode pipeline // Decode primary channels if (mDecodedImageRaw.isNull()) { @@ -272,6 +319,7 @@ bool LLImageDecodeThread::ImageRequest::processRequestIntern() } if (done && mNeedsAux && !mDecodedAux && mFormattedImage.notNull()) { + FSZoneC(tracy::Color::DarkOrange2); // instrument the image decode pipeline // Decode aux channel if (!mDecodedImageAux) { @@ -282,7 +330,12 @@ bool LLImageDecodeThread::ImageRequest::processRequestIntern() done = mFormattedImage->decodeChannels(mDecodedImageAux, decode_time_slice, 4, 4); // 1ms mDecodedAux = done && mDecodedImageAux->getData(); } - + // report timeout on async thread (which leads to worker abort errors) + if(!done) + { + LL_WARNS("ImageDecode") << "Image decoding failed to complete with time slice=" << decode_time_slice << LL_ENDL; + } + // // Image thread pool from CoolVL if (mFlags & FLAG_ASYNC) { diff --git a/indra/llimagej2coj/llimagej2coj.cpp b/indra/llimagej2coj/llimagej2coj.cpp index 0e605cf8b2..f46bcacb64 100644 --- a/indra/llimagej2coj/llimagej2coj.cpp +++ b/indra/llimagej2coj/llimagej2coj.cpp @@ -25,6 +25,7 @@ */ #include "linden_common.h" +#include "fstelemetry.h" // instrument image decodes #include "llimagej2coj.h" #define OPENJPEG2 @@ -258,10 +259,11 @@ bool LLImageJ2COJ::initEncode(LLImageJ2C &base, LLImageRaw &raw_image, int block bool LLImageJ2COJ::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decode_time, S32 first_channel, S32 max_channel_count) { // texture comment metadata reader + FSZone; // instrument image decodes U8* c_data = base.getData(); S32 c_size = base.getDataSize(); S32 position = 0; - + while (position < 1024 && position < (c_size - 7)) // the comment field should be in the first 1024 bytes. { if (c_data[position] == 0xff && c_data[position + 1] == 0x64) diff --git a/indra/llkdu/llimagej2ckdu.cpp b/indra/llkdu/llimagej2ckdu.cpp index 300a60c551..e1e7863cca 100644 --- a/indra/llkdu/llimagej2ckdu.cpp +++ b/indra/llkdu/llimagej2ckdu.cpp @@ -32,7 +32,7 @@ #include "llpointer.h" #include "llmath.h" #include "llkdumem.h" - +#include "fstelemetry.h" // instrument image decodes #define kdu_xxxx "kdu_block_coding.h" #include "include_kdu_xxxx.h" @@ -287,6 +287,7 @@ void transfer_bytes(kdu_byte *dest, kdu_line_buf &src, int gap, int precision); // as well, when that still existed, with keep_codestream true and MODE_FAST. void LLImageJ2CKDU::setupCodeStream(LLImageJ2C &base, bool keep_codestream, ECodeStreamMode mode) { + FSZone; // instrument image decodes S32 data_size = base.getDataSize(); S32 max_bytes = (base.getMaxBytes() ? base.getMaxBytes() : data_size); @@ -436,6 +437,7 @@ bool LLImageJ2CKDU::initEncode(LLImageJ2C &base, LLImageRaw &raw_image, int bloc // decodeImpl() usage matters for production. bool LLImageJ2CKDU::initDecode(LLImageJ2C &base, LLImageRaw &raw_image, F32 decode_time, ECodeStreamMode mode, S32 first_channel, S32 max_channel_count, int discard_level, int* region) { + FSZone; // instrument image decodes base.resetLastError(); // *FIX: kdu calls our callback function if there's an error, and then bombs. @@ -519,6 +521,7 @@ bool LLImageJ2CKDU::initDecode(LLImageJ2C &base, LLImageRaw &raw_image, F32 deco // Returns true to mean done, whether successful or not. bool LLImageJ2CKDU::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decode_time, S32 first_channel, S32 max_channel_count) { + FSZone; // instrument image decodes ECodeStreamMode mode = MODE_FAST; LLTimer decode_timer; diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index a2596335c2..ef008e0a81 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -1220,7 +1220,13 @@ bool LLModel::isMaterialListSubset( LLModel* ref ) { int refCnt = ref->mMaterialList.size(); int modelCnt = mMaterialList.size(); - + // FIRE-30965 Cleanup braindead mesh parsing error handlers + if(modelCnt > refCnt) + { + // this model cannot be a strict subset if it has more materials than the reference + return FALSE; + } + // for (U32 src = 0; src < modelCnt; ++src) { bool foundRef = false; @@ -1264,77 +1270,80 @@ bool LLModel::needToAddFaces( LLModel* ref, int& refFaceCnt, int& modelFaceCnt ) return changed; } -bool LLModel::matchMaterialOrder(LLModel* ref, int& refFaceCnt, int& modelFaceCnt ) -{ - //Is this a subset? - //LODs cannot currently add new materials, e.g. - //1. ref = a,b,c lod1 = d,e => This is not permitted - //2. ref = a,b,c lod1 = c => This would be permitted +// FIRE-30965 Improve mesh upload error handling +// function moved to llmodelpreview +// bool LLModel::matchMaterialOrder(LLModel* ref, int& refFaceCnt, int& modelFaceCnt ) +// { +// //Is this a subset? +// //LODs cannot currently add new materials, e.g. +// //1. ref = a,b,c lod1 = d,e => This is not permitted +// //2. ref = a,b,c lod1 = c => This would be permitted - bool isASubset = isMaterialListSubset( ref ); - if ( !isASubset ) - { - LL_INFOS("MESHSKININFO")<<"Material of model is not a subset of reference."< ref->mMaterialList.size()) - { - LL_INFOS("MESHSKININFO") << "Material of model has more materials than a reference." << LL_ENDL; - // We passed isMaterialListSubset, so materials are a subset, but subset isn't supposed to be - // larger than original and if we keep going, reordering will cause a crash - return false; - } +// if (mMaterialList.size() > ref->mMaterialList.size()) +// { +// LL_INFOS("MESHSKININFO") << "Material of model has more materials than a reference." << LL_ENDL; +// // We passed isMaterialListSubset, so materials are a subset, but subset isn't supposed to be +// // larger than original and if we keep going, reordering will cause a crash +// return false; +// } - std::map index_map; +// std::map index_map; - //build a map of material slot names to face indexes - bool reorder = false; +// //build a map of material slot names to face indexes +// bool reorder = false; - std::set base_mat; - std::set cur_mat; +// std::set base_mat; +// std::set cur_mat; - for (U32 i = 0; i < mMaterialList.size(); i++) - { - index_map[ref->mMaterialList[i]] = i; - //if any material name does not match reference, we need to reorder - reorder |= ref->mMaterialList[i] != mMaterialList[i]; - base_mat.insert(ref->mMaterialList[i]); - cur_mat.insert(mMaterialList[i]); - } +// for (U32 i = 0; i < mMaterialList.size(); i++) +// { +// index_map[ref->mMaterialList[i]] = i; +// //if any material name does not match reference, we need to reorder +// reorder |= ref->mMaterialList[i] != mMaterialList[i]; +// base_mat.insert(ref->mMaterialList[i]); +// cur_mat.insert(mMaterialList[i]); +// } - if (reorder && (base_mat == cur_mat)) //don't reorder if material name sets don't match - { - std::vector new_face_list; - new_face_list.resize(mMaterialList.size()); +// if (reorder && (base_mat == cur_mat)) //don't reorder if material name sets don't match +// { +// std::vector new_face_list; +// new_face_list.resize(mMaterialList.size()); - std::vector new_material_list; - new_material_list.resize(mMaterialList.size()); +// std::vector new_material_list; +// new_material_list.resize(mMaterialList.size()); - //rebuild face list so materials have the same order - //as the reference model - for (U32 i = 0; i < mMaterialList.size(); ++i) - { - U32 ref_idx = index_map[mMaterialList[i]]; +// //rebuild face list so materials have the same order +// //as the reference model +// for (U32 i = 0; i < mMaterialList.size(); ++i) +// { +// U32 ref_idx = index_map[mMaterialList[i]]; - if (i < mVolumeFaces.size()) - { - new_face_list[ref_idx] = mVolumeFaces[i]; - } - new_material_list[ref_idx] = mMaterialList[i]; - } +// if (i < mVolumeFaces.size()) +// { +// new_face_list[ref_idx] = mVolumeFaces[i]; +// } +// new_material_list[ref_idx] = mMaterialList[i]; +// } - llassert(new_material_list == ref->mMaterialList); +// llassert(new_material_list == ref->mMaterialList); - mVolumeFaces = new_face_list; +// mVolumeFaces = new_face_list; - //override material list with reference model ordering - mMaterialList = ref->mMaterialList; - } +// //override material list with reference model ordering +// mMaterialList = ref->mMaterialList; +// } - return true; -} +// return true; +// } +// bool LLModel::loadSkinInfo(LLSD& header, std::istream &is) { diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h index c2a5389b6c..d77a13f145 100644 --- a/indra/llprimitive/llmodel.h +++ b/indra/llprimitive/llmodel.h @@ -187,7 +187,7 @@ public: //reorder face list based on mMaterialList in this and reference so //order matches that of reference (material ordering touchup) - bool matchMaterialOrder(LLModel* ref, int& refFaceCnt, int& modelFaceCnt ); + // bool matchMaterialOrder(LLModel* ref, int& refFaceCnt, int& modelFaceCnt ); // FIRE-30965 error handling improvements (function relocated) bool isMaterialListSubset( LLModel* ref ); bool needToAddFaces( LLModel* ref, int& refFaceCnt, int& modelFaceCnt ); diff --git a/indra/llprimitive/llmodelloader.h b/indra/llprimitive/llmodelloader.h index 0bd7a05217..20278dcdb5 100644 --- a/indra/llprimitive/llmodelloader.h +++ b/indra/llprimitive/llmodelloader.h @@ -87,7 +87,7 @@ public: DONE, WARNING_BIND_SHAPE_ORIENTATION, ERROR_PARSING, //basically loading failed - ERROR_MATERIALS, + ERROR_MATERIALS_NOT_A_SUBSET, // FIRE-30965 - better error differentiation ERROR_PASSWORD_REQUIRED, ERROR_NEED_MORE_MEMORY, ERROR_INVALID_FILE, @@ -96,6 +96,7 @@ public: ERROR_OUT_OF_RANGE, ERROR_FILE_VERSION_INVALID, ERROR_LOD_MODEL_MISMATCH, // clean up and improve error reporting + ERROR_HIGH_LOD_MODEL_MISSING, // clean up and improve error reporting ERROR_MODEL // this error should always be last in this list, error code is passed as ERROR_MODEL+error_code } eLoadState; diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 6a168fa017..366d1c158c 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -25672,5 +25672,27 @@ Change of this parameter will affect the layout of buttons in notification toast Value 1 + FSAutoUnmuteSounds + + Comment + If Sound Effects are muted, unmute on TP. Default (false) + Persist + 1 + Type + Boolean + Value + 0 + + FSAutoUnmuteAmbient + + Comment + If Ambient sounds are muted, unmute on TP. Default (false) + Persist + 1 + Type + Boolean + Value + 0 + diff --git a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl index 4bb588335a..3945160db6 100644 --- a/indra/newview/app_settings/shaders/class1/objects/previewV.glsl +++ b/indra/newview/app_settings/shaders/class1/objects/previewV.glsl @@ -25,6 +25,7 @@ uniform mat3 normal_matrix; uniform mat4 texture_matrix0; +uniform vec4 ambient_color; // add ambient color to preview shader uniform mat4 modelview_matrix; uniform mat4 modelview_projection_matrix; @@ -87,7 +88,7 @@ void main() vec3 norm = normalize(normal_matrix * normal); - vec4 col = vec4(0,0,0,1); + vec4 col = ambient_color; // add ambient color to preview shader // Collect normal lights (need to be divided by two, as we later multiply by 2) col.rgb += light_diffuse[1].rgb * calcDirectionalLight(norm, light_position[1].xyz); diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index d1a29351a6..dd217c2003 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -1879,8 +1879,13 @@ bool LLAppViewer::doFrame() S32 work_pending = 0; S32 io_pending = 0; F32 max_time = llmin(gFrameIntervalSeconds.value() *10.f, 1.f); - + // instrument image decodes + { + FSZoneN("updateTextureThreads"); + // FSPlot("max_time_ms",max_time); + // work_pending += updateTextureThreads(max_time); + } // instrument image decodes { LL_RECORD_BLOCK_TIME(FTM_LFS); @@ -3827,6 +3832,7 @@ LLSD LLAppViewer::getViewerInfo() const // CPU info["CPU"] = gSysCPU.getCPUString(); info["MEMORY_MB"] = LLSD::Integer(gSysMemory.getPhysicalMemoryKB().valueInUnits()); + info["CONCURRENCY"] = LLSD::Integer((S32)boost::thread::hardware_concurrency()); // Add hardware concurrency to info // Moved hack adjustment to Windows memory size into llsys.cpp info["OS_VERSION"] = LLOSInfo::instance().getOSString(); info["GRAPHICS_CARD_VENDOR"] = ll_safe_string((const char*)(glGetString(GL_VENDOR))); diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp index 31867a5f70..78ab6ae055 100644 --- a/indra/newview/llfloatermodelpreview.cpp +++ b/indra/newview/llfloatermodelpreview.cpp @@ -864,7 +864,7 @@ void LLFloaterModelPreview::draw() if (!mModelPreview->mLoading) { - if ( mModelPreview->getLoadState() == LLModelLoader::ERROR_MATERIALS ) + if ( mModelPreview->getLoadState() == LLModelLoader::ERROR_MATERIALS_NOT_A_SUBSET )// Improve error reporting { // cleanup/improve errors - this error is effectively duplicated, the unused one was actually better // childSetTextArg("status", "[STATUS]", getString("status_material_mismatch")); diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index d3cc03914f..e8542dcaf6 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -2234,6 +2234,22 @@ bool LLInventoryModel::loadSkeleton( LLFile::remove(inventory_filename); } + // also delete library cache if inventory cache is purged, so issues with EEP settings going missing + // and bridge objects not being found can be resolved + inventory_filename = getInvCacheAddres(ALEXANDRIA_LINDEN_ID); + if (LLFile::isfile(inventory_filename)) + { + LL_INFOS("LLInventoryModel") << "Purging library cache file: " << inventory_filename << LL_ENDL; + LLFile::remove(inventory_filename); + } + + inventory_filename.append(".gz"); + if (LLFile::isfile(inventory_filename)) + { + LL_INFOS("LLInventoryModel") << "Purging library cache file: " << inventory_filename << LL_ENDL; + LLFile::remove(inventory_filename); + } + LL_INFOS("LLInventoryModel") << "Clear inventory cache marker removed: " << delete_cache_marker << LL_ENDL; LLFile::remove(delete_cache_marker); } diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index c6b41ca2c0..83e4fe3326 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -368,6 +368,118 @@ U32 LLModelPreview::calcResourceCost() return (U32)streaming_cost; } +// relocate from llmodel and rewrite so it does what it is meant to +// Material matching should work as the comment below states (subsets are allowed) +// prior to this a mess in multiple places meant that all LODs are forced to carry unwanted triangles for unused materials +bool LLModelPreview::matchMaterialOrder(LLModel* lod, LLModel* ref, int& refFaceCnt, int& modelFaceCnt ) +{ + //Is this a subset? + //LODs cannot currently add new materials, e.g. + //1. ref = a,b,c lod1 = d,e => This is not permitted + //2. ref = a,b,c lod1 = c => This would be permitted + + LL_INFOS("MESHSKININFO") << "In matchMaterialOrder." << LL_ENDL; + bool isASubset = lod->isMaterialListSubset( ref ); + if ( !isASubset ) + { + LL_INFOS("MESHSKININFO")<<"Material of model is not a subset of reference."<getName() << "'s materials are not a subset of the High LOD (reference) model " << ref->getName(); + LL_INFOS() << out.str() << LL_ENDL; + LLFloaterModelPreview::addStringToLog(out, true); + return false; + } + + LL_DEBUGS("MESHSKININFO") << "subset check passed." << LL_ENDL; + std::map index_map; + + //build a map of material slot names to face indexes + bool reorder = false; + auto max_lod_mats = lod->mMaterialList.size(); + + for ( U32 i = 0; i < ref->mMaterialList.size(); i++ ) + { + // create the reference map for later + index_map[ref->mMaterialList[i]] = i; + LL_DEBUGS("MESHSKININFO") << "setting reference material " << ref->mMaterialList[i] << " as index " << i << LL_ENDL; + if( i >= max_lod_mats || lod->mMaterialList[i] != ref->mMaterialList[i] ) + { + // i is already out of range of the original material sets in this LOD OR is not matching. + LL_DEBUGS("MESHSKININFO") << "mismatch at " << i << " " << ref->mMaterialList[i] + << " != " << ((i >= max_lod_mats)? "Out-of-range":lod->mMaterialList[i]) << LL_ENDL; + // we have a misalignment/ordering + // check that ref[i] is in cur and if not add a blank + U32 j{0}; + for ( ; j < max_lod_mats; j++ ) + { + if( i != j && lod->mMaterialList[j] == ref->mMaterialList[i] ) + { + LL_DEBUGS("MESHSKININFO") << "material " << ref->mMaterialList[i] + << " found at " << j << LL_ENDL; + // we found it but in the wrong place. + reorder = true; + break; + } + } + if( j >= max_lod_mats ) + { + std::ostringstream out; + out << "material " << ref->mMaterialList[i] + << " not found in lod adding placeholder"; + LL_DEBUGS("MESHSKININFO") << out.str() << LL_ENDL; + if (mImporterDebug) + { + LLFloaterModelPreview::addStringToLog(out, false); + } + // The material is not in the submesh, add a placeholder. + // this is appended to the existing data so we'll need to reorder + // Note that this placeholder will be eliminated on the writeData (upload) and replaced with + // "NoGeometry" in the LLSD + reorder = true; + LLVolumeFace face; + + face.resizeIndices(3); + face.resizeVertices(1); + face.mPositions->clear(); + face.mNormals->clear(); + face.mTexCoords->setZero(); + memset(face.mIndices, 0, sizeof(U16)*3); + lod->addFace(face); + lod->mMaterialList.push_back( ref->mMaterialList[i] ); + } + } + //if any material name does not match reference, we need to reorder + } + LL_DEBUGS("MESHSKININFO") << "finished parsing materials" << LL_ENDL; + for ( U32 i = 0; i < lod->mMaterialList.size(); i++ ) + { + LL_DEBUGS("MESHSKININFO") << "lod material " << lod->mMaterialList[i] << " has index " << i << LL_ENDL; + } + // Sanity check. We have added placeholders for any mats in ref that are not in this. + // the mat count MUST be equal now. + if (lod->mMaterialList.size() != ref->mMaterialList.size()) + { + std::ostringstream out; + out << "Material of LOD model " << lod->getName() << " has more materials than the reference " << ref->getName() << "."; + LL_INFOS("MESHSKININFO") << out.str() << LL_ENDL; + LLFloaterModelPreview::addStringToLog(out, true); + return false; + } + + + // Fix up material matching badness + // if (reorder && (base_mat == cur_mat)) //don't reorder if material name sets don't match + if ( reorder ) + { + LL_INFOS("MESHSKININFO") << "re-ordering." << LL_ENDL; + lod->sortVolumeFacesByMaterialName(); + lod->mMaterialList = ref->mMaterialList; + } + + return true; +} +// + void LLModelPreview::rebuildUploadData() { assert_main_thread(); @@ -582,7 +694,7 @@ void LLModelPreview::rebuildUploadData() if (!high_lod_model) { LLFloaterModelPreview::addStringToLog("Model " + instance.mLabel + " has no High Lod (LOD3).", true); - load_state = LLModelLoader::ERROR_MATERIALS; + load_state = LLModelLoader::ERROR_HIGH_LOD_MODEL_MISSING; // FIRE-30965 Cleanup braindead mesh parsing error handlers mFMP->childDisable("calculate_btn"); } else @@ -592,10 +704,13 @@ void LLModelPreview::rebuildUploadData() int refFaceCnt = 0; int modelFaceCnt = 0; llassert(instance.mLOD[i]); - if (instance.mLOD[i] && !instance.mLOD[i]->matchMaterialOrder(high_lod_model, refFaceCnt, modelFaceCnt)) + // Fix material matching algorithm to work as per design + // if (instance.mLOD[i] && !instance.mLOD[i]->matchMaterialOrder(high_lod_model, refFaceCnt, modelFaceCnt)) + if (instance.mLOD[i] && !matchMaterialOrder(instance.mLOD[i],high_lod_model, refFaceCnt, modelFaceCnt)) + // { LLFloaterModelPreview::addStringToLog("Model " + instance.mLabel + " has mismatching materials between lods." , true); - load_state = LLModelLoader::ERROR_MATERIALS; + load_state = LLModelLoader::ERROR_MATERIALS_NOT_A_SUBSET; // more descriptive errors mFMP->childDisable("calculate_btn"); } } @@ -664,7 +779,12 @@ void LLModelPreview::rebuildUploadData() // encountered issues setLoadState(load_state); } - else if (getLoadState() == LLModelLoader::ERROR_MATERIALS + // FIRE-30965 Cleanup braindead mesh parsing error handlers + // else if (getLoadState() == LLModelLoader::ERROR_MATERIALS + else if (getLoadState() == LLModelLoader::ERROR_MATERIALS_NOT_A_SUBSET + || getLoadState() == LLModelLoader::ERROR_HIGH_LOD_MODEL_MISSING + || getLoadState() == LLModelLoader::ERROR_LOD_MODEL_MISMATCH + // || getLoadState() == LLModelLoader::WARNING_BIND_SHAPE_ORIENTATION) { // This is only valid for these two error types because they are @@ -1873,7 +1993,7 @@ void LLModelPreview::updateStatusMessages() LLModel* model_high_lod = instance.mLOD[LLModel::LOD_HIGH]; if (!model_high_lod) { - setLoadState(LLModelLoader::ERROR_MATERIALS); + setLoadState(LLModelLoader::ERROR_HIGH_LOD_MODEL_MISSING); // FIRE-30965 Cleanup braindead mesh parsing error handlers mFMP->childDisable("calculate_btn"); continue; } @@ -1883,7 +2003,7 @@ void LLModelPreview::updateStatusMessages() LLModel* lod_model = instance.mLOD[i]; if (!lod_model) { - setLoadState(LLModelLoader::ERROR_MATERIALS); + setLoadState(LLModelLoader::ERROR_LOD_MODEL_MISMATCH); // FIRE-30965 Cleanup braindead mesh parsing error handlers mFMP->childDisable("calculate_btn"); } else @@ -3253,6 +3373,7 @@ BOOL LLModelPreview::render() gGL.loadIdentity(); gPipeline.enableLightsPreview(); + gObjectPreviewProgram.uniform4fv(LLShaderMgr::AMBIENT, 1, LLPipeline::PreviewAmbientColor.mV); // pass ambient setting to shader LLQuaternion camera_rot = LLQuaternion(mCameraPitch, LLVector3::y_axis) * LLQuaternion(mCameraYaw, LLVector3::z_axis); diff --git a/indra/newview/llmodelpreview.h b/indra/newview/llmodelpreview.h index 90a3fccf81..2cfee9e3cb 100644 --- a/indra/newview/llmodelpreview.h +++ b/indra/newview/llmodelpreview.h @@ -200,7 +200,7 @@ public: bool mHasDegenerate; protected: - + bool matchMaterialOrder(LLModel* lod, LLModel* ref, int& refFaceCnt, int& modelFaceCnt ); // FIRE-30965 Cleanup mesh material parsing static void loadedCallback(LLModelLoader::scene& scene, LLModelLoader::model_list& model_list, S32 lod, void* opaque); static void stateChangedCallback(U32 state, void* opaque); diff --git a/indra/newview/llpreviewanim.cpp b/indra/newview/llpreviewanim.cpp index 29accdb074..b9a27dc799 100644 --- a/indra/newview/llpreviewanim.cpp +++ b/indra/newview/llpreviewanim.cpp @@ -235,4 +235,28 @@ void LLPreviewAnim::onClose(bool app_quitting) // } // } //} + +// virtual +void LLPreviewAnim::refreshFromItem() +{ + LLPreview::refreshFromItem(); + + const LLInventoryItem* item = getItem(); + if (item) + { + pMotion = gAgentAvatarp->createMotion(item->getAssetUUID()); // preload the animation + + if (pMotion) + { + LLTextBox* stats_box_left = getChild("AdvancedStatsLeft"); + LLTextBox* stats_box_right = getChild("AdvancedStatsRight"); + stats_box_left->setTextArg("[PRIORITY]", llformat("%d", pMotion->getPriority())); + stats_box_left->setTextArg("[DURATION]", llformat("%.2f", pMotion->getDuration())); + stats_box_left->setTextArg("[IS_LOOP]", (pMotion->getLoop() ? LLTrans::getString("PermYes") : LLTrans::getString("PermNo"))); + stats_box_right->setTextArg("[EASE_IN]", llformat("%.2f", pMotion->getEaseInDuration())); + stats_box_right->setTextArg("[EASE_OUT]", llformat("%.2f", pMotion->getEaseOutDuration())); + stats_box_right->setTextArg("[NUM_JOINTS]", llformat("%d", pMotion->getNumJointMotions())); + } + } +} // diff --git a/indra/newview/llpreviewanim.h b/indra/newview/llpreviewanim.h index df5ad99187..7ce6cfc371 100644 --- a/indra/newview/llpreviewanim.h +++ b/indra/newview/llpreviewanim.h @@ -45,6 +45,7 @@ public: void play(const LLSD& param); // Improved animation preview //void showAdvanced(); + /*virtual*/ void refreshFromItem(); protected: diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index 270e342ec3..d37d84b188 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -3956,6 +3956,13 @@ void process_agent_movement_complete(LLMessageSystem* msg, void**) gSavedPerAccountSettings.setBOOL("FSRenderFriendsOnly", FALSE); } // + // FIRE-30947: Auto-Unmute + if (gSavedSettings.getBOOL("MuteSounds") && gSavedSettings.getBOOL("FSAutoUnmuteSounds")) + gSavedSettings.setBOOL("MuteSounds", FALSE); + + if (gSavedSettings.getBOOL("MuteAmbient") && gSavedSettings.getBOOL("FSAutoUnmuteAmbient")) + gSavedSettings.setBOOL("MuteAmbient", FALSE); + // if (gAgent.getTeleportKeepsLookAt()) { // *NOTE: the LookAt data we get from the sim here doesn't diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 3ca714fd46..525387af51 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -3219,7 +3219,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() if (success) { - gObjectPreviewProgram.mName = "Simple Shader"; + gObjectPreviewProgram.mName = "Preview Shader"; // update preview shader name gObjectPreviewProgram.mFeatures.calculatesLighting = false; gObjectPreviewProgram.mFeatures.calculatesAtmospherics = false; gObjectPreviewProgram.mFeatures.hasGamma = false; diff --git a/indra/newview/skins/default/xui/de/floater_model_preview.xml b/indra/newview/skins/default/xui/de/floater_model_preview.xml index 875a318f7d..088be49dbb 100644 --- a/indra/newview/skins/default/xui/de/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/de/floater_model_preview.xml @@ -393,6 +393,7 @@ + Physik: diff --git a/indra/newview/skins/default/xui/de/panel_preferences_sound.xml b/indra/newview/skins/default/xui/de/panel_preferences_sound.xml index a6a81583c0..8cdf0fa6dd 100644 --- a/indra/newview/skins/default/xui/de/panel_preferences_sound.xml +++ b/indra/newview/skins/default/xui/de/panel_preferences_sound.xml @@ -25,6 +25,11 @@ + + Stummschaltung nach Teleport automatisch aufheben: + + + Klang abspielen wenn sich Freunde: diff --git a/indra/newview/skins/default/xui/de/strings.xml b/indra/newview/skins/default/xui/de/strings.xml index f5eba43d8e..6b7bfadb3a 100644 --- a/indra/newview/skins/default/xui/de/strings.xml +++ b/indra/newview/skins/default/xui/de/strings.xml @@ -53,6 +53,7 @@ SLURL: <nolink>[SLURL]</nolink> CPU: [CPU] Speicher: [MEMORY_MB] MB +Parallelität: [CONCURRENCY] Betriebssystemversion: [OS_VERSION] Grafikkartenhersteller: [GRAPHICS_CARD_VENDOR] Grafikkarte: [GRAPHICS_CARD] diff --git a/indra/newview/skins/default/xui/en/floater_about.xml b/indra/newview/skins/default/xui/en/floater_about.xml index 13ae3186e7..8af051c4dd 100644 --- a/indra/newview/skins/default/xui/en/floater_about.xml +++ b/indra/newview/skins/default/xui/en/floater_about.xml @@ -165,7 +165,7 @@ Additional code generously contributed to Firestorm by: top_pad="4" width="450" wrap="true"> -Albatroz Hird, Alexie Birman, Andromeda Rage, Angeldark Raymaker, Animats, Armin Weatherwax, Beq Janus, Casper Warden, Chalice Yao, Chaser Zaks, Chorazin Allen, Cron Stardust, Damian Zhaoying, Dan Threebeards, Dawa Gurbux, Denver Maksim, Drake Arconis, Felyza Wishbringer, f0rbidden, Fractured Crystal, Geenz Spad, Gibson Firehawk, Hitomi Tiponi, Inusaito Sayori, Jean Severine, Katharine Berry, Kittin Ninetails, Kool Koolhoven, Lance Corrimal, Lassie, Latif Khalifa, Laurent Bechir, Magne Metaverse LLC, Magus Freston, Manami Hokkigai, MartinRJ Fayray, McCabe Maxstead, Melancholy Lemon, Melysmile, Mimika Oh, Mister Acacia, MorganMegan, mygoditsfullofstars, Mysty Saunders, Nagi Michinaga, Name Short, nhede Core, NiranV Dean, Nogardrevlis Lectar, Oren Hurvitz, Paladin Forzane, paperwork, Penny Patton, Peyton Menges, programmtest, Qwerty Venom, Revolution Smythe, Romka Swallowtail, Sahkolihaa Contepomi, sal Kaligawa, Samm Florian, Satomi Ahn, Sei Lisa, Sempervirens Oddfellow, Shin Wasp, Shyotl Kuhr, Sione Lomu, Skills Hak, StarlightShining, Sunset Faulkes, Testicular Slingshot, Thickbrick Sleaford, Ubit Umarov, Vaalith Jinn, Vincent Sylvester, Whirly Fizzle, Xenhat Liamano, Zwagoth Klaar and others. +Albatroz Hird, Alexie Birman, Andromeda Rage, Angeldark Raymaker, Animats, Armin Weatherwax, Beq Janus, Casper Warden, Chalice Yao, Chaser Zaks, Chorazin Allen, Cron Stardust, Damian Zhaoying, Dan Threebeards, Dawa Gurbux, Denver Maksim, Drake Arconis, Felyza Wishbringer, f0rbidden, Fractured Crystal, Geenz Spad, Gibson Firehawk, Hitomi Tiponi, Inusaito Sayori, Jean Severine, Katharine Berry, Kittin Ninetails, Kool Koolhoven, Lance Corrimal, Lassie, Latif Khalifa, Laurent Bechir, Magne Metaverse LLC, Magus Freston, Manami Hokkigai, MartinRJ Fayray, McCabe Maxstead, Melancholy Lemon, Melysmile, Mimika Oh, Mister Acacia, MorganMegan, mygoditsfullofstars, Mysty Saunders, Nagi Michinaga, Name Short, nhede Core, NiranV Dean, Nogardrevlis Lectar, Oren Hurvitz, Paladin Forzane, paperwork, Penny Patton, Peyton Menges, programmtest, Qwerty Venom, Rebecca Ashbourne, Revolution Smythe, Romka Swallowtail, Sahkolihaa Contepomi, sal Kaligawa, Samm Florian, Satomi Ahn, Sei Lisa, Sempervirens Oddfellow, Shin Wasp, Shyotl Kuhr, Sione Lomu, Skills Hak, StarlightShining, Sunset Faulkes, Testicular Slingshot, Thickbrick Sleaford, Ubit Umarov, Vaalith Jinn, Vincent Sylvester, Whirly Fizzle, Xenhat Liamano, Zwagoth Klaar and others. + + Automatically unmute after teleport: + + + + + CPU: [CPU] Memory: [MEMORY_MB] MB +Concurrency: [CONCURRENCY] OS Version: [OS_VERSION] Graphics Card Vendor: [GRAPHICS_CARD_VENDOR] Graphics Card: [GRAPHICS_CARD] diff --git a/indra/newview/skins/default/xui/pl/floater_model_preview.xml b/indra/newview/skins/default/xui/pl/floater_model_preview.xml index ad5b5a73d4..d9b91fd3b7 100644 --- a/indra/newview/skins/default/xui/pl/floater_model_preview.xml +++ b/indra/newview/skins/default/xui/pl/floater_model_preview.xml @@ -213,6 +213,7 @@ + Fizyka: diff --git a/indra/newview/skins/default/xui/pl/panel_preferences_graphics1.xml b/indra/newview/skins/default/xui/pl/panel_preferences_graphics1.xml index a32ee9a883..5f0046c379 100644 --- a/indra/newview/skins/default/xui/pl/panel_preferences_graphics1.xml +++ b/indra/newview/skins/default/xui/pl/panel_preferences_graphics1.xml @@ -121,6 +121,7 @@ + diff --git a/indra/newview/skins/default/xui/pl/strings.xml b/indra/newview/skins/default/xui/pl/strings.xml index ee633a534a..e13a7e8796 100644 --- a/indra/newview/skins/default/xui/pl/strings.xml +++ b/indra/newview/skins/default/xui/pl/strings.xml @@ -42,6 +42,7 @@ Położenie: [REGION] Procesor (CPU): [CPU] Pamięć (Memory): [MEMORY_MB] MB +Wątki dekodowania (Concurrency): [CONCURRENCY] System operacyjny (OS Version): [OS_VERSION] Dostawca karty graficznej (Graphics Card Vendor): [GRAPHICS_CARD_VENDOR] Karta graficzna (Graphics Card): [GRAPHICS_CARD]