master
Ansariel 2021-04-02 22:53:28 +02:00
commit 8a44c58dee
9 changed files with 149 additions and 61 deletions

View File

@ -404,10 +404,18 @@ BOOL LLGLSLShader::createShader(std::vector<LLStaticHashedString> * attributes,
mLightHash = 0xFFFFFFFF;
llassert_always(!mShaderFiles.empty());
BOOL success = TRUE;
// Create program
mProgramObject = glCreateProgramObjectARB();
if (mProgramObject == 0)
{
// Shouldn't happen if shader related extensions, like ARB_vertex_shader, exist.
LL_SHADER_LOADING_WARNS() << "Failed to create handle for shader: " << mName << LL_ENDL;
unloadInternal();
return FALSE;
}
BOOL success = TRUE;
#if LL_DARWIN
// work-around missing mix(vec3,vec3,bvec3)

View File

@ -617,13 +617,11 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
#endif
GLenum error = GL_NO_ERROR;
if (gDebugGL)
error = glGetError();
if (error != GL_NO_ERROR)
{
error = glGetError();
if (error != GL_NO_ERROR)
{
LL_SHADER_LOADING_WARNS() << "GL ERROR entering loadShaderFile(): " << error << LL_ENDL;
}
LL_SHADER_LOADING_WARNS() << "GL ERROR entering loadShaderFile(): " << error << " for file: " << filename << LL_ENDL;
}
if (filename.empty())
@ -972,55 +970,45 @@ GLhandleARB LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shade
//create shader object
GLhandleARB ret = glCreateShaderObjectARB(type);
if (gDebugGL)
error = glGetError();
if (error != GL_NO_ERROR)
{
error = glGetError();
if (error != GL_NO_ERROR)
{
LL_WARNS("ShaderLoading") << "GL ERROR in glCreateShaderObjectARB: " << error << LL_ENDL;
}
LL_WARNS("ShaderLoading") << "GL ERROR in glCreateShaderObjectARB: " << error << " for file: " << open_file_name << LL_ENDL;
}
//load source
glShaderSourceARB(ret, shader_code_count, (const GLcharARB**) shader_code_text, NULL);
if (gDebugGL)
error = glGetError();
if (error != GL_NO_ERROR)
{
error = glGetError();
if (error != GL_NO_ERROR)
{
LL_WARNS("ShaderLoading") << "GL ERROR in glShaderSourceARB: " << error << LL_ENDL;
}
LL_WARNS("ShaderLoading") << "GL ERROR in glShaderSourceARB: " << error << " for file: " << open_file_name << LL_ENDL;
}
//compile source
glCompileShaderARB(ret);
if (gDebugGL)
error = glGetError();
if (error != GL_NO_ERROR)
{
error = glGetError();
if (error != GL_NO_ERROR)
{
LL_WARNS("ShaderLoading") << "GL ERROR in glCompileShaderARB: " << error << LL_ENDL;
}
LL_WARNS("ShaderLoading") << "GL ERROR in glCompileShaderARB: " << error << " for file: " << open_file_name << LL_ENDL;
}
if (error == GL_NO_ERROR)
{
//check for errors
GLint success = GL_TRUE;
glGetObjectParameterivARB(ret, GL_OBJECT_COMPILE_STATUS_ARB, &success);
if (gDebugGL || success == GL_FALSE)
error = glGetError();
if (error != GL_NO_ERROR || success == GL_FALSE)
{
error = glGetError();
if (error != GL_NO_ERROR || success == GL_FALSE)
{
//an error occured, print log
LL_WARNS("ShaderLoading") << "GLSL Compilation Error:" << LL_ENDL;
dumpObjectLog(ret, TRUE, open_file_name);
dumpShaderSource(shader_code_count, shader_code_text);
ret = 0;
}
//an error occured, print log
LL_WARNS("ShaderLoading") << "GLSL Compilation Error:" << LL_ENDL;
dumpObjectLog(ret, TRUE, open_file_name);
dumpShaderSource(shader_code_count, shader_code_text);
ret = 0;
}
}
else

View File

@ -1289,6 +1289,46 @@ bool LLAppViewer::init()
}
}
#if LL_WINDOWS && ADDRESS_SIZE == 64
if (gGLManager.mIsIntel)
{
// Check intel driver's version
// Ex: "3.1.0 - Build 8.15.10.2559";
std::string version = ll_safe_string((const char *)glGetString(GL_VERSION));
const boost::regex is_intel_string("[0-9].[0-9].[0-9] - Build [0-9]{1,2}.[0-9]{2}.[0-9]{2}.[0-9]{4}");
if (boost::regex_search(version, is_intel_string))
{
// Valid string, extract driver version
std::size_t found = version.find("Build ");
std::string driver = version.substr(found + 6);
S32 v1, v2, v3, v4;
S32 count = sscanf(driver.c_str(), "%d.%d.%d.%d", &v1, &v2, &v3, &v4);
if (count > 0 && v1 <= 10)
{
LL_INFOS("AppInit") << "Detected obsolete intel driver: " << driver << LL_ENDL;
LLUIString details = LLNotifications::instance().getGlobalString("UnsupportedIntelDriver");
std::string gpu_name = ll_safe_string((const char *)glGetString(GL_RENDERER));
details.setArg("[VERSION]", driver);
details.setArg("[GPUNAME]", gpu_name);
S32 button = OSMessageBox(details.getString(),
LLStringUtil::null,
OSMB_YESNO);
if (OSBTN_YES == button && gViewerWindow)
{
std::string url = LLWeb::escapeURL(LLTrans::getString("IntelDriverPage"));
if (gViewerWindow->getWindow())
{
gViewerWindow->getWindow()->spawnWebBrowser(url, false);
}
}
}
}
}
#endif
// Obsolete? mExpectedGLVersion is always zero
#if LL_WINDOWS
if (gGLManager.mGLVersion < LLFeatureManager::getInstance()->getExpectedGLVersion())
{

View File

@ -357,7 +357,7 @@ LLConversationItemParticipant* LLConversationItemSession::findParticipant(const
for (iter = mChildren.begin(); iter != mChildren.end(); iter++)
{
participant = dynamic_cast<LLConversationItemParticipant*>(*iter);
if (participant->hasSameValue(participant_id))
if (participant && participant->hasSameValue(participant_id))
{
break;
}
@ -468,7 +468,7 @@ const bool LLConversationItemSession::getTime(F64& time) const
{
participant = dynamic_cast<LLConversationItemParticipant*>(*iter);
F64 participant_time;
if (participant->getTime(participant_time))
if (participant && participant->getTime(participant_time))
{
has_time = true;
most_recent_time = llmax(most_recent_time,participant_time);

View File

@ -619,10 +619,13 @@ void LLConversationViewParticipant::refresh()
{
// Refresh the participant view from its model data
LLConversationItemParticipant* participant_model = dynamic_cast<LLConversationItemParticipant*>(getViewModelItem());
participant_model->resetRefresh();
// *TODO: We should also do something with vmi->isModerator() to echo that state in the UI somewhat
mSpeakingIndicator->setIsModeratorMuted(participant_model->isModeratorMuted());
if (participant_model)
{
participant_model->resetRefresh();
// *TODO: We should also do something with vmi->isModerator() to echo that state in the UI somewhat
mSpeakingIndicator->setIsModeratorMuted(participant_model->isModeratorMuted());
}
// Do the regular upstream refresh
LLFolderViewItem::refresh();

View File

@ -63,7 +63,9 @@
#include "boost/foreach.hpp"
const S32 EVENTS_PER_IDLE_LOOP = 100;
const S32 EVENTS_PER_IDLE_LOOP_CURRENT_SESSION = 80;
const S32 EVENTS_PER_IDLE_LOOP_BACKGROUND = 40;
const F32 EVENTS_PER_IDLE_LOOP_MIN_PERCENTAGE = 0.01f; // process a minimum of 1% of total events per frame
//
// LLFloaterIMContainer
@ -420,8 +422,11 @@ void LLFloaterIMContainer::processParticipantsStyleUpdate()
while (current_participant_model != end_participant_model)
{
LLConversationItemParticipant* participant_model = dynamic_cast<LLConversationItemParticipant*>(*current_participant_model);
// Get the avatar name for this participant id from the cache and update the model
participant_model->updateName();
if (participant_model)
{
// Get the avatar name for this participant id from the cache and update the model
participant_model->updateName();
}
// Next participant
current_participant_model++;
}
@ -468,8 +473,11 @@ void LLFloaterIMContainer::idleUpdate()
while (current_participant_model != end_participant_model)
{
LLConversationItemParticipant* participant_model = dynamic_cast<LLConversationItemParticipant*>(*current_participant_model);
participant_model->setModeratorOptionsVisible(is_moderator);
participant_model->setGroupBanVisible(can_ban && participant_model->getUUID() != gAgentID);
if (participant_model)
{
participant_model->setModeratorOptionsVisible(is_moderator);
participant_model->setGroupBanVisible(can_ban && participant_model->getUUID() != gAgentID);
}
current_participant_model++;
}
@ -502,20 +510,49 @@ void LLFloaterIMContainer::idleUpdate()
void LLFloaterIMContainer::idleProcessEvents()
{
if (!mConversationEventQueue.empty())
{
S32 events_to_handle = llmin((S32)mConversationEventQueue.size(), EVENTS_PER_IDLE_LOOP);
for (S32 i = 0; i < events_to_handle; i++)
{
handleConversationModelEvent(mConversationEventQueue.back());
mConversationEventQueue.pop_back();
}
}
LLUUID current_session_id = getSelectedSession();
conversations_items_deque::iterator iter = mConversationEventQueue.begin();
conversations_items_deque::iterator end = mConversationEventQueue.end();
while (iter != end)
{
std::deque<LLSD> &events = iter->second;
if (!events.empty())
{
S32 events_to_handle;
S32 query_size = (S32)events.size();
if (current_session_id == iter->first)
{
events_to_handle = EVENTS_PER_IDLE_LOOP_CURRENT_SESSION;
}
else
{
events_to_handle = EVENTS_PER_IDLE_LOOP_BACKGROUND;
}
if (events_to_handle <= query_size)
{
// Some groups can be very large and can generate huge amount of updates, scale processing up to keep up
events_to_handle = llmax(events_to_handle, (S32)(query_size * EVENTS_PER_IDLE_LOOP_MIN_PERCENTAGE));
}
else
{
events_to_handle = query_size;
}
for (S32 i = 0; i < events_to_handle; i++)
{
handleConversationModelEvent(events.back());
events.pop_back();
}
}
iter++;
}
}
bool LLFloaterIMContainer::onConversationModelEvent(const LLSD& event)
{
mConversationEventQueue.push_front(event);
LLUUID id = event.get("session_uuid").asUUID();
mConversationEventQueue[id].push_front(event);
return true;
}
@ -1835,6 +1872,8 @@ bool LLFloaterIMContainer::removeConversationListItem(const LLUUID& uuid, bool c
// Suppress the conversation items and widgets from their respective maps
mConversationsItems.erase(uuid);
mConversationsWidgets.erase(uuid);
// Clear event query (otherwise reopening session in some way can bombard session with stale data)
mConversationEventQueue.erase(uuid);
// Don't let the focus fall IW, select and refocus on the first conversation in the list
if (change_focus)

View File

@ -231,9 +231,10 @@ private:
conversations_widgets_map mConversationsWidgets;
LLConversationViewModel mConversationViewModel;
LLFolderView* mConversationsRoot;
LLEventStream mConversationsEventStream;
LLEventStream mConversationsEventStream;
std::deque<LLSD> mConversationEventQueue;
typedef std::map<LLUUID, std::deque<LLSD> > conversations_items_deque;
conversations_items_deque mConversationEventQueue;
LLTimer mParticipantRefreshTimer;
};

View File

@ -494,7 +494,10 @@ void LLFloaterIMSessionTab::buildConversationViewParticipant()
while (current_participant_model != end_participant_model)
{
LLConversationItem* participant_model = dynamic_cast<LLConversationItem*>(*current_participant_model);
addConversationViewParticipant(participant_model);
if (participant_model)
{
addConversationViewParticipant(participant_model);
}
current_participant_model++;
}
}

View File

@ -10275,6 +10275,12 @@ You do not appear to have the proper hardware requirements for [APP_NAME]. [APP_
If you continue to have problems, please visit the [SUPPORT_SITE].
</global>
<global name="UnsupportedIntelDriver">
The installed Intel graphics driver for [GPUNAME], version [VERSION], is significantly out of date and is known to cause excessive rates of program crashes. You are strongly advised to update to a current Intel driver
Do you want to check the Intel driver website?
</global>
<global name="UnsupportedCPUAmount">
796
</global>