diff options
Diffstat (limited to 'indra/llrender')
37 files changed, 37 insertions, 27 deletions
diff --git a/indra/llrender/CMakeLists.txt b/indra/llrender/CMakeLists.txt index 669b70aa43..669b70aa43 100644..100755 --- a/indra/llrender/CMakeLists.txt +++ b/indra/llrender/CMakeLists.txt diff --git a/indra/llrender/llcubemap.cpp b/indra/llrender/llcubemap.cpp index 362452d837..362452d837 100644..100755 --- a/indra/llrender/llcubemap.cpp +++ b/indra/llrender/llcubemap.cpp diff --git a/indra/llrender/llcubemap.h b/indra/llrender/llcubemap.h index ee2c41e026..ee2c41e026 100644..100755 --- a/indra/llrender/llcubemap.h +++ b/indra/llrender/llcubemap.h diff --git a/indra/llrender/llfontbitmapcache.cpp b/indra/llrender/llfontbitmapcache.cpp index c985f6b959..c985f6b959 100644..100755 --- a/indra/llrender/llfontbitmapcache.cpp +++ b/indra/llrender/llfontbitmapcache.cpp diff --git a/indra/llrender/llfontbitmapcache.h b/indra/llrender/llfontbitmapcache.h index c93b0c7320..c93b0c7320 100644..100755 --- a/indra/llrender/llfontbitmapcache.h +++ b/indra/llrender/llfontbitmapcache.h diff --git a/indra/llrender/llfontfreetype.cpp b/indra/llrender/llfontfreetype.cpp index 058bef43a5..058bef43a5 100644..100755 --- a/indra/llrender/llfontfreetype.cpp +++ b/indra/llrender/llfontfreetype.cpp diff --git a/indra/llrender/llfontfreetype.h b/indra/llrender/llfontfreetype.h index f1b23f22d5..f1b23f22d5 100644..100755 --- a/indra/llrender/llfontfreetype.h +++ b/indra/llrender/llfontfreetype.h diff --git a/indra/llrender/llfontgl.cpp b/indra/llrender/llfontgl.cpp index c4f36cabd0..c4f36cabd0 100644..100755 --- a/indra/llrender/llfontgl.cpp +++ b/indra/llrender/llfontgl.cpp diff --git a/indra/llrender/llfontgl.h b/indra/llrender/llfontgl.h index 0988e99deb..0988e99deb 100644..100755 --- a/indra/llrender/llfontgl.h +++ b/indra/llrender/llfontgl.h diff --git a/indra/llrender/llfontregistry.cpp b/indra/llrender/llfontregistry.cpp index f5ca8d5b04..f5ca8d5b04 100644..100755 --- a/indra/llrender/llfontregistry.cpp +++ b/indra/llrender/llfontregistry.cpp diff --git a/indra/llrender/llfontregistry.h b/indra/llrender/llfontregistry.h index 059248fbbd..059248fbbd 100644..100755 --- a/indra/llrender/llfontregistry.h +++ b/indra/llrender/llfontregistry.h diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index d8ccbf7b24..d8ccbf7b24 100644..100755 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h index 823de9d361..823de9d361 100644..100755 --- a/indra/llrender/llgl.h +++ b/indra/llrender/llgl.h diff --git a/indra/llrender/llgldbg.cpp b/indra/llrender/llgldbg.cpp index 4b68194db3..4b68194db3 100644..100755 --- a/indra/llrender/llgldbg.cpp +++ b/indra/llrender/llgldbg.cpp diff --git a/indra/llrender/llgldbg.h b/indra/llrender/llgldbg.h index 963579cb82..963579cb82 100644..100755 --- a/indra/llrender/llgldbg.h +++ b/indra/llrender/llgldbg.h diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h index a92ed428da..a92ed428da 100644..100755 --- a/indra/llrender/llglheaders.h +++ b/indra/llrender/llglheaders.h diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index 298a03f32a..298a03f32a 100644..100755 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h index 019d5a86d6..019d5a86d6 100644..100755 --- a/indra/llrender/llglslshader.h +++ b/indra/llrender/llglslshader.h diff --git a/indra/llrender/llglstates.h b/indra/llrender/llglstates.h index 0e2c3bcb44..0e2c3bcb44 100644..100755 --- a/indra/llrender/llglstates.h +++ b/indra/llrender/llglstates.h diff --git a/indra/llrender/llgltypes.h b/indra/llrender/llgltypes.h index 6c217ef727..6c217ef727 100644..100755 --- a/indra/llrender/llgltypes.h +++ b/indra/llrender/llgltypes.h diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 28b7830b0e..5aef2c972e 100755 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -736,10 +736,11 @@ void LLImageGL::setImage(const U8* data_in, BOOL data_hasmips) stop_glerror(); } - if (gGLManager.mHasFramebufferObject) + if (LLRender::sGLCoreProfile) { glGenerateMipmap(mTarget); - } + } + stop_glerror(); } } else @@ -1116,37 +1117,46 @@ void LLImageGL::deleteTextures(LLTexUnit::eTextureType type, U32 format, S32 mip { if (gGLManager.mInited) { - if (LLRender::sGLCoreProfile) + switch (format) { - switch (format) - { - case GL_LUMINANCE8: format = GL_RGB8; break; - case GL_LUMINANCE8_ALPHA8: - case GL_ALPHA8: format = GL_RGBA8; break; - } - } + case 0: - if (format == 0 || type == LLTexUnit::TT_CUBE_MAP || mip_levels == -1) - { //unknown internal format or unknown number of mip levels, not safe to reuse - glDeleteTextures(numTextures, textures); - } - else - { - for (S32 i = 0; i < numTextures; ++i) - { //remove texture from VRAM by setting its size to zero - for (S32 j = 0; j <= mip_levels; j++) - { - gGL.getTexUnit(0)->bindManual(type, textures[i]); + // We get ARB errors in debug when attempting to use glTexImage2D with these deprecated pix formats + // + case GL_LUMINANCE8: + case GL_INTENSITY8: + case GL_ALPHA8: + glDeleteTextures(numTextures, textures); + break; - glTexImage2D(LLTexUnit::getInternalType(type), j, format, 0, 0, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); + default: + { + if (type == LLTexUnit::TT_CUBE_MAP || mip_levels == -1) + { //unknown internal format or unknown number of mip levels, not safe to reuse + glDeleteTextures(numTextures, textures); } + else + { + for (S32 i = 0; i < numTextures; ++i) + { //remove texture from VRAM by setting its size to zero - llassert(std::find(sDeadTextureList[type][format].begin(), - sDeadTextureList[type][format].end(), textures[i]) == - sDeadTextureList[type][format].end()); + for (S32 j = 0; j <= mip_levels; j++) + { + gGL.getTexUnit(0)->bindManual(type, textures[i]); + U32 internal_type = LLTexUnit::getInternalType(type); + glTexImage2D(internal_type, j, format, 0, 0, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL); + stop_glerror(); + } + + llassert(std::find(sDeadTextureList[type][format].begin(), + sDeadTextureList[type][format].end(), textures[i]) == + sDeadTextureList[type][format].end()); - sDeadTextureList[type][format].push_back(textures[i]); - } + sDeadTextureList[type][format].push_back(textures[i]); + } + } + } + break; } } diff --git a/indra/llrender/llpostprocess.cpp b/indra/llrender/llpostprocess.cpp index 4c36185b08..4c36185b08 100644..100755 --- a/indra/llrender/llpostprocess.cpp +++ b/indra/llrender/llpostprocess.cpp diff --git a/indra/llrender/llpostprocess.h b/indra/llrender/llpostprocess.h index 6894505753..6894505753 100644..100755 --- a/indra/llrender/llpostprocess.h +++ b/indra/llrender/llpostprocess.h diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 18ca5b35f0..18ca5b35f0 100644..100755 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index 90b1ec2f57..90b1ec2f57 100644..100755 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h diff --git a/indra/llrender/llrendernavprim.cpp b/indra/llrender/llrendernavprim.cpp index ca72964832..ca72964832 100644..100755 --- a/indra/llrender/llrendernavprim.cpp +++ b/indra/llrender/llrendernavprim.cpp diff --git a/indra/llrender/llrendernavprim.h b/indra/llrender/llrendernavprim.h index a3a5dfec3a..a3a5dfec3a 100644..100755 --- a/indra/llrender/llrendernavprim.h +++ b/indra/llrender/llrendernavprim.h diff --git a/indra/llrender/llrendersphere.cpp b/indra/llrender/llrendersphere.cpp index 26bfe036e8..26bfe036e8 100644..100755 --- a/indra/llrender/llrendersphere.cpp +++ b/indra/llrender/llrendersphere.cpp diff --git a/indra/llrender/llrendersphere.h b/indra/llrender/llrendersphere.h index f8e9e86e7f..f8e9e86e7f 100644..100755 --- a/indra/llrender/llrendersphere.h +++ b/indra/llrender/llrendersphere.h diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp index 4a4f6a7a2f..4a4f6a7a2f 100644..100755 --- a/indra/llrender/llrendertarget.cpp +++ b/indra/llrender/llrendertarget.cpp diff --git a/indra/llrender/llrendertarget.h b/indra/llrender/llrendertarget.h index a7bc4e1385..a7bc4e1385 100644..100755 --- a/indra/llrender/llrendertarget.h +++ b/indra/llrender/llrendertarget.h diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 825f80a6dc..825f80a6dc 100644..100755 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp diff --git a/indra/llrender/llshadermgr.h b/indra/llrender/llshadermgr.h index 77e90372e0..77e90372e0 100644..100755 --- a/indra/llrender/llshadermgr.h +++ b/indra/llrender/llshadermgr.h diff --git a/indra/llrender/lltexture.cpp b/indra/llrender/lltexture.cpp index 90fbcec2be..90fbcec2be 100644..100755 --- a/indra/llrender/lltexture.cpp +++ b/indra/llrender/lltexture.cpp diff --git a/indra/llrender/lltexture.h b/indra/llrender/lltexture.h index 093bac20d1..093bac20d1 100644..100755 --- a/indra/llrender/lltexture.h +++ b/indra/llrender/lltexture.h diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 87fb76e46e..87fb76e46e 100644..100755 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index 52559d3505..52559d3505 100644..100755 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h |