PanteraPolnocy 2020-04-28 19:54:22 +02:00
commit 4c0e966f7c
3 changed files with 33 additions and 48 deletions

View File

@ -5295,21 +5295,14 @@ bool LLVolumeFace::cacheOptimize()
llassert(!mOptimized);
mOptimized = TRUE;
// <FS:ND> FIRE-23370/BUG-8801/MAIN-5060
// <FS:ND> FIRE-23370/BUG-8801/MAIN-5060/FIRE-29492
// cacheOptimize will destroy triangles. This is due to LLVCacheVertexData pointing to vertices in the vector vertex_data.
// Once vertex_data is sorted (std::sort(triangle_data.begin(), triangle_data.end()) ) this will invalidate those pointers and
// LLVCacheVertexData suddenly does point to unrelated vertices. It is an interesting fact that this is no problem for the
// windows version.
//
// To solve the issue with the pointer invalidation it use a std::vector< U16 > for triangle indices, sort this using
// std::sort( v.begin(), v.end(), [&triangle_data](U16 rhs, U16 lhs ){ return triangle_data[rhs].mScore > triangle_data[lhs].mScore; }
// Then access all LLVCacheTriangleData> via triangle_data[ v[ idx ] ].
//
// Unfortunately this is a bit of a messy interwoven change all of this method, alternative is to copy a Linux specific version. Which
// won't be that great either
// NB The change really should be safe for Winows too, in fact it is surprising Windows does not suffer fro the sae bug. Just cannot test
// the windows versions right now.
#ifndef LL_LINUX
LLVCacheLRU cache;
if (mNumVertices < 3 || mNumIndices < 3)
@ -5344,13 +5337,6 @@ bool LLVolumeFace::cacheOptimize()
triangle_data[tri_idx].mVertex[i%3] = &(vertex_data[idx]);
}
// <FS:ND> FIRE-23370/BUG-8801/MAIN-5060
#ifdef LL_LINUX
std::vector< U32 > v;
for (U32 j = 0; j < triangle_data.size(); ++j)
v.push_back( j );
#endif
/*F32 pre_acmr = 1.f;
//measure cache misses from before rebuild
{
@ -5382,27 +5368,14 @@ bool LLVolumeFace::cacheOptimize()
}
//sort triangle data by score
// <FS:ND> FIRE-23370/BUG-8801/MAIN-5060
#ifndef LL_LINUX
std::sort(triangle_data.begin(), triangle_data.end());
#else
std::sort( v.begin(), v.end(),
[&triangle_data](U16 rhs, U16 lhs )
{ return triangle_data[rhs].mScore > triangle_data[lhs].mScore; }
);
#endif
std::vector<U16> new_indices;
LLVCacheTriangleData* tri;
//prime pump by adding first triangle to cache;
// <FS:ND> FIRE-23370/BUG-8801/MAIN-5060
#ifndef LL_LINUX
tri = &(triangle_data[0]);
#else
tri = &(triangle_data[v[0]]);
#endif
cache.addTriangle(tri);
new_indices.push_back(tri->mVertex[0]->mIdx);
@ -5420,21 +5393,11 @@ bool LLVolumeFace::cacheOptimize()
breaks++;
for (U32 j = 0; j < triangle_data.size(); ++j)
{
// <FS:ND> FIRE-23370/BUG-8801/MAIN-5060
#ifndef LL_LINUX
if (triangle_data[j].mActive)
{
tri = &(triangle_data[j]);
break;
}
#else
if (triangle_data[v[j]].mActive)
{
tri = &(triangle_data[v[j]]);
break;
}
#endif
}
}
@ -5565,7 +5528,8 @@ bool LLVolumeFace::cacheOptimize()
//std::string result = llformat("ACMR pre/post: %.3f/%.3f -- %d triangles %d breaks", pre_acmr, post_acmr, mNumIndices/3, breaks);
//LL_INFOS() << result << LL_ENDL;
#endif
return true;
}

View File

@ -25224,7 +25224,7 @@ Change of this parameter will affect the layout of buttons in notification toast
<key>Type</key>
<string>Boolean</string>
<key>Value</key>
<integer>0</integer>
<integer>1</integer>
</map>
<key>FSRestrictMaxTextureSize</key>
<map>

View File

@ -1348,18 +1348,39 @@ void LLIMProcessing::processNewMessage(LLUUID from_id,
}
else // IM_TASK_INVENTORY_OFFERED
{
info->mType = (LLAssetType::EType) binary_bucket[0];
info->mObjectID = LLUUID::null;
info->mFromObject = TRUE;
}
if (offline == IM_OFFLINE && session_id.isNull() && aux_id.notNull() && binary_bucket_size > sizeof(S8)* 5)
{
// cap received offline message
std::string str_bucket = ll_safe_string((char*)binary_bucket, binary_bucket_size);
typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
boost::char_separator<char> sep("|", "", boost::keep_empty_tokens);
tokenizer tokens(str_bucket, sep);
tokenizer::iterator iter = tokens.begin();
// In the case of an offline message, the transaction id will be in aux_id and th session_id will be null
// (conversely when online the transaction id is passed as session_id)
info->mTransactionID = session_id.isNull() ? aux_id : session_id;
info->mType = (LLAssetType::EType)(atoi((*(iter++)).c_str()));
// Note There is more elements in 'tokens' ...
info->mObjectID = LLUUID::null;
info->mFromObject = TRUE;
}
else
{
if (sizeof(S8) != binary_bucket_size)
{
LL_WARNS("Messaging") << "Malformed inventory offer from object" << LL_ENDL;
delete info;
break;
}
info->mType = (LLAssetType::EType) binary_bucket[0];
info->mObjectID = LLUUID::null;
info->mFromObject = TRUE;
}
}
info->mIM = dialog;
info->mFromID = from_id;
info->mFromGroup = from_group;
info->mTransactionID = session_id;
info->mFolderID = gInventory.findCategoryUUIDForType(LLFolderType::assetTypeToFolderType(info->mType));
info->mFromName = name;