Fix merge issues:
* Restore changes frommaster21947778bato llwindow/llwindowwin32.cpp * Restore changes from3758618949to newview/llinspecttexture.cpp * Fix apparent merge error in LLInventoryPanel::itemChanged * Restore changes from1eeecfa1a8in newview/llpaneloutfitsinventory.h * Restore changes fromb9633c17e3in newview/llpaneloutfitsinventory.h & newview/llpanelwearing.cpp * Restore changes fromf660f1f0fdin newview/llviewertexture.cpp * Restore changes fromb9633c17e3&98f7d73d46in newview/lloutfitgallery.cpp and newview/lloutfitslist.cpp * Replace changes from23729442aawith current implementation in develop branch * Fix more broken changes in LLViewerTexture::saveRawImage * Restore the changes in LLMath both from develop and maint-c * Fix all kind of other merge errors # Conflicts: # indra/llmath/v2math.h # indra/llmath/v3math.h # indra/llui/llfolderviewitem.cpp # indra/llwindow/llwindowwin32.cpp # indra/newview/llfloaterobjectweights.h # indra/newview/lloutfitgallery.cpp # indra/newview/lloutfitslist.cpp # indra/newview/llsidepaneliteminfo.cpp # indra/newview/llvoavatar.cpp
parent
d53183557d
commit
19347f7094
|
|
@ -75,7 +75,7 @@ constexpr F32 DEG_TO_RAD = 0.017453292519943295769236907684886f;
|
|||
constexpr F32 RAD_TO_DEG = 57.295779513082320876798154814105f;
|
||||
constexpr F32 F_APPROXIMATELY_ZERO = 0.00001f;
|
||||
constexpr F32 F_LN10 = 2.3025850929940456840179914546844f;
|
||||
constexpr F32 OO_LN10 = 0.43429448190325182765112891891661;
|
||||
constexpr F32 OO_LN10 = 0.43429448190325182765112891891661f;
|
||||
constexpr F32 F_LN2 = 0.69314718056f;
|
||||
constexpr F32 OO_LN2 = 1.4426950408889634073599246810019f;
|
||||
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ inline void LLVector2::setVec(const F32 *vec)
|
|||
|
||||
inline F32 LLVector2::length(void) const
|
||||
{
|
||||
return (F32) sqrt(lengthSquared());
|
||||
return sqrt(lengthSquared());
|
||||
}
|
||||
|
||||
inline F32 LLVector2::lengthSquared(void) const
|
||||
|
|
|
|||
|
|
@ -325,10 +325,10 @@ inline F32 LLVector3::normVec(void)
|
|||
|
||||
inline F32 LLVector3::length(void) const
|
||||
{
|
||||
return (F32) sqrt(lengthSquared());
|
||||
return sqrt(lengthSquared());
|
||||
}
|
||||
|
||||
inline F32 LLVector3::lengthSquared(void) const
|
||||
inline F32 LLVector3::lengthSquared() const
|
||||
{
|
||||
return mV[0]*mV[0] + mV[1]*mV[1] + mV[2]*mV[2];
|
||||
}
|
||||
|
|
|
|||
|
|
@ -341,7 +341,7 @@ inline void LLVector4::setVec(const F32 *vec)
|
|||
|
||||
inline F32 LLVector4::length(void) const
|
||||
{
|
||||
return (F32) sqrt(lengthSquared());
|
||||
return sqrt(lengthSquared());
|
||||
}
|
||||
|
||||
inline F32 LLVector4::lengthSquared(void) const
|
||||
|
|
@ -489,7 +489,7 @@ inline LLVector4 lerp(const LLVector4 &a, const LLVector4 &b, F32 u)
|
|||
|
||||
inline F32 LLVector4::normalize(void)
|
||||
{
|
||||
F32 mag = (F32) sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]);
|
||||
F32 mag = sqrt(mV[VX]*mV[VX] + mV[VY]*mV[VY] + mV[VZ]*mV[VZ]);
|
||||
|
||||
if (mag > FP_MAG_THRESHOLD)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -410,7 +410,7 @@ struct LLWindowWin32::LLWindowWin32Thread : public LL::ThreadPool
|
|||
// until after some graphics setup. See SL-20177. -Cosmic,2023-09-18
|
||||
bool mGLReady = false;
|
||||
bool mGotGLBuffer = false;
|
||||
LLAtomicBool mDeleteOnExit = false;
|
||||
bool mDeleteOnExit = false;
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -4852,6 +4852,15 @@ bool LLWindowWin32::LLWindowWin32Thread::wakeAndDestroy()
|
|||
mGLReady = false;
|
||||
});
|
||||
|
||||
mDeleteOnExit = true;
|
||||
SetWindowLongPtr(old_handle, GWLP_USERDATA, NULL);
|
||||
|
||||
// Let thread finish on its own and don't block main thread.
|
||||
for (auto& pair : mThreads)
|
||||
{
|
||||
pair.second.detach();
|
||||
}
|
||||
|
||||
LL_DEBUGS("Window") << "Closing window's pool queue" << LL_ENDL;
|
||||
mQueue->close();
|
||||
|
||||
|
|
@ -4866,47 +4875,6 @@ bool LLWindowWin32::LLWindowWin32Thread::wakeAndDestroy()
|
|||
PostMessage(old_handle, WM_DUMMY_, wparam, 0x1337);
|
||||
}
|
||||
|
||||
// There are cases where window will refuse to close,
|
||||
// can't wait forever on join, check state instead
|
||||
LLTimer timeout;
|
||||
timeout.setTimerExpirySec(2.0);
|
||||
while (!getQueue().done() && !timeout.hasExpired() && mWindowHandleThrd)
|
||||
{
|
||||
ms_sleep(100);
|
||||
}
|
||||
|
||||
if (getQueue().done() || mWindowHandleThrd == NULL)
|
||||
{
|
||||
// Window is closed, started closing or is cleaning up
|
||||
// now wait for our single thread to die.
|
||||
if (mWindowHandleThrd)
|
||||
{
|
||||
LL_INFOS("Window") << "Window is closing, waiting on pool's thread to join, time since post: " << timeout.getElapsedSeconds() << "s" << LL_ENDL;
|
||||
}
|
||||
else
|
||||
{
|
||||
LL_DEBUGS("Window") << "Waiting on pool's thread, time since post: " << timeout.getElapsedSeconds() << "s" << LL_ENDL;
|
||||
}
|
||||
for (auto& pair : mThreads)
|
||||
{
|
||||
pair.second.join();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Something suspended window thread, can't afford to wait forever
|
||||
// so kill thread instead
|
||||
// Ex: This can happen if user starts dragging window arround (if it
|
||||
// was visible) or a modal notification pops up
|
||||
LL_WARNS("Window") << "Window is frozen, couldn't perform clean exit" << LL_ENDL;
|
||||
|
||||
for (auto& pair : mThreads)
|
||||
{
|
||||
// very unsafe
|
||||
TerminateThread(pair.second.native_handle(), 0);
|
||||
pair.second.detach();
|
||||
}
|
||||
}
|
||||
LL_DEBUGS("Window") << "thread pool shutdown complete" << LL_ENDL;
|
||||
return true;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -139,12 +139,12 @@ private:
|
|||
//--------------------------------------------------------------------
|
||||
public:
|
||||
LLVector3d getCameraPositionGlobal() const;
|
||||
const LLVector3 &getCameraPositionAgent() const;
|
||||
const LLVector3& getCameraPositionAgent() const;
|
||||
LLVector3d calcCameraPositionTargetGlobal(bool *hit_limit = NULL); // Calculate the camera position target
|
||||
F32 getCameraMinOffGround(); // Minimum height off ground for this mode, meters
|
||||
void setCameraCollidePlane(const LLVector4 &plane) { mCameraCollidePlane = plane; }
|
||||
bool calcCameraMinDistance(F32 &obj_min_distance);
|
||||
F32 getCurrentCameraBuildOffset() { return (F32)mCameraFocusOffset.length(); }
|
||||
F32 getCurrentCameraBuildOffset() const { return (F32)mCameraFocusOffset.length(); }
|
||||
void clearCameraLag() { mCameraLag.clearVec(); }
|
||||
const LLVector3& getCameraUpVector() const { return mCameraUpVector; }
|
||||
private:
|
||||
|
|
|
|||
|
|
@ -58,7 +58,7 @@ public:
|
|||
LLFloaterObjectWeights(const LLSD& key);
|
||||
~LLFloaterObjectWeights();
|
||||
|
||||
/*virtual*/ bool postBuild() override;
|
||||
bool postBuild() override;
|
||||
|
||||
void onOpen(const LLSD& key) override;
|
||||
|
||||
|
|
|
|||
|
|
@ -248,7 +248,7 @@ bool LLFolderViewModelItemInventory::filterChildItem( LLFolderViewModelItem* ite
|
|||
return continue_filtering;
|
||||
}
|
||||
|
||||
bool LLFolderViewModelItemInventory::filter( LLFolderViewFilter& filter)
|
||||
bool LLFolderViewModelItemInventory::filter(LLFolderViewFilter& filter)
|
||||
{
|
||||
const S32 filter_generation = filter.getCurrentGeneration();
|
||||
const S32 must_pass_generation = filter.getFirstRequiredGeneration();
|
||||
|
|
|
|||
|
|
@ -148,7 +148,8 @@ void LLTexturePreviewView::draw()
|
|||
bool isLoading = (!m_Image->isFullyLoaded()) && (m_Image->getDiscardLevel() > 0);
|
||||
if (isLoading)
|
||||
LLFontGL::getFontSansSerif()->renderUTF8(mLoadingText, 0, rctClient.mLeft + 3, rctClient.mTop - 25, LLColor4::white, LLFontGL::LEFT, LLFontGL::BASELINE, LLFontGL::DROP_SHADOW);
|
||||
m_Image->addTextureStats((isLoading) ? MAX_IMAGE_AREA : (F32)(rctClient.getWidth() * rctClient.getHeight()));
|
||||
|
||||
m_Image->setKnownDrawSize(MAX_IMAGE_SIZE, MAX_IMAGE_SIZE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1275,8 +1275,6 @@ void LLOutfitGalleryGearMenu::onUpdateItemsVisibility()
|
|||
{
|
||||
if (!mMenu) return;
|
||||
bool have_selection = getSelectedOutfitID().notNull();
|
||||
mMenu->setItemVisible("expand", false);
|
||||
mMenu->setItemVisible("collapse", false);
|
||||
mMenu->setItemVisible("thumbnail", have_selection);
|
||||
mMenu->setItemVisible("sepatator3", true);
|
||||
mMenu->setItemVisible("sort_folders_by_name", true);
|
||||
|
|
|
|||
|
|
@ -1151,12 +1151,6 @@ void LLOutfitListBase::ChangeOutfitSelection(LLWearableItemsList* list, const LL
|
|||
|
||||
bool LLOutfitListBase::postBuild()
|
||||
{
|
||||
mGearMenu = createGearMenu();
|
||||
|
||||
LLMenuButton* menu_gear_btn = getChild<LLMenuButton>("options_gear_btn");
|
||||
|
||||
menu_gear_btn->setMouseDownCallback(boost::bind(&LLOutfitListGearMenuBase::updateItemsVisibility, mGearMenu));
|
||||
menu_gear_btn->setMenu(mGearMenu->getMenu());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -1515,9 +1509,8 @@ LLOutfitListGearMenu::~LLOutfitListGearMenu()
|
|||
void LLOutfitListGearMenu::onUpdateItemsVisibility()
|
||||
{
|
||||
if (!mMenu) return;
|
||||
mMenu->setItemVisible("expand", true);
|
||||
mMenu->setItemVisible("collapse", true);
|
||||
mMenu->setItemVisible("thumbnail", getSelectedOutfitID().notNull());
|
||||
mMenu->setItemVisible("favorite", getSelectedOutfitID().notNull());
|
||||
mMenu->setItemVisible("sepatator3", false);
|
||||
mMenu->setItemVisible("sort_folders_by_name", false);
|
||||
LLOutfitListGearMenuBase::onUpdateItemsVisibility();
|
||||
|
|
|
|||
|
|
@ -263,10 +263,6 @@ bool LLPanelWearing::postBuild()
|
|||
mTempItemsList->setFgUnselectedColor(LLColor4::white);
|
||||
mTempItemsList->setRightMouseDownCallback(boost::bind(&LLPanelWearing::onTempAttachmentsListRightClick, this, _1, _2, _3));
|
||||
|
||||
LLMenuButton* menu_gear_btn = getChild<LLMenuButton>("options_gear_btn");
|
||||
|
||||
menu_gear_btn->setMenu(mGearMenu->getMenu());
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -2110,6 +2110,7 @@ bool LLViewerFetchedTexture::updateFetch()
|
|||
LL_PROFILE_ZONE_NAMED_CATEGORY_TEXTURE("vftuf - request created");
|
||||
mHasFetcher = true;
|
||||
mIsFetching = true;
|
||||
mLastWorkerDiscardLevel = worker_discard;
|
||||
// in some cases createRequest can modify discard, as an example
|
||||
// bake textures are always at discard 0
|
||||
mRequestedDiscardLevel = llmin(desired_discard, fetch_request_response);
|
||||
|
|
@ -2733,6 +2734,8 @@ void LLViewerFetchedTexture::saveRawImage()
|
|||
return;
|
||||
}
|
||||
|
||||
LLImageDataSharedLock lock(mRawImage);
|
||||
|
||||
mSavedRawDiscardLevel = mRawDiscardLevel;
|
||||
if (mBoostLevel == LLGLTexture::BOOST_ICON)
|
||||
{
|
||||
|
|
@ -2748,13 +2751,25 @@ void LLViewerFetchedTexture::saveRawImage()
|
|||
mSavedRawImage = new LLImageRaw(mRawImage->getData(), mRawImage->getWidth(), mRawImage->getHeight(), mRawImage->getComponents());
|
||||
}
|
||||
}
|
||||
else if (mBoostLevel == LLGLTexture::BOOST_THUMBNAIL)
|
||||
{
|
||||
if (mRawImage->getWidth() > DEFAULT_THUMBNAIL_DIMENSIONS || mRawImage->getHeight() > DEFAULT_THUMBNAIL_DIMENSIONS)
|
||||
{
|
||||
mSavedRawImage = new LLImageRaw(DEFAULT_THUMBNAIL_DIMENSIONS, DEFAULT_THUMBNAIL_DIMENSIONS, mRawImage->getComponents());
|
||||
mSavedRawImage->copyScaled(mRawImage);
|
||||
}
|
||||
else
|
||||
{
|
||||
mSavedRawImage = new LLImageRaw(mRawImage->getData(), mRawImage->getWidth(), mRawImage->getHeight(), mRawImage->getComponents());
|
||||
}
|
||||
}
|
||||
else if (mBoostLevel == LLGLTexture::BOOST_SCULPTED)
|
||||
{
|
||||
S32 expected_width = mKnownDrawWidth > 0 ? mKnownDrawWidth : sMaxSculptRez;
|
||||
S32 expected_height = mKnownDrawHeight > 0 ? mKnownDrawHeight : sMaxSculptRez;
|
||||
if (mRawImage->getWidth() > expected_width || mRawImage->getHeight() > expected_height)
|
||||
{
|
||||
mSavedRawImage = new LLImageRaw(DEFAULT_THUMBNAIL_DIMENSIONS, DEFAULT_THUMBNAIL_DIMENSIONS, mRawImage->getComponents());
|
||||
mSavedRawImage = new LLImageRaw(expected_width, expected_height, mRawImage->getComponents());
|
||||
mSavedRawImage->copyScaled(mRawImage);
|
||||
}
|
||||
else
|
||||
|
|
|
|||
|
|
@ -683,6 +683,7 @@ LLVOAvatar::LLVOAvatar(const LLUUID& id,
|
|||
mPreviousFullyLoaded(false),
|
||||
mFullyLoadedInitialized(false),
|
||||
mLastCloudAttachmentCount(0),
|
||||
mFullyLoadedFrameCounter(0),
|
||||
mVisualComplexity(VISUAL_COMPLEXITY_UNKNOWN),
|
||||
mLoadedCallbacksPaused(false),
|
||||
mLoadedCallbackTextures(0),
|
||||
|
|
@ -966,7 +967,7 @@ bool LLVOAvatar::areAllNearbyInstancesBaked(S32& grey_avatars)
|
|||
++grey_avatars;
|
||||
}
|
||||
}
|
||||
return !grey_avatars;
|
||||
return grey_avatars == 0;
|
||||
}
|
||||
|
||||
// static
|
||||
|
|
@ -8210,7 +8211,7 @@ bool LLVOAvatar::getIsCloud() const
|
|||
void LLVOAvatar::updateRezzedStatusTimers(S32 rez_status)
|
||||
{
|
||||
// State machine for rezzed status. Statuses are -1 on startup, 0
|
||||
// = cloud, 1 = gray, 2 = downloading, 3 = waiting for attachments, 4 = full.
|
||||
// Statuses are -1 on startup, 0 = cloud, 1 = gray, 2 = downloading, 3 = waiting for attachments, 4 = full.
|
||||
// Purpose is to collect time data for each it takes avatar to reach
|
||||
// various loading landmarks: gray, textured (partial), textured fully.
|
||||
|
||||
|
|
@ -8392,15 +8393,15 @@ bool LLVOAvatar::updateIsFullyLoaded()
|
|||
if (mFirstFullyVisible && !mIsControlAvatar)
|
||||
{
|
||||
loading = ((rez_status < 2)
|
||||
// Wait at least 60s for unfinished textures to finish on first load,
|
||||
// don't wait forever, it might fail. Even if it will eventually load by
|
||||
// itself and update mLoadedCallbackTextures (or fail and clean the list),
|
||||
// avatars are more time-sensitive than textures and can't wait that long.
|
||||
|| (mLoadedCallbackTextures < mCallbackTextureList.size() && mLastTexCallbackAddedTime.getElapsedTimeF32() < MAX_TEXTURE_WAIT_TIME_SEC)
|
||||
|| !mPendingAttachment.empty()
|
||||
|| (rez_status < 3 && !isFullyBaked())
|
||||
|| hasPendingAttachedMeshes()
|
||||
);
|
||||
// Wait at least 60s for unfinished textures to finish on first load,
|
||||
// don't wait forever, it might fail. Even if it will eventually load by
|
||||
// itself and update mLoadedCallbackTextures (or fail and clean the list),
|
||||
// avatars are more time-sensitive than textures and can't wait that long.
|
||||
|| (mLoadedCallbackTextures < mCallbackTextureList.size() && mLastTexCallbackAddedTime.getElapsedTimeF32() < MAX_TEXTURE_WAIT_TIME_SEC)
|
||||
|| !mPendingAttachment.empty()
|
||||
|| (rez_status < 3 && !isFullyBaked())
|
||||
|| hasPendingAttachedMeshes()
|
||||
);
|
||||
|
||||
// compare amount of attachments to one reported by simulator
|
||||
if (!loading && !isSelf() && rez_status < 4 && mLastCloudAttachmentCount < mSimAttachments.size())
|
||||
|
|
@ -8460,41 +8461,33 @@ void LLVOAvatar::updateRuthTimer(bool loading)
|
|||
bool LLVOAvatar::processFullyLoadedChange(bool loading)
|
||||
{
|
||||
// We wait a little bit before giving the 'all clear', to let things to
|
||||
// settle down (models to snap into place, textures to get first packets).
|
||||
// And if viewer isn't aware of some parts yet, this gives them a chance
|
||||
// to arrive.
|
||||
// settle down: models to snap into place, textures to get first packets,
|
||||
// LODs to load.
|
||||
const F32 LOADED_DELAY = 1.f;
|
||||
|
||||
if (loading)
|
||||
{
|
||||
mFullyLoadedTimer.reset();
|
||||
mFullyLoaded = false;
|
||||
}
|
||||
else if (!mFullyLoaded)
|
||||
{
|
||||
// We wait a little bit before giving the 'all clear', to let things to
|
||||
// settle down: models to snap into place, textures to get first packets,
|
||||
// LODs to load.
|
||||
const F32 LOADED_DELAY = 1.f;
|
||||
|
||||
if (mFirstFullyVisible)
|
||||
{
|
||||
F32 first_use_delay = FIRST_APPEARANCE_CLOUD_MIN_DELAY;
|
||||
if (!isSelf() && loading)
|
||||
{
|
||||
// Note that textures can causes 60s delay on thier own
|
||||
// so this delay might end up on top of textures' delay
|
||||
first_use_delay = llclamp(
|
||||
mFirstAppearanceMessageTimer.getElapsedTimeF32(),
|
||||
FIRST_APPEARANCE_CLOUD_MIN_DELAY,
|
||||
FIRST_APPEARANCE_CLOUD_MAX_DELAY);
|
||||
// Note that textures can causes 60s delay on thier own
|
||||
// so this delay might end up on top of textures' delay
|
||||
first_use_delay = llclamp(
|
||||
mFirstAppearanceMessageTimer.getElapsedTimeF32(),
|
||||
FIRST_APPEARANCE_CLOUD_MIN_DELAY,
|
||||
FIRST_APPEARANCE_CLOUD_MAX_DELAY);
|
||||
|
||||
if (shouldImpostor())
|
||||
{
|
||||
// Impostors are less of a priority,
|
||||
// let them stay cloud longer
|
||||
first_use_delay *= FIRST_APPEARANCE_CLOUD_IMPOSTOR_MODIFIER;
|
||||
}
|
||||
if (shouldImpostor())
|
||||
{
|
||||
// Impostors are less of a priority,
|
||||
// let them stay cloud longer
|
||||
first_use_delay *= FIRST_APPEARANCE_CLOUD_IMPOSTOR_MODIFIER;
|
||||
}
|
||||
}
|
||||
mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > first_use_delay);
|
||||
}
|
||||
|
|
@ -8503,10 +8496,9 @@ bool LLVOAvatar::processFullyLoadedChange(bool loading)
|
|||
mFullyLoaded = (mFullyLoadedTimer.getElapsedTimeF32() > LOADED_DELAY);
|
||||
}
|
||||
|
||||
if (!mPreviousFullyLoaded && !loading && mFullyLoaded)
|
||||
{
|
||||
debugAvatarRezTime("AvatarRezNotification", "fully loaded");
|
||||
}
|
||||
if (!mPreviousFullyLoaded && !loading && mFullyLoaded)
|
||||
{
|
||||
debugAvatarRezTime("AvatarRezNotification", "fully loaded");
|
||||
}
|
||||
|
||||
// did our loading state "change" from last call?
|
||||
|
|
@ -8516,8 +8508,9 @@ bool LLVOAvatar::processFullyLoadedChange(bool loading)
|
|||
const S32 UPDATE_RATE = 30;
|
||||
bool changed =
|
||||
((mFullyLoaded != mPreviousFullyLoaded) || // if the value is different from the previous call
|
||||
(!mFullyLoadedInitialized) || // if we've never been called before
|
||||
(mFullyLoadedFrameCounter % UPDATE_RATE == 0)); // every now and then issue a change
|
||||
(!mFullyLoadedInitialized) || // if we've never been called before
|
||||
(mFullyLoadedFrameCounter % UPDATE_RATE == 0)); // every now and then issue a change
|
||||
bool fully_loaded_changed = (mFullyLoaded != mPreviousFullyLoaded);
|
||||
|
||||
mPreviousFullyLoaded = mFullyLoaded;
|
||||
mFullyLoadedInitialized = true;
|
||||
|
|
|
|||
Loading…
Reference in New Issue