summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-01-11 21:13:17 +0200
committerAndrey Kleshchev <andreykproductengine@lindenlab.com>2022-01-11 21:29:04 +0200
commit59356963c4a34081a0c0fb0235c267c06fbcb832 (patch)
tree3d7cb562fcaef1c9d1aedb6d2e3ea831f5d49919
parent82a3c185cd39646af861fe8355fa9539f7d3441e (diff)
SL-16614 Viewer's uploader crash with RenderGLCoreProfile
-rw-r--r--indra/cmake/GLOD.cmake2
-rw-r--r--indra/newview/CMakeLists.txt4
-rw-r--r--indra/newview/llfloatermodelpreview.cpp21
-rw-r--r--indra/newview/llfloatermodelpreview.h1
-rw-r--r--indra/newview/llviewermenufile.cpp9
-rw-r--r--indra/newview/skins/default/xui/en/notifications.xml7
6 files changed, 37 insertions, 7 deletions
diff --git a/indra/cmake/GLOD.cmake b/indra/cmake/GLOD.cmake
index a347eb6fee..6f42b44ab8 100644
--- a/indra/cmake/GLOD.cmake
+++ b/indra/cmake/GLOD.cmake
@@ -5,5 +5,7 @@ if (NOT USESYSTEMLIBS)
use_prebuilt_binary(glod)
endif (NOT USESYSTEMLIBS)
+set(GLODLIB ON CACHE BOOL "Using GLOD library")
+
set(GLOD_INCLUDE_DIR ${LIBS_PREBUILT_DIR}/include)
set(GLOD_LIBRARIES GLOD)
diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt
index 13f8749b9f..6e648485fd 100644
--- a/indra/newview/CMakeLists.txt
+++ b/indra/newview/CMakeLists.txt
@@ -1751,6 +1751,10 @@ endif (HAVOK OR HAVOK_TPV)
# progress view disables/enables icons based on available packages
set_source_files_properties(llprogressview.cpp PROPERTIES COMPILE_FLAGS "${LLSTARTUP_COMPILE_FLAGS}")
+if (GLODLIB)
+ set_source_files_properties(llfloatermodelpreview.cpp PROPERTIES COMPILE_FLAGS "-DLL_GLOD")
+endif (GLODLIB)
+
list(APPEND viewer_SOURCE_FILES ${viewer_HEADER_FILES})
set_source_files_properties(${viewer_HEADER_FILES}
diff --git a/indra/newview/llfloatermodelpreview.cpp b/indra/newview/llfloatermodelpreview.cpp
index 64b24d54c3..6d23d14374 100644
--- a/indra/newview/llfloatermodelpreview.cpp
+++ b/indra/newview/llfloatermodelpreview.cpp
@@ -40,6 +40,7 @@
#include "llagent.h"
#include "llbutton.h"
#include "llcombobox.h"
+#include "llfloaterreg.h"
#include "llfocusmgr.h"
#include "llmeshrepository.h"
#include "llnotificationsutil.h"
@@ -347,6 +348,26 @@ void LLFloaterModelPreview::initModelPreview()
mModelPreview->setModelUpdatedCallback(boost::bind(&LLFloaterModelPreview::modelUpdated, this, _1));
}
+//static
+bool LLFloaterModelPreview::showModelPreview()
+{
+#ifdef LL_GLOD
+ if (LLRender::sGLCoreProfile)
+ {
+ // GLOD is incompatible with RenderGLCoreProfile, will crash on init
+ LLNotificationsUtil::add("MeshUploadProfilerError");
+ return false;
+ }
+#endif
+
+ LLFloaterModelPreview* fmp = (LLFloaterModelPreview*)LLFloaterReg::getInstance("upload_model");
+ if (fmp && !fmp->isModelLoading())
+ {
+ fmp->loadHighLodModel();
+ }
+ return true;
+}
+
void LLFloaterModelPreview::onUploadOptionChecked(LLUICtrl* ctrl)
{
if (mModelPreview)
diff --git a/indra/newview/llfloatermodelpreview.h b/indra/newview/llfloatermodelpreview.h
index 8a01b0c307..19b13bc48a 100644
--- a/indra/newview/llfloatermodelpreview.h
+++ b/indra/newview/llfloatermodelpreview.h
@@ -73,6 +73,7 @@ public:
/*virtual*/ void reshape(S32 width, S32 height, BOOL called_from_parent = TRUE);
void initModelPreview();
+ static bool showModelPreview();
BOOL handleMouseDown(S32 x, S32 y, MASK mask);
BOOL handleMouseUp(S32 x, S32 y, MASK mask);
diff --git a/indra/newview/llviewermenufile.cpp b/indra/newview/llviewermenufile.cpp
index 4efc3d1cb3..4da1bcf541 100644
--- a/indra/newview/llviewermenufile.cpp
+++ b/indra/newview/llviewermenufile.cpp
@@ -549,13 +549,8 @@ class LLFileUploadModel : public view_listener_t
{
bool handleEvent(const LLSD& userdata)
{
- LLFloaterModelPreview* fmp = (LLFloaterModelPreview*) LLFloaterReg::getInstance("upload_model");
- if (fmp && !fmp->isModelLoading())
- {
- fmp->loadHighLodModel();
- }
-
- return TRUE;
+ LLFloaterModelPreview::showModelPreview();
+ return TRUE;
}
};
diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml
index b1229d90a3..9d520d5f9a 100644
--- a/indra/newview/skins/default/xui/en/notifications.xml
+++ b/indra/newview/skins/default/xui/en/notifications.xml
@@ -8766,6 +8766,13 @@ See SecondLife.log for details
type="alert">
Error while requesting mesh upload permissons.
</notification>
+
+ <notification
+ name="MeshUploadProfilerError"
+ icon="alert.tga"
+ type="alert">
+Mesh uploader is incompatible with RenderGLCoreProfile, please turn RenderGLCoreProfile off in debug settings and restart the viewer.
+ </notification>
<notification
name="RegionCapabilityRequestError"