diff options
author | Kyle Ambroff <ambroff@lindenlab.com> | 2011-01-27 15:14:18 -0800 |
---|---|---|
committer | Kyle Ambroff <ambroff@lindenlab.com> | 2011-01-27 15:14:18 -0800 |
commit | 5161b500c97878179cc4f8c9a0df717a25c5cb14 (patch) | |
tree | 1e95b17c64f050a8179935a0ad69393f3d044a5b /indra/llrender | |
parent | a4de39381ffcfeb455c3860ace7e7da7f756f774 (diff) |
Prevent crashiness from DisableRendering setting.
When DisableRendering is set, bypass all of the new rendering code that would
have crashed otherwise, since the GL manager isn't initialized.
Many of these blocks will be removed once I get LLWindowHeadless working with
the viewer.
--HG--
branch : headless
Diffstat (limited to 'indra/llrender')
-rw-r--r-- | indra/llrender/llgl.cpp | 42 | ||||
-rw-r--r-- | indra/llrender/llimagegl.cpp | 18 |
2 files changed, 53 insertions, 7 deletions
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 6ea63809f8..4d9ed0f0e2 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -538,9 +538,24 @@ void LLGLManager::setToDebugGPU() void LLGLManager::getGLInfo(LLSD& info) { - info["GLInfo"]["GLVendor"] = std::string((const char *)glGetString(GL_VENDOR)); - info["GLInfo"]["GLRenderer"] = std::string((const char *)glGetString(GL_RENDERER)); - info["GLInfo"]["GLVersion"] = std::string((const char *)glGetString(GL_VERSION)); + // KWA FIXME: Disabling this for now if we are headless. Will revert + // this after MESA implementation of llwindow is working for the + // headless viewer. + if (gNoRender) + { + info["GLInfo"]["GLVendor"] = ""; + info["GLInfo"]["GLRenderer"] = ""; + info["GLInfo"]["GLVersion"] = ""; + } + else + { + info["GLInfo"]["GLVendor"] = + std::string((const char *)glGetString(GL_VENDOR)); + info["GLInfo"]["GLRenderer"] = + std::string((const char *)glGetString(GL_RENDERER)); + info["GLInfo"]["GLVersion"] = + std::string((const char *)glGetString(GL_VERSION)); + } #if !LL_MESA_HEADLESS std::string all_exts = ll_safe_string((const char *)gGLHExts.mSysExts); @@ -573,12 +588,25 @@ std::string LLGLManager::getGLInfoString() void LLGLManager::printGLInfoString() { + // KWA FIXME remove this when mesa implementation of llwindow is + // working. + if (gNoRender) + { + return; + } + std::string info_str; std::string all_exts, line; - - LL_INFOS("RenderInit") << "GL_VENDOR: " << ((const char *)glGetString(GL_VENDOR)) << LL_ENDL; - LL_INFOS("RenderInit") << "GL_RENDERER: " << ((const char *)glGetString(GL_RENDERER)) << LL_ENDL; - LL_INFOS("RenderInit") << "GL_VERSION: " << ((const char *)glGetString(GL_VERSION)) << LL_ENDL; + + LL_INFOS("RenderInit") << "GL_VENDOR: " + << ((const char *)glGetString(GL_VENDOR)) + << LL_ENDL; + LL_INFOS("RenderInit") << "GL_RENDERER: " + << ((const char *)glGetString(GL_RENDERER)) + << LL_ENDL; + LL_INFOS("RenderInit") << "GL_VERSION: " + << ((const char *)glGetString(GL_VERSION)) + << LL_ENDL; #if !LL_MESA_HEADLESS all_exts = std::string(gGLHExts.mSysExts); diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index e8e98211f1..4dfae948a8 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -1100,6 +1100,12 @@ void LLImageGL::setManualImage(U32 target, S32 miplevel, S32 intformat, S32 widt //the texture is assiciate with some image by calling glTexImage outside LLImageGL BOOL LLImageGL::createGLTexture() { + // KWA FIXME remove this when MESA llwindow works in the viewer. + if (gNoRender) + { + return FALSE; + } + if (gGLManager.mIsDisabled) { llwarns << "Trying to create a texture while GL is disabled!" << llendl; @@ -1128,6 +1134,12 @@ BOOL LLImageGL::createGLTexture() BOOL LLImageGL::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, S32 usename/*=0*/, BOOL to_create, S32 category) { + // KWA FIXME remove this when MESA llwindow works in the viewer. + if (gNoRender) + { + return FALSE; + } + if (gGLManager.mIsDisabled) { llwarns << "Trying to create a texture while GL is disabled!" << llendl; @@ -1202,6 +1214,12 @@ BOOL LLImageGL::createGLTexture(S32 discard_level, const LLImageRaw* imageraw, S BOOL LLImageGL::createGLTexture(S32 discard_level, const U8* data_in, BOOL data_hasmips, S32 usename) { + // KWA FIXME remove this when MESA llwindow works in the viewer. + if (gNoRender) + { + return FALSE; + } + llassert(data_in); if (discard_level < 0) |