summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrey Kleshchev <andreykproductengine@lindenlab.com>2024-01-24 23:56:22 +0200
committerAndrey Kleshchev <117672381+akleshchev@users.noreply.github.com>2024-01-25 01:40:53 +0200
commit56a9322569c3e36e68f47b6b5e4e488c917e9e26 (patch)
treef2b1c7973e3c87b0ad26b0bbbc369d9dd31f6cde
parent03afd4ee7866a5ffc81c5fb62edca58607693243 (diff)
Issue #54 LLRender::init crash
-rw-r--r--indra/llrender/llrender.cpp10
-rw-r--r--indra/llrender/llrender.h2
-rw-r--r--indra/newview/llviewerwindow.cpp6
3 files changed, 15 insertions, 3 deletions
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index ee66122774..4d64dc9e10 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -857,7 +857,7 @@ LLRender::~LLRender()
shutdown();
}
-void LLRender::init(bool needs_vertex_buffer)
+bool LLRender::init(bool needs_vertex_buffer)
{
#if LL_WINDOWS
if (gGLManager.mHasDebugOutput && gDebugGL)
@@ -879,6 +879,13 @@ void LLRender::init(bool needs_vertex_buffer)
// necessary for reflection maps
glEnable(GL_TEXTURE_CUBE_MAP_SEAMLESS);
+#if LL_WINDOWS
+ if (glGenVertexArrays == nullptr)
+ {
+ return false;
+ }
+#endif
+
{ //bind a dummy vertex array object so we're core profile compliant
U32 ret;
glGenVertexArrays(1, &ret);
@@ -889,6 +896,7 @@ void LLRender::init(bool needs_vertex_buffer)
{
initVertexBuffer();
}
+ return true;
}
void LLRender::initVertexBuffer()
diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h
index fd922affba..716b52354d 100644
--- a/indra/llrender/llrender.h
+++ b/indra/llrender/llrender.h
@@ -375,7 +375,7 @@ public:
LLRender();
~LLRender();
- void init(bool needs_vertex_buffer);
+ bool init(bool needs_vertex_buffer);
void initVertexBuffer();
void resetVertexBuffer();
void shutdown();
diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp
index a89d535943..3eb485dfc8 100644
--- a/indra/newview/llviewerwindow.cpp
+++ b/indra/newview/llviewerwindow.cpp
@@ -1958,7 +1958,11 @@ LLViewerWindow::LLViewerWindow(const Params& p)
// Initialize OpenGL Renderer
LLVertexBuffer::initClass(mWindow);
LL_INFOS("RenderInit") << "LLVertexBuffer initialization done." << LL_ENDL ;
- gGL.init(true);
+ if (!gGL.init(true))
+ {
+ LLError::LLUserWarningMsg::show(LLTrans::getString("MBVideoDrvErr"));
+ LL_ERRS() << "gGL not initialized" << LL_ENDL;
+ }
if (LLFeatureManager::getInstance()->isSafe()
|| (gSavedSettings.getS32("LastFeatureVersion") != LLFeatureManager::getInstance()->getVersion())