Skip to content
Snippets Groups Projects
Commit 72b1cfc7 authored by Mnikolenko Productengine's avatar Mnikolenko Productengine
Browse files

SL-18586 FIXED Crash when opening 360 snapshot

parent af675bbe
No related branches found
No related tags found
2 merge requests!3Update to main branch,!2Rebase onto current main branch
...@@ -283,6 +283,7 @@ Beq Janus ...@@ -283,6 +283,7 @@ Beq Janus
SL-15709 SL-15709
SL-16021 SL-16021
SL-18202 SL-18202
SL-18586
Beth Walcher Beth Walcher
Bezilon Kasei Bezilon Kasei
Biancaluce Robbiani Biancaluce Robbiani
......
...@@ -319,13 +319,7 @@ const std::string LLFloater360Capture::getHTMLBaseFolder() ...@@ -319,13 +319,7 @@ const std::string LLFloater360Capture::getHTMLBaseFolder()
// triggered when the 'capture' button in the UI is pressed // triggered when the 'capture' button in the UI is pressed
void LLFloater360Capture::onCapture360ImagesBtn() void LLFloater360Capture::onCapture360ImagesBtn()
{ {
// launch the main capture code in a coroutine so we can capture360Images();
// yield/suspend at some points to give the main UI
// thread a look-in occasionally.
LLCoros::instance().launch("capture360cap", [this]()
{
capture360Images();
});
} }
// Gets the full path name for a given JavaScript file in the HTML folder. We // Gets the full path name for a given JavaScript file in the HTML folder. We
...@@ -680,9 +674,6 @@ void LLFloater360Capture::capture360Images() ...@@ -680,9 +674,6 @@ void LLFloater360Capture::capture360Images()
mCaptureBtn->setEnabled(true); mCaptureBtn->setEnabled(true);
mSaveLocalBtn->setEnabled(true); mSaveLocalBtn->setEnabled(true);
// allow the UI to update by suspending and waiting for the
// main render loop to update the UI
suspendForAFrame();
} }
// once the request is made to navigate to the web page containing the code // once the request is made to navigate to the web page containing the code
......
...@@ -43,6 +43,8 @@ namespace LLPerfStats ...@@ -43,6 +43,8 @@ namespace LLPerfStats
U32 lastGlobalPrefChange{0}; U32 lastGlobalPrefChange{0};
std::mutex bufferToggleLock{}; std::mutex bufferToggleLock{};
F64 cpu_hertz{0.0};
Tunables tunables; Tunables tunables;
std::atomic<int> StatsRecorder::writeBuffer{0}; std::atomic<int> StatsRecorder::writeBuffer{0};
...@@ -126,6 +128,8 @@ namespace LLPerfStats ...@@ -126,6 +128,8 @@ namespace LLPerfStats
// create a queue // create a queue
// create a thread to consume from the queue // create a thread to consume from the queue
tunables.initialiseFromSettings(); tunables.initialiseFromSettings();
LLPerfStats::cpu_hertz = (F64)LLTrace::BlockTimer::countsPerSecond();
t.detach(); t.detach();
} }
...@@ -332,7 +336,7 @@ namespace LLPerfStats ...@@ -332,7 +336,7 @@ namespace LLPerfStats
} }
// The frametime budget we have based on the target FPS selected // The frametime budget we have based on the target FPS selected
auto target_frame_time_raw = (U64)llround((F64)LLTrace::BlockTimer::countsPerSecond()/(tunables.userTargetFPS==0?1:tunables.userTargetFPS)); auto target_frame_time_raw = (U64)llround(LLPerfStats::cpu_hertz/(tunables.userTargetFPS==0?1:tunables.userTargetFPS));
// LL_INFOS() << "Effective FPS(raw):" << tot_frame_time_raw << " Target:" << target_frame_time_raw << LL_ENDL; // LL_INFOS() << "Effective FPS(raw):" << tot_frame_time_raw << " Target:" << target_frame_time_raw << LL_ENDL;
auto inferredFPS{1000/(U32)std::max(raw_to_ms(tot_frame_time_raw),1.0)}; auto inferredFPS{1000/(U32)std::max(raw_to_ms(tot_frame_time_raw),1.0)};
U32 settingsChangeFrequency{inferredFPS > 25?inferredFPS:25}; U32 settingsChangeFrequency{inferredFPS > 25?inferredFPS:25};
......
...@@ -55,6 +55,8 @@ namespace LLPerfStats ...@@ -55,6 +55,8 @@ namespace LLPerfStats
static constexpr U32 TUNE_AVATARS_ONLY{0}; static constexpr U32 TUNE_AVATARS_ONLY{0};
static constexpr U32 TUNE_SCENE_AND_AVATARS{1}; static constexpr U32 TUNE_SCENE_AND_AVATARS{1};
extern F64 cpu_hertz;
extern std::atomic<int64_t> tunedAvatars; extern std::atomic<int64_t> tunedAvatars;
extern std::atomic<U64> renderAvatarMaxART_ns; extern std::atomic<U64> renderAvatarMaxART_ns;
extern bool belowTargetFPS; extern bool belowTargetFPS;
...@@ -398,9 +400,9 @@ namespace LLPerfStats ...@@ -398,9 +400,9 @@ namespace LLPerfStats
}; };
inline double raw_to_ns(U64 raw) { return (static_cast<double>(raw) * 1000000000.0) / (F64)LLTrace::BlockTimer::countsPerSecond(); }; inline double raw_to_ns(U64 raw) { return (static_cast<double>(raw) * 1000000000.0) / LLPerfStats::cpu_hertz; };
inline double raw_to_us(U64 raw) { return (static_cast<double>(raw) * 1000000.0) / (F64)LLTrace::BlockTimer::countsPerSecond(); }; inline double raw_to_us(U64 raw) { return (static_cast<double>(raw) * 1000000.0) / LLPerfStats::cpu_hertz; };
inline double raw_to_ms(U64 raw) { return (static_cast<double>(raw) * 1000.0) / (F64)LLTrace::BlockTimer::countsPerSecond(); }; inline double raw_to_ms(U64 raw) { return (static_cast<double>(raw) * 1000.0) / LLPerfStats::cpu_hertz; };
using RecordSceneTime = RecordTime<ObjType_t::OT_GENERAL>; using RecordSceneTime = RecordTime<ObjType_t::OT_GENERAL>;
using RecordAvatarTime = RecordTime<ObjType_t::OT_AVATAR>; using RecordAvatarTime = RecordTime<ObjType_t::OT_AVATAR>;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment