From a313cedd69309910a79c8354a2d994fe5deabd74 Mon Sep 17 00:00:00 2001 From: Xiaohong Bao Date: Mon, 7 Mar 2011 15:02:48 -0700 Subject: fix for STORM-1026: Viewer crahes while trying to reset Graphics quality. reviewed by davep --- indra/llrender/llvertexbuffer.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'indra/llrender') diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 7b5907a668..b515e4fcab 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -310,7 +310,18 @@ void LLVertexBuffer::drawArrays(U32 mode, U32 first, U32 count) const //static void LLVertexBuffer::initClass(bool use_vbo, bool no_vbo_mapping) { - sEnableVBOs = use_vbo; + sEnableVBOs = use_vbo && gGLManager.mHasVertexBufferObject ; + if(sEnableVBOs) + { + llassert_always(glBindBufferARB) ; //double check the extention for VBO is loaded. + + llinfos << "VBO is enabled." << llendl ; + } + else + { + llinfos << "VBO is disabled." << llendl ; + } + sDisableVBOMapping = sEnableVBOs && no_vbo_mapping ; LLGLNamePool::registerPool(&sDynamicVBOPool); LLGLNamePool::registerPool(&sDynamicIBOPool); -- cgit v1.2.3 From 76a325b83271424d231561d8ef099df1406c9517 Mon Sep 17 00:00:00 2001 From: Merov Linden Date: Tue, 8 Mar 2011 17:00:39 -0800 Subject: STORM-1026 : Suppress trivial assert that makes Mac build fail (warning treated as error) --- indra/llrender/llvertexbuffer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/llrender') diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index b515e4fcab..1beb74eca6 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -313,7 +313,7 @@ void LLVertexBuffer::initClass(bool use_vbo, bool no_vbo_mapping) sEnableVBOs = use_vbo && gGLManager.mHasVertexBufferObject ; if(sEnableVBOs) { - llassert_always(glBindBufferARB) ; //double check the extention for VBO is loaded. + //llassert_always(glBindBufferARB) ; //double check the extention for VBO is loaded. llinfos << "VBO is enabled." << llendl ; } -- cgit v1.2.3 From 5fd953df8fafb769d31688c47cf3f8634f858de5 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 10 Mar 2011 00:41:46 -0600 Subject: SH-874 Properly detect available video memory on ATI cards and disable vertex buffer objects when available vram is under 256MB. --- indra/llrender/llgl.cpp | 10 ++++++++++ indra/llrender/llgl.h | 1 + 2 files changed, 11 insertions(+) (limited to 'indra/llrender') diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 9354373dba..d1eb4c8be0 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -313,6 +313,7 @@ LLGLManager::LLGLManager() : mIsDisabled(FALSE), mHasMultitexture(FALSE), + mHasATIMemInfo(FALSE), mNumTextureUnits(1), mHasMipMapGeneration(FALSE), mHasCompressedTextures(FALSE), @@ -497,6 +498,14 @@ bool LLGLManager::initGL() // This is called here because it depends on the setting of mIsGF2or4MX, and sets up mHasMultitexture. initExtensions(); + if (mHasATIMemInfo) + { //ask the gl how much vram is free at startup and attempt to use no more than half of that + S32 meminfo[4]; + glGetIntegerv(GL_TEXTURE_FREE_MEMORY_ATI, meminfo); + + mVRAM = meminfo[0]/1024; + } + if (mHasMultitexture) { GLint num_tex_units; @@ -659,6 +668,7 @@ void LLGLManager::initExtensions() mHasTextureRectangle = FALSE; #else // LL_MESA_HEADLESS mHasMultitexture = glh_init_extensions("GL_ARB_multitexture"); + mHasATIMemInfo = ExtensionExists("GL_ATI_meminfo", gGLHExts.mSysExts); mHasMipMapGeneration = glh_init_extensions("GL_SGIS_generate_mipmap"); mHasSeparateSpecularColor = glh_init_extensions("GL_EXT_separate_specular_color"); mHasAnisotropic = glh_init_extensions("GL_EXT_texture_filter_anisotropic"); diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h index df110613e3..f4be067f2e 100644 --- a/indra/llrender/llgl.h +++ b/indra/llrender/llgl.h @@ -76,6 +76,7 @@ public: // Extensions used by everyone BOOL mHasMultitexture; + BOOL mHasATIMemInfo; S32 mNumTextureUnits; BOOL mHasMipMapGeneration; BOOL mHasCompressedTextures; -- cgit v1.2.3