From 68875523e09f9fe06fc4b3cd5225995bb13966c3 Mon Sep 17 00:00:00 2001 From: RunitaiLinden Date: Thu, 30 Nov 2023 12:01:45 -0600 Subject: SL-20611 Incorporate water haze into new post effect atmospherics goodness --- indra/newview/lleventpoll.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'indra/newview/lleventpoll.cpp') diff --git a/indra/newview/lleventpoll.cpp b/indra/newview/lleventpoll.cpp index 26782e53f0..670a780fdd 100644 --- a/indra/newview/lleventpoll.cpp +++ b/indra/newview/lleventpoll.cpp @@ -102,6 +102,7 @@ namespace Details void LLEventPollImpl::handleMessage(const LLSD& content) { + LL_PROFILE_ZONE_SCOPED_CATEGORY_APP; std::string msg_name = content["message"]; LLSD message; message["sender"] = mSenderIp; @@ -149,6 +150,12 @@ namespace Details mAdapter = httpAdapter; + LL::WorkQueue::ptr_t main_queue = nullptr; + +#if 1 + main_queue = LL::WorkQueue::getInstance("mainloop"); +#endif + // continually poll for a server update until we've been flagged as // finished while (!mDone) @@ -266,13 +273,26 @@ namespace Details // was LL_INFOS() but now that CoarseRegionUpdate is TCP @ 1/second, it'd be too verbose for viewer logs. -MG LL_DEBUGS("LLEventPollImpl") << " <" << counter << "> " << events.size() << "events (id " << acknowledge << ")" << LL_ENDL; + LLSD::array_const_iterator i = events.beginArray(); LLSD::array_const_iterator end = events.endArray(); for (; i != end; ++i) { if (i->has("message")) { - handleMessage(*i); + if (main_queue) + { // shuttle to a sensible spot in the main thread instead + // of wherever this coroutine happens to be executing + const LLSD& msg = *i; + main_queue->post([this, msg]() + { + handleMessage(msg); + }); + } + else + { + handleMessage(*i); + } } } } -- cgit v1.2.3 From c573d27e5baf23adbc14153c4d65a581f55febb4 Mon Sep 17 00:00:00 2001 From: RunitaiLinden Date: Fri, 1 Dec 2023 14:49:22 -0600 Subject: SL-20611 Followup -- fix for water rendering twice. Add comments around LLEventPoll hack. --- indra/newview/lleventpoll.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'indra/newview/lleventpoll.cpp') diff --git a/indra/newview/lleventpoll.cpp b/indra/newview/lleventpoll.cpp index 670a780fdd..6ffc8f7bdd 100644 --- a/indra/newview/lleventpoll.cpp +++ b/indra/newview/lleventpoll.cpp @@ -152,6 +152,8 @@ namespace Details LL::WorkQueue::ptr_t main_queue = nullptr; + // HACK -- grab the mainloop workqueue to move execution of the handler + // to a place that's safe in the main thread #if 1 main_queue = LL::WorkQueue::getInstance("mainloop"); #endif -- cgit v1.2.3