From c9eae38156b1eafad0c9e3ba5fdf7989b0a8d9db Mon Sep 17 00:00:00 2001 From: Boroondas Gupte Date: Mon, 20 Jun 2011 15:16:27 +0200 Subject: VWR-26066: FIXED request LLFloaterWorldMap child "zoom slider" with correct type LLSliderCtrl instead of LLSlider to get rid of warning when opening map flaoter --- doc/contributions.txt | 1 + indra/newview/llfloaterworldmap.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/doc/contributions.txt b/doc/contributions.txt index c18d3eb171..ccae0de59b 100644 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -125,6 +125,7 @@ blino Nakamura VWR-17 Boroondas Gupte VWR-233 + VWR-26066 WEB-262 Bulli Schumann CT-218 diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index cdc4cbc411..bd68875ba5 100644 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -67,7 +67,7 @@ #include "llappviewer.h" #include "llmapimagetype.h" #include "llweb.h" -#include "llslider.h" +#include "llsliderctrl.h" #include "llglheaders.h" #include "llwindow.h" // copyTextToClipboard() @@ -974,7 +974,7 @@ void LLFloaterWorldMap::adjustZoomSliderBounds() F32 min_power = log(pixels_per_region/256.f)/log(2.f); - getChild("zoom slider")->setMinValue(min_power); + getChild("zoom slider")->setMinValue(min_power); } -- cgit v1.2.3 From 52b9842ced222ac05f54058833f9404409eb0c79 Mon Sep 17 00:00:00 2001 From: seth_productengine Date: Thu, 7 Jul 2011 21:09:09 +0300 Subject: STORM-1476 FIXED Replaced non-fatal errors in LLDirIterator constructor with warnings to avoid viewer crashes. Added exception handling case. --- indra/llvfs/lldiriterator.cpp | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/indra/llvfs/lldiriterator.cpp b/indra/llvfs/lldiriterator.cpp index 25550321f0..ff92cbb7fd 100644 --- a/indra/llvfs/lldiriterator.cpp +++ b/indra/llvfs/lldiriterator.cpp @@ -52,8 +52,20 @@ LLDirIterator::Impl::Impl(const std::string &dirname, const std::string &mask) { fs::path dir_path(dirname); - // Check if path exists. - if (!fs::exists(dir_path)) + bool is_dir = false; + + // Check if path is a directory. + try + { + is_dir = fs::is_directory(dir_path); + } + catch (fs::basic_filesystem_error& e) + { + llwarns << e.what() << llendl; + return; + } + + if (!is_dir) { llwarns << "Invalid path: \"" << dir_path.string() << "\"" << llendl; return; @@ -66,7 +78,7 @@ LLDirIterator::Impl::Impl(const std::string &dirname, const std::string &mask) } catch (fs::basic_filesystem_error& e) { - llerrs << e.what() << llendl; + llwarns << e.what() << llendl; return; } @@ -82,7 +94,7 @@ LLDirIterator::Impl::Impl(const std::string &dirname, const std::string &mask) } catch (boost::regex_error& e) { - llerrs << "\"" << exp << "\" is not a valid regular expression: " + llwarns << "\"" << exp << "\" is not a valid regular expression: " << e.what() << llendl; return; } -- cgit v1.2.3 From f1443579b32cf260e7ad35f35de3930f0f801bd2 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Sat, 9 Jul 2011 02:28:34 -0500 Subject: SH-2038 Potential fix for a myriad of performance problems concering VBO usage. --- indra/llrender/llvertexbuffer.cpp | 5 ++- indra/newview/featuretable.txt | 6 ++-- indra/newview/featuretable_linux.txt | 6 ++-- indra/newview/featuretable_mac.txt | 11 ++----- indra/newview/featuretable_xp.txt | 6 ++-- indra/newview/llface.cpp | 64 ++++++++++++++++++++++++++---------- indra/newview/llfeaturemanager.cpp | 4 +++ indra/newview/llvovolume.cpp | 38 ++++++++++----------- 8 files changed, 81 insertions(+), 59 deletions(-) diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 4a0b964e61..6c972647f8 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -1008,6 +1008,7 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran LLMemType mt_v(LLMemType::MTYPE_VERTEX_MAP_BUFFER_VERTICES); setBuffer(0, type); mVertexLocked = TRUE; + sMappedCount++; stop_glerror(); if(sDisableVBOMapping) @@ -1082,7 +1083,6 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran llerrs << "memory allocation for vertex data failed." << llendl ; } } - sMappedCount++; } } else @@ -1152,6 +1152,7 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range) setBuffer(0, TYPE_INDEX); mIndexLocked = TRUE; + sMappedCount++; stop_glerror(); if(sDisableVBOMapping) @@ -1211,8 +1212,6 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range) llerrs << "memory allocation for Index data failed. " << llendl ; } } - - sMappedCount++; } else { diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt index 5384660d4c..b81053c140 100644 --- a/indra/newview/featuretable.txt +++ b/indra/newview/featuretable.txt @@ -1,4 +1,4 @@ -version 30 +version 31 // NOTE: This is mostly identical to featuretable_mac.txt with a few differences // Should be combined into one table @@ -246,9 +246,9 @@ RenderDeferredSSAO 0 0 RenderShadowDetail 0 0 // -// No GL_ARB_map_buffer_range +// GL_ARB_map_buffer_range exists // -list NoMapBufferRange +list MapBufferRange RenderVBOMappingDisable 1 0 diff --git a/indra/newview/featuretable_linux.txt b/indra/newview/featuretable_linux.txt index dab73dc3d1..a6705e41fe 100644 --- a/indra/newview/featuretable_linux.txt +++ b/indra/newview/featuretable_linux.txt @@ -1,4 +1,4 @@ -version 25 +version 26 // NOTE: This is mostly identical to featuretable_mac.txt with a few differences // Should be combined into one table @@ -244,9 +244,9 @@ RenderDeferredSSAO 0 0 RenderShadowDetail 0 0 // -// No GL_ARB_map_buffer_range +// GL_ARB_map_buffer_range exists // -list NoMapBufferRange +list MapBufferRange RenderVBOMappingDisable 1 0 diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt index a1e25aae08..2f9f82fd9e 100644 --- a/indra/newview/featuretable_mac.txt +++ b/indra/newview/featuretable_mac.txt @@ -1,4 +1,4 @@ -version 26 +version 27 // NOTE: This is mostly identical to featuretable_mac.txt with a few differences // Should be combined into one table @@ -48,7 +48,7 @@ RenderTransparentWater 1 1 RenderTreeLODFactor 1 1.0 RenderUseImpostors 1 1 RenderVBOEnable 1 1 -RenderVBOMappingDisable 1 1 +RenderVBOMappingDisable 1 0 RenderVolumeLODFactor 1 2.0 UseStartScreen 1 1 UseOcclusion 1 1 @@ -245,13 +245,6 @@ RenderDeferred 0 0 RenderDeferredSSAO 0 0 RenderShadowDetail 0 0 -// -// No GL_ARB_map_buffer_range -// -list NoMapBufferRange -RenderVBOMappingDisable 1 0 - - // // "Default" setups for safe, low, medium, high // diff --git a/indra/newview/featuretable_xp.txt b/indra/newview/featuretable_xp.txt index ce2adac221..50f0f5dec1 100644 --- a/indra/newview/featuretable_xp.txt +++ b/indra/newview/featuretable_xp.txt @@ -1,4 +1,4 @@ -version 30 +version 31 // NOTE: This is mostly identical to featuretable_mac.txt with a few differences // Should be combined into one table @@ -246,9 +246,9 @@ RenderDeferredSSAO 0 0 RenderShadowDetail 0 0 // -// No GL_ARB_map_buffer_range +// GL_ARB_map_buffer_range exists // -list NoMapBufferRange +list MapBufferRange RenderVBOMappingDisable 1 0 diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index b6566fcbd0..d2b05d1088 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1064,6 +1064,8 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, S32 num_vertices = (S32)vf.mNumVertices; S32 num_indices = (S32) vf.mNumIndices; + bool map_range = gGLManager.mHasMapBufferRange; + if (mVertexBuffer.notNull()) { if (num_indices + (S32) mIndicesIndex > mVertexBuffer->getNumIndices()) @@ -1182,7 +1184,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, // INDICES if (full_rebuild) { - mVertexBuffer->getIndexStrider(indicesp, mIndicesIndex, mIndicesCount, true); + mVertexBuffer->getIndexStrider(indicesp, mIndicesIndex, mIndicesCount, map_range); __m128i* dst = (__m128i*) indicesp.get(); __m128i* src = (__m128i*) vf.mIndices; @@ -1201,7 +1203,10 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, indicesp[i] = vf.mIndices[i]+index_offset; } - mVertexBuffer->setBuffer(0); + if (map_range) + { + mVertexBuffer->setBuffer(0); + } } LLMatrix4a mat_normal; @@ -1422,11 +1427,14 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, } } - mVertexBuffer->setBuffer(0); + if (map_range) + { + mVertexBuffer->setBuffer(0); + } } else { //either bump mapped or in atlas, just do the whole expensive loop - mVertexBuffer->getTexCoord0Strider(tex_coords, mGeomIndex, mGeomCount, true); + mVertexBuffer->getTexCoord0Strider(tex_coords, mGeomIndex, mGeomCount, map_range); std::vector bump_tc; @@ -1566,12 +1574,14 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, } } - mVertexBuffer->setBuffer(0); - + if (map_range) + { + mVertexBuffer->setBuffer(0); + } if (do_bump) { - mVertexBuffer->getTexCoord1Strider(tex_coords2, mGeomIndex, mGeomCount, true); + mVertexBuffer->getTexCoord1Strider(tex_coords2, mGeomIndex, mGeomCount, map_range); for (S32 i = 0; i < num_vertices; i++) { @@ -1601,14 +1611,17 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, *tex_coords2++ = tc; } - mVertexBuffer->setBuffer(0); + if (map_range) + { + mVertexBuffer->setBuffer(0); + } } } } if (rebuild_pos) { - mVertexBuffer->getVertexStrider(vert, mGeomIndex, mGeomCount, true); + mVertexBuffer->getVertexStrider(vert, mGeomIndex, mGeomCount, map_range); vertices = (LLVector4a*) vert.get(); LLMatrix4a mat_vert; @@ -1637,12 +1650,15 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, } while (index_dst < index_end); - mVertexBuffer->setBuffer(0); + if (map_range) + { + mVertexBuffer->setBuffer(0); + } } if (rebuild_normal) { - mVertexBuffer->getNormalStrider(norm, mGeomIndex, mGeomCount, true); + mVertexBuffer->getNormalStrider(norm, mGeomIndex, mGeomCount, map_range); normals = (LLVector4a*) norm.get(); for (S32 i = 0; i < num_vertices; i++) @@ -1653,12 +1669,15 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, normals[i] = normal; } - mVertexBuffer->setBuffer(0); + if (map_range) + { + mVertexBuffer->setBuffer(0); + } } if (rebuild_binormal) { - mVertexBuffer->getBinormalStrider(binorm, mGeomIndex, mGeomCount, true); + mVertexBuffer->getBinormalStrider(binorm, mGeomIndex, mGeomCount, map_range); binormals = (LLVector4a*) binorm.get(); for (S32 i = 0; i < num_vertices; i++) @@ -1669,20 +1688,26 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, binormals[i] = binormal; } - mVertexBuffer->setBuffer(0); + if (map_range) + { + mVertexBuffer->setBuffer(0); + } } if (rebuild_weights && vf.mWeights) { - mVertexBuffer->getWeight4Strider(wght, mGeomIndex, mGeomCount, true); + mVertexBuffer->getWeight4Strider(wght, mGeomIndex, mGeomCount, map_range); weights = (LLVector4a*) wght.get(); LLVector4a::memcpyNonAliased16((F32*) weights, (F32*) vf.mWeights, num_vertices*4*sizeof(F32)); - mVertexBuffer->setBuffer(0); + if (map_range) + { + mVertexBuffer->setBuffer(0); + } } if (rebuild_color) { - mVertexBuffer->getColorStrider(colors, mGeomIndex, mGeomCount, true); + mVertexBuffer->getColorStrider(colors, mGeomIndex, mGeomCount, map_range); LLVector4a src; @@ -1703,7 +1728,10 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, dst[i] = src; } - mVertexBuffer->setBuffer(0); + if (map_range) + { + mVertexBuffer->setBuffer(0); + } } if (rebuild_tcoord) diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index 83844048d1..0ea0e41dfa 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -769,6 +769,10 @@ void LLFeatureManager::applyBaseMasks() { maskFeatures("TexUnit8orLess"); } + if (gGLManager.mHasMapBufferRange) + { + maskFeatures("MapBufferRange"); + } // now mask by gpu string // Replaces ' ' with '_' in mGPUString to deal with inability for parser to handle spaces diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index e6da8eb89d..40afabdb65 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4361,6 +4361,8 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) group->mBuilt = 1.f; + std::set mapped_buffers; + for (LLSpatialGroup::element_iter drawable_iter = group->getData().begin(); drawable_iter != group->getData().end(); ++drawable_iter) { LLFastTimer t(FTM_VOLUME_GEOM_PARTIAL); @@ -4375,35 +4377,31 @@ void LLVolumeGeometryManager::rebuildMesh(LLSpatialGroup* group) for (S32 i = 0; i < drawablep->getNumFaces(); ++i) { LLFace* face = drawablep->getFace(i); - if (face && face->getVertexBuffer()) + if (face) { - face->getGeometryVolume(*volume, face->getTEOffset(), - vobj->getRelativeXform(), vobj->getRelativeXformInvTrans(), face->getGeomIndex()); + LLVertexBuffer* buff = face->getVertexBuffer(); + if (buff) + { + face->getGeometryVolume(*volume, face->getTEOffset(), + vobj->getRelativeXform(), vobj->getRelativeXformInvTrans(), face->getGeomIndex()); + + if (buff->isLocked()) + { + mapped_buffers.insert(buff); + } + } } } - + drawablep->clearState(LLDrawable::REBUILD_ALL); } } - //unmap all the buffers - for (LLSpatialGroup::buffer_map_t::iterator i = group->mBufferMap.begin(); i != group->mBufferMap.end(); ++i) + for (std::set::iterator iter = mapped_buffers.begin(); iter != mapped_buffers.end(); ++iter) { - LLSpatialGroup::buffer_texture_map_t& map = i->second; - for (LLSpatialGroup::buffer_texture_map_t::iterator j = map.begin(); j != map.end(); ++j) - { - LLSpatialGroup::buffer_list_t& list = j->second; - for (LLSpatialGroup::buffer_list_t::iterator k = list.begin(); k != list.end(); ++k) - { - LLVertexBuffer* buffer = *k; - if (buffer->isLocked()) - { - buffer->setBuffer(0); - } - } - } + (*iter)->setBuffer(0); } - + // don't forget alpha if(group != NULL && !group->mVertexBuffer.isNull() && -- cgit v1.2.3 From e4d0d62e71de69d1685d00da571e9055e18fdc0c Mon Sep 17 00:00:00 2001 From: Don Kjer Date: Sat, 9 Jul 2011 22:30:30 -0700 Subject: Added support for apple flush buffer range --- indra/llrender/llgl.cpp | 2 + indra/llrender/llgl.h | 1 + indra/llrender/llvertexbuffer.cpp | 89 ++++++++++++++++++++++++++++----------- indra/newview/llface.cpp | 2 +- 4 files changed, 69 insertions(+), 25 deletions(-) diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index c224ab0e9b..02c975a17a 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -337,6 +337,7 @@ LLGLManager::LLGLManager() : mHasVertexBufferObject(FALSE), mHasMapBufferRange(FALSE), + mHasFlushBufferRange(FALSE), mHasPBuffer(FALSE), mHasShaderObjects(FALSE), mHasVertexShader(FALSE), @@ -775,6 +776,7 @@ void LLGLManager::initExtensions() mHasOcclusionQuery2 = ExtensionExists("GL_ARB_occlusion_query2", gGLHExts.mSysExts); mHasVertexBufferObject = ExtensionExists("GL_ARB_vertex_buffer_object", gGLHExts.mSysExts); mHasMapBufferRange = ExtensionExists("GL_ARB_map_buffer_range", gGLHExts.mSysExts); + mHasFlushBufferRange = ExtensionExists("GL_APPLE_flush_buffer_range", gGLHExts.mSysExts); mHasDepthClamp = ExtensionExists("GL_ARB_depth_clamp", gGLHExts.mSysExts) || ExtensionExists("GL_NV_depth_clamp", gGLHExts.mSysExts); // mask out FBO support when packed_depth_stencil isn't there 'cause we need it for LLRenderTarget -Brad #ifdef GL_ARB_framebuffer_object diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h index d1bee00161..3e98c04321 100644 --- a/indra/llrender/llgl.h +++ b/indra/llrender/llgl.h @@ -89,6 +89,7 @@ public: // ARB Extensions BOOL mHasVertexBufferObject; BOOL mHasMapBufferRange; + BOOL mHasFlushBufferRange; BOOL mHasPBuffer; BOOL mHasShaderObjects; BOOL mHasVertexShader; diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 6c972647f8..db9c8f83f8 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -968,7 +968,7 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran if (useVBOs()) { - if (sDisableVBOMapping || gGLManager.mHasMapBufferRange) + if (sDisableVBOMapping || gGLManager.mHasMapBufferRange || gGLManager.mHasFlushBufferRange) { if (count == -1) { @@ -1019,29 +1019,44 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran else { U8* src = NULL; -#ifdef GL_ARB_map_buffer_range if (gGLManager.mHasMapBufferRange) { if (map_range) { +#ifdef GL_ARB_map_buffer_range S32 offset = mOffsets[type] + sTypeSize[type]*index; S32 length = (sTypeSize[type]*count+0xF) & ~0xF; src = (U8*) glMapBufferRange(GL_ARRAY_BUFFER_ARB, offset, length, GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT | GL_MAP_INVALIDATE_RANGE_BIT); +#endif } else { +#ifdef GL_ARB_map_buffer_range src = (U8*) glMapBufferRange(GL_ARRAY_BUFFER_ARB, 0, mSize, GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT); +#endif + } + } + else if (gGLManager.mHasFlushBufferRange) + { + if (map_range) + { + glBufferParameteriAPPLE(GL_ARRAY_BUFFER_ARB, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_FALSE); + glBufferParameteriAPPLE(GL_ARRAY_BUFFER_ARB, GL_BUFFER_FLUSHING_UNMAP_APPLE, GL_FALSE); + src = (U8*) glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); + } + else + { + src = (U8*) glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); } } else -#else - llassert_always(!gGLManager.mHasMapBufferRange); -#endif { map_range = false; src = (U8*) glMapBufferARB(GL_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); } + llassert(src != NULL); + mMappedData = LL_NEXT_ALIGNED_ADDRESS(src); mAlignedOffset = mMappedData - src; @@ -1090,7 +1105,7 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran map_range = false; } - if (map_range && !sDisableVBOMapping) + if (map_range && gGLManager.mHasMapBufferRange && !sDisableVBOMapping) { return mMappedData; } @@ -1114,7 +1129,7 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range) if (useVBOs()) { - if (sDisableVBOMapping || gGLManager.mHasMapBufferRange) + if (sDisableVBOMapping || gGLManager.mHasMapBufferRange || gGLManager.mHasFlushBufferRange) { if (count == -1) { @@ -1163,29 +1178,45 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range) else { U8* src = NULL; -#ifdef GL_ARB_map_buffer_range if (gGLManager.mHasMapBufferRange) { if (map_range) { +#ifdef GL_ARB_map_buffer_range S32 offset = sizeof(U16)*index; S32 length = sizeof(U16)*count; src = (U8*) glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER_ARB, offset, length, GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT | GL_MAP_INVALIDATE_RANGE_BIT); +#endif } else { +#ifdef GL_ARB_map_buffer_range src = (U8*) glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER_ARB, 0, sizeof(U16)*mNumIndices, GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT); +#endif + } + } + else if (gGLManager.mHasFlushBufferRange) + { + if (map_range) + { + glBufferParameteriAPPLE(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_BUFFER_SERIALIZED_MODIFY_APPLE, GL_FALSE); + glBufferParameteriAPPLE(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_BUFFER_FLUSHING_UNMAP_APPLE, GL_FALSE); + src = (U8*) glMapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); + } + else + { + src = (U8*) glMapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); } } else -#else - llassert_always(!gGLManager.mHasMapBufferRange); -#endif { map_range = false; src = (U8*) glMapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, GL_WRITE_ONLY_ARB); } + llassert(src != NULL); + + mMappedIndexData = src; //LL_NEXT_ALIGNED_ADDRESS(src); mAlignedIndexOffset = mMappedIndexData - src; stop_glerror(); @@ -1218,7 +1249,7 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range) map_range = false; } - if (map_range && !sDisableVBOMapping) + if (map_range && gGLManager.mHasMapBufferRange && !sDisableVBOMapping) { return mMappedIndexData; } @@ -1267,8 +1298,7 @@ void LLVertexBuffer::unmapBuffer(S32 type) } else { -#ifdef GL_ARB_map_buffer_range - if (gGLManager.mHasMapBufferRange) + if (gGLManager.mHasMapBufferRange || gGLManager.mHasFlushBufferRange) { if (!mMappedVertexRegions.empty()) { @@ -1278,16 +1308,22 @@ void LLVertexBuffer::unmapBuffer(S32 type) const MappedRegion& region = mMappedVertexRegions[i]; S32 offset = region.mIndex >= 0 ? mOffsets[region.mType]+sTypeSize[region.mType]*region.mIndex : 0; S32 length = sTypeSize[region.mType]*region.mCount; - glFlushMappedBufferRange(GL_ARRAY_BUFFER_ARB, offset, length); + if (gGLManager.mHasMapBufferRange) + { +#ifdef GL_ARB_map_buffer_range + glFlushMappedBufferRange(GL_ARRAY_BUFFER_ARB, offset, length); +#endif + } + else if (gGLManager.mHasFlushBufferRange) + { + glFlushMappedBufferRangeAPPLE(GL_ARRAY_BUFFER_ARB, offset, length); + } stop_glerror(); } mMappedVertexRegions.clear(); } } -#else - llassert_always(!gGLManager.mHasMapBufferRange); -#endif stop_glerror(); glUnmapBufferARB(GL_ARRAY_BUFFER_ARB); stop_glerror(); @@ -1325,8 +1361,7 @@ void LLVertexBuffer::unmapBuffer(S32 type) } else { -#ifdef GL_ARB_map_buffer_range - if (gGLManager.mHasMapBufferRange) + if (gGLManager.mHasMapBufferRange || gGLManager.mHasFlushBufferRange) { if (!mMappedIndexRegions.empty()) { @@ -1335,16 +1370,22 @@ void LLVertexBuffer::unmapBuffer(S32 type) const MappedRegion& region = mMappedIndexRegions[i]; S32 offset = region.mIndex >= 0 ? sizeof(U16)*region.mIndex : 0; S32 length = sizeof(U16)*region.mCount; - glFlushMappedBufferRange(GL_ELEMENT_ARRAY_BUFFER_ARB, offset, length); + if (gGLManager.mHasMapBufferRange) + { +#ifdef GL_ARB_map_buffer_range + glFlushMappedBufferRange(GL_ELEMENT_ARRAY_BUFFER_ARB, offset, length); +#endif + } + else if (gGLManager.mHasFlushBufferRange) + { + glFlushMappedBufferRangeAPPLE(GL_ELEMENT_ARRAY_BUFFER_ARB, offset, length); + } stop_glerror(); } mMappedIndexRegions.clear(); } } -#else - llassert_always(!gGLManager.mHasMapBufferRange); -#endif stop_glerror(); glUnmapBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB); stop_glerror(); diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index d2b05d1088..59c6e904a1 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1064,7 +1064,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, S32 num_vertices = (S32)vf.mNumVertices; S32 num_indices = (S32) vf.mNumIndices; - bool map_range = gGLManager.mHasMapBufferRange; + bool map_range = gGLManager.mHasMapBufferRange || gGLManager.mHasFlushBufferRange; if (mVertexBuffer.notNull()) { -- cgit v1.2.3 From 268f3dbdea27d2549e69cd81334c1c8b0a057da4 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Sun, 10 Jul 2011 02:29:39 -0500 Subject: SH-2038 Fix for some compiler errors from the apple tweaks -- also add a fence API (disabled for now). --- indra/llrender/llgl.cpp | 31 +++++++++-- indra/llrender/llgl.h | 1 + indra/llrender/llglheaders.h | 39 ++++++++++++++ indra/llrender/llvertexbuffer.cpp | 109 +++++++++++++++++++++++++++++++++++--- indra/llrender/llvertexbuffer.h | 12 +++++ 5 files changed, 182 insertions(+), 10 deletions(-) diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index 02c975a17a..e07ff0015c 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -128,9 +128,21 @@ PFNGLGETBUFFERPARAMETERIVARBPROC glGetBufferParameterivARB = NULL; PFNGLGETBUFFERPOINTERVARBPROC glGetBufferPointervARB = NULL; // GL_ARB_map_buffer_range -PFNGLMAPBUFFERRANGEPROC glMapBufferRange; -PFNGLFLUSHMAPPEDBUFFERRANGEPROC glFlushMappedBufferRange; - +PFNGLMAPBUFFERRANGEPROC glMapBufferRange = NULL; +PFNGLFLUSHMAPPEDBUFFERRANGEPROC glFlushMappedBufferRange = NULL; + +// GL_ARB_sync +PFNGLFENCESYNCPROC glFenceSync = NULL; +PFNGLISSYNCPROC glIsSync = NULL; +PFNGLDELETESYNCPROC glDeleteSync = NULL; +PFNGLCLIENTWAITSYNCPROC glClientWaitSync = NULL; +PFNGLWAITSYNCPROC glWaitSync = NULL; +PFNGLGETINTEGER64VPROC glGetInteger64v = NULL; +PFNGLGETSYNCIVPROC glGetSynciv = NULL; + +// GL_APPLE_flush_buffer_range +PFNGLBUFFERPARAMETERIAPPLEPROC glBufferParameteriAPPLE = NULL; +PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC glFlushMappedBufferRangeAPPLE = NULL; // vertex object prototypes PFNGLNEWOBJECTBUFFERATIPROC glNewObjectBufferATI = NULL; @@ -334,7 +346,7 @@ LLGLManager::LLGLManager() : mHasFramebufferObject(FALSE), mMaxSamples(0), mHasBlendFuncSeparate(FALSE), - + mHasSync(FALSE), mHasVertexBufferObject(FALSE), mHasMapBufferRange(FALSE), mHasFlushBufferRange(FALSE), @@ -775,6 +787,7 @@ void LLGLManager::initExtensions() mHasOcclusionQuery = ExtensionExists("GL_ARB_occlusion_query", gGLHExts.mSysExts); mHasOcclusionQuery2 = ExtensionExists("GL_ARB_occlusion_query2", gGLHExts.mSysExts); mHasVertexBufferObject = ExtensionExists("GL_ARB_vertex_buffer_object", gGLHExts.mSysExts); + mHasSync = ExtensionExists("GL_ARB_sync", gGLHExts.mSysExts); mHasMapBufferRange = ExtensionExists("GL_ARB_map_buffer_range", gGLHExts.mSysExts); mHasFlushBufferRange = ExtensionExists("GL_APPLE_flush_buffer_range", gGLHExts.mSysExts); mHasDepthClamp = ExtensionExists("GL_ARB_depth_clamp", gGLHExts.mSysExts) || ExtensionExists("GL_NV_depth_clamp", gGLHExts.mSysExts); @@ -971,6 +984,16 @@ void LLGLManager::initExtensions() mHasVertexBufferObject = FALSE; } } + if (mHasSync) + { + glFenceSync = (PFNGLFENCESYNCPROC) GLH_EXT_GET_PROC_ADDRESS("glFenceSync"); + glIsSync = (PFNGLISSYNCPROC) GLH_EXT_GET_PROC_ADDRESS("glIsSync"); + glDeleteSync = (PFNGLDELETESYNCPROC) GLH_EXT_GET_PROC_ADDRESS("glDeleteSync"); + glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC) GLH_EXT_GET_PROC_ADDRESS("glClientWaitSync"); + glWaitSync = (PFNGLWAITSYNCPROC) GLH_EXT_GET_PROC_ADDRESS("glWaitSync"); + glGetInteger64v = (PFNGLGETINTEGER64VPROC) GLH_EXT_GET_PROC_ADDRESS("glGetInteger64v"); + glGetSynciv = (PFNGLGETSYNCIVPROC) GLH_EXT_GET_PROC_ADDRESS("glGetSynciv"); + } if (mHasMapBufferRange) { glMapBufferRange = (PFNGLMAPBUFFERRANGEPROC) GLH_EXT_GET_PROC_ADDRESS("glMapBufferRange"); diff --git a/indra/llrender/llgl.h b/indra/llrender/llgl.h index 3e98c04321..d736133f3f 100644 --- a/indra/llrender/llgl.h +++ b/indra/llrender/llgl.h @@ -88,6 +88,7 @@ public: // ARB Extensions BOOL mHasVertexBufferObject; + BOOL mHasSync; BOOL mHasMapBufferRange; BOOL mHasFlushBufferRange; BOOL mHasPBuffer; diff --git a/indra/llrender/llglheaders.h b/indra/llrender/llglheaders.h index f35f329f00..851a75629e 100644 --- a/indra/llrender/llglheaders.h +++ b/indra/llrender/llglheaders.h @@ -68,6 +68,19 @@ extern PFNGLUNMAPBUFFERARBPROC glUnmapBufferARB; extern PFNGLGETBUFFERPARAMETERIVARBPROC glGetBufferParameterivARB; extern PFNGLGETBUFFERPOINTERVARBPROC glGetBufferPointervARB; +// GL_ARB_sync +extern PFNGLFENCESYNCPROC glFenceSync; +extern PFNGLISSYNCPROC glIsSync; +extern PFNGLDELETESYNCPROC glDeleteSync; +extern PFNGLCLIENTWAITSYNCPROC glClientWaitSync; +extern PFNGLWAITSYNCPROC glWaitSync; +extern PFNGLGETINTEGER64VPROC glGetInteger64v; +extern PFNGLGETSYNCIVPROC glGetSynciv; + +// GL_APPLE_flush_buffer_range +extern PFNGLBUFFERPARAMETERIAPPLEPROC glBufferParameteriAPPLE; +extern PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC glFlushMappedBufferRangeAPPLE; + // GL_ARB_map_buffer_range extern PFNGLMAPBUFFERRANGEPROC glMapBufferRange; extern PFNGLFLUSHMAPPEDBUFFERRANGEPROC glFlushMappedBufferRange; @@ -310,6 +323,19 @@ extern PFNGLUNMAPBUFFERARBPROC glUnmapBufferARB; extern PFNGLGETBUFFERPARAMETERIVARBPROC glGetBufferParameterivARB; extern PFNGLGETBUFFERPOINTERVARBPROC glGetBufferPointervARB; +// GL_ARB_sync +extern PFNGLFENCESYNCPROC glFenceSync; +extern PFNGLISSYNCPROC glIsSync; +extern PFNGLDELETESYNCPROC glDeleteSync; +extern PFNGLCLIENTWAITSYNCPROC glClientWaitSync; +extern PFNGLWAITSYNCPROC glWaitSync; +extern PFNGLGETINTEGER64VPROC glGetInteger64v; +extern PFNGLGETSYNCIVPROC glGetSynciv; + +// GL_APPLE_flush_buffer_range +extern PFNGLBUFFERPARAMETERIAPPLEPROC glBufferParameteriAPPLE; +extern PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC glFlushMappedBufferRangeAPPLE; + // GL_ARB_map_buffer_range extern PFNGLMAPBUFFERRANGEPROC glMapBufferRange; extern PFNGLFLUSHMAPPEDBUFFERRANGEPROC glFlushMappedBufferRange; @@ -519,6 +545,19 @@ extern PFNGLUNMAPBUFFERARBPROC glUnmapBufferARB; extern PFNGLGETBUFFERPARAMETERIVARBPROC glGetBufferParameterivARB; extern PFNGLGETBUFFERPOINTERVARBPROC glGetBufferPointervARB; +// GL_ARB_sync +extern PFNGLFENCESYNCPROC glFenceSync; +extern PFNGLISSYNCPROC glIsSync; +extern PFNGLDELETESYNCPROC glDeleteSync; +extern PFNGLCLIENTWAITSYNCPROC glClientWaitSync; +extern PFNGLWAITSYNCPROC glWaitSync; +extern PFNGLGETINTEGER64VPROC glGetInteger64v; +extern PFNGLGETSYNCIVPROC glGetSynciv; + +// GL_APPLE_flush_buffer_range +extern PFNGLBUFFERPARAMETERIAPPLEPROC glBufferParameteriAPPLE; +extern PFNGLFLUSHMAPPEDBUFFERRANGEAPPLEPROC glFlushMappedBufferRangeAPPLE; + // GL_ARB_map_buffer_range extern PFNGLMAPBUFFERRANGEPROC glMapBufferRange; extern PFNGLFLUSHMAPPEDBUFFERRANGEPROC glFlushMappedBufferRange; diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index db9c8f83f8..2a297bcc45 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -65,6 +65,50 @@ S32 LLVertexBuffer::sWeight4Loc = -1; std::vector LLVertexBuffer::sDeleteList; +const U32 FENCE_WAIT_TIME_NANOSECONDS = 10000; //1 ms + +class LLGLSyncFence : public LLGLFence +{ +public: + GLsync mSync; + + LLGLSyncFence() + { + mSync = 0; + } + + ~LLGLSyncFence() + { + if (mSync) + { + glDeleteSync(mSync); + } + } + + void placeFence() + { + if (mSync) + { + glDeleteSync(mSync); + } + mSync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0); + } + + void wait() + { + if (mSync) + { + while (glClientWaitSync(mSync, 0, FENCE_WAIT_TIME_NANOSECONDS) == GL_TIMEOUT_EXPIRED) + { //track the number of times we've waited here + static S32 waits = 0; + waits++; + } + } + } + + +}; + S32 LLVertexBuffer::sTypeSize[LLVertexBuffer::TYPE_MAX] = { sizeof(LLVector4), // TYPE_VERTEX, @@ -309,6 +353,7 @@ void LLVertexBuffer::drawRange(U32 mode, U32 start, U32 end, U32 count, U32 indi glDrawRangeElements(sGLMode[mode], start, end, count, GL_UNSIGNED_SHORT, idx); stop_glerror(); + placeFence(); } void LLVertexBuffer::draw(U32 mode, U32 count, U32 indices_offset) const @@ -340,6 +385,7 @@ void LLVertexBuffer::draw(U32 mode, U32 count, U32 indices_offset) const glDrawElements(sGLMode[mode], count, GL_UNSIGNED_SHORT, ((U16*) getIndicesPointer()) + indices_offset); stop_glerror(); + placeFence(); } void LLVertexBuffer::drawArrays(U32 mode, U32 first, U32 count) const @@ -365,6 +411,7 @@ void LLVertexBuffer::drawArrays(U32 mode, U32 first, U32 count) const stop_glerror(); glDrawArrays(sGLMode[mode], first, count); stop_glerror(); + placeFence(); } //static @@ -444,9 +491,11 @@ LLVertexBuffer::LLVertexBuffer(U32 typemask, S32 usage) : mFilthy(FALSE), mEmpty(TRUE), mResized(FALSE), - mDynamicSize(FALSE) + mDynamicSize(FALSE), + mFence(NULL) { LLMemType mt2(LLMemType::MTYPE_VERTEX_CONSTRUCTOR); + mFence = NULL; if (!sEnableVBOs) { mUsage = 0 ; @@ -527,9 +576,40 @@ LLVertexBuffer::~LLVertexBuffer() destroyGLIndices(); sCount--; + if (mFence) + { + delete mFence; + } + + mFence = NULL; + llassert_always(!mMappedData && !mMappedIndexData) ; }; +void LLVertexBuffer::placeFence() const +{ + /*if (!mFence && useVBOs()) + { + if (gGLManager.mHasSync) + { + mFence = new LLGLSyncFence(); + } + } + + if (mFence) + { + mFence->placeFence(); + }*/ +} + +void LLVertexBuffer::waitFence() const +{ + /*if (mFence) + { + mFence->wait(); + }*/ +} + //---------------------------------------------------------------------------- void LLVertexBuffer::genBuffer() @@ -967,7 +1047,6 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran if (useVBOs()) { - if (sDisableVBOMapping || gGLManager.mHasMapBufferRange || gGLManager.mHasFlushBufferRange) { if (count == -1) @@ -1019,6 +1098,7 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran else { U8* src = NULL; + waitFence(); if (gGLManager.mHasMapBufferRange) { if (map_range) @@ -1026,13 +1106,20 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran #ifdef GL_ARB_map_buffer_range S32 offset = mOffsets[type] + sTypeSize[type]*index; S32 length = (sTypeSize[type]*count+0xF) & ~0xF; - src = (U8*) glMapBufferRange(GL_ARRAY_BUFFER_ARB, offset, length, GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT | GL_MAP_INVALIDATE_RANGE_BIT); + src = (U8*) glMapBufferRange(GL_ARRAY_BUFFER_ARB, offset, length, + GL_MAP_WRITE_BIT | + GL_MAP_FLUSH_EXPLICIT_BIT | + GL_MAP_INVALIDATE_RANGE_BIT | + GL_MAP_UNSYNCHRONIZED_BIT); #endif } else { #ifdef GL_ARB_map_buffer_range - src = (U8*) glMapBufferRange(GL_ARRAY_BUFFER_ARB, 0, mSize, GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT); + src = (U8*) glMapBufferRange(GL_ARRAY_BUFFER_ARB, 0, mSize, + GL_MAP_WRITE_BIT | + GL_MAP_FLUSH_EXPLICIT_BIT | + GL_MAP_UNSYNCHRONIZED_BIT); #endif } } @@ -1178,6 +1265,7 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range) else { U8* src = NULL; + waitFence(); if (gGLManager.mHasMapBufferRange) { if (map_range) @@ -1185,13 +1273,20 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range) #ifdef GL_ARB_map_buffer_range S32 offset = sizeof(U16)*index; S32 length = sizeof(U16)*count; - src = (U8*) glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER_ARB, offset, length, GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT | GL_MAP_INVALIDATE_RANGE_BIT); + src = (U8*) glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER_ARB, offset, length, + GL_MAP_WRITE_BIT | + GL_MAP_FLUSH_EXPLICIT_BIT | + GL_MAP_INVALIDATE_RANGE_BIT | + GL_MAP_UNSYNCHRONIZED_BIT); #endif } else { #ifdef GL_ARB_map_buffer_range - src = (U8*) glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER_ARB, 0, sizeof(U16)*mNumIndices, GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT); + src = (U8*) glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER_ARB, 0, sizeof(U16)*mNumIndices, + GL_MAP_WRITE_BIT | + GL_MAP_FLUSH_EXPLICIT_BIT | + GL_MAP_UNSYNCHRONIZED_BIT); #endif } } @@ -1378,7 +1473,9 @@ void LLVertexBuffer::unmapBuffer(S32 type) } else if (gGLManager.mHasFlushBufferRange) { +#ifdef GL_APPLE_flush_buffer_range glFlushMappedBufferRangeAPPLE(GL_ELEMENT_ARRAY_BUFFER_ARB, offset, length); +#endif } stop_glerror(); } diff --git a/indra/llrender/llvertexbuffer.h b/indra/llrender/llvertexbuffer.h index aa5df305a6..cc5d11e1c2 100644 --- a/indra/llrender/llvertexbuffer.h +++ b/indra/llrender/llvertexbuffer.h @@ -70,6 +70,12 @@ protected: } }; +class LLGLFence +{ +public: + virtual void placeFence() = 0; + virtual void wait() = 0; +}; //============================================================================ // base class @@ -270,6 +276,12 @@ protected: std::vector mMappedVertexRegions; std::vector mMappedIndexRegions; + mutable LLGLFence* mFence; + + void placeFence() const; + void waitFence() const; + + public: static S32 sCount; static S32 sGLCount; -- cgit v1.2.3 From b5149a63f9a3d4eeaa3c8807f9c65d04bbd113bf Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 11 Jul 2011 11:41:34 -0500 Subject: SH-2038 Compatibility fix for mac build (GL_ARB_sync symbols not defined on OSX) --- indra/llrender/llvertexbuffer.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 2a297bcc45..53ddca124b 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -79,23 +79,28 @@ public: ~LLGLSyncFence() { +#ifdef GL_ARB_sync if (mSync) { glDeleteSync(mSync); } +#endif } void placeFence() { +#ifdef GL_ARB_sync if (mSync) { glDeleteSync(mSync); } mSync = glFenceSync(GL_SYNC_GPU_COMMANDS_COMPLETE, 0); +#endif } void wait() { +#ifdef GL_ARB_sync if (mSync) { while (glClientWaitSync(mSync, 0, FENCE_WAIT_TIME_NANOSECONDS) == GL_TIMEOUT_EXPIRED) @@ -103,6 +108,7 @@ public: static S32 waits = 0; waits++; } +#endif } } -- cgit v1.2.3 From 9db49b4448abae1e171fd1b40d1a7049b6762353 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 11 Jul 2011 12:14:06 -0500 Subject: SH-2038 Disable usage of stream vbo on mac and make flexi's use stream vbo if stream vbo disabled (effectively disables usage of vertex buffers for flexible objects on mac) --- indra/llrender/llvertexbuffer.cpp | 8 +------- indra/newview/featuretable_mac.txt | 4 ++-- indra/newview/lldrawable.cpp | 5 +++++ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 53ddca124b..b96023f613 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -978,17 +978,11 @@ BOOL LLVertexBuffer::useVBOs() const { //it's generally ineffective to use VBO for things that are streaming on apple -#if LL_DARWIN - if (!mUsage || mUsage == GL_STREAM_DRAW_ARB) - { - return FALSE; - } -#else if (!mUsage) { return FALSE; } -#endif + return TRUE; } diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt index 2f9f82fd9e..2784302f5a 100644 --- a/indra/newview/featuretable_mac.txt +++ b/indra/newview/featuretable_mac.txt @@ -1,4 +1,4 @@ -version 27 +version 28 // NOTE: This is mostly identical to featuretable_mac.txt with a few differences // Should be combined into one table @@ -64,7 +64,7 @@ RenderDeferred 1 1 RenderDeferredSSAO 1 1 RenderShadowDetail 1 2 WatchdogDisabled 1 1 -RenderUseStreamVBO 1 1 +RenderUseStreamVBO 1 0 RenderFSAASamples 1 16 // diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index ad3710843c..90fcb94088 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -1529,6 +1529,11 @@ BOOL LLDrawable::isAnimating() const return TRUE; } + if (!LLVertexBuffer::sUseStreamDraw && mVObjp->isFlexible()) + { + return TRUE; + } + return FALSE; } -- cgit v1.2.3 From f587af0af19afb52a2b8411f071defe420f8d48d Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Mon, 11 Jul 2011 15:16:56 -0700 Subject: Build fix for Mac OS X. --- indra/llrender/llvertexbuffer.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index b96023f613..82c5efe0ac 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -70,11 +70,15 @@ const U32 FENCE_WAIT_TIME_NANOSECONDS = 10000; //1 ms class LLGLSyncFence : public LLGLFence { public: +#ifdef GL_ARB_sync GLsync mSync; +#endif LLGLSyncFence() { +#ifdef GL_ARB_sync mSync = 0; +#endif } ~LLGLSyncFence() @@ -108,8 +112,8 @@ public: static S32 waits = 0; waits++; } -#endif } +#endif } -- cgit v1.2.3 From b1473d4b6bbcbfd67af80f8f1d2f7a7584677c5c Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Wed, 13 Jul 2011 12:02:03 +0300 Subject: STORM-1502 FIXED Disable "Delete Water/Sky/Day Preset" dialogs if no user presets exist. --- indra/newview/llviewermenu.cpp | 37 ++++++++++++++++++++++ indra/newview/skins/default/xui/en/menu_viewer.xml | 9 ++++++ 2 files changed, 46 insertions(+) diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index a37f8ad0d8..f74bcafc5c 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -44,6 +44,7 @@ #include "llbottomtray.h" #include "llcompilequeue.h" #include "llconsole.h" +#include "lldaycyclemanager.h" #include "lldebugview.h" #include "llenvmanager.h" #include "llfilepicker.h" @@ -100,6 +101,7 @@ #include "llworldmap.h" #include "pipeline.h" #include "llviewerjoystick.h" +#include "llwaterparammanager.h" #include "llwlanimator.h" #include "llwlparammanager.h" #include "llfloatercamera.h" @@ -7667,6 +7669,40 @@ class LLWorldEnvPreset : public view_listener_t } }; +class LLWorldEnableEnvPreset : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + std::string item = userdata.asString(); + + if (item == "delete_water") + { + LLWaterParamManager::preset_name_list_t user_waters; + LLWaterParamManager::instance().getUserPresetNames(user_waters); + return !user_waters.empty(); + } + else if (item == "delete_sky") + { + LLWLParamManager::preset_name_list_t user_skies; + LLWLParamManager::instance().getUserPresetNames(user_skies); + return !user_skies.empty(); + } + else if (item == "delete_day_cycle") + { + LLDayCycleManager::preset_name_list_t user_days; + LLDayCycleManager::instance().getUserPresetNames(user_days); + return !user_days.empty(); + } + else + { + llwarns << "Unknown item" << llendl; + } + + return false; + } +}; + + /// Post-Process callbacks class LLWorldPostProcess : public view_listener_t { @@ -7906,6 +7942,7 @@ void initialize_menus() view_listener_t::addMenu(new LLWorldEnvSettings(), "World.EnvSettings"); view_listener_t::addMenu(new LLWorldEnvPreset(), "World.EnvPreset"); + view_listener_t::addMenu(new LLWorldEnableEnvPreset(), "World.EnableEnvPreset"); view_listener_t::addMenu(new LLWorldPostProcess(), "World.PostProcess"); view_listener_t::addMenu(new LLWorldToggleMovementControls(), "World.Toggle.MovementControls"); diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index e00586811b..6d3bca10d9 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -557,6 +557,9 @@ + @@ -583,6 +586,9 @@ + @@ -609,6 +615,9 @@ + -- cgit v1.2.3 From f783c335f050b1fe87412c061e1b5134d8c00306 Mon Sep 17 00:00:00 2001 From: Paul ProductEngine Date: Wed, 13 Jul 2011 18:55:08 +0300 Subject: STORM-1503 FIXED Find floater doesn't set focus to its browser. Added tab stop for browser to get focus when find floater is focused. --- indra/newview/skins/default/xui/en/floater_search.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/skins/default/xui/en/floater_search.xml b/indra/newview/skins/default/xui/en/floater_search.xml index 8770ede7e9..c7b26c59c7 100644 --- a/indra/newview/skins/default/xui/en/floater_search.xml +++ b/indra/newview/skins/default/xui/en/floater_search.xml @@ -38,6 +38,7 @@ user_resize="false" width="630"> Date: Wed, 13 Jul 2011 17:36:59 -0400 Subject: Introduce support for C++ integration tests running Python scripts. This is in its infancy; tested on Mac; needs to be ironed out on Windows and Linux. Goal is to test at least some cross-language LLSD serialization. --- indra/llcommon/CMakeLists.txt | 3 +- indra/llcommon/tests/llsdserialize_test.cpp | 97 ++++++++++++++++++++++++----- indra/llcommon/tests/setpython.py | 19 ++++++ 3 files changed, 103 insertions(+), 16 deletions(-) create mode 100644 indra/llcommon/tests/setpython.py diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 9910281b64..c755020a64 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -317,7 +317,8 @@ if (LL_TESTS) LL_ADD_INTEGRATION_TEST(lllazy "" "${test_libs}") LL_ADD_INTEGRATION_TEST(llprocessor "" "${test_libs}") LL_ADD_INTEGRATION_TEST(llrand "" "${test_libs}") - LL_ADD_INTEGRATION_TEST(llsdserialize "" "${test_libs}") + LL_ADD_INTEGRATION_TEST(llsdserialize "" "${test_libs}" + "${PYTHON_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/setpython.py") LL_ADD_INTEGRATION_TEST(llstring "" "${test_libs}") LL_ADD_INTEGRATION_TEST(lltreeiterators "" "${test_libs}") LL_ADD_INTEGRATION_TEST(lluri "" "${test_libs}") diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp index 7b4c7d6a48..75b79467b7 100644 --- a/indra/llcommon/tests/llsdserialize_test.cpp +++ b/indra/llcommon/tests/llsdserialize_test.cpp @@ -25,33 +25,26 @@ * $/LicenseInfo$ */ -#if !LL_WINDOWS -#include -#endif - #include "linden_common.h" #include "../llsd.h" #include "../llsdserialize.h" #include "../llformat.h" #include "../test/lltut.h" - +#include "llprocesslauncher.h" +#include "stringize.h" #if LL_WINDOWS #include typedef U32 uint32_t; +#else +#include +#include #endif -std::vector string_to_vector(std::string str) +std::vector string_to_vector(const std::string& str) { - // bc LLSD can't... - size_t len = (size_t)str.length(); - std::vector v(len); - for (size_t i = 0; i < len ; i++) - { - v[i] = str[i]; - } - return v; + return std::vector(str.begin(), str.end()); } namespace tut @@ -1494,5 +1487,79 @@ namespace tut ensureBinaryAndNotation("map", test); ensureBinaryAndXML("map", test); } -} + struct TestPythonCompatible + { + TestPythonCompatible() {} + ~TestPythonCompatible() {} + + void python(const std::string& desc, const std::string& script, F32 timeout=5) + { + const char* PYTHON(getenv("PYTHON")); + ensure("Set $PYTHON to the Python interpreter", PYTHON); + LLProcessLauncher py; + py.setExecutable(PYTHON); + py.addArgument("-c"); + py.addArgument(script); + ensure_equals(STRINGIZE("Couldn't launch " << desc << " script"), py.launch(), 0); + +#if LL_WINDOWS + ensure_equals(STRINGIZE(desc << " script ran beyond " + << std::fixed << std::setprecision(1) + << timeout << " seconds"), + WaitForSingleObject(py.getProcessHandle(), DWORD(timeout * 1000)), + WAIT_OBJECT_0); + DWORD rc(0); + GetExitCodeProcess(py.getProcessHandle(), &rc); + ensure_equals(STRINGIZE(desc << " script terminated with rc " << rc), rc, 0); +#else + // Implementing timeout would mean messing with alarm() and + // catching SIGALRM... later maybe... + int status(0); + if (waitpid(py.getProcessID(), &status, 0) == -1) + { + int waitpid_errno(errno); + ensure_equals(STRINGIZE("Couldn't retrieve rc from " << desc << " script: " + "waitpid() errno " << waitpid_errno), + waitpid_errno, ECHILD); + } + else + { + if (WIFEXITED(status)) + { + int rc(WEXITSTATUS(status)); + ensure_equals(STRINGIZE(desc << " script terminated with rc " << rc), rc, 0); + } + else if (WIFSIGNALED(status)) + { + ensure(STRINGIZE(desc << " script terminated by signal " << WTERMSIG(status)), + false); + } + else + { + ensure(STRINGIZE(desc << " script produced impossible status " << status), + false); + } + } +#endif + } + }; + + typedef tut::test_group TestPythonCompatibleGroup; + typedef TestPythonCompatibleGroup::object TestPythonCompatibleObject; + TestPythonCompatibleGroup pycompat("LLSD serialize Python compatibility"); + + template<> template<> + void TestPythonCompatibleObject::test<1>() + { + python("hello", "print 'Hello, world!'"); + } + + template<> template<> + void TestPythonCompatibleObject::test<2>() + { + python("platform", +"import sys\n" +"print 'Running on', sys.platform"); + } +} diff --git a/indra/llcommon/tests/setpython.py b/indra/llcommon/tests/setpython.py new file mode 100644 index 0000000000..df7b90428e --- /dev/null +++ b/indra/llcommon/tests/setpython.py @@ -0,0 +1,19 @@ +#!/usr/bin/python +"""\ +@file setpython.py +@author Nat Goodspeed +@date 2011-07-13 +@brief Set PYTHON environment variable for tests that care. + +$LicenseInfo:firstyear=2011&license=viewerlgpl$ +Copyright (c) 2011, Linden Research, Inc. +$/LicenseInfo$ +""" + +import os +import sys +import subprocess + +if __name__ == "__main__": + os.environ["PYTHON"] = sys.executable + sys.exit(subprocess.call(sys.argv[1:])) -- cgit v1.2.3 From beea7cdc2d003d815ef2ac32978f841b81288494 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 13 Jul 2011 19:03:28 -0400 Subject: Attempt to fix confusing header-file-order problems on Windows. --- indra/llcommon/tests/llsdserialize_test.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp index 75b79467b7..6b96c0e234 100644 --- a/indra/llcommon/tests/llsdserialize_test.cpp +++ b/indra/llcommon/tests/llsdserialize_test.cpp @@ -25,6 +25,12 @@ * $/LicenseInfo$ */ +#if !LL_WINDOWS +#include +#include +#include +#endif + #include "linden_common.h" #include "../llsd.h" #include "../llsdserialize.h" @@ -37,9 +43,6 @@ #if LL_WINDOWS #include typedef U32 uint32_t; -#else -#include -#include #endif std::vector string_to_vector(const std::string& str) -- cgit v1.2.3 From ec780a733f46e2fc436ca5d492f42ab4e3e8b516 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Wed, 13 Jul 2011 19:41:23 -0400 Subject: Still trying to fix Windows header-file-order problem. --- indra/llcommon/tests/llsdserialize_test.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp index 6b96c0e234..ff0d8d5f46 100644 --- a/indra/llcommon/tests/llsdserialize_test.cpp +++ b/indra/llcommon/tests/llsdserialize_test.cpp @@ -25,13 +25,18 @@ * $/LicenseInfo$ */ -#if !LL_WINDOWS + +#include "linden_common.h" + +#if LL_WINDOWS +#include +typedef U32 uint32_t; +#else #include #include #include #endif -#include "linden_common.h" #include "../llsd.h" #include "../llsdserialize.h" #include "../llformat.h" @@ -40,11 +45,6 @@ #include "llprocesslauncher.h" #include "stringize.h" -#if LL_WINDOWS -#include -typedef U32 uint32_t; -#endif - std::vector string_to_vector(const std::string& str) { return std::vector(str.begin(), str.end()); -- cgit v1.2.3 From 0ab0efc3270f44da3d8b3a9db2845eeddde44dc6 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 14 Jul 2011 14:00:12 -0400 Subject: Work around broken Windows command-line processing. It's wonderful that the Python interpreter will accept a whole multi-line script as a composite -c argument... but because Windows command-line processing is fundamentally flawed, we simply can't count on it for Windows. Instead, accept script text, write a temporary script file in a system- dependent temp directory, ask Python to run that script and delete the file. Also, on Windows, use _spawnl(), much simpler than adding bizarre Windows wait logic to LLProcessLauncher. Use LLProcessLauncher only on Mac & Linux, with waitpid() to capture rc. --- indra/llcommon/tests/llsdserialize_test.cpp | 93 ++++++++++++++++++++++++----- 1 file changed, 78 insertions(+), 15 deletions(-) diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp index ff0d8d5f46..4e09a4fe3c 100644 --- a/indra/llcommon/tests/llsdserialize_test.cpp +++ b/indra/llcommon/tests/llsdserialize_test.cpp @@ -31,18 +31,28 @@ #if LL_WINDOWS #include typedef U32 uint32_t; +#include #else #include #include #include +#include "llprocesslauncher.h" #endif +// As we're not trying to preserve compatibility with old Boost.Filesystem +// code, but rather writing brand-new code, use the newest available +// Filesystem API. +#define BOOST_FILESYSTEM_VERSION 3 +#include "boost/filesystem.hpp" +#include "boost/filesystem/v3/fstream.hpp" +#include "boost/range.hpp" +#include "boost/foreach.hpp" + #include "../llsd.h" #include "../llsdserialize.h" #include "../llformat.h" #include "../test/lltut.h" -#include "llprocesslauncher.h" #include "stringize.h" std::vector string_to_vector(const std::string& str) @@ -50,6 +60,51 @@ std::vector string_to_vector(const std::string& str) return std::vector(str.begin(), str.end()); } +// boost::filesystem::temp_directory_path() isn't yet in Boost 1.45! :-( +// Switch to that one as soon as we update to a Boost that contains it. +boost::filesystem::path temp_directory_path() +{ +#if LL_WINDOWS + char buffer[PATH_MAX]; + GetTempPath(sizeof(buffer), buffer); + return boost::filesystem::path(buffer); + +#else // LL_DARWIN, LL_LINUX + static const char* vars[] = { "TMPDIR", "TMP", "TEMP", "TEMPDIR" }; + BOOST_FOREACH(const char* var, vars) + { + const char* found = getenv(var); + if (found) + return boost::filesystem::path(found); + } + return boost::filesystem::path("/tmp"); +#endif // LL_DARWIN, LL_LINUX +} + +// Create a Python script file with specified content "somewhere in the +// filesystem," cleaning up when it goes out of scope. +class NamedTempScript +{ +public: + NamedTempScript(const std::string& content): + mPath(/*boost::filesystem*/::temp_directory_path() / + boost::filesystem::unique_path("%%%%-%%%%-%%%%-%%%%.py")) + { + boost::filesystem::ofstream file(mPath); + file << content << '\n'; + } + + ~NamedTempScript() + { + boost::filesystem::remove(mPath); + } + + std::string getName() const { return mPath.native(); } + +private: + boost::filesystem::path mPath; +}; + namespace tut { struct sd_xml_data @@ -1496,26 +1551,34 @@ namespace tut TestPythonCompatible() {} ~TestPythonCompatible() {} - void python(const std::string& desc, const std::string& script, F32 timeout=5) + void python(const std::string& desc, const std::string& script /*, F32 timeout=5 */) { const char* PYTHON(getenv("PYTHON")); ensure("Set $PYTHON to the Python interpreter", PYTHON); + + NamedTempScript scriptfile(script); + +#if LL_WINDOWS + std::string q("\""); + std::string qPYTHON(q + PYTHON + q); + std::string qscript(q + scriptfile.getName() + q); + int rc(_spawnl(_P_WAIT, PYTHON, qPYTHON.c_str(), qscript.c_str(), NULL)); + if (rc == -1) + { + char buffer[256]; + strerror_s(buffer, errno); // C++ can infer the buffer size! :-O + ensure(STRINGIZE("Couldn't run Python " << desc << "script: " << buffer), false); + } + else + { + ensure_equals(STRINGIZE(desc << " script terminated with rc " << rc), rc, 0); + } + +#else // LL_DARWIN, LL_LINUX LLProcessLauncher py; py.setExecutable(PYTHON); - py.addArgument("-c"); - py.addArgument(script); + py.addArgument(scriptfile.getName()); ensure_equals(STRINGIZE("Couldn't launch " << desc << " script"), py.launch(), 0); - -#if LL_WINDOWS - ensure_equals(STRINGIZE(desc << " script ran beyond " - << std::fixed << std::setprecision(1) - << timeout << " seconds"), - WaitForSingleObject(py.getProcessHandle(), DWORD(timeout * 1000)), - WAIT_OBJECT_0); - DWORD rc(0); - GetExitCodeProcess(py.getProcessHandle(), &rc); - ensure_equals(STRINGIZE(desc << " script terminated with rc " << rc), rc, 0); -#else // Implementing timeout would mean messing with alarm() and // catching SIGALRM... later maybe... int status(0); -- cgit v1.2.3 From 3ddaf95c5c0dc35f0efa91860f9642d4cdf26559 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 14 Jul 2011 14:01:45 -0400 Subject: New llsdserialize_test logic needs Boost.Filesystem library. That, in turn, needs Boost.System library. --- indra/llcommon/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index c755020a64..09a05689f4 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -317,7 +317,8 @@ if (LL_TESTS) LL_ADD_INTEGRATION_TEST(lllazy "" "${test_libs}") LL_ADD_INTEGRATION_TEST(llprocessor "" "${test_libs}") LL_ADD_INTEGRATION_TEST(llrand "" "${test_libs}") - LL_ADD_INTEGRATION_TEST(llsdserialize "" "${test_libs}" + LL_ADD_INTEGRATION_TEST(llsdserialize "" + "${test_libs};${BOOST_FILESYSTEM_LIBRARY};${BOOST_SYSTEM_LIBRARY}" "${PYTHON_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/setpython.py") LL_ADD_INTEGRATION_TEST(llstring "" "${test_libs}") LL_ADD_INTEGRATION_TEST(lltreeiterators "" "${test_libs}") -- cgit v1.2.3 From 4c465f496f602860f5044bded01fde8883083e70 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 14 Jul 2011 15:08:25 -0400 Subject: Eliminate use of PATH_MAX, which is bogus anyway. --- indra/llcommon/tests/llsdserialize_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp index 4e09a4fe3c..687c64dfeb 100644 --- a/indra/llcommon/tests/llsdserialize_test.cpp +++ b/indra/llcommon/tests/llsdserialize_test.cpp @@ -65,7 +65,7 @@ std::vector string_to_vector(const std::string& str) boost::filesystem::path temp_directory_path() { #if LL_WINDOWS - char buffer[PATH_MAX]; + char buffer[4096]; GetTempPath(sizeof(buffer), buffer); return boost::filesystem::path(buffer); -- cgit v1.2.3 From 24508cc924938d2a8752496b9752b7c4d934dd77 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 14 Jul 2011 15:27:36 -0400 Subject: Attempt to fix minor build errors on Windows. --- indra/llcommon/tests/llsdserialize_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp index 687c64dfeb..e0a7835550 100644 --- a/indra/llcommon/tests/llsdserialize_test.cpp +++ b/indra/llcommon/tests/llsdserialize_test.cpp @@ -66,7 +66,7 @@ boost::filesystem::path temp_directory_path() { #if LL_WINDOWS char buffer[4096]; - GetTempPath(sizeof(buffer), buffer); + GetTempPathA(sizeof(buffer), buffer); return boost::filesystem::path(buffer); #else // LL_DARWIN, LL_LINUX @@ -99,7 +99,7 @@ public: boost::filesystem::remove(mPath); } - std::string getName() const { return mPath.native(); } + std::string getName() const { return mPath.string(); } private: boost::filesystem::path mPath; -- cgit v1.2.3 From 624c3f1a8e503a3a577b81e06b0ae3344e8ede17 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 14 Jul 2011 16:24:31 -0400 Subject: Use Linden wstring-to-string conversion, not boost::filesystem's. On Windows, calling boost::filesystem::path::string() implicitly requests code conversion between std::wstring (the boost::filesystem::path::string_type selected on Windows) and std::string. At least for integration-test program, that produces link errors. Use Linden's wstring_to_utf8str() instead. --- indra/llcommon/tests/llsdserialize_test.cpp | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp index e0a7835550..93261fa306 100644 --- a/indra/llcommon/tests/llsdserialize_test.cpp +++ b/indra/llcommon/tests/llsdserialize_test.cpp @@ -54,6 +54,7 @@ typedef U32 uint32_t; #include "../test/lltut.h" #include "stringize.h" +#include "llstring.h" std::vector string_to_vector(const std::string& str) { @@ -81,6 +82,28 @@ boost::filesystem::path temp_directory_path() #endif // LL_DARWIN, LL_LINUX } +// We want a std::string from a boost::filesystem::path::native() call. While +// there is a boost::filesystem::path::string() call as well, invoking that +// (at least in this test-program context) produces unresolved externals for +// boost::filesystem::path conversion machinery even though we can resolve +// other boost::filesystem symbols. Possibly those conversion routines aren't +// being built for Linden's Boost package. But that's okay, llstring.h +// provides conversion machinery we can use instead. +// On Posix platforms, boost::filesystem::path::native() returns std::string. +inline +std::string native_to_string(const std::string& in) +{ + return in; +} + +// On Windows, though, boost::filesystem::path::native() returns std::wstring. +// Make sure the right conversion happens. +inline +std::string native_to_string(const std::wstring& in) +{ + return wstring_to_utf8str(in); +} + // Create a Python script file with specified content "somewhere in the // filesystem," cleaning up when it goes out of scope. class NamedTempScript @@ -99,7 +122,7 @@ public: boost::filesystem::remove(mPath); } - std::string getName() const { return mPath.string(); } + std::string getName() const { return native_to_string(mPath.native()); } private: boost::filesystem::path mPath; -- cgit v1.2.3 From 8ca0f872f2f3cd026788c3ea28c3a00f5d407033 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 14 Jul 2011 17:12:02 -0400 Subject: wstring_to_utf8str() accepts LLWString rather than std::wstring. --- indra/llcommon/tests/llsdserialize_test.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp index 93261fa306..e61e6b9460 100644 --- a/indra/llcommon/tests/llsdserialize_test.cpp +++ b/indra/llcommon/tests/llsdserialize_test.cpp @@ -101,7 +101,8 @@ std::string native_to_string(const std::string& in) inline std::string native_to_string(const std::wstring& in) { - return wstring_to_utf8str(in); + // So actually, wstring_to_utf8str() accepts LLWString rather than std::wstring... + return wstring_to_utf8str(LLWString(in.begin(), in.end())); } // Create a Python script file with specified content "somewhere in the -- cgit v1.2.3 From 5f37ec3c712221765bbb42e3428975e9b1402c9c Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 14 Jul 2011 19:07:13 -0400 Subject: Avoid Boost.Filesystem: Boost package improperly built on Windows? Seems Linden's Boost package and the viewer build might use different settings of the /Zc:wchar_t switch. Anyway, this implementation using open(O_CREAT | O_EXCL) should be more robust. I'm surprised Boost.Filesystem doesn't seem to offer "create a unique file"; all I found was "generate a random filename fairly likely to be unique." --- indra/llcommon/tests/llsdserialize_test.cpp | 112 +++++++++++++++++++--------- 1 file changed, 77 insertions(+), 35 deletions(-) diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp index e61e6b9460..ec0cacfe90 100644 --- a/indra/llcommon/tests/llsdserialize_test.cpp +++ b/indra/llcommon/tests/llsdserialize_test.cpp @@ -33,18 +33,34 @@ typedef U32 uint32_t; #include #else +#include #include #include +#include #include +#include #include "llprocesslauncher.h" #endif +/*==========================================================================*| +// Whoops, seems Linden's Boost package and the viewer are built with +// different settings of VC's /Zc:wchar_t switch! Using Boost.Filesystem +// pathname operations produces Windows link errors: +// unresolved external symbol "private: static class std::codecvt const * & __cdecl boost::filesystem3::path::wchar_t_codecvt_facet()" +// unresolved external symbol "void __cdecl boost::filesystem3::path_traits::convert()" +// See: +// http://boost.2283326.n4.nabble.com/filesystem-v3-unicode-and-std-codecvt-linker-error-td3455549.html +// which points to: +// http://msdn.microsoft.com/en-us/library/dh8che7s%28v=VS.100%29.aspx + // As we're not trying to preserve compatibility with old Boost.Filesystem // code, but rather writing brand-new code, use the newest available // Filesystem API. #define BOOST_FILESYSTEM_VERSION 3 #include "boost/filesystem.hpp" #include "boost/filesystem/v3/fstream.hpp" +|*==========================================================================*/ #include "boost/range.hpp" #include "boost/foreach.hpp" @@ -54,7 +70,6 @@ typedef U32 uint32_t; #include "../test/lltut.h" #include "stringize.h" -#include "llstring.h" std::vector string_to_vector(const std::string& str) { @@ -62,13 +77,12 @@ std::vector string_to_vector(const std::string& str) } // boost::filesystem::temp_directory_path() isn't yet in Boost 1.45! :-( -// Switch to that one as soon as we update to a Boost that contains it. -boost::filesystem::path temp_directory_path() +std::string temp_directory_path() { #if LL_WINDOWS char buffer[4096]; GetTempPathA(sizeof(buffer), buffer); - return boost::filesystem::path(buffer); + return buffer; #else // LL_DARWIN, LL_LINUX static const char* vars[] = { "TMPDIR", "TMP", "TEMP", "TEMPDIR" }; @@ -76,34 +90,28 @@ boost::filesystem::path temp_directory_path() { const char* found = getenv(var); if (found) - return boost::filesystem::path(found); + return found; } - return boost::filesystem::path("/tmp"); + return "/tmp"; #endif // LL_DARWIN, LL_LINUX } -// We want a std::string from a boost::filesystem::path::native() call. While -// there is a boost::filesystem::path::string() call as well, invoking that -// (at least in this test-program context) produces unresolved externals for -// boost::filesystem::path conversion machinery even though we can resolve -// other boost::filesystem symbols. Possibly those conversion routines aren't -// being built for Linden's Boost package. But that's okay, llstring.h -// provides conversion machinery we can use instead. -// On Posix platforms, boost::filesystem::path::native() returns std::string. -inline -std::string native_to_string(const std::string& in) -{ - return in; -} - -// On Windows, though, boost::filesystem::path::native() returns std::wstring. -// Make sure the right conversion happens. -inline -std::string native_to_string(const std::wstring& in) -{ - // So actually, wstring_to_utf8str() accepts LLWString rather than std::wstring... - return wstring_to_utf8str(LLWString(in.begin(), in.end())); -} +// Windows presents a kinda sorta compatibility layer. Code to the yucky +// Windows names because they're less likely than the Posix names to collide +// with any other names in this source. +#if LL_WINDOWS +#define _remove DeleteFile +#else // ! LL_WINDOWS +#define _open open +#define _write write +#define _close close +#define _remove remove +#define _O_WRONLY O_WRONLY +#define _O_CREAT O_CREAT +#define _O_EXCL O_EXCL +#define _S_IWRITE S_IWUSR +#define _S_IREAD S_IRUSR +#endif // ! LL_WINDOWS // Create a Python script file with specified content "somewhere in the // filesystem," cleaning up when it goes out of scope. @@ -111,22 +119,56 @@ class NamedTempScript { public: NamedTempScript(const std::string& content): - mPath(/*boost::filesystem*/::temp_directory_path() / - boost::filesystem::unique_path("%%%%-%%%%-%%%%-%%%%.py")) + mPath(temp_directory_path()) { - boost::filesystem::ofstream file(mPath); - file << content << '\n'; + // Make sure mPath ends with a directory separator, if it doesn't already. + if (mPath.empty() || + ! (mPath[mPath.length() - 1] == '\\' || mPath[mPath.length() - 1] == '/')) + { + mPath.append("/"); + } + + // Open a file with a unique name in the mPath directory. + int fd(-1); + for (int i(0);; ++i) + { + // Append an integer name to mPath. It need not be zero-filled, + // but I think it's neater that way. + std::string testname(STRINGIZE(mPath + << std::setw(8) << std::setfill('0') << i + << ".py")); + // The key to this whole loop is the _O_CREAT | _O_EXCL bitmask, + // which requests an error if the file already exists. A proper + // implementation will check atomically, ensuring that racing + // processes will end up with two different filenames. + fd = _open(testname.c_str(), + _O_WRONLY | _O_CREAT | _O_EXCL, + _S_IREAD | _S_IWRITE); + if (fd != -1) // managed to open the file + { + mPath = testname; // remember its actual name + break; + } + // it's a problem if the open() failed for any other reason but + // the existence of a file by the same name + assert(errno == EEXIST); + // loop back to try another filename + } + // File is open, its name is in mPath: write it and close it. + _write(fd, content.c_str(), content.length()); + _write(fd, "\n", 1); + _close(fd); } ~NamedTempScript() { - boost::filesystem::remove(mPath); + _remove(mPath.c_str()); } - std::string getName() const { return native_to_string(mPath.native()); } + std::string getName() const { return mPath; } private: - boost::filesystem::path mPath; + std::string mPath; }; namespace tut -- cgit v1.2.3 From 9f66409b88481ca4ded5b9bb9d81e5977a43a5af Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 14 Jul 2011 19:39:32 -0400 Subject: #include correct headers for Windows _open() et al. Also mollify Linux build, which gets alarmed when you implicitly ignore write()'s return value. Ignore it explicitly. --- indra/llcommon/tests/llsdserialize_test.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp index ec0cacfe90..025870c915 100644 --- a/indra/llcommon/tests/llsdserialize_test.cpp +++ b/indra/llcommon/tests/llsdserialize_test.cpp @@ -32,16 +32,18 @@ #include typedef U32 uint32_t; #include +#include #else #include #include #include -#include #include -#include #include "llprocesslauncher.h" #endif +#include +#include + /*==========================================================================*| // Whoops, seems Linden's Boost package and the viewer are built with // different settings of VC's /Zc:wchar_t switch! Using Boost.Filesystem @@ -100,7 +102,7 @@ std::string temp_directory_path() // Windows names because they're less likely than the Posix names to collide // with any other names in this source. #if LL_WINDOWS -#define _remove DeleteFile +#define _remove DeleteFileA #else // ! LL_WINDOWS #define _open open #define _write write @@ -155,8 +157,8 @@ public: // loop back to try another filename } // File is open, its name is in mPath: write it and close it. - _write(fd, content.c_str(), content.length()); - _write(fd, "\n", 1); + (void)_write(fd, content.c_str(), content.length()); + (void)_write(fd, "\n", 1); _close(fd); } -- cgit v1.2.3 From 1f58cd688f44fed6da91af5cac0d48166c2647d0 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Thu, 14 Jul 2011 20:20:35 -0400 Subject: Pacify Linux gcc more thoroughly. --- indra/llcommon/tests/llsdserialize_test.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp index 025870c915..41d2fcc696 100644 --- a/indra/llcommon/tests/llsdserialize_test.cpp +++ b/indra/llcommon/tests/llsdserialize_test.cpp @@ -157,8 +157,12 @@ public: // loop back to try another filename } // File is open, its name is in mPath: write it and close it. - (void)_write(fd, content.c_str(), content.length()); - (void)_write(fd, "\n", 1); + // Truthfully, we'd just as soon ignore the return value from + // _write(), but Linux gcc generates fatal warnings if we do. + bool ok(true); + ok = ok && (content.length() == _write(fd, content.c_str(), content.length())); + ok = ok && (1 == _write(fd, "\n", 1)); + assert(ok); _close(fd); } -- cgit v1.2.3 From e3b5d9fc5c638beff4eed25a366dc5cc1c0478b1 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 15 Jul 2011 10:48:46 -0400 Subject: Change NamedTempScript to NamedTempFile; allow streaming to it. The only thing about NamedTempScript that was specific to script files was the hardcoded ".py" extension. Renaming it to NamedTempFile with an explicit extension argument addresses that. Allow constructing NamedTempFile with either a std::string, as before, or an expression of the form (lambda::_1 << some << stuff). If Linden's Boost package included the Boost.Iostreams lib, we could even stream such an expression directly to an ostream constructed around the fd. But oh well. --- indra/llcommon/tests/llsdserialize_test.cpp | 102 ++++++++++++++++++++-------- 1 file changed, 75 insertions(+), 27 deletions(-) diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp index 41d2fcc696..8b59e99b24 100644 --- a/indra/llcommon/tests/llsdserialize_test.cpp +++ b/indra/llcommon/tests/llsdserialize_test.cpp @@ -43,6 +43,7 @@ typedef U32 uint32_t; #include #include +#include /*==========================================================================*| // Whoops, seems Linden's Boost package and the viewer are built with @@ -65,6 +66,14 @@ typedef U32 uint32_t; |*==========================================================================*/ #include "boost/range.hpp" #include "boost/foreach.hpp" +#include "boost/function.hpp" +#include "boost/lambda/lambda.hpp" +namespace lambda = boost::lambda; +/*==========================================================================*| +// Aaaarrgh, Linden's Boost package doesn't even include Boost.Iostreams! +#include "boost/iostreams/stream.hpp" +#include "boost/iostreams/device/file_descriptor.hpp" +|*==========================================================================*/ #include "../llsd.h" #include "../llsdserialize.h" @@ -115,13 +124,37 @@ std::string temp_directory_path() #define _S_IREAD S_IRUSR #endif // ! LL_WINDOWS -// Create a Python script file with specified content "somewhere in the +// Create a text file with specified content "somewhere in the // filesystem," cleaning up when it goes out of scope. -class NamedTempScript +class NamedTempFile { public: - NamedTempScript(const std::string& content): + // Function that accepts an ostream ref and (presumably) writes stuff to + // it, e.g.: + // (lambda::_1 << "the value is " << 17 << '\n') + typedef boost::function Streamer; + + NamedTempFile(const std::string& ext, const std::string& content): + mPath(temp_directory_path()) + { + createFile(ext, lambda::_1 << content); + } + + NamedTempFile(const std::string& ext, const Streamer& func): mPath(temp_directory_path()) + { + createFile(ext, func); + } + + ~NamedTempFile() + { + _remove(mPath.c_str()); + } + + std::string getName() const { return mPath; } + +private: + void createFile(const std::string& ext, const Streamer& func) { // Make sure mPath ends with a directory separator, if it doesn't already. if (mPath.empty() || @@ -138,11 +171,11 @@ public: // but I think it's neater that way. std::string testname(STRINGIZE(mPath << std::setw(8) << std::setfill('0') << i - << ".py")); + << ext)); // The key to this whole loop is the _O_CREAT | _O_EXCL bitmask, - // which requests an error if the file already exists. A proper - // implementation will check atomically, ensuring that racing - // processes will end up with two different filenames. + // which requests error EEXIST if the file already exists. A + // proper implementation will check atomically, ensuring that + // racing processes will end up with two different filenames. fd = _open(testname.c_str(), _O_WRONLY | _O_CREAT | _O_EXCL, _S_IREAD | _S_IWRITE); @@ -151,29 +184,40 @@ public: mPath = testname; // remember its actual name break; } - // it's a problem if the open() failed for any other reason but - // the existence of a file by the same name - assert(errno == EEXIST); + // This loop is specifically coded to handle EEXIST. Any other + // error is a problem. + llassert_always(errno == EEXIST); // loop back to try another filename } - // File is open, its name is in mPath: write it and close it. - // Truthfully, we'd just as soon ignore the return value from - // _write(), but Linux gcc generates fatal warnings if we do. - bool ok(true); - ok = ok && (content.length() == _write(fd, content.c_str(), content.length())); - ok = ok && (1 == _write(fd, "\n", 1)); - assert(ok); - _close(fd); + // fd is open, its name is in mPath: write it and close it. + +/*==========================================================================*| + // Define an ostream on the open fd. Tell it to close fd on destruction. + boost::iostreams::stream + out(fd, boost::iostreams::close_handle); +|*==========================================================================*/ + std::ostringstream out; + // Stream stuff to it. + func(out); + // toss in a final newline for good measure + out << '\n'; + + std::string data(out.str()); + int written(_write(fd, data.c_str(), data.length())); + int closed(_close(fd)); + llassert_always(written == data.length() && closed == 0); } - ~NamedTempScript() + void peep() { - _remove(mPath.c_str()); + std::cout << "File '" << mPath << "' contains:\n"; + std::ifstream reader(mPath.c_str()); + std::string line; + while (std::getline(reader, line)) + std::cout << line << '\n'; + std::cout << "---\n"; } - std::string getName() const { return mPath; } - -private: std::string mPath; }; @@ -1628,7 +1672,7 @@ namespace tut const char* PYTHON(getenv("PYTHON")); ensure("Set $PYTHON to the Python interpreter", PYTHON); - NamedTempScript scriptfile(script); + NamedTempFile scriptfile(".py", script); #if LL_WINDOWS std::string q("\""); @@ -1690,14 +1734,18 @@ namespace tut template<> template<> void TestPythonCompatibleObject::test<1>() { - python("hello", "print 'Hello, world!'"); + set_test_name("verify python()"); + python("hello", + "import sys\n" + "sys.exit(0)"); } template<> template<> void TestPythonCompatibleObject::test<2>() { + set_test_name("verify NamedTempFile"); python("platform", -"import sys\n" -"print 'Running on', sys.platform"); + "import sys\n" + "print 'Running on', sys.platform"); } } -- cgit v1.2.3 From c33cf379f25e9a1a3780a73805749616fa07de66 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 15 Jul 2011 11:53:05 -0400 Subject: Add test to verify C++-to-Python LLSD notation sequence. Write a sequence of LLSDSerialize::toNotation() calls separated by newlines to a data file, then read lines and parse using llbase.llsd.parse(). Verify that this produces expected data even when one item is a string containing newlines. Generalize python() helper function to allow using any of the NamedTempFile constructor forms. Allow specifying expected Python rc (default 0) and use this to verify an intentional sys.exit(17). This is better than previous sys.exit(0) test because when, at one point, NamedTempFile failed to write file data, running Python on an empty script file still terminates with rc 0. A nonzero rc verifies that we've written the file, that Python is running it and that we're retrieving its rc. --- indra/llcommon/tests/llsdserialize_test.cpp | 65 +++++++++++++++++++++++++++-- 1 file changed, 61 insertions(+), 4 deletions(-) diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp index 8b59e99b24..aaf3740b07 100644 --- a/indra/llcommon/tests/llsdserialize_test.cpp +++ b/indra/llcommon/tests/llsdserialize_test.cpp @@ -68,6 +68,7 @@ typedef U32 uint32_t; #include "boost/foreach.hpp" #include "boost/function.hpp" #include "boost/lambda/lambda.hpp" +#include "boost/lambda/bind.hpp" namespace lambda = boost::lambda; /*==========================================================================*| // Aaaarrgh, Linden's Boost package doesn't even include Boost.Iostreams! @@ -77,6 +78,7 @@ namespace lambda = boost::lambda; #include "../llsd.h" #include "../llsdserialize.h" +#include "llsdutil.h" #include "../llformat.h" #include "../test/lltut.h" @@ -140,6 +142,13 @@ public: createFile(ext, lambda::_1 << content); } + // Disambiguate when passing string literal + NamedTempFile(const std::string& ext, const char* content): + mPath(temp_directory_path()) + { + createFile(ext, lambda::_1 << content); + } + NamedTempFile(const std::string& ext, const Streamer& func): mPath(temp_directory_path()) { @@ -1667,7 +1676,8 @@ namespace tut TestPythonCompatible() {} ~TestPythonCompatible() {} - void python(const std::string& desc, const std::string& script /*, F32 timeout=5 */) + template + void python(const std::string& desc, const CONTENT& script, int expect=0) { const char* PYTHON(getenv("PYTHON")); ensure("Set $PYTHON to the Python interpreter", PYTHON); @@ -1687,7 +1697,7 @@ namespace tut } else { - ensure_equals(STRINGIZE(desc << " script terminated with rc " << rc), rc, 0); + ensure_equals(STRINGIZE(desc << " script terminated with rc " << rc), rc, expect); } #else // LL_DARWIN, LL_LINUX @@ -1710,7 +1720,8 @@ namespace tut if (WIFEXITED(status)) { int rc(WEXITSTATUS(status)); - ensure_equals(STRINGIZE(desc << " script terminated with rc " << rc), rc, 0); + ensure_equals(STRINGIZE(desc << " script terminated with rc " << rc), + rc, expect); } else if (WIFSIGNALED(status)) { @@ -1737,7 +1748,8 @@ namespace tut set_test_name("verify python()"); python("hello", "import sys\n" - "sys.exit(0)"); + "sys.exit(17)", + 17); // expect nonzero rc } template<> template<> @@ -1748,4 +1760,49 @@ namespace tut "import sys\n" "print 'Running on', sys.platform"); } + + template<> template<> + void TestPythonCompatibleObject::test<3>() + { + set_test_name("verify sequence to Python"); + + LLSD cdata(LLSDArray(17)(3.14) + ("This string\n" + "has several\n" + "lines.")); + + const char pydata[] = + "def verify(iterable):\n" + " it = iter(iterable)\n" + " assert it.next() == 17\n" + " assert abs(it.next() - 3.14) < 0.01\n" + " assert it.next() == '''\\\n" + "This string\n" + "has several\n" + "lines.'''\n" + " try:\n" + " it.next()\n" + " except StopIteration:\n" + " pass\n" + " else:\n" + " assert False, 'Too many data items'\n"; + + // Create a something.llsd file containing 'data' serialized to notation. + // Avoid final newline because NamedTempFile implicitly adds one. + NamedTempFile file(".llsd", + (lambda::bind(LLSDSerialize::toNotation, cdata[0], lambda::_1), + lambda::_1 << '\n', + lambda::bind(LLSDSerialize::toNotation, cdata[1], lambda::_1), + lambda::_1 << '\n', + lambda::bind(LLSDSerialize::toNotation, cdata[2], lambda::_1))); + + python("read C++ notation", + lambda::_1 << + "from llbase import llsd\n" + "def parse_each(iterable):\n" + " for item in iterable:\n" + " yield llsd.parse(item)\n" << + pydata << + "verify(parse_each(open('" << file.getName() << "')))\n"); + } } -- cgit v1.2.3 From 7341e01ce2c833a190e6361bd97cf64bc1947efc Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 15 Jul 2011 12:42:49 -0400 Subject: Add test to verify Python-to-C++ LLSD notation sequence. Verify that an LLSD::String containing newlines works; verify that newlines between items are accepted. --- indra/llcommon/tests/llsdserialize_test.cpp | 60 ++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 2 deletions(-) diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp index aaf3740b07..0b9f1b53d2 100644 --- a/indra/llcommon/tests/llsdserialize_test.cpp +++ b/indra/llcommon/tests/llsdserialize_test.cpp @@ -1787,8 +1787,12 @@ namespace tut " else:\n" " assert False, 'Too many data items'\n"; - // Create a something.llsd file containing 'data' serialized to notation. - // Avoid final newline because NamedTempFile implicitly adds one. + // Create a something.llsd file containing 'data' serialized to + // notation. It's important to separate with newlines because Python's + // llsd module doesn't support parsing from a file stream, only from a + // string, so we have to know how much of the file to read into a + // string. Avoid final newline because NamedTempFile implicitly adds + // one. NamedTempFile file(".llsd", (lambda::bind(LLSDSerialize::toNotation, cdata[0], lambda::_1), lambda::_1 << '\n', @@ -1805,4 +1809,56 @@ namespace tut pydata << "verify(parse_each(open('" << file.getName() << "')))\n"); } + + template<> template<> + void TestPythonCompatibleObject::test<4>() + { + set_test_name("verify sequence from Python"); + + // Create an empty data file. This is just a placeholder for our + // script to write into. Create it to establish a unique name that + // we know. + NamedTempFile file(".llsd", ""); + + python("write Python notation", + lambda::_1 << + "from __future__ import with_statement\n" + "from llbase import llsd\n" + "DATA = [\n" + " 17,\n" + " 3.14,\n" + " '''\\\n" + "This string\n" + "has several\n" + "lines.''',\n" + "]\n" + // N.B. Using 'print' implicitly adds newlines. + "with open('" << file.getName() << "', 'w') as f:\n" + " for item in DATA:\n" + " print >>f, llsd.format_notation(item)\n"); + + std::ifstream inf(file.getName().c_str()); + LLSD item; + // Notice that we're not doing anything special to parse out the + // newlines: LLSDSerialize::fromNotation ignores them. While it would + // seem they're not strictly necessary, going in this direction, we + // want to ensure that notation-separated-by-newlines works in both + // directions -- since in practice, a given file might be read by + // either language. + ensure_equals("Failed to read LLSD::Integer from Python", + LLSDSerialize::fromNotation(item, inf, LLSDSerialize::SIZE_UNLIMITED), + 1); + ensure_equals(item.asInteger(), 17); + ensure_equals("Failed to read LLSD::Real from Python", + LLSDSerialize::fromNotation(item, inf, LLSDSerialize::SIZE_UNLIMITED), + 1); + ensure_approximately_equals(item.asReal(), 3.14, 7); // 7 bits ~= 0.01 + ensure_equals("Failed to read LLSD::String from Python", + LLSDSerialize::fromNotation(item, inf, LLSDSerialize::SIZE_UNLIMITED), + 1); + ensure_equals(item.asString(), + "This string\n" + "has several\n" + "lines."); + } } -- cgit v1.2.3 From 4b21954729163069e9d8f78c22624a2ecbc17b38 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 15 Jul 2011 14:02:45 -0400 Subject: Muzzle VS warning --- indra/llcommon/tests/llsdserialize_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp index 0b9f1b53d2..e6a0deaa8b 100644 --- a/indra/llcommon/tests/llsdserialize_test.cpp +++ b/indra/llcommon/tests/llsdserialize_test.cpp @@ -1852,7 +1852,7 @@ namespace tut ensure_equals("Failed to read LLSD::Real from Python", LLSDSerialize::fromNotation(item, inf, LLSDSerialize::SIZE_UNLIMITED), 1); - ensure_approximately_equals(item.asReal(), 3.14, 7); // 7 bits ~= 0.01 + ensure_approximately_equals(F32(item.asReal()), 3.14, 7); // 7 bits ~= 0.01 ensure_equals("Failed to read LLSD::String from Python", LLSDSerialize::fromNotation(item, inf, LLSDSerialize::SIZE_UNLIMITED), 1); -- cgit v1.2.3 From fee07bb597a64489b8e4bca8513ebd2afd9e7b6e Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 15 Jul 2011 14:24:37 -0400 Subject: Try again to pacify VS fatal warning. --- indra/llcommon/tests/llsdserialize_test.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp index e6a0deaa8b..b0c0df192c 100644 --- a/indra/llcommon/tests/llsdserialize_test.cpp +++ b/indra/llcommon/tests/llsdserialize_test.cpp @@ -1852,7 +1852,8 @@ namespace tut ensure_equals("Failed to read LLSD::Real from Python", LLSDSerialize::fromNotation(item, inf, LLSDSerialize::SIZE_UNLIMITED), 1); - ensure_approximately_equals(F32(item.asReal()), 3.14, 7); // 7 bits ~= 0.01 + ensure_approximately_equals("Bad LLSD::Real value from Python", + item.asReal(), 3.14, 7); // 7 bits ~= 0.01 ensure_equals("Failed to read LLSD::String from Python", LLSDSerialize::fromNotation(item, inf, LLSDSerialize::SIZE_UNLIMITED), 1); -- cgit v1.2.3 From e41c4c90f0d8c935fa8e4de6a8439d00283c3206 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 15 Jul 2011 16:01:43 -0400 Subject: Not all TC agents have llbase.llsd, fall back to indra.base.llsd --- indra/llcommon/tests/llsdserialize_test.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp index b0c0df192c..30cc2bbc8a 100644 --- a/indra/llcommon/tests/llsdserialize_test.cpp +++ b/indra/llcommon/tests/llsdserialize_test.cpp @@ -1802,7 +1802,10 @@ namespace tut python("read C++ notation", lambda::_1 << - "from llbase import llsd\n" + "try:\n" + " from llbase import llsd\n" + "except ImportError:\n" + " from indra.base import llsd\n" "def parse_each(iterable):\n" " for item in iterable:\n" " yield llsd.parse(item)\n" << @@ -1823,7 +1826,10 @@ namespace tut python("write Python notation", lambda::_1 << "from __future__ import with_statement\n" - "from llbase import llsd\n" + "try:\n" + " from llbase import llsd\n" + "except ImportError:\n" + " from indra.base import llsd\n" "DATA = [\n" " 17,\n" " 3.14,\n" -- cgit v1.2.3 From 15c36ee9b39624a29303b6e0cf434c9758657ded Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 15 Jul 2011 17:20:27 -0400 Subject: If we're going to need indra.base.llsd, have to munge sys.path. And at that point, the Python logic needed to bring in the llsd module is big enough to warrant capturing it in a separate string variable common to multiple tests. --- indra/llcommon/tests/llsdserialize_test.cpp | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp index 30cc2bbc8a..a54d861680 100644 --- a/indra/llcommon/tests/llsdserialize_test.cpp +++ b/indra/llcommon/tests/llsdserialize_test.cpp @@ -1673,9 +1673,21 @@ namespace tut struct TestPythonCompatible { - TestPythonCompatible() {} + TestPythonCompatible(): + import_llsd("import os.path\n" + "import sys\n" + "sys.path.insert(0,\n" + " os.path.join(os.path.dirname(__file__),\n" + " os.pardir, os.pardir, 'lib', 'python'))\n" + "try:\n" + " from llbase import llsd\n" + "except ImportError:\n" + " from indra.base import llsd\n") + {} ~TestPythonCompatible() {} + std::string import_llsd; + template void python(const std::string& desc, const CONTENT& script, int expect=0) { @@ -1802,10 +1814,7 @@ namespace tut python("read C++ notation", lambda::_1 << - "try:\n" - " from llbase import llsd\n" - "except ImportError:\n" - " from indra.base import llsd\n" + import_llsd << "def parse_each(iterable):\n" " for item in iterable:\n" " yield llsd.parse(item)\n" << @@ -1825,11 +1834,8 @@ namespace tut python("write Python notation", lambda::_1 << - "from __future__ import with_statement\n" - "try:\n" - " from llbase import llsd\n" - "except ImportError:\n" - " from indra.base import llsd\n" + "from __future__ import with_statement\n" << + import_llsd << "DATA = [\n" " 17,\n" " 3.14,\n" -- cgit v1.2.3 From 2b509383ccb22a1a4258e1d56710cbb998d6c6af Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Fri, 15 Jul 2011 22:32:06 -0400 Subject: Use C++ __FILE__ rather than Python __file__ to find indra work area. In this case, the Python code in question is being written from a C++ string literal to a temp script file in a platform-dependent temp directory -- so the Python __file__ value tells you nothing about the location of the repository checkout. Embedding __FILE__ from the containing C++ source file works better. --- indra/llcommon/tests/llsdserialize_test.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp index a54d861680..c65a1d3ca0 100644 --- a/indra/llcommon/tests/llsdserialize_test.cpp +++ b/indra/llcommon/tests/llsdserialize_test.cpp @@ -1674,10 +1674,16 @@ namespace tut struct TestPythonCompatible { TestPythonCompatible(): + // Note the peculiar insertion of __FILE__ into this string. + // Normally I like to make a Python script navigate relative to + // its own placement in the repo directory tree (__file__) -- but + // in this case, the script is being written into a platform- + // dependent temp directory! So locate indra/lib/python relative + // to this C++ source file rather than the Python module. import_llsd("import os.path\n" "import sys\n" "sys.path.insert(0,\n" - " os.path.join(os.path.dirname(__file__),\n" + " os.path.join(os.path.dirname('" __FILE__ "'),\n" " os.pardir, os.pardir, 'lib', 'python'))\n" "try:\n" " from llbase import llsd\n" -- cgit v1.2.3 From 81dc4401288f0a3cb95ce53d4ede79daa0f0f3d0 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sat, 16 Jul 2011 10:20:41 -0400 Subject: Use raw-string syntax for Python string containing Windows pathname. Consider this pathname for llsdserialize_test.cpp: C:\nats\indra\llcommon\tests\llsdserialize_test.cpp Embed that in a Python string literal: 'C:\nats\indra\llcommon\tests\llsdserialize_test.cpp' and you get a string containing: C: ats\indra\llcommon ests\llsdserialize_test.cpp where the \n became a newline and the \t became a tab character. Hopefully Python raw-string syntax r'C:\etc\etc' works better. --- indra/llcommon/tests/llsdserialize_test.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp index c65a1d3ca0..81de64930f 100644 --- a/indra/llcommon/tests/llsdserialize_test.cpp +++ b/indra/llcommon/tests/llsdserialize_test.cpp @@ -1680,10 +1680,12 @@ namespace tut // in this case, the script is being written into a platform- // dependent temp directory! So locate indra/lib/python relative // to this C++ source file rather than the Python module. + // Use Python raw-string syntax so Windows pathname backslashes + // won't mislead Python's string scanner. import_llsd("import os.path\n" "import sys\n" "sys.path.insert(0,\n" - " os.path.join(os.path.dirname('" __FILE__ "'),\n" + " os.path.join(os.path.dirname(r'" __FILE__ "'),\n" " os.pardir, os.pardir, 'lib', 'python'))\n" "try:\n" " from llbase import llsd\n" -- cgit v1.2.3 From 790032d2316989eb5b36af2569408ce1e1296015 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sat, 16 Jul 2011 22:24:31 -0400 Subject: Use raw-string syntax for other Windows pathnames inserted to Python. --- indra/llcommon/tests/llsdserialize_test.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp index 81de64930f..7ce7ada29e 100644 --- a/indra/llcommon/tests/llsdserialize_test.cpp +++ b/indra/llcommon/tests/llsdserialize_test.cpp @@ -1827,7 +1827,8 @@ namespace tut " for item in iterable:\n" " yield llsd.parse(item)\n" << pydata << - "verify(parse_each(open('" << file.getName() << "')))\n"); + // Don't forget raw-string syntax for Windows pathnames. + "verify(parse_each(open(r'" << file.getName() << "')))\n"); } template<> template<> @@ -1852,8 +1853,9 @@ namespace tut "has several\n" "lines.''',\n" "]\n" + // Don't forget raw-string syntax for Windows pathnames. // N.B. Using 'print' implicitly adds newlines. - "with open('" << file.getName() << "', 'w') as f:\n" + "with open(r'" << file.getName() << "', 'w') as f:\n" " for item in DATA:\n" " print >>f, llsd.format_notation(item)\n"); -- cgit v1.2.3 From 6469f1c2f21ecd3b15a18957d882ef6a16b17ecf Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Sun, 17 Jul 2011 00:24:08 -0500 Subject: SH-2031 High risk changeset, but potentially high reward. Addresses frame stalls in renderer by never using the fixed function pipeline if shaders are available. --- indra/llrender/llcubemap.cpp | 12 +- indra/llrender/llgl.cpp | 23 ++-- indra/llrender/llglslshader.cpp | 3 + indra/llrender/llglslshader.h | 1 + indra/llrender/llimagegl.cpp | 12 ++ indra/llrender/llrender.cpp | 29 ++++- indra/llrender/llrender.h | 2 + indra/llrender/llvertexbuffer.cpp | 14 +-- indra/llui/llui.cpp | 21 +++- indra/llui/llui.h | 5 + indra/newview/app_settings/logcontrol.xml | 1 - .../shaders/class1/interface/customalphaF.glsl | 17 +++ .../shaders/class1/interface/customalphaV.glsl | 16 +++ .../shaders/class1/interface/glowcombineF.glsl | 17 +++ .../shaders/class1/interface/glowcombineV.glsl | 15 +++ .../shaders/class1/interface/occlusionF.glsl | 11 ++ .../shaders/class1/interface/occlusionV.glsl | 12 ++ .../shaders/class1/interface/solidcolorF.glsl | 15 +++ .../shaders/class1/interface/solidcolorV.glsl | 15 +++ .../shaders/class1/interface/twotextureaddF.glsl | 14 +++ .../shaders/class1/interface/twotextureaddV.glsl | 16 +++ .../app_settings/shaders/class1/interface/uiF.glsl | 13 +++ .../app_settings/shaders/class1/interface/uiV.glsl | 16 +++ .../app_settings/shaders/class1/objects/bumpF.glsl | 17 +++ .../app_settings/shaders/class1/objects/bumpV.glsl | 16 +++ indra/newview/lldrawpool.cpp | 5 +- indra/newview/lldrawpoolalpha.cpp | 4 +- indra/newview/lldrawpoolbump.cpp | 103 +++++++++++------ indra/newview/lldrawpoolsimple.cpp | 16 ++- indra/newview/lldrawpoolsky.cpp | 5 + indra/newview/lldrawpooltree.cpp | 2 +- indra/newview/lldrawpoolwlsky.cpp | 36 +++++- indra/newview/llhudnametag.cpp | 2 +- indra/newview/llspatialpartition.cpp | 5 +- indra/newview/lltexlayer.cpp | 7 ++ indra/newview/llviewerdisplay.cpp | 27 ++++- indra/newview/llviewershadermgr.cpp | 126 +++++++++++++++++++++ indra/newview/llviewershadermgr.h | 13 +++ indra/newview/llviewertexture.cpp | 2 +- indra/newview/llviewertexturelist.cpp | 2 +- indra/newview/llviewerwindow.cpp | 10 ++ indra/newview/llvoicevivox.cpp | 3 + indra/newview/llvotree.cpp | 1 + indra/newview/pipeline.cpp | 116 +++++++++++++------ shining-fixes_rev18977.patch | 41 +++++++ 45 files changed, 742 insertions(+), 117 deletions(-) create mode 100644 indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl create mode 100644 indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl create mode 100644 indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl create mode 100644 indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl create mode 100644 indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl create mode 100644 indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl create mode 100644 indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl create mode 100644 indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl create mode 100644 indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl create mode 100644 indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl create mode 100644 indra/newview/app_settings/shaders/class1/interface/uiF.glsl create mode 100644 indra/newview/app_settings/shaders/class1/interface/uiV.glsl create mode 100644 indra/newview/app_settings/shaders/class1/objects/bumpF.glsl create mode 100644 indra/newview/app_settings/shaders/class1/objects/bumpV.glsl create mode 100644 shining-fixes_rev18977.patch diff --git a/indra/llrender/llcubemap.cpp b/indra/llrender/llcubemap.cpp index fb22d7f1f5..1b10354c22 100644 --- a/indra/llrender/llcubemap.cpp +++ b/indra/llrender/llcubemap.cpp @@ -259,7 +259,7 @@ void LLCubeMap::setMatrix(S32 stage) if (mMatrixStage < 0) return; - if (stage > 0) + //if (stage > 0) { gGL.getTexUnit(stage)->activate(); } @@ -278,17 +278,17 @@ void LLCubeMap::setMatrix(S32 stage) glLoadMatrixf((F32 *)trans.mMatrix); glMatrixMode(GL_MODELVIEW); - if (stage > 0) + /*if (stage > 0) { gGL.getTexUnit(0)->activate(); - } + }*/ } void LLCubeMap::restoreMatrix() { if (mMatrixStage < 0) return; - if (mMatrixStage > 0) + //if (mMatrixStage > 0) { gGL.getTexUnit(mMatrixStage)->activate(); } @@ -296,10 +296,10 @@ void LLCubeMap::restoreMatrix() glPopMatrix(); glMatrixMode(GL_MODELVIEW); - if (mMatrixStage > 0) + /*if (mMatrixStage > 0) { gGL.getTexUnit(0)->activate(); - } + }*/ } void LLCubeMap::setReflection (void) diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp index e07ff0015c..8937726209 100644 --- a/indra/llrender/llgl.cpp +++ b/indra/llrender/llgl.cpp @@ -986,12 +986,12 @@ void LLGLManager::initExtensions() } if (mHasSync) { - glFenceSync = (PFNGLFENCESYNCPROC) GLH_EXT_GET_PROC_ADDRESS("glFenceSync"); - glIsSync = (PFNGLISSYNCPROC) GLH_EXT_GET_PROC_ADDRESS("glIsSync"); - glDeleteSync = (PFNGLDELETESYNCPROC) GLH_EXT_GET_PROC_ADDRESS("glDeleteSync"); - glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC) GLH_EXT_GET_PROC_ADDRESS("glClientWaitSync"); - glWaitSync = (PFNGLWAITSYNCPROC) GLH_EXT_GET_PROC_ADDRESS("glWaitSync"); - glGetInteger64v = (PFNGLGETINTEGER64VPROC) GLH_EXT_GET_PROC_ADDRESS("glGetInteger64v"); + glFenceSync = (PFNGLFENCESYNCPROC) GLH_EXT_GET_PROC_ADDRESS("glFenceSync"); + glIsSync = (PFNGLISSYNCPROC) GLH_EXT_GET_PROC_ADDRESS("glIsSync"); + glDeleteSync = (PFNGLDELETESYNCPROC) GLH_EXT_GET_PROC_ADDRESS("glDeleteSync"); + glClientWaitSync = (PFNGLCLIENTWAITSYNCPROC) GLH_EXT_GET_PROC_ADDRESS("glClientWaitSync"); + glWaitSync = (PFNGLWAITSYNCPROC) GLH_EXT_GET_PROC_ADDRESS("glWaitSync"); + glGetInteger64v = (PFNGLGETINTEGER64VPROC) GLH_EXT_GET_PROC_ADDRESS("glGetInteger64v"); glGetSynciv = (PFNGLGETSYNCIVPROC) GLH_EXT_GET_PROC_ADDRESS("glGetSynciv"); } if (mHasMapBufferRange) @@ -1379,6 +1379,8 @@ void LLGLState::checkStates(const std::string& msg) glGetIntegerv(GL_BLEND_SRC, &src); glGetIntegerv(GL_BLEND_DST, &dst); + stop_glerror(); + BOOL error = FALSE; if (src != GL_SRC_ALPHA || dst != GL_ONE_MINUS_SRC_ALPHA) @@ -1399,7 +1401,9 @@ void LLGLState::checkStates(const std::string& msg) { LLGLenum state = iter->first; LLGLboolean cur_state = iter->second; + stop_glerror(); LLGLboolean gl_state = glIsEnabled(state); + stop_glerror(); if(cur_state != gl_state) { dumpStates(); @@ -1424,11 +1428,11 @@ void LLGLState::checkStates(const std::string& msg) void LLGLState::checkTextureChannels(const std::string& msg) { +#if 0 if (!gDebugGL) { return; } - stop_glerror(); GLint activeTexture; @@ -1594,6 +1598,7 @@ void LLGLState::checkTextureChannels(const std::string& msg) LL_GL_ERRS << "GL texture state corruption detected. " << msg << LL_ENDL; } } +#endif } void LLGLState::checkClientArrays(const std::string& msg, U32 data_mask) @@ -1710,7 +1715,7 @@ void LLGLState::checkClientArrays(const std::string& msg, U32 data_mask) } } - if (glIsEnabled(GL_TEXTURE_2D)) + /*if (glIsEnabled(GL_TEXTURE_2D)) { if (!(data_mask & 0x0008)) { @@ -1733,7 +1738,7 @@ void LLGLState::checkClientArrays(const std::string& msg, U32 data_mask) gFailLog << "GL does not have GL_TEXTURE_2D enabled on channel 1." << std::endl; } } - } + }*/ glClientActiveTextureARB(GL_TEXTURE0_ARB); gGL.getTexUnit(0)->activate(); diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index ad2c662dfc..c582858413 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -49,6 +49,7 @@ using std::make_pair; using std::string; GLhandleARB LLGLSLShader::sCurBoundShader = 0; +bool LLGLSLShader::sNoFixedFunction = false; BOOL shouldChange(const LLVector4& v1, const LLVector4& v2) { @@ -376,6 +377,7 @@ BOOL LLGLSLShader::link(BOOL suppress_errors) void LLGLSLShader::bind() { + gGL.flush(); if (gGLManager.mHasShaderObjects) { glUseProgramObjectARB(mProgramObject); @@ -390,6 +392,7 @@ void LLGLSLShader::bind() void LLGLSLShader::unbind() { + gGL.flush(); if (gGLManager.mHasShaderObjects) { stop_glerror(); diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h index 4922eb6d67..24562c3c42 100644 --- a/indra/llrender/llglslshader.h +++ b/indra/llrender/llglslshader.h @@ -67,6 +67,7 @@ public: LLGLSLShader(); static GLhandleARB sCurBoundShader; + static bool sNoFixedFunction; void unload(); BOOL createShader(std::vector * attributes, diff --git a/indra/llrender/llimagegl.cpp b/indra/llrender/llimagegl.cpp index 60a5962234..9ca3a23d52 100644 --- a/indra/llrender/llimagegl.cpp +++ b/indra/llrender/llimagegl.cpp @@ -1414,6 +1414,8 @@ BOOL LLImageGL::readBackRaw(S32 discard_level, LLImageRaw* imageraw, bool compre void LLImageGL::deleteDeadTextures() { + bool reset = false; + while (!sDeadTextureList.empty()) { GLuint tex = sDeadTextureList.front(); @@ -1426,12 +1428,22 @@ void LLImageGL::deleteDeadTextures() { tex_unit->unbind(tex_unit->getCurrType()); stop_glerror(); + + if (i > 0) + { + reset = true; + } } } glDeleteTextures(1, &tex); stop_glerror(); } + + if (reset) + { + gGL.getTexUnit(0)->activate(); + } } void LLImageGL::destroyGLTexture() diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 1d82dda30f..70df1dd1d1 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -46,6 +46,7 @@ S32 gGLViewport[4]; U32 LLRender::sUICalls = 0; U32 LLRender::sUIVerts = 0; +U32 LLTexUnit::sWhiteTexture = 0; static const U32 LL_NUM_TEXTURE_LAYERS = 32; static const U32 LL_NUM_LIGHT_UNITS = 8; @@ -126,7 +127,8 @@ void LLTexUnit::refreshState(void) // Per apple spec, don't call glEnable/glDisable when index exceeds max texture units // http://www.mailinglistarchive.com/html/mac-opengl@lists.apple.com/2008-07/msg00653.html // - bool enableDisable = (mIndex < gGLManager.mNumTextureUnits) && mCurrTexType != LLTexUnit::TT_MULTISAMPLE_TEXTURE; + bool enableDisable = !LLGLSLShader::sNoFixedFunction && + (mIndex < gGLManager.mNumTextureUnits) && mCurrTexType != LLTexUnit::TT_MULTISAMPLE_TEXTURE; if (mCurrTexType != TT_NONE) { @@ -184,7 +186,8 @@ void LLTexUnit::enable(eTextureType type) mCurrTexType = type; gGL.flush(); - if (type != LLTexUnit::TT_MULTISAMPLE_TEXTURE && + if (!LLGLSLShader::sNoFixedFunction && + type != LLTexUnit::TT_MULTISAMPLE_TEXTURE && mIndex < gGLManager.mNumTextureUnits) { glEnable(sGLTextureType[type]); @@ -201,7 +204,8 @@ void LLTexUnit::disable(void) activate(); unbind(mCurrTexType); gGL.flush(); - if (mCurrTexType != LLTexUnit::TT_MULTISAMPLE_TEXTURE && + if (!LLGLSLShader::sNoFixedFunction && + mCurrTexType != LLTexUnit::TT_MULTISAMPLE_TEXTURE && mIndex < gGLManager.mNumTextureUnits) { glDisable(sGLTextureType[mCurrTexType]); @@ -403,7 +407,14 @@ void LLTexUnit::unbind(eTextureType type) activate(); mCurrTexture = 0; - glBindTexture(sGLTextureType[type], 0); + if (LLGLSLShader::sNoFixedFunction && type == LLTexUnit::TT_TEXTURE) + { + glBindTexture(sGLTextureType[type], sWhiteTexture); + } + else + { + glBindTexture(sGLTextureType[type], 0); + } stop_glerror(); } } @@ -474,6 +485,11 @@ void LLTexUnit::setTextureFilteringOption(LLTexUnit::eTextureFilterOptions optio void LLTexUnit::setTextureBlendType(eTextureBlendType type) { + if (LLGLSLShader::sNoFixedFunction) + { //texture blend type means nothing when using shaders + return; + } + if (mIndex < 0) return; // Do nothing if it's already correctly set. @@ -594,6 +610,11 @@ GLint LLTexUnit::getTextureSourceType(eTextureBlendSrc src, bool isAlpha) void LLTexUnit::setTextureCombiner(eTextureBlendOp op, eTextureBlendSrc src1, eTextureBlendSrc src2, bool isAlpha) { + if (LLGLSLShader::sNoFixedFunction) + { //register combiners do nothing when not using fixed function + return; + } + if (mIndex < 0) return; activate(); diff --git a/indra/llrender/llrender.h b/indra/llrender/llrender.h index 41e7b35341..9eedebe2ce 100644 --- a/indra/llrender/llrender.h +++ b/indra/llrender/llrender.h @@ -52,6 +52,8 @@ class LLTexUnit { friend class LLRender; public: + static U32 sWhiteTexture; + typedef enum { TT_TEXTURE = 0, // Standard 2D Texture diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 82c5efe0ac..1180afa631 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -35,6 +35,8 @@ #include "llmemtype.h" #include "llrender.h" #include "llvector4a.h" +#include "llglslshader.h" + //============================================================================ @@ -1113,8 +1115,7 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran src = (U8*) glMapBufferRange(GL_ARRAY_BUFFER_ARB, offset, length, GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT | - GL_MAP_INVALIDATE_RANGE_BIT | - GL_MAP_UNSYNCHRONIZED_BIT); + GL_MAP_INVALIDATE_RANGE_BIT); #endif } else @@ -1122,8 +1123,7 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran #ifdef GL_ARB_map_buffer_range src = (U8*) glMapBufferRange(GL_ARRAY_BUFFER_ARB, 0, mSize, GL_MAP_WRITE_BIT | - GL_MAP_FLUSH_EXPLICIT_BIT | - GL_MAP_UNSYNCHRONIZED_BIT); + GL_MAP_FLUSH_EXPLICIT_BIT); #endif } } @@ -1280,8 +1280,7 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range) src = (U8*) glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER_ARB, offset, length, GL_MAP_WRITE_BIT | GL_MAP_FLUSH_EXPLICIT_BIT | - GL_MAP_INVALIDATE_RANGE_BIT | - GL_MAP_UNSYNCHRONIZED_BIT); + GL_MAP_INVALIDATE_RANGE_BIT); #endif } else @@ -1289,8 +1288,7 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range) #ifdef GL_ARB_map_buffer_range src = (U8*) glMapBufferRange(GL_ELEMENT_ARRAY_BUFFER_ARB, 0, sizeof(U16)*mNumIndices, GL_MAP_WRITE_BIT | - GL_MAP_FLUSH_EXPLICIT_BIT | - GL_MAP_UNSYNCHRONIZED_BIT); + GL_MAP_FLUSH_EXPLICIT_BIT); #endif } } diff --git a/indra/llui/llui.cpp b/indra/llui/llui.cpp index 8020ca802b..28d7e0a5ba 100644 --- a/indra/llui/llui.cpp +++ b/indra/llui/llui.cpp @@ -95,7 +95,6 @@ static LLDefaultChildRegistry::Register register_search_editor(" // register other widgets which otherwise may not be linked in static LLDefaultChildRegistry::Register register_loading_indicator("loading_indicator"); - // // Functions // @@ -524,8 +523,15 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex if (solid_color) { - gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR); - gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_ALPHA, LLTexUnit::TBS_VERT_ALPHA); + if (LLGLSLShader::sNoFixedFunction) + { + gSolidColorProgram.bind(); + } + else + { + gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_PREV_COLOR); + gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_ALPHA, LLTexUnit::TBS_VERT_ALPHA); + } } gGL.getTexUnit(0)->bind(image); @@ -699,7 +705,14 @@ void gl_draw_scaled_image_with_border(S32 x, S32 y, S32 width, S32 height, LLTex if (solid_color) { - gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); + if (LLGLSLShader::sNoFixedFunction) + { + gUIProgram.bind(); + } + else + { + gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); + } } } diff --git a/indra/llui/llui.h b/indra/llui/llui.h index c583d58d5a..a04b232a28 100644 --- a/indra/llui/llui.h +++ b/indra/llui/llui.h @@ -33,6 +33,7 @@ #include "llrect.h" #include "llcontrol.h" #include "llcoord.h" +#include "llglslshader.h" #include "llinitparam.h" #include "llregistry.h" #include "lluicolor.h" @@ -47,6 +48,7 @@ // for initparam specialization #include "llfontgl.h" + class LLColor4; class LLVector3; class LLVector2; @@ -484,4 +486,7 @@ namespace LLInitParam }; } +extern LLGLSLShader gSolidColorProgram; +extern LLGLSLShader gUIProgram; + #endif diff --git a/indra/newview/app_settings/logcontrol.xml b/indra/newview/app_settings/logcontrol.xml index 9f4e89691f..ae72dee900 100644 --- a/indra/newview/app_settings/logcontrol.xml +++ b/indra/newview/app_settings/logcontrol.xml @@ -44,7 +44,6 @@ - Capabilities diff --git a/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl b/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl new file mode 100644 index 0000000000..3827c72f4c --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/customalphaF.glsl @@ -0,0 +1,17 @@ +/** + * @file customalphaF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + +uniform sampler2D diffuseMap; + +uniform float custom_alpha; + +void main() +{ + vec4 color = gl_Color*texture2D(diffuseMap, gl_TexCoord[0].xy); + color.a *= custom_alpha; + gl_FragColor = color; +} diff --git a/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl b/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl new file mode 100644 index 0000000000..04bfff22c1 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/customalphaV.glsl @@ -0,0 +1,16 @@ +/** + * @file customalphaV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + + + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + gl_TexCoord[0] = gl_MultiTexCoord0; + gl_FrontColor = gl_Color; +} + diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl new file mode 100644 index 0000000000..a60fb1eaa7 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl @@ -0,0 +1,17 @@ +/** + * @file glowcombineF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + +#extension GL_ARB_texture_rectangle : enable + +uniform sampler2D glowMap; +uniform sampler2DRect screenMap; + +void main() +{ + gl_FragColor = texture2D(glowMap, gl_TexCoord[0].xy) + + texture2DRect(screenMap, gl_TexCoord[1].xy); +} diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl new file mode 100644 index 0000000000..ce183ec154 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineV.glsl @@ -0,0 +1,15 @@ +/** + * @file glowcombineV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + gl_TexCoord[0] = gl_MultiTexCoord0; + gl_TexCoord[1] = gl_MultiTexCoord1; +} + diff --git a/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl b/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl new file mode 100644 index 0000000000..b140712f18 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/occlusionF.glsl @@ -0,0 +1,11 @@ +/** + * @file occlusionF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + +void main() +{ + gl_FragColor = vec4(1,1,1,1); +} diff --git a/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl b/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl new file mode 100644 index 0000000000..5a5d0ec506 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/occlusionV.glsl @@ -0,0 +1,12 @@ +/** + * @file uiV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; +} + diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl new file mode 100644 index 0000000000..ae943cc438 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorF.glsl @@ -0,0 +1,15 @@ +/** + * @file twotextureaddF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + +uniform sampler2D tex0; + +void main() +{ + float alpha = texture2D(tex0, gl_TexCoord[0].xy).a; + + gl_FragColor = vec4(gl_Color.rgb, alpha); +} diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl new file mode 100644 index 0000000000..5a854b4e02 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl @@ -0,0 +1,15 @@ +/** + * @file solidcolorV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + + + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + gl_TexCoord[0] = gl_MultiTexCoord0; +} + diff --git a/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl b/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl new file mode 100644 index 0000000000..d81b56fdb9 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/twotextureaddF.glsl @@ -0,0 +1,14 @@ +/** + * @file twotextureaddF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + +uniform sampler2D tex0; +uniform sampler2D tex1; + +void main() +{ + gl_FragColor = texture2D(tex0, gl_TexCoord[0].xy)+texture2D(tex1, gl_TexCoord[1].xy); +} diff --git a/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl b/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl new file mode 100644 index 0000000000..f685b112b4 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/twotextureaddV.glsl @@ -0,0 +1,16 @@ +/** + * @file twotextureaddV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + + + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + gl_TexCoord[0] = gl_MultiTexCoord0; + gl_TexCoord[1] = gl_MultiTexCoord1; +} + diff --git a/indra/newview/app_settings/shaders/class1/interface/uiF.glsl b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl new file mode 100644 index 0000000000..9dec7a56ba --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/uiF.glsl @@ -0,0 +1,13 @@ +/** + * @file uiF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + +uniform sampler2D diffuseMap; + +void main() +{ + gl_FragColor = gl_Color*texture2D(diffuseMap, gl_TexCoord[0].xy); +} diff --git a/indra/newview/app_settings/shaders/class1/interface/uiV.glsl b/indra/newview/app_settings/shaders/class1/interface/uiV.glsl new file mode 100644 index 0000000000..9ca6cae5c5 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/interface/uiV.glsl @@ -0,0 +1,16 @@ +/** + * @file uiV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + + + +void main() +{ + gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + gl_TexCoord[0] = gl_MultiTexCoord0; + gl_FrontColor = gl_Color; +} + diff --git a/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl b/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl new file mode 100644 index 0000000000..587ab93a80 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/objects/bumpF.glsl @@ -0,0 +1,17 @@ +/** + * @file bumpF.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + +uniform sampler2D texture0; +uniform sampler2D texture1; + +void main() +{ + float tex0 = texture2D(texture0, gl_TexCoord[0].xy).a; + float tex1 = texture2D(texture1, gl_TexCoord[1].xy).a; + + gl_FragColor = vec4(tex0+(1.0-tex1)-0.5); +} diff --git a/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl b/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl new file mode 100644 index 0000000000..056d1a9582 --- /dev/null +++ b/indra/newview/app_settings/shaders/class1/objects/bumpV.glsl @@ -0,0 +1,16 @@ +/** + * @file bumpV.glsl + * + * $LicenseInfo:firstyear=2007&license=viewerlgpl$ + * $/LicenseInfo$ + */ + + +void main() +{ + //transform vertex + gl_Position = gl_ModelViewProjectionMatrix*gl_Vertex; + gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; + gl_TexCoord[1] = gl_TextureMatrix[1] * gl_MultiTexCoord1; + gl_FrontColor = gl_Color; +} diff --git a/indra/newview/lldrawpool.cpp b/indra/newview/lldrawpool.cpp index fa7d6e2a40..286284f828 100644 --- a/indra/newview/lldrawpool.cpp +++ b/indra/newview/lldrawpool.cpp @@ -190,15 +190,16 @@ void LLDrawPool::renderPostDeferred(S32 pass) //virtual void LLDrawPool::endRenderPass( S32 pass ) { - for (U32 i = 0; i < gGLManager.mNumTextureImageUnits; i++) + /*for (U32 i = 0; i < gGLManager.mNumTextureImageUnits; i++) { //dummy cleanup of any currently bound textures if (gGL.getTexUnit(i)->getCurrType() != LLTexUnit::TT_NONE) { gGL.getTexUnit(i)->unbind(gGL.getTexUnit(i)->getCurrType()); gGL.getTexUnit(i)->disable(); } - } + }*/ + //make sure channel 0 is active channel gGL.getTexUnit(0)->activate(); } diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp index ad7e3ad593..ddcf42e523 100644 --- a/indra/newview/lldrawpoolalpha.cpp +++ b/indra/newview/lldrawpoolalpha.cpp @@ -138,6 +138,7 @@ void LLDrawPoolAlpha::beginPostDeferredPass(S32 pass) gPipeline.mDeferredDepth.bindTarget(); simple_shader = NULL; fullbright_shader = NULL; + gObjectFullbrightProgram.bind(); } deferred_render = TRUE; @@ -156,6 +157,7 @@ void LLDrawPoolAlpha::endPostDeferredPass(S32 pass) { gPipeline.mDeferredDepth.flush(); gPipeline.mScreen.bindTarget(); + gObjectFullbrightProgram.unbind(); } deferred_render = FALSE; @@ -238,7 +240,7 @@ void LLDrawPoolAlpha::render(S32 pass) fullbright_shader->bind(); } pushBatches(LLRenderPass::PASS_FULLBRIGHT_ALPHA_MASK, getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE); - LLGLSLShader::bindNoShader(); + //LLGLSLShader::bindNoShader(); } else { diff --git a/indra/newview/lldrawpoolbump.cpp b/indra/newview/lldrawpoolbump.cpp index 813b3820ee..d801f6df18 100644 --- a/indra/newview/lldrawpoolbump.cpp +++ b/indra/newview/lldrawpoolbump.cpp @@ -464,11 +464,15 @@ void LLDrawPoolBump::unbindCubeMap(LLGLSLShader* shader, S32 shader_level, S32& } } } - gGL.getTexUnit(diffuse_channel)->disable(); - gGL.getTexUnit(cube_channel)->disable(); - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); + if (!LLGLSLShader::sNoFixedFunction) + { + gGL.getTexUnit(diffuse_channel)->disable(); + gGL.getTexUnit(cube_channel)->disable(); + + gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); + } } void LLDrawPoolBump::endShiny(bool invisible) @@ -583,19 +587,19 @@ void LLDrawPoolBump::endFullbrightShiny() cube_map->disable(); cube_map->restoreMatrix(); - if (diffuse_channel != 0) + /*if (diffuse_channel != 0) { shader->disableTexture(LLViewerShaderMgr::DIFFUSE_MAP); } gGL.getTexUnit(0)->activate(); - gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE); + gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE);*/ shader->unbind(); - gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); + //gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); } - gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); - gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); + //gGL.getTexUnit(0)->unbind(LLTexUnit::TT_TEXTURE); + //gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); diffuse_channel = -1; cube_channel = 0; @@ -706,36 +710,44 @@ void LLDrawPoolBump::beginBump(U32 pass) // Optional second pass: emboss bump map stop_glerror(); - // TEXTURE UNIT 0 - // Output.rgb = texture at texture coord 0 - gGL.getTexUnit(0)->activate(); + if (LLGLSLShader::sNoFixedFunction) + { + gObjectBumpProgram.bind(); + } + else + { + // TEXTURE UNIT 0 + // Output.rgb = texture at texture coord 0 + gGL.getTexUnit(0)->activate(); - gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_TEX_ALPHA); - gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_TEX_ALPHA); + gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_TEX_ALPHA); + gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_TEX_ALPHA); - // TEXTURE UNIT 1 - gGL.getTexUnit(1)->activate(); + // TEXTURE UNIT 1 + gGL.getTexUnit(1)->activate(); - gGL.getTexUnit(1)->enable(LLTexUnit::TT_TEXTURE); + gGL.getTexUnit(1)->enable(LLTexUnit::TT_TEXTURE); + + gGL.getTexUnit(1)->setTextureColorBlend(LLTexUnit::TBO_ADD_SIGNED, LLTexUnit::TBS_PREV_COLOR, LLTexUnit::TBS_ONE_MINUS_TEX_ALPHA); + gGL.getTexUnit(1)->setTextureAlphaBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_TEX_ALPHA); - gGL.getTexUnit(1)->setTextureColorBlend(LLTexUnit::TBO_ADD_SIGNED, LLTexUnit::TBS_PREV_COLOR, LLTexUnit::TBS_ONE_MINUS_TEX_ALPHA); - gGL.getTexUnit(1)->setTextureAlphaBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_TEX_ALPHA); + // src = tex0 + (1 - tex1) - 0.5 + // = (bump0/2 + 0.5) + (1 - (bump1/2 + 0.5)) - 0.5 + // = (1 + bump0 - bump1) / 2 - // src = tex0 + (1 - tex1) - 0.5 - // = (bump0/2 + 0.5) + (1 - (bump1/2 + 0.5)) - 0.5 - // = (1 + bump0 - bump1) / 2 + // Blend: src * dst + dst * src + // = 2 * src * dst + // = 2 * ((1 + bump0 - bump1) / 2) * dst [0 - 2 * dst] + // = (1 + bump0 - bump1) * dst.rgb + // = dst.rgb + dst.rgb * (bump0 - bump1) + + gGL.getTexUnit(0)->activate(); + gGL.getTexUnit(1)->unbind(LLTexUnit::TT_TEXTURE); + } - // Blend: src * dst + dst * src - // = 2 * src * dst - // = 2 * ((1 + bump0 - bump1) / 2) * dst [0 - 2 * dst] - // = (1 + bump0 - bump1) * dst.rgb - // = dst.rgb + dst.rgb * (bump0 - bump1) gGL.setSceneBlendType(LLRender::BT_MULT_X2); - gGL.getTexUnit(0)->activate(); stop_glerror(); - - gGL.getTexUnit(1)->unbind(LLTexUnit::TT_TEXTURE); } //static @@ -765,14 +777,21 @@ void LLDrawPoolBump::endBump(U32 pass) return; } - // Disable texture unit 1 - gGL.getTexUnit(1)->activate(); - gGL.getTexUnit(1)->disable(); - gGL.getTexUnit(1)->setTextureBlendType(LLTexUnit::TB_MULT); + if (LLGLSLShader::sNoFixedFunction) + { + gObjectBumpProgram.unbind(); + } + else + { + // Disable texture blending on unit 1 + gGL.getTexUnit(1)->activate(); + //gGL.getTexUnit(1)->disable(); + gGL.getTexUnit(1)->setTextureBlendType(LLTexUnit::TB_MULT); - // Disable texture unit 0 - gGL.getTexUnit(0)->activate(); - gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); + // Disable texture blending on unit 0 + gGL.getTexUnit(0)->activate(); + gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); + } gGL.setSceneBlendType(LLRender::BT_ALPHA); } @@ -1407,6 +1426,11 @@ void LLDrawPoolInvisible::render(S32 pass) { //render invisiprims LLFastTimer t(FTM_RENDER_INVISIBLE); + if (gPipeline.canUseVertexShaders()) + { + gOcclusionProgram.bind(); + } + U32 invisi_mask = LLVertexBuffer::MAP_VERTEX; glStencilMask(0); gGL.setColorMask(false, false); @@ -1414,6 +1438,11 @@ void LLDrawPoolInvisible::render(S32 pass) gGL.setColorMask(true, false); glStencilMask(0xFFFFFFFF); + if (gPipeline.canUseVertexShaders()) + { + gOcclusionProgram.unbind(); + } + if (gPipeline.hasRenderBatches(LLRenderPass::PASS_INVISI_SHINY)) { beginShiny(true); diff --git a/indra/newview/lldrawpoolsimple.cpp b/indra/newview/lldrawpoolsimple.cpp index 5dbb27cabb..224f149c6b 100644 --- a/indra/newview/lldrawpoolsimple.cpp +++ b/indra/newview/lldrawpoolsimple.cpp @@ -49,6 +49,8 @@ void LLDrawPoolGlow::beginPostDeferredPass(S32 pass) gDeferredFullbrightProgram.bind(); } +static LLFastTimer::DeclareTimer FTM_RENDER_GLOW_PUSH("Glow Push"); + void LLDrawPoolGlow::renderPostDeferred(S32 pass) { LLFastTimer t(FTM_RENDER_GLOW); @@ -62,7 +64,11 @@ void LLDrawPoolGlow::renderPostDeferred(S32 pass) LLGLDepthTest depth(GL_TRUE, GL_FALSE); gGL.setColorMask(false, true); - pushBatches(LLRenderPass::PASS_GLOW, getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE); + + { + LLFastTimer t(FTM_RENDER_GLOW_PUSH); + pushBatches(LLRenderPass::PASS_GLOW, getVertexDataMask() | LLVertexBuffer::MAP_TEXTURE_INDEX, TRUE, TRUE); + } gGL.setColorMask(true, false); gGL.setSceneBlendType(LLRender::BT_ALPHA); @@ -374,10 +380,14 @@ void LLDrawPoolFullbright::endRenderPass(S32 pass) LLFastTimer t(FTM_RENDER_FULLBRIGHT); LLRenderPass::endRenderPass(pass); + stop_glerror(); + if (mVertexShaderLevel > 0) { fullbright_shader->unbind(); } + + stop_glerror(); } void LLDrawPoolFullbright::render(S32 pass) @@ -385,6 +395,8 @@ void LLDrawPoolFullbright::render(S32 pass) LLFastTimer t(FTM_RENDER_FULLBRIGHT); gGL.setSceneBlendType(LLRender::BT_ALPHA); + stop_glerror(); + if (mVertexShaderLevel > 0) { fullbright_shader->bind(); @@ -398,6 +410,8 @@ void LLDrawPoolFullbright::render(S32 pass) U32 fullbright_mask = LLVertexBuffer::MAP_VERTEX | LLVertexBuffer::MAP_TEXCOORD0 | LLVertexBuffer::MAP_COLOR; renderTexture(LLRenderPass::PASS_FULLBRIGHT, fullbright_mask); } + + stop_glerror(); } S32 LLDrawPoolFullbright::getNumPasses() diff --git a/indra/newview/lldrawpoolsky.cpp b/indra/newview/lldrawpoolsky.cpp index 030d6e1110..efffb2df9e 100644 --- a/indra/newview/lldrawpoolsky.cpp +++ b/indra/newview/lldrawpoolsky.cpp @@ -82,6 +82,10 @@ void LLDrawPoolSky::render(S32 pass) mShader = &gObjectFullbrightWaterProgram; mShader->bind(); } + else if (LLGLSLShader::sNoFixedFunction) + { //just use the UI shader (generic single texture no lighting) + gUIProgram.bind(); + } else { // don't use shaders! @@ -139,6 +143,7 @@ void LLDrawPoolSky::renderSkyCubeFace(U8 side) if (LLSkyTex::doInterpolate()) { + LLGLEnable blend(GL_BLEND); mSkyTex[side].bindTexture(FALSE); glColor4f(1, 1, 1, LLSkyTex::getInterpVal()); // lighting is disabled diff --git a/indra/newview/lldrawpooltree.cpp b/indra/newview/lldrawpooltree.cpp index 81c796b146..429e06b227 100644 --- a/indra/newview/lldrawpooltree.cpp +++ b/indra/newview/lldrawpooltree.cpp @@ -73,7 +73,7 @@ void LLDrawPoolTree::beginRenderPass(S32 pass) shader = &gObjectSimpleNonIndexedProgram; } - if (gPipeline.canUseWindLightShadersOnObjects()) + if (gPipeline.canUseVertexShaders()) { shader->bind(); } diff --git a/indra/newview/lldrawpoolwlsky.cpp b/indra/newview/lldrawpoolwlsky.cpp index bf79c2100c..f9fd501072 100644 --- a/indra/newview/lldrawpoolwlsky.cpp +++ b/indra/newview/lldrawpoolwlsky.cpp @@ -189,16 +189,31 @@ void LLDrawPoolWLSky::renderStars(void) const glRotatef(gFrameTimeSeconds*0.01f, 0.f, 0.f, 1.f); // gl_FragColor.rgb = gl_Color.rgb; // gl_FragColor.a = gl_Color.a * star_alpha.a; - gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_COLOR, LLTexUnit::TBS_VERT_COLOR); - gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_MULT_X2, LLTexUnit::TBS_CONST_ALPHA, LLTexUnit::TBS_TEX_ALPHA); - glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, star_alpha.mV); + if (LLGLSLShader::sNoFixedFunction) + { + gCustomAlphaProgram.bind(); + gCustomAlphaProgram.uniform1f("custom_alpha", star_alpha.mV[3]); + } + else + { + gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_MULT, LLTexUnit::TBS_TEX_COLOR, LLTexUnit::TBS_VERT_COLOR); + gGL.getTexUnit(0)->setTextureAlphaBlend(LLTexUnit::TBO_MULT_X2, LLTexUnit::TBS_CONST_ALPHA, LLTexUnit::TBS_TEX_ALPHA); + glTexEnvfv(GL_TEXTURE_ENV, GL_TEXTURE_ENV_COLOR, star_alpha.mV); + } gSky.mVOWLSkyp->drawStars(); gGL.popMatrix(); - - // and disable the combiner states - gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); + + if (LLGLSLShader::sNoFixedFunction) + { + gCustomAlphaProgram.unbind(); + } + else + { + // and disable the combiner states + gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); + } } void LLDrawPoolWLSky::renderSkyClouds(F32 camHeightLocal) const @@ -242,6 +257,10 @@ void LLDrawPoolWLSky::renderHeavenlyBodies() if (gSky.mVOSkyp->getMoon().getDraw() && face->getGeomCount()) { + if (gPipeline.canUseVertexShaders()) + { + gUIProgram.bind(); + } // *NOTE: even though we already bound this texture above for the // stars register combiners, we bind again here for defensive reasons, // since LLImageGL::bind detects that it's a noop, and optimizes it out. @@ -257,6 +276,11 @@ void LLDrawPoolWLSky::renderHeavenlyBodies() LLFacePool::LLOverrideFaceColor color_override(this, color); face->renderIndexed(); + + if (gPipeline.canUseVertexShaders()) + { + gUIProgram.unbind(); + } } } diff --git a/indra/newview/llhudnametag.cpp b/indra/newview/llhudnametag.cpp index 82e1f2dfb5..482294c8a6 100644 --- a/indra/newview/llhudnametag.cpp +++ b/indra/newview/llhudnametag.cpp @@ -477,7 +477,7 @@ void LLHUDNameTag::renderText(BOOL for_select) // Render label { - gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); + //gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); for(std::vector::iterator segment_iter = mLabelSegments.begin(); segment_iter != mLabelSegments.end(); ++segment_iter ) diff --git a/indra/newview/llspatialpartition.cpp b/indra/newview/llspatialpartition.cpp index f99afa923b..e23b431457 100644 --- a/indra/newview/llspatialpartition.cpp +++ b/indra/newview/llspatialpartition.cpp @@ -47,6 +47,7 @@ #include "llvoavatar.h" #include "llvolumemgr.h" #include "lltextureatlas.h" +#include "llglslshader.h" static LLFastTimer::DeclareTimer FTM_FRUSTUM_CULL("Frustum Culling"); static LLFastTimer::DeclareTimer FTM_CULL_REBOUND("Cull Rebound"); @@ -3176,6 +3177,8 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume) glColor4fv(line_color.mV); LLVertexBuffer::unbind(); + llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShader != 0); + glVertexPointer(3, GL_FLOAT, 16, phys_volume->mHullPoints); glDrawElements(GL_TRIANGLES, phys_volume->mNumHullIndices, GL_UNSIGNED_SHORT, phys_volume->mHullIndices); @@ -3257,7 +3260,7 @@ void renderPhysicsShape(LLDrawable* drawable, LLVOVolume* volume) if (phys_volume->mHullPoints && phys_volume->mHullIndices) { glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - + llassert(!LLGLSLShader::sNoFixedFunction || LLGLSLShader::sCurBoundShader != 0); LLVertexBuffer::unbind(); glVertexPointer(3, GL_FLOAT, 16, phys_volume->mHullPoints); glColor4fv(line_color.mV); diff --git a/indra/newview/lltexlayer.cpp b/indra/newview/lltexlayer.cpp index bd41aa64f0..e8abee2fb7 100644 --- a/indra/newview/lltexlayer.cpp +++ b/indra/newview/lltexlayer.cpp @@ -45,6 +45,7 @@ #include "llagentwearables.h" #include "llwearable.h" #include "llviewercontrol.h" +#include "llviewershadermgr.h" #include "llviewervisualparam.h" //#include "../tools/imdebug/imdebug.h" @@ -294,11 +295,17 @@ BOOL LLTexLayerSetBuffer::render() BOOL success = TRUE; + //hack to use fixed function when updating tex layer sets + bool no_ff = LLGLSLShader::sNoFixedFunction; + LLGLSLShader::sNoFixedFunction = false; + // Composite the color data LLGLSUIDefault gls_ui; success &= mTexLayerSet->render( mOrigin.mX, mOrigin.mY, mFullWidth, mFullHeight ); gGL.flush(); + LLGLSLShader::sNoFixedFunction = no_ff; + if(upload_now) { if (!success) diff --git a/indra/newview/llviewerdisplay.cpp b/indra/newview/llviewerdisplay.cpp index 911fc8e1ed..39053fe9e4 100644 --- a/indra/newview/llviewerdisplay.cpp +++ b/indra/newview/llviewerdisplay.cpp @@ -616,6 +616,7 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) && LLFeatureManager::getInstance()->isFeatureAvailable("UseOcclusion") && gSavedSettings.getBOOL("UseOcclusion") && gGLManager.mHasOcclusionQuery) ? 2 : 0; + LLTexUnit::sWhiteTexture = LLViewerFetchedTexture::sWhiteImagep->getTexName(); /*if (LLPipeline::sUseOcclusion && LLPipeline::sRenderDeferred) { //force occlusion on for all render types if doing deferred render (tighter shadow frustum) @@ -709,6 +710,9 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) glClear(GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); } + LLGLState::checkStates(); + LLGLState::checkClientArrays(); + //if (!for_snapshot) { LLMemType mt_gw(LLMemType::MTYPE_DISPLAY_GEN_REFLECTION); @@ -717,6 +721,9 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) gPipeline.generateHighlight(*LLViewerCamera::getInstance()); } + LLGLState::checkStates(); + LLGLState::checkClientArrays(); + ////////////////////////////////////// // // Update images, using the image stats generated during object update/culling @@ -743,6 +750,10 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) LLImageGL::deleteDeadTextures(); stop_glerror(); } + + LLGLState::checkStates(); + LLGLState::checkClientArrays(); + /////////////////////////////////// // // StateSort @@ -770,6 +781,9 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) } } + LLGLState::checkStates(); + LLGLState::checkClientArrays(); + LLPipeline::sUseOcclusion = occlusion; { @@ -828,6 +842,9 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) LLPipeline::sUnderWaterRender = LLViewerCamera::getInstance()->cameraUnderWater() ? TRUE : FALSE; LLPipeline::refreshRenderDeferred(); + LLGLState::checkStates(); + LLGLState::checkClientArrays(); + stop_glerror(); if (to_texture) @@ -878,6 +895,14 @@ void display(BOOL rebuild, F32 zoom_factor, int subfield, BOOL for_snapshot) stop_glerror(); } + for (U32 i = 0; i < gGLManager.mNumTextureImageUnits; i++) + { //dummy cleanup of any currently bound textures + if (gGL.getTexUnit(i)->getCurrType() != LLTexUnit::TT_NONE) + { + gGL.getTexUnit(i)->unbind(gGL.getTexUnit(i)->getCurrType()); + gGL.getTexUnit(i)->disable(); + } + } LLAppViewer::instance()->pingMainloopTimeout("Display:RenderFlush"); if (to_texture) @@ -1339,7 +1364,7 @@ void render_ui_2d() } stop_glerror(); - gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); + //gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); // render outline for HUD if (isAgentAvatarValid() && gAgentCamera.mHUDCurZoom < 0.98f) diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index e473901609..812b03a2e6 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -61,6 +61,14 @@ BOOL LLViewerShaderMgr::sInitialized = FALSE; LLVector4 gShinyOrigin; +//utility shaders +LLGLSLShader gOcclusionProgram; +LLGLSLShader gUIProgram; +LLGLSLShader gCustomAlphaProgram; +LLGLSLShader gGlowCombineProgram; +LLGLSLShader gTwoTextureAddProgram; +LLGLSLShader gSolidColorProgram; + //object shaders LLGLSLShader gObjectSimpleProgram; LLGLSLShader gObjectSimpleWaterProgram; @@ -70,6 +78,7 @@ LLGLSLShader gObjectFullbrightShinyProgram; LLGLSLShader gObjectFullbrightShinyWaterProgram; LLGLSLShader gObjectShinyProgram; LLGLSLShader gObjectShinyWaterProgram; +LLGLSLShader gObjectBumpProgram; LLGLSLShader gObjectSimpleNonIndexedProgram; LLGLSLShader gObjectSimpleNonIndexedWaterProgram; @@ -169,6 +178,13 @@ LLViewerShaderMgr::LLViewerShaderMgr() : mShaderList.push_back(&gWaterProgram); mShaderList.push_back(&gAvatarEyeballProgram); mShaderList.push_back(&gObjectSimpleProgram); + mShaderList.push_back(&gObjectBumpProgram); + mShaderList.push_back(&gUIProgram); + mShaderList.push_back(&gCustomAlphaProgram); + mShaderList.push_back(&gGlowCombineProgram); + mShaderList.push_back(&gTwoTextureAddProgram); + mShaderList.push_back(&gSolidColorProgram); + mShaderList.push_back(&gOcclusionProgram); mShaderList.push_back(&gObjectFullbrightProgram); mShaderList.push_back(&gObjectFullbrightShinyProgram); mShaderList.push_back(&gObjectFullbrightShinyWaterProgram); @@ -410,9 +426,13 @@ void LLViewerShaderMgr::setShaders() } mMaxAvatarShaderLevel = 0; + LLGLSLShader::sNoFixedFunction = false; if (LLFeatureManager::getInstance()->isFeatureAvailable("VertexShaderEnable") && gSavedSettings.getBOOL("VertexShaderEnable")) { + //using shaders, disable fixed function + LLGLSLShader::sNoFixedFunction = true; + S32 light_class = 2; S32 env_class = 2; S32 obj_class = 2; @@ -554,6 +574,7 @@ void LLViewerShaderMgr::setShaders() } else { + LLGLSLShader::sNoFixedFunction = false; gPipeline.mVertexShadersEnabled = FALSE; gPipeline.mVertexShadersLoaded = 0; mVertexShaderLevel[SHADER_LIGHTING] = 0; @@ -568,6 +589,7 @@ void LLViewerShaderMgr::setShaders() } else { + LLGLSLShader::sNoFixedFunction = false; gPipeline.mVertexShadersEnabled = FALSE; gPipeline.mVertexShadersLoaded = 0; mVertexShaderLevel[SHADER_LIGHTING] = 0; @@ -591,7 +613,15 @@ void LLViewerShaderMgr::setShaders() void LLViewerShaderMgr::unloadShaders() { + gOcclusionProgram.unload(); + gUIProgram.unload(); + gCustomAlphaProgram.unload(); + gGlowCombineProgram.unload(); + gTwoTextureAddProgram.unload(); + gSolidColorProgram.unload(); + gObjectSimpleProgram.unload(); + gObjectBumpProgram.unload(); gObjectSimpleWaterProgram.unload(); gObjectFullbrightProgram.unload(); gObjectFullbrightWaterProgram.unload(); @@ -1581,6 +1611,7 @@ BOOL LLViewerShaderMgr::loadShadersObject() gObjectFullbrightShinyWaterProgram.unload(); gObjectShinyWaterProgram.unload(); gObjectSimpleProgram.unload(); + gObjectBumpProgram.unload(); gObjectSimpleWaterProgram.unload(); gObjectFullbrightProgram.unload(); gObjectFullbrightWaterProgram.unload(); @@ -1751,6 +1782,22 @@ BOOL LLViewerShaderMgr::loadShadersObject() success = gObjectSimpleProgram.createShader(NULL, NULL); } + if (success) + { + gObjectBumpProgram.mName = "Bump Shader"; + /*gObjectBumpProgram.mFeatures.calculatesLighting = true; + gObjectBumpProgram.mFeatures.calculatesAtmospherics = true; + gObjectBumpProgram.mFeatures.hasGamma = true; + gObjectBumpProgram.mFeatures.hasAtmospherics = true; + gObjectBumpProgram.mFeatures.hasLighting = true; + gObjectBumpProgram.mFeatures.mIndexedTextureChannels = 0;*/ + gObjectBumpProgram.mShaderFiles.clear(); + gObjectBumpProgram.mShaderFiles.push_back(make_pair("objects/bumpV.glsl", GL_VERTEX_SHADER_ARB)); + gObjectBumpProgram.mShaderFiles.push_back(make_pair("objects/bumpF.glsl", GL_FRAGMENT_SHADER_ARB)); + gObjectBumpProgram.mShaderLevel = mVertexShaderLevel[SHADER_OBJECT]; + success = gObjectBumpProgram.createShader(NULL, NULL); + } + if (success) { gObjectSimpleWaterProgram.mName = "Simple Water Shader"; @@ -2135,6 +2182,85 @@ BOOL LLViewerShaderMgr::loadShadersInterface() success = gHighlightProgram.createShader(NULL, NULL); } + if (success) + { + gUIProgram.mName = "UI Shader"; + gUIProgram.mShaderFiles.clear(); + gUIProgram.mShaderFiles.push_back(make_pair("interface/uiV.glsl", GL_VERTEX_SHADER_ARB)); + gUIProgram.mShaderFiles.push_back(make_pair("interface/uiF.glsl", GL_FRAGMENT_SHADER_ARB)); + gUIProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; + success = gUIProgram.createShader(NULL, NULL); + } + + if (success) + { + gCustomAlphaProgram.mName = "Custom Alpha Shader"; + gCustomAlphaProgram.mShaderFiles.clear(); + gCustomAlphaProgram.mShaderFiles.push_back(make_pair("interface/customalphaV.glsl", GL_VERTEX_SHADER_ARB)); + gCustomAlphaProgram.mShaderFiles.push_back(make_pair("interface/customalphaF.glsl", GL_FRAGMENT_SHADER_ARB)); + gCustomAlphaProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; + success = gCustomAlphaProgram.createShader(NULL, NULL); + } + + if (success) + { + gGlowCombineProgram.mName = "Glow Combine Shader"; + gGlowCombineProgram.mShaderFiles.clear(); + gGlowCombineProgram.mShaderFiles.push_back(make_pair("interface/glowcombineV.glsl", GL_VERTEX_SHADER_ARB)); + gGlowCombineProgram.mShaderFiles.push_back(make_pair("interface/glowcombineF.glsl", GL_FRAGMENT_SHADER_ARB)); + gGlowCombineProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; + success = gGlowCombineProgram.createShader(NULL, NULL); + if (success) + { + gGlowCombineProgram.bind(); + gGlowCombineProgram.uniform1i("glowMap", 0); + gGlowCombineProgram.uniform1i("screenMap", 1); + gGlowCombineProgram.unbind(); + } + } + + if (success) + { + gTwoTextureAddProgram.mName = "Two Texture Add Shader"; + gTwoTextureAddProgram.mShaderFiles.clear(); + gTwoTextureAddProgram.mShaderFiles.push_back(make_pair("interface/twotextureaddV.glsl", GL_VERTEX_SHADER_ARB)); + gTwoTextureAddProgram.mShaderFiles.push_back(make_pair("interface/twotextureaddF.glsl", GL_FRAGMENT_SHADER_ARB)); + gTwoTextureAddProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; + success = gTwoTextureAddProgram.createShader(NULL, NULL); + if (success) + { + gTwoTextureAddProgram.bind(); + gTwoTextureAddProgram.uniform1i("tex0", 0); + gTwoTextureAddProgram.uniform1i("tex1", 1); + } + } + + if (success) + { + gSolidColorProgram.mName = "Solid Color Shader"; + gSolidColorProgram.mShaderFiles.clear(); + gSolidColorProgram.mShaderFiles.push_back(make_pair("interface/solidcolorV.glsl", GL_VERTEX_SHADER_ARB)); + gSolidColorProgram.mShaderFiles.push_back(make_pair("interface/solidcolorF.glsl", GL_FRAGMENT_SHADER_ARB)); + gSolidColorProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; + success = gSolidColorProgram.createShader(NULL, NULL); + if (success) + { + gSolidColorProgram.bind(); + gSolidColorProgram.uniform1i("tex0", 0); + gSolidColorProgram.unbind(); + } + } + + if (success) + { + gOcclusionProgram.mName = "Occlusion Shader"; + gOcclusionProgram.mShaderFiles.clear(); + gOcclusionProgram.mShaderFiles.push_back(make_pair("interface/occlusionV.glsl", GL_VERTEX_SHADER_ARB)); + gOcclusionProgram.mShaderFiles.push_back(make_pair("interface/occlusionF.glsl", GL_FRAGMENT_SHADER_ARB)); + gOcclusionProgram.mShaderLevel = mVertexShaderLevel[SHADER_INTERFACE]; + success = gOcclusionProgram.createShader(NULL, NULL); + } + if( !success ) { mVertexShaderLevel[SHADER_INTERFACE] = 0; diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h index efef9ec5b2..6b22e83a9f 100644 --- a/indra/newview/llviewershadermgr.h +++ b/indra/newview/llviewershadermgr.h @@ -287,6 +287,18 @@ inline bool operator != (LLViewerShaderMgr::shader_iter const & a, LLViewerShade extern LLVector4 gShinyOrigin; +//utility shaders +extern LLGLSLShader gOcclusionProgram; +extern LLGLSLShader gUIProgram; +extern LLGLSLShader gCustomAlphaProgram; +extern LLGLSLShader gGlowCombineProgram; + +//output tex0[tc0] + tex1[tc1] +extern LLGLSLShader gTwoTextureAddProgram; + +//output vec4(color.rgb,color.a*tex0[tc0].a) +extern LLGLSLShader gSolidColorProgram; + //object shaders extern LLGLSLShader gObjectSimpleProgram; extern LLGLSLShader gObjectSimpleWaterProgram; @@ -296,6 +308,7 @@ extern LLGLSLShader gObjectFullbrightProgram; extern LLGLSLShader gObjectFullbrightWaterProgram; extern LLGLSLShader gObjectFullbrightNonIndexedProgram; extern LLGLSLShader gObjectFullbrightNonIndexedWaterProgram; +extern LLGLSLShader gObjectBumpProgram; extern LLGLSLShader gObjectSimpleLODProgram; extern LLGLSLShader gObjectFullbrightLODProgram; diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 4da0f80a00..5fcc57bc91 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -599,7 +599,7 @@ bool LLViewerTexture::bindDefaultImage(S32 stage) } if (!res && LLViewerTexture::sNullImagep.notNull() && (this != LLViewerTexture::sNullImagep)) { - res = gGL.getTexUnit(stage)->bind(LLViewerTexture::sNullImagep) ; + res = gGL.getTexUnit(stage)->bind(LLViewerTexture::sNullImagep); } if (!res) { diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index d24174adea..30ef8b8a29 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -115,7 +115,7 @@ void LLViewerTextureList::doPreloadImages() // Set the "white" image LLViewerFetchedTexture::sWhiteImagep = LLViewerTextureManager::getFetchedTextureFromFile("white.tga", MIPMAP_NO, LLViewerFetchedTexture::BOOST_UI); - + LLTexUnit::sWhiteTexture = LLViewerFetchedTexture::sWhiteImagep->getTexName(); LLUIImageList* image_list = LLUIImageList::getInstance(); image_list->initFromFile(); diff --git a/indra/newview/llviewerwindow.cpp b/indra/newview/llviewerwindow.cpp index cff166b825..1e056898d5 100644 --- a/indra/newview/llviewerwindow.cpp +++ b/indra/newview/llviewerwindow.cpp @@ -2296,6 +2296,11 @@ void LLViewerWindow::draw() // Draw all nested UI views. // No translation needed, this view is glued to 0,0 + if (LLGLSLShader::sNoFixedFunction) + { + gUIProgram.bind(); + } + gGL.pushMatrix(); LLUI::pushMatrix(); { @@ -2370,6 +2375,11 @@ void LLViewerWindow::draw() LLUI::popMatrix(); gGL.popMatrix(); + if (LLGLSLShader::sNoFixedFunction) + { + gUIProgram.unbind(); + } + //#if LL_DEBUG LLView::sIsDrawing = FALSE; //#endif diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index cd2bbad620..9dc6b5194e 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -7049,6 +7049,8 @@ LLVivoxProtocolParser::~LLVivoxProtocolParser() XML_ParserFree(parser); } +//static LLFastTimer::DeclareTimer FTM_VIVOX_PROCESS("Vivox Process"); + // virtual LLIOPipe::EStatus LLVivoxProtocolParser::process_impl( const LLChannelDescriptors& channels, @@ -7057,6 +7059,7 @@ LLIOPipe::EStatus LLVivoxProtocolParser::process_impl( LLSD& context, LLPumpIO* pump) { + //LLFastTimer t(FTM_VIVOX_PROCESS); LLBufferStream istr(channels, buffer.get()); std::ostringstream ostr; while (istr.good()) diff --git a/indra/newview/llvotree.cpp b/indra/newview/llvotree.cpp index 3c7fe708e6..890861df71 100644 --- a/indra/newview/llvotree.cpp +++ b/indra/newview/llvotree.cpp @@ -51,6 +51,7 @@ #include "llspatialpartition.h" #include "llnotificationsutil.h" #include "raytrace.h" +#include "llglslshader.h" extern LLPipeline gPipeline; diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index e74bf2a620..8372c2430b 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -1983,6 +1983,14 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl LLGLDepthTest depth(GL_TRUE, GL_FALSE); + bool bound_shader = false; + if (gPipeline.canUseVertexShaders() && LLGLSLShader::sCurBoundShader == 0) + { //if no shader is currently bound, use the occlusion shader instead of fixed function if we can + // (shadow render uses a special shader that clamps to clip planes) + bound_shader = true; + gOcclusionProgram.bind(); + } + for (LLWorld::region_list_t::const_iterator iter = LLWorld::getInstance()->getRegionList().begin(); iter != LLWorld::getInstance()->getRegionList().end(); ++iter) { @@ -2010,6 +2018,11 @@ void LLPipeline::updateCull(LLCamera& camera, LLCullResult& result, S32 water_cl } } + if (bound_shader) + { + gOcclusionProgram.unbind(); + } + camera.disableUserClipPlane(); if (hasRenderType(LLPipeline::RENDER_TYPE_SKY) && @@ -2133,7 +2146,12 @@ void LLPipeline::doOcclusion(LLCamera& camera) LLGLDepthTest depth(GL_TRUE, GL_FALSE); LLGLDisable cull(GL_CULL_FACE); - + + if (canUseVertexShaders()) + { + gOcclusionProgram.bind(); + } + for (LLCullResult::sg_list_t::iterator iter = sCull->beginOcclusionGroups(); iter != sCull->endOcclusionGroups(); ++iter) { LLSpatialGroup* group = *iter; @@ -2141,6 +2159,11 @@ void LLPipeline::doOcclusion(LLCamera& camera) group->clearOcclusionState(LLSpatialGroup::ACTIVE_OCCLUSION); } + if (canUseVertexShaders()) + { + gOcclusionProgram.unbind(); + } + gGL.setColorMask(true, false); } } @@ -3249,6 +3272,11 @@ void render_hud_elements() gGL.color4f(1,1,1,1); if (!LLPipeline::sReflectionRender && gPipeline.hasRenderDebugFeatureMask(LLPipeline::RENDER_DEBUG_FEATURE_UI)) { + if (LLGLSLShader::sNoFixedFunction) + { + gUIProgram.bind(); + } + LLGLEnable multisample(gSavedSettings.getU32("RenderFSAASamples") > 0 ? GL_MULTISAMPLE_ARB : 0); gViewerWindow->renderSelections(FALSE, FALSE, FALSE); // For HUD version in render_ui_3d() @@ -3262,6 +3290,10 @@ void render_hud_elements() // Render name tags. LLHUDObject::renderAll(); + if (LLGLSLShader::sNoFixedFunction) + { + gUIProgram.unbind(); + } } else if (gForceRenderLandFence) { @@ -3599,8 +3631,8 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) check_stack_depth(stack_depth); std::string msg = llformat("pass %d", i); LLGLState::checkStates(msg); - LLGLState::checkTextureChannels(msg); - LLGLState::checkClientArrays(msg); + //LLGLState::checkTextureChannels(msg); + //LLGLState::checkClientArrays(msg); } } } @@ -3638,16 +3670,8 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) LLVertexBuffer::unbind(); LLGLState::checkStates(); - LLGLState::checkTextureChannels(); - LLGLState::checkClientArrays(); - - - - stop_glerror(); - - LLGLState::checkStates(); - LLGLState::checkTextureChannels(); - LLGLState::checkClientArrays(); + //LLGLState::checkTextureChannels(); + //LLGLState::checkClientArrays(); LLAppViewer::instance()->pingMainloopTimeout("Pipeline:RenderHighlights"); @@ -3701,8 +3725,8 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) LLVertexBuffer::unbind(); LLGLState::checkStates(); - LLGLState::checkTextureChannels(); - LLGLState::checkClientArrays(); +// LLGLState::checkTextureChannels(); +// LLGLState::checkClientArrays(); } void LLPipeline::renderGeomDeferred(LLCamera& camera) @@ -6449,30 +6473,39 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) LLGLDisable blend(GL_BLEND); - //tex unit 0 - gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_TEX_COLOR); - - gGL.getTexUnit(0)->bind(&mGlow[1]); - gGL.getTexUnit(1)->activate(); - gGL.getTexUnit(1)->enable(LLTexUnit::TT_RECT_TEXTURE); - - - //tex unit 1 - gGL.getTexUnit(1)->setTextureColorBlend(LLTexUnit::TBO_ADD, LLTexUnit::TBS_TEX_COLOR, LLTexUnit::TBS_PREV_COLOR); + if (LLGLSLShader::sNoFixedFunction) + { + gGlowCombineProgram.bind(); + } + else + { + //tex unit 0 + gGL.getTexUnit(0)->setTextureColorBlend(LLTexUnit::TBO_REPLACE, LLTexUnit::TBS_TEX_COLOR); + //tex unit 1 + gGL.getTexUnit(1)->setTextureColorBlend(LLTexUnit::TBO_ADD, LLTexUnit::TBS_TEX_COLOR, LLTexUnit::TBS_PREV_COLOR); + } + gGL.getTexUnit(0)->bind(&mGlow[1]); gGL.getTexUnit(1)->bind(&mScreen); - gGL.getTexUnit(1)->activate(); LLGLEnable multisample(gSavedSettings.getU32("RenderFSAASamples") > 0 ? GL_MULTISAMPLE_ARB : 0); buff->setBuffer(mask); buff->drawArrays(LLRender::TRIANGLE_STRIP, 0, 3); - gGL.getTexUnit(1)->disable(); - gGL.getTexUnit(1)->setTextureBlendType(LLTexUnit::TB_MULT); + if (LLGLSLShader::sNoFixedFunction) + { + gGlowCombineProgram.unbind(); + } + else + { + gGL.getTexUnit(1)->disable(); + gGL.getTexUnit(1)->setTextureBlendType(LLTexUnit::TB_MULT); - gGL.getTexUnit(0)->activate(); - gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); + gGL.getTexUnit(0)->activate(); + gGL.getTexUnit(0)->setTextureBlendType(LLTexUnit::TB_MULT); + } + } if (LLRenderTarget::sUseFBO) @@ -6485,6 +6518,11 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) if (hasRenderDebugMask(LLPipeline::RENDER_DEBUG_PHYSICS_SHAPES)) { + if (LLGLSLShader::sNoFixedFunction) + { + gUIProgram.bind(); + } + gGL.setColorMask(true, false); LLVector2 tc1(0,0); @@ -6508,6 +6546,12 @@ void LLPipeline::renderBloom(BOOL for_snapshot, F32 zoom_factor, int subfield) gGL.end(); gGL.flush(); + + if (LLGLSLShader::sNoFixedFunction) + { + gUIProgram.unbind(); + } + } glMatrixMode(GL_PROJECTION); @@ -8063,8 +8107,8 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) LLViewerCamera::getInstance()->setUserClipPlane(npnorm); LLGLState::checkStates(); - LLGLState::checkTextureChannels(); - LLGLState::checkClientArrays(); + //LLGLState::checkTextureChannels(); + //LLGLState::checkClientArrays(); if (!skip_avatar_update) { @@ -8197,6 +8241,10 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera LLVertexBuffer::unbind(); { + if (!use_shader) + { //occlusion program is general purpose depth-only no-textures + gOcclusionProgram.bind(); + } LLFastTimer ftm(FTM_SHADOW_SIMPLE); LLGLDisable test(GL_ALPHA_TEST); gGL.getTexUnit(0)->disable(); @@ -8205,6 +8253,10 @@ void LLPipeline::renderShadow(glh::matrix4f& view, glh::matrix4f& proj, LLCamera renderObjects(types[i], LLVertexBuffer::MAP_VERTEX, FALSE); } gGL.getTexUnit(0)->enable(LLTexUnit::TT_TEXTURE); + if (!use_shader) + { + gOcclusionProgram.unbind(); + } } if (use_shader) diff --git a/shining-fixes_rev18977.patch b/shining-fixes_rev18977.patch new file mode 100644 index 0000000000..b711da870a --- /dev/null +++ b/shining-fixes_rev18977.patch @@ -0,0 +1,41 @@ +# HG changeset patch +# User Dave Parks +# Date 1308673064 18000 +# Node ID 95c5639a3f80920e8dc54703d894517dd7694edf +# Parent 6af10678de4736222b2c3f7e010e984fb5b327de +SH-208 Disable VBO on all intel graphics chips (stability improvement). + +diff -r 6af10678de47 -r 95c5639a3f80 indra/newview/featuretable.txt +--- a/indra/newview/featuretable.txt Mon Jun 20 16:42:31 2011 -0700 ++++ b/indra/newview/featuretable.txt Tue Jun 21 11:17:44 2011 -0500 +@@ -1,4 +1,4 @@ +-version 29 ++version 30 + + // NOTE: This is mostly identical to featuretable_mac.txt with a few differences + // Should be combined into one table +@@ -297,6 +297,7 @@ + + list Intel + RenderAnisotropic 1 0 ++RenderVBOEnable 1 0 + + list GeForce2 + RenderAnisotropic 1 0 +diff -r 6af10678de47 -r 95c5639a3f80 indra/newview/featuretable_xp.txt +--- a/indra/newview/featuretable_xp.txt Mon Jun 20 16:42:31 2011 -0700 ++++ b/indra/newview/featuretable_xp.txt Tue Jun 21 11:17:44 2011 -0500 +@@ -1,4 +1,4 @@ +-version 29 ++version 30 + + // NOTE: This is mostly identical to featuretable_mac.txt with a few differences + // Should be combined into one table +@@ -295,6 +295,7 @@ + + list Intel + RenderAnisotropic 1 0 ++RenderVBOEnable 1 0 + + list GeForce2 + RenderAnisotropic 1 0 -- cgit v1.2.3 From 9077f7722b3ab2b6dda7e5c13cee3fd59d7dbf53 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Sun, 17 Jul 2011 09:51:29 -0400 Subject: Decided against using Boost.Filesystem, remove from link --- indra/llcommon/CMakeLists.txt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/indra/llcommon/CMakeLists.txt b/indra/llcommon/CMakeLists.txt index 09a05689f4..c755020a64 100644 --- a/indra/llcommon/CMakeLists.txt +++ b/indra/llcommon/CMakeLists.txt @@ -317,8 +317,7 @@ if (LL_TESTS) LL_ADD_INTEGRATION_TEST(lllazy "" "${test_libs}") LL_ADD_INTEGRATION_TEST(llprocessor "" "${test_libs}") LL_ADD_INTEGRATION_TEST(llrand "" "${test_libs}") - LL_ADD_INTEGRATION_TEST(llsdserialize "" - "${test_libs};${BOOST_FILESYSTEM_LIBRARY};${BOOST_SYSTEM_LIBRARY}" + LL_ADD_INTEGRATION_TEST(llsdserialize "" "${test_libs}" "${PYTHON_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/setpython.py") LL_ADD_INTEGRATION_TEST(llstring "" "${test_libs}") LL_ADD_INTEGRATION_TEST(lltreeiterators "" "${test_libs}") -- cgit v1.2.3 From 190ff3c346ae8f86b4533fd03f7a0dcb0808dde3 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 18 Jul 2011 10:39:02 -0500 Subject: SH-2031 Fix for link error in llui_libtest --- indra/llrender/llglslshader.cpp | 4 ++++ indra/llrender/llglslshader.h | 6 ++++++ indra/newview/llviewershadermgr.cpp | 2 -- indra/newview/llviewershadermgr.h | 4 ---- 4 files changed, 10 insertions(+), 6 deletions(-) diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index c582858413..80c93bb0d2 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -51,6 +51,10 @@ using std::string; GLhandleARB LLGLSLShader::sCurBoundShader = 0; bool LLGLSLShader::sNoFixedFunction = false; +//UI shader -- declared here so llui_libtest will link properly +LLGLSLShader gUIProgram; +LLGLSLShader gSolidColorProgram; + BOOL shouldChange(const LLVector4& v1, const LLVector4& v2) { return v1 != v2; diff --git a/indra/llrender/llglslshader.h b/indra/llrender/llglslshader.h index 24562c3c42..621e0b82ee 100644 --- a/indra/llrender/llglslshader.h +++ b/indra/llrender/llglslshader.h @@ -142,4 +142,10 @@ public: std::string mName; }; +//UI shader (declared here so llui_libtest will link properly) +extern LLGLSLShader gUIProgram; +//output vec4(color.rgb,color.a*tex0[tc0].a) +extern LLGLSLShader gSolidColorProgram; + + #endif diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 812b03a2e6..a772777495 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -63,11 +63,9 @@ LLVector4 gShinyOrigin; //utility shaders LLGLSLShader gOcclusionProgram; -LLGLSLShader gUIProgram; LLGLSLShader gCustomAlphaProgram; LLGLSLShader gGlowCombineProgram; LLGLSLShader gTwoTextureAddProgram; -LLGLSLShader gSolidColorProgram; //object shaders LLGLSLShader gObjectSimpleProgram; diff --git a/indra/newview/llviewershadermgr.h b/indra/newview/llviewershadermgr.h index 6b22e83a9f..93a0ecc4f0 100644 --- a/indra/newview/llviewershadermgr.h +++ b/indra/newview/llviewershadermgr.h @@ -289,16 +289,12 @@ extern LLVector4 gShinyOrigin; //utility shaders extern LLGLSLShader gOcclusionProgram; -extern LLGLSLShader gUIProgram; extern LLGLSLShader gCustomAlphaProgram; extern LLGLSLShader gGlowCombineProgram; //output tex0[tc0] + tex1[tc1] extern LLGLSLShader gTwoTextureAddProgram; -//output vec4(color.rgb,color.a*tex0[tc0].a) -extern LLGLSLShader gSolidColorProgram; - //object shaders extern LLGLSLShader gObjectSimpleProgram; extern LLGLSLShader gObjectSimpleWaterProgram; -- cgit v1.2.3 From 2eaadf902406fbdf6feb5e3e39a9f07f3369fc17 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 18 Jul 2011 12:22:54 -0500 Subject: SH-2031 Fix for shadow render targets using inappropriate shader for occlusion culling resulting in objects popping in and out of the shadow map. --- indra/newview/pipeline.cpp | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 8372c2430b..bd801ae4c2 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -2147,9 +2147,18 @@ void LLPipeline::doOcclusion(LLCamera& camera) LLGLDisable cull(GL_CULL_FACE); - if (canUseVertexShaders()) + + bool bind_shader = LLGLSLShader::sNoFixedFunction && LLGLSLShader::sCurBoundShader == 0; + if (bind_shader) { - gOcclusionProgram.bind(); + if (LLPipeline::sShadowRender) + { + gDeferredShadowProgram.bind(); + } + else + { + gOcclusionProgram.bind(); + } } for (LLCullResult::sg_list_t::iterator iter = sCull->beginOcclusionGroups(); iter != sCull->endOcclusionGroups(); ++iter) @@ -2159,9 +2168,16 @@ void LLPipeline::doOcclusion(LLCamera& camera) group->clearOcclusionState(LLSpatialGroup::ACTIVE_OCCLUSION); } - if (canUseVertexShaders()) + if (bind_shader) { - gOcclusionProgram.unbind(); + if (LLPipeline::sShadowRender) + { + gDeferredShadowProgram.unbind(); + } + else + { + gOcclusionProgram.unbind(); + } } gGL.setColorMask(true, false); -- cgit v1.2.3 From 677609b7224b2cd1e02e5866218f2e0d1fce57ba Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 19 Jul 2011 09:05:54 -0400 Subject: Per Josh's comments in http://codereview.lindenlab.com/6510035/ Instead of low-level open(O_CREAT | O_EXCL) loop on all platforms, use GetTempFileName() on Windows and mkstemp() elsewhere. Don't append a final newline to NamedTempFile: use caller's data literally. Tweak a couple comments. --- indra/llcommon/tests/llsdserialize_test.cpp | 179 +++++++++++++++++++++------- 1 file changed, 133 insertions(+), 46 deletions(-) diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp index 7ce7ada29e..1fe3dc13c0 100644 --- a/indra/llcommon/tests/llsdserialize_test.cpp +++ b/indra/llcommon/tests/llsdserialize_test.cpp @@ -37,12 +37,12 @@ typedef U32 uint32_t; #include #include #include +#include +#include #include #include "llprocesslauncher.h" #endif -#include -#include #include /*==========================================================================*| @@ -89,6 +89,45 @@ std::vector string_to_vector(const std::string& str) return std::vector(str.begin(), str.end()); } +#if ! LL_WINDOWS +// We want to call strerror_r(), but alarmingly, there are two different +// variants. The one that returns int always populates the passed buffer +// (except in case of error), whereas the other one always returns a valid +// char* but might or might not populate the passed buffer. How do we know +// which one we're getting? Define adapters for each and let the compiler +// select the applicable adapter. + +// strerror_r() returns char* +std::string message_from(int /*orig_errno*/, const char* /*buffer*/, const char* strerror_ret) +{ + return strerror_ret; +} + +// strerror_r() returns int +std::string message_from(int orig_errno, const char* buffer, int strerror_ret) +{ + if (strerror_ret == 0) + { + return buffer; + } + // Here strerror_r() has set errno. Since strerror_r() has already failed, + // seems like a poor bet to call it again to diagnose its own error... + int stre_errno = errno; + if (stre_errno == ERANGE) + { + return STRINGIZE("strerror_r() can't explain errno " << orig_errno + << " (buffer too small)"); + } + if (stre_errno == EINVAL) + { + return STRINGIZE("unknown errno " << orig_errno); + } + // Here we don't even understand the errno from strerror_r()! + return STRINGIZE("strerror_r() can't explain errno " << orig_errno + << " (error " << stre_errno << ')'); +} +#endif // ! LL_WINDOWS + // boost::filesystem::temp_directory_path() isn't yet in Boost 1.45! :-( std::string temp_directory_path() { @@ -119,11 +158,6 @@ std::string temp_directory_path() #define _write write #define _close close #define _remove remove -#define _O_WRONLY O_WRONLY -#define _O_CREAT O_CREAT -#define _O_EXCL O_EXCL -#define _S_IWRITE S_IWUSR -#define _S_IREAD S_IRUSR #endif // ! LL_WINDOWS // Create a text file with specified content "somewhere in the @@ -165,6 +199,11 @@ public: private: void createFile(const std::string& ext, const Streamer& func) { + // Silly maybe, but use 'ext' as the name prefix. Strip off a leading + // '.' if present. + int pfx_offset = ((! ext.empty()) && ext[0] == '.')? 1 : 0; + +#if ! LL_WINDOWS // Make sure mPath ends with a directory separator, if it doesn't already. if (mPath.empty() || ! (mPath[mPath.length() - 1] == '\\' || mPath[mPath.length() - 1] == '/')) @@ -172,49 +211,92 @@ private: mPath.append("/"); } - // Open a file with a unique name in the mPath directory. - int fd(-1); - for (int i(0);; ++i) + // mkstemp() accepts and modifies a char* template string. Generate + // the template string, then copy to modifiable storage. + // mkstemp() requires its template string to end in six X's. + mPath += ext.substr(pfx_offset) + "XXXXXX"; + // Copy to vector + std::vector pathtemplate(mPath.begin(), mPath.end()); + // append a nul byte for classic-C semantics + pathtemplate.push_back('\0'); + // std::vector promises that a pointer to the 0th element is the same + // as a pointer to a contiguous classic-C array + int fd(mkstemp(&pathtemplate[0])); + if (fd == -1) { - // Append an integer name to mPath. It need not be zero-filled, - // but I think it's neater that way. - std::string testname(STRINGIZE(mPath - << std::setw(8) << std::setfill('0') << i - << ext)); - // The key to this whole loop is the _O_CREAT | _O_EXCL bitmask, - // which requests error EEXIST if the file already exists. A - // proper implementation will check atomically, ensuring that - // racing processes will end up with two different filenames. - fd = _open(testname.c_str(), - _O_WRONLY | _O_CREAT | _O_EXCL, - _S_IREAD | _S_IWRITE); - if (fd != -1) // managed to open the file + // The documented errno values (http://linux.die.net/man/3/mkstemp) + // are used in a somewhat unusual way, so provide context-specific + // errors. + if (errno == EEXIST) + { + LL_ERRS("NamedTempFile") << "mkstemp(\"" << mPath + << "\") could not create unique file " << LL_ENDL; + } + if (errno == EINVAL) { - mPath = testname; // remember its actual name - break; + LL_ERRS("NamedTempFile") << "bad mkstemp() file path template '" + << mPath << "'" << LL_ENDL; } - // This loop is specifically coded to handle EEXIST. Any other - // error is a problem. - llassert_always(errno == EEXIST); - // loop back to try another filename + // Shrug, something else + int mkst_errno = errno; + char buffer[256]; + LL_ERRS("NamedTempFile") << "mkstemp(\"" << mPath << "\") failed: " + << message_from(mkst_errno, buffer, + strerror_r(mkst_errno, buffer, sizeof(buffer))) + << LL_ENDL; } - // fd is open, its name is in mPath: write it and close it. + // mkstemp() seems to have worked! Capture the modified filename. + // Avoid the nul byte we appended. + mPath.assign(pathtemplate.begin(), (pathtemplate.end()-1)); /*==========================================================================*| // Define an ostream on the open fd. Tell it to close fd on destruction. boost::iostreams::stream out(fd, boost::iostreams::close_handle); |*==========================================================================*/ + + // Write desired content. std::ostringstream out; // Stream stuff to it. func(out); - // toss in a final newline for good measure - out << '\n'; std::string data(out.str()); int written(_write(fd, data.c_str(), data.length())); int closed(_close(fd)); llassert_always(written == data.length() && closed == 0); + +#else // LL_WINDOWS + // GetTempFileName() is documented to require a MAX_PATH buffer. + char tempname[MAX_PATH]; + // Use 'ext' as filename prefix, but skip leading '.' if any. + // The 0 param is very important: requests iterating until we get a + // unique name. + if (0 == GetTempFileNameA(mPath.c_str(), ext.c_str() + pfx_offset, 0, tempname)) + { + // I always have to look up this call... :-P + LPVOID msgptr; + FormatMessageA( + FORMAT_MESSAGE_ALLOCATE_BUFFER | + FORMAT_MESSAGE_FROM_SYSTEM | + FORMAT_MESSAGE_IGNORE_INSERTS, + NULL, + GetLastError(), + MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), + LPTSTR(&lpMsgBuf), + 0, NULL ); + LL_ERRS("NamedTempFile") << "GetTempFileName(\"" << mPath << "\", \"" + << (ext.c_str() + pfx_offset) << "\") failed: " + << msgptr << LL_ENDL; + LocalFree(msgptr); + } + // GetTempFileName() appears to have worked! Capture the actual + // filename. + mPath = tempname; + // Open the file and stream content to it. Destructor will close. + std::ofstream out(tempname); + func(out); + +#endif // LL_WINDOWS } void peep() @@ -1674,14 +1756,13 @@ namespace tut struct TestPythonCompatible { TestPythonCompatible(): - // Note the peculiar insertion of __FILE__ into this string. - // Normally I like to make a Python script navigate relative to - // its own placement in the repo directory tree (__file__) -- but - // in this case, the script is being written into a platform- - // dependent temp directory! So locate indra/lib/python relative - // to this C++ source file rather than the Python module. - // Use Python raw-string syntax so Windows pathname backslashes - // won't mislead Python's string scanner. + // Note the peculiar insertion of __FILE__ into this string. Since + // this script is being written into a platform-dependent temp + // directory, we can't locate indra/lib/python relative to + // Python's __file__. Use __FILE__ instead, navigating relative + // to this C++ source file. Use Python raw-string syntax so + // Windows pathname backslashes won't mislead Python's string + // scanner. import_llsd("import os.path\n" "import sys\n" "sys.path.insert(0,\n" @@ -1708,7 +1789,7 @@ namespace tut std::string q("\""); std::string qPYTHON(q + PYTHON + q); std::string qscript(q + scriptfile.getName() + q); - int rc(_spawnl(_P_WAIT, PYTHON, qPYTHON.c_str(), qscript.c_str(), NULL)); + int rc = _spawnl(_P_WAIT, PYTHON, qPYTHON.c_str(), qscript.c_str(), NULL); if (rc == -1) { char buffer[256]; @@ -1768,7 +1849,7 @@ namespace tut set_test_name("verify python()"); python("hello", "import sys\n" - "sys.exit(17)", + "sys.exit(17)\n", 17); // expect nonzero rc } @@ -1778,7 +1859,7 @@ namespace tut set_test_name("verify NamedTempFile"); python("platform", "import sys\n" - "print 'Running on', sys.platform"); + "print 'Running on', sys.platform\n"); } template<> template<> @@ -1811,14 +1892,20 @@ namespace tut // notation. It's important to separate with newlines because Python's // llsd module doesn't support parsing from a file stream, only from a // string, so we have to know how much of the file to read into a - // string. Avoid final newline because NamedTempFile implicitly adds - // one. + // string. NamedTempFile file(".llsd", + // NamedTempFile's boost::function constructor + // takes a callable. To this callable it passes the + // std::ostream with which it's writing the + // NamedTempFile. This lambda-based expression + // first calls LLSD::Serialize() with that ostream, + // then streams a newline to it, etc. (lambda::bind(LLSDSerialize::toNotation, cdata[0], lambda::_1), lambda::_1 << '\n', lambda::bind(LLSDSerialize::toNotation, cdata[1], lambda::_1), lambda::_1 << '\n', - lambda::bind(LLSDSerialize::toNotation, cdata[2], lambda::_1))); + lambda::bind(LLSDSerialize::toNotation, cdata[2], lambda::_1), + lambda::_1 << '\n')); python("read C++ notation", lambda::_1 << -- cgit v1.2.3 From 5379467ccb2861d2dbcbc8a13f860d9448bd2fb0 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 19 Jul 2011 10:18:12 -0400 Subject: Fix copy/paste error in swiped FormatMessage() example code. --- indra/llcommon/tests/llsdserialize_test.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp index 1fe3dc13c0..f2a7530f10 100644 --- a/indra/llcommon/tests/llsdserialize_test.cpp +++ b/indra/llcommon/tests/llsdserialize_test.cpp @@ -282,7 +282,7 @@ private: NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - LPTSTR(&lpMsgBuf), + LPTSTR(&msgptr), 0, NULL ); LL_ERRS("NamedTempFile") << "GetTempFileName(\"" << mPath << "\", \"" << (ext.c_str() + pfx_offset) << "\") failed: " -- cgit v1.2.3 From 25ababd7a6e7a1ab7222b760b7bcc8dde3e6b829 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Tue, 19 Jul 2011 10:40:02 -0400 Subject: More FormatMessage compile errors, try again to fix --- indra/llcommon/tests/llsdserialize_test.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/indra/llcommon/tests/llsdserialize_test.cpp b/indra/llcommon/tests/llsdserialize_test.cpp index f2a7530f10..72322c3b72 100644 --- a/indra/llcommon/tests/llsdserialize_test.cpp +++ b/indra/llcommon/tests/llsdserialize_test.cpp @@ -274,7 +274,7 @@ private: if (0 == GetTempFileNameA(mPath.c_str(), ext.c_str() + pfx_offset, 0, tempname)) { // I always have to look up this call... :-P - LPVOID msgptr; + LPSTR msgptr; FormatMessageA( FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | @@ -282,7 +282,7 @@ private: NULL, GetLastError(), MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), - LPTSTR(&msgptr), + LPSTR(&msgptr), // have to cast (char**) to (char*) 0, NULL ); LL_ERRS("NamedTempFile") << "GetTempFileName(\"" << mPath << "\", \"" << (ext.c_str() + pfx_offset) << "\") failed: " -- cgit v1.2.3 From cf8c7701dfd758a9f19e076baad0a9b8d37bbe5f Mon Sep 17 00:00:00 2001 From: Seth ProductEngine Date: Tue, 19 Jul 2011 20:04:24 +0300 Subject: STORM-1221 FIXED Hard coded dates made localizable under Group Profile Land/Assets. Added a function for parsing a date string of specific format. Added strings defining the date format in Group Profile Land/Assets that should be localized. --- indra/newview/lldateutil.cpp | 27 ++++++++++++++++++ indra/newview/lldateutil.h | 14 +++++++++ indra/newview/llpanelgrouplandmoney.cpp | 39 +++++++++++++++++++++++--- indra/newview/skins/default/xui/en/strings.xml | 2 ++ 4 files changed, 78 insertions(+), 4 deletions(-) diff --git a/indra/newview/lldateutil.cpp b/indra/newview/lldateutil.cpp index 18ae6107e7..c7fc45f61e 100644 --- a/indra/newview/lldateutil.cpp +++ b/indra/newview/lldateutil.cpp @@ -27,10 +27,16 @@ #include "lldateutil.h" +#include +#include + // Linden libraries #include "lltrans.h" #include "llui.h" +using namespace boost::gregorian; +using namespace boost::posix_time; + static S32 DAYS_PER_MONTH_NOLEAP[] = { 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 }; static S32 DAYS_PER_MONTH_LEAP[] = @@ -186,3 +192,24 @@ std::string LLDateUtil::ageFromDate(const std::string& date_string) //{ // return ageFromDateISO(date_string, LLDate::now()); //} + +S32 LLDateUtil::secondsSinceEpochFromString(const std::string& format, const std::string& str) +{ + date_input_facet *facet = new date_input_facet(format); + + std::stringstream ss; + ss << str; + ss.imbue(std::locale(ss.getloc(), facet)); + + date d; + ss >> d; + + ptime time_t_date(d); + ptime time_t_epoch(date(1970,1,1)); + + // We assume that the date defined by str is in UTC, so the difference + // is calculated with no time zone corrections. + time_duration diff = time_t_date - time_t_epoch; + + return diff.total_seconds(); +} diff --git a/indra/newview/lldateutil.h b/indra/newview/lldateutil.h index 2843a357c9..f027d360f7 100644 --- a/indra/newview/lldateutil.h +++ b/indra/newview/lldateutil.h @@ -69,6 +69,20 @@ namespace LLDateUtil //std::string ageFromDateISO(const std::string& date_string); //std::string ageFromDate(S32 born_year, S32 born_month, S32 born_day, const LLDate& now); + + /** + * Convert a string of a specified date format into seconds since the Epoch. + * + * Many of the format flags are those used by strftime(...), but not all. + * For the full list of supported time format specifiers + * see http://www.boost.org/doc/libs/1_47_0/doc/html/date_time/date_time_io.html#date_time.format_flags + * + * @param format Format characters string. Example: "%A %b %d, %Y" + * @param str Date string containing the time in specified format. + * + * @return Number of seconds since 01/01/1970 UTC. + */ + S32 secondsSinceEpochFromString(const std::string& format, const std::string& str); } #endif diff --git a/indra/newview/llpanelgrouplandmoney.cpp b/indra/newview/llpanelgrouplandmoney.cpp index 8d8d9bc1c4..eddd6e554d 100644 --- a/indra/newview/llpanelgrouplandmoney.cpp +++ b/indra/newview/llpanelgrouplandmoney.cpp @@ -35,6 +35,7 @@ #include "llqueryflags.h" #include "llagent.h" +#include "lldateutil.h" #include "lliconctrl.h" #include "llfloaterreg.h" #include "lllineeditor.h" @@ -1056,6 +1057,14 @@ void LLGroupMoneyDetailsTabEventHandler::processReply(LLMessageSystem* msg, msg->getS32Fast(_PREHASH_MoneyData, _PREHASH_CurrentInterval, current_interval ); msg->getStringFast(_PREHASH_MoneyData, _PREHASH_StartDate, start_date); + std::string time_str = LLTrans::getString("GroupMoneyDate"); + LLSD substitution; + + // We don't do time zone corrections of the calculated number of seconds + // because we don't have a full time stamp, only a date. + substitution["datetime"] = LLDateUtil::secondsSinceEpochFromString("%A %b %d, %Y", start_date); + LLStringUtil::format (time_str, substitution); + if ( interval_days != mImplementationp->mIntervalLength || current_interval != mImplementationp->mCurrentInterval ) { @@ -1064,7 +1073,7 @@ void LLGroupMoneyDetailsTabEventHandler::processReply(LLMessageSystem* msg, return; } - std::string text = start_date; + std::string text = time_str; text.append("\n\n"); S32 total_amount = 0; @@ -1203,7 +1212,15 @@ void LLGroupMoneySalesTabEventHandler::processReply(LLMessageSystem* msg, // Start with the date. if (text == mImplementationp->mLoadingText) { - text = start_date + "\n\n"; + std::string time_str = LLTrans::getString("GroupMoneyDate"); + LLSD substitution; + + // We don't do time zone corrections of the calculated number of seconds + // because we don't have a full time stamp, only a date. + substitution["datetime"] = LLDateUtil::secondsSinceEpochFromString("%A %b %d, %Y", start_date); + LLStringUtil::format (time_str, substitution); + + text = time_str + "\n\n"; } S32 transactions = msg->getNumberOfBlocksFast(_PREHASH_HistoryData); @@ -1408,12 +1425,26 @@ void LLGroupMoneyPlanningTabEventHandler::processReply(LLMessageSystem* msg, } text.append(LLTrans::getString("SummaryForTheWeek")); - text.append(start_date); + + std::string date_format_str = LLTrans::getString("GroupPlanningDate"); + std::string time_str = date_format_str; + LLSD substitution; + // We don't do time zone corrections of the calculated number of seconds + // because we don't have a full time stamp, only a date. + substitution["datetime"] = LLDateUtil::secondsSinceEpochFromString("%m/%d/%Y", start_date); + LLStringUtil::format (time_str, substitution); + + text.append(time_str); if (current_interval == 0) { text.append(LLTrans::getString("NextStipendDay")); - text.append(next_stipend_date); + + time_str = date_format_str; + substitution["datetime"] = LLDateUtil::secondsSinceEpochFromString("%m/%d/%Y", next_stipend_date); + LLStringUtil::format (time_str, substitution); + + text.append(time_str); text.append("\n\n"); text.append(llformat("%-24sL$%6d\n", LLTrans::getString("GroupMoneyBalance").c_str(), balance )); text.append(1, '\n'); diff --git a/indra/newview/skins/default/xui/en/strings.xml b/indra/newview/skins/default/xui/en/strings.xml index c1c1151eb9..ee6317f367 100644 --- a/indra/newview/skins/default/xui/en/strings.xml +++ b/indra/newview/skins/default/xui/en/strings.xml @@ -2238,6 +2238,7 @@ Returns a string with the requested data about the region (Unknown) + [mthnum,datetime,utc]/[day,datetime,utc]/[year,datetime,utc] Balance @@ -2394,6 +2395,7 @@ Returns a string with the requested data about the region Balance Credits Debits + [weekday,datetime,utc] [mth,datetime,utc] [day,datetime,utc], [year,datetime,utc] Contents -- cgit v1.2.3 From 563c942a346cb44b18c12bb58b639410136b33d9 Mon Sep 17 00:00:00 2001 From: Vadim ProductEngine Date: Tue, 19 Jul 2011 21:21:11 +0300 Subject: STORM-1487 FIXED Changed the "get more gestures" marketplace URL. --- indra/newview/app_settings/settings.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 58b0879fde..9bb320d882 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -3848,7 +3848,7 @@ Type String Value - https://www.xstreetsl.com/modules.php?name=Marketplace&CategoryID=233 + https://marketplace.secondlife.com/products/search?search[category_id]=200&search[maturity][]=General&search[page]=1&search[per_page]=12 GridCrossSections -- cgit v1.2.3 From 880a7ebb9298b1cc6b516b894daf4aa09cdc776b Mon Sep 17 00:00:00 2001 From: Paul ProductEngine Date: Tue, 19 Jul 2011 21:24:56 +0300 Subject: STORM-519 FIXED "Delete" is enabled in the context menu for folders which contain worn items - Disable "Delete" menu item in case selected folder contains non-removable items. --- indra/newview/llinventorybridge.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 75d4c4e80d..9f093b8a34 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2514,6 +2514,11 @@ void LLFolderBridge::folderOptionsMenu() } } + if (!isItemRemovable()) + { + disabled_items.push_back(std::string("Delete")); + } + #ifndef LL_RELEASE_FOR_DOWNLOAD if (LLFolderType::lookupIsProtectedType(type)) { -- cgit v1.2.3 From 76249c58f64beec0d426ab37397159feeafca2d6 Mon Sep 17 00:00:00 2001 From: Leslie Linden Date: Tue, 19 Jul 2011 13:31:32 -0700 Subject: SH-2038 FIX -- [PUBLIC] Severe performance drop on MacBook Pros EXP-997 FIX -- Significant FPS degradation in 2.8.0 Beta on Mac equipped ATI video card * Disabled VBO's on mac to avoid stalls in renderer * Placed valid data into the padding between triangles in the vertex buffer to remove uninitialized craziness * Removed invalid rendering checks causing GL errors in debug mode Reviewed by davep --- indra/newview/featuretable_mac.txt | 4 ++-- indra/newview/lldrawable.cpp | 5 ----- indra/newview/llface.cpp | 12 +++++++++++- indra/newview/pipeline.cpp | 10 ---------- 4 files changed, 13 insertions(+), 18 deletions(-) diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt index f0b1f532a9..fa67ee547c 100644 --- a/indra/newview/featuretable_mac.txt +++ b/indra/newview/featuretable_mac.txt @@ -1,4 +1,4 @@ -version 28 +version 29 // NOTE: This is mostly identical to featuretable_mac.txt with a few differences // Should be combined into one table @@ -47,7 +47,7 @@ RenderTerrainLODFactor 1 2.0 RenderTransparentWater 1 1 RenderTreeLODFactor 1 1.0 RenderUseImpostors 1 1 -RenderVBOEnable 1 1 +RenderVBOEnable 1 0 RenderVBOMappingDisable 1 0 RenderVolumeLODFactor 1 2.0 UseStartScreen 1 1 diff --git a/indra/newview/lldrawable.cpp b/indra/newview/lldrawable.cpp index a5168fd897..debac9dcbf 100644 --- a/indra/newview/lldrawable.cpp +++ b/indra/newview/lldrawable.cpp @@ -1524,11 +1524,6 @@ BOOL LLDrawable::isAnimating() const return TRUE; } - if (!LLVertexBuffer::sUseStreamDraw && mVObjp->isFlexible()) - { - return TRUE; - } - return FALSE; } diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 59c6e904a1..17b6912b63 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1621,6 +1621,8 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, if (rebuild_pos) { + llassert(num_vertices > 0); + mVertexBuffer->getVertexStrider(vert, mGeomIndex, mGeomCount, map_range); vertices = (LLVector4a*) vert.get(); @@ -1649,7 +1651,15 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, index_dst += 4; } while (index_dst < index_end); - + + S32 aligned_pad_vertices = mGeomCount - num_vertices; + LLVector4a* last_vec = end - 1; + while (aligned_pad_vertices > 0) + { + --aligned_pad_vertices; + *dst++ = *last_vec; + } + if (map_range) { mVertexBuffer->setBuffer(0); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index bd801ae4c2..3e35e0e41a 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -3686,8 +3686,6 @@ void LLPipeline::renderGeom(LLCamera& camera, BOOL forceVBOUpdate) LLVertexBuffer::unbind(); LLGLState::checkStates(); - //LLGLState::checkTextureChannels(); - //LLGLState::checkClientArrays(); LLAppViewer::instance()->pingMainloopTimeout("Pipeline:RenderHighlights"); @@ -3825,8 +3823,6 @@ void LLPipeline::renderGeomDeferred(LLCamera& camera) llerrs << "GL matrix stack corrupted!" << llendl; } LLGLState::checkStates(); - LLGLState::checkTextureChannels(); - LLGLState::checkClientArrays(); } } } @@ -3919,8 +3915,6 @@ void LLPipeline::renderGeomPostDeferred(LLCamera& camera) llerrs << "GL matrix stack corrupted!" << llendl; } LLGLState::checkStates(); - LLGLState::checkTextureChannels(); - LLGLState::checkClientArrays(); } } } @@ -3995,8 +3989,6 @@ void LLPipeline::renderGeomShadow(LLCamera& camera) LLVertexBuffer::unbind(); LLGLState::checkStates(); - LLGLState::checkTextureChannels(); - LLGLState::checkClientArrays(); } } else @@ -8123,8 +8115,6 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) LLViewerCamera::getInstance()->setUserClipPlane(npnorm); LLGLState::checkStates(); - //LLGLState::checkTextureChannels(); - //LLGLState::checkClientArrays(); if (!skip_avatar_update) { -- cgit v1.2.3 From 26568d5c984699b75cae209a652c43cb2303ba5f Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 20 Jul 2011 16:06:04 -0500 Subject: SH-1838 Add error handling for allocation of off screen render targets. Reviewed by Leslie --- indra/llrender/llrendertarget.cpp | 47 ++++++++++++--- indra/llrender/llrendertarget.h | 14 ++--- indra/newview/pipeline.cpp | 122 +++++++++++++++++++++++++++----------- indra/newview/pipeline.h | 2 + 4 files changed, 135 insertions(+), 50 deletions(-) diff --git a/indra/llrender/llrendertarget.cpp b/indra/llrender/llrendertarget.cpp index b6463309e1..8c0d3592df 100644 --- a/indra/llrender/llrendertarget.cpp +++ b/indra/llrender/llrendertarget.cpp @@ -72,11 +72,11 @@ LLRenderTarget::~LLRenderTarget() release(); } -void LLRenderTarget::allocate(U32 resx, U32 resy, U32 color_fmt, bool depth, bool stencil, LLTexUnit::eTextureType usage, bool use_fbo, S32 samples) +bool LLRenderTarget::allocate(U32 resx, U32 resy, U32 color_fmt, bool depth, bool stencil, LLTexUnit::eTextureType usage, bool use_fbo, S32 samples) { stop_glerror(); - release(); + stop_glerror(); mResX = resx; mResY = resy; @@ -103,9 +103,11 @@ void LLRenderTarget::allocate(U32 resx, U32 resy, U32 color_fmt, bool depth, boo { if (depth) { - stop_glerror(); - allocateDepth(); - stop_glerror(); + if (!allocateDepth()) + { + llwarns << "Failed to allocate depth buffer for render target." << llendl; + return false; + } } glGenFramebuffers(1, (GLuint *) &mFBO); @@ -131,14 +133,14 @@ void LLRenderTarget::allocate(U32 resx, U32 resy, U32 color_fmt, bool depth, boo stop_glerror(); } - addColorAttachment(color_fmt); + return addColorAttachment(color_fmt); } -void LLRenderTarget::addColorAttachment(U32 color_fmt) +bool LLRenderTarget::addColorAttachment(U32 color_fmt) { if (color_fmt == 0) { - return; + return true; } U32 offset = mTex.size(); @@ -158,14 +160,26 @@ void LLRenderTarget::addColorAttachment(U32 color_fmt) #ifdef GL_ARB_texture_multisample if (mSamples > 1) { + clear_glerror(); glTexImage2DMultisample(LLTexUnit::getInternalType(mUsage), mSamples, color_fmt, mResX, mResY, GL_TRUE); + if (glGetError() != GL_NO_ERROR) + { + llwarns << "Could not allocate multisample color buffer for render target." << llendl; + return false; + } } else #else llassert_always(mSamples <= 1); #endif { + clear_glerror(); LLImageGL::setManualImage(LLTexUnit::getInternalType(mUsage), 0, color_fmt, mResX, mResY, GL_RGBA, GL_UNSIGNED_BYTE, NULL); + if (glGetError() != GL_NO_ERROR) + { + llwarns << "Could not allocate color buffer for render target." << llendl; + return false; + } } stop_glerror(); @@ -217,15 +231,18 @@ void LLRenderTarget::addColorAttachment(U32 color_fmt) flush(); } + return true; } -void LLRenderTarget::allocateDepth() +bool LLRenderTarget::allocateDepth() { if (mStencil) { //use render buffers where stencil buffers are in play glGenRenderbuffers(1, (GLuint *) &mDepth); glBindRenderbuffer(GL_RENDERBUFFER, mDepth); + stop_glerror(); + clear_glerror(); glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH24_STENCIL8, mResX, mResY); glBindRenderbuffer(GL_RENDERBUFFER, 0); } @@ -237,17 +254,29 @@ void LLRenderTarget::allocateDepth() { U32 internal_type = LLTexUnit::getInternalType(mUsage); gGL.getTexUnit(0)->setTextureFilteringOption(LLTexUnit::TFO_POINT); + stop_glerror(); + clear_glerror(); LLImageGL::setManualImage(internal_type, 0, GL_DEPTH_COMPONENT32, mResX, mResY, GL_DEPTH_COMPONENT, GL_UNSIGNED_INT, NULL); } #ifdef GL_ARB_texture_multisample else { + stop_glerror(); + clear_glerror(); glTexImage2DMultisample(LLTexUnit::getInternalType(mUsage), mSamples, GL_DEPTH_COMPONENT32, mResX, mResY, GL_TRUE); } #else llassert_always(mSamples <= 1); #endif } + + if (glGetError() != GL_NO_ERROR) + { + llwarns << "Unable to allocate depth buffer for render target." << llendl; + return false; + } + + return true; } void LLRenderTarget::shareDepthBuffer(LLRenderTarget& target) diff --git a/indra/llrender/llrendertarget.h b/indra/llrender/llrendertarget.h index 094b58b562..dea1de12d8 100644 --- a/indra/llrender/llrendertarget.h +++ b/indra/llrender/llrendertarget.h @@ -66,30 +66,30 @@ public: static bool sUseFBO; LLRenderTarget(); - virtual ~LLRenderTarget(); + ~LLRenderTarget(); //allocate resources for rendering //must be called before use //multiple calls will release previously allocated resources - void allocate(U32 resx, U32 resy, U32 color_fmt, bool depth, bool stencil, LLTexUnit::eTextureType usage = LLTexUnit::TT_TEXTURE, bool use_fbo = false, S32 samples = 0); + bool allocate(U32 resx, U32 resy, U32 color_fmt, bool depth, bool stencil, LLTexUnit::eTextureType usage = LLTexUnit::TT_TEXTURE, bool use_fbo = false, S32 samples = 0); //add color buffer attachment //limit of 4 color attachments per render target - virtual void addColorAttachment(U32 color_fmt); + bool addColorAttachment(U32 color_fmt); //allocate a depth texture - virtual void allocateDepth(); + bool allocateDepth(); //share depth buffer with provided render target - virtual void shareDepthBuffer(LLRenderTarget& target); + void shareDepthBuffer(LLRenderTarget& target); //free any allocated resources //safe to call redundantly - virtual void release(); + void release(); //bind target for rendering //applies appropriate viewport - virtual void bindTarget(); + void bindTarget(); //unbind target for rendering static void unbindTarget(); diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 3e35e0e41a..99f8a87b16 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -336,10 +336,10 @@ static const U32 gl_cube_face[] = void validate_framebuffer_object(); -void addDeferredAttachments(LLRenderTarget& target) +bool addDeferredAttachments(LLRenderTarget& target) { - target.addColorAttachment(GL_RGBA); //specular - target.addColorAttachment(GL_RGBA); //normal+z + return target.addColorAttachment(GL_RGBA) && //specular + target.addColorAttachment(GL_RGBA); //normal+z } LLPipeline::LLPipeline() : @@ -586,18 +586,61 @@ void LLPipeline::allocatePhysicsBuffer() void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY) { - // remember these dimensions - mScreenWidth = resX; - mScreenHeight = resY; - - //cap samples at 4 for render targets to avoid out of memory errors U32 samples = gGLManager.getNumFBOFSAASamples(gSavedSettings.getU32("RenderFSAASamples")); if (gGLManager.mIsATI) - { //disable multisampling of render targets where ATI is involved + { //ATI doesn't like the way we use multisample texture samples = 0; } + //try to allocate screen buffers at requested resolution and samples + // - on failure, shrink number of samples and try again + // - if not multisampled, shrink resolution and try again (favor X resolution over Y) + // Make sure to call "releaseScreenBuffers" after each failure to cleanup the partially loaded state + + if (!allocateScreenBuffer(resX, resY, samples)) + { + releaseScreenBuffers(); + //reduce number of samples + while (samples > 0) + { + samples /= 2; + if (allocateScreenBuffer(resX, resY, samples)) + { //success + return; + } + releaseScreenBuffers(); + } + + //reduce resolution + while (resY > 0 && resX > 0) + { + resY /= 2; + if (allocateScreenBuffer(resX, resY, samples)) + { + return; + } + releaseScreenBuffers(); + + resX /= 2; + if (allocateScreenBuffer(resX, resY, samples)) + { + return; + } + releaseScreenBuffers(); + } + + llwarns << "Unable to allocate screen buffer at any resolution!" << llendl; + } +} + + +bool LLPipeline::allocateScreenBuffer(U32 resX, U32 resY, U32 samples) +{ + // remember these dimensions + mScreenWidth = resX; + mScreenHeight = resY; + U32 res_mod = gSavedSettings.getU32("RenderResolutionDivisor"); if (res_mod > 1 && res_mod < resX && res_mod < resY) @@ -608,7 +651,10 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY) if (gSavedSettings.getBOOL("RenderUIBuffer")) { - mUIScreen.allocate(resX,resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE); + if (!mUIScreen.allocate(resX,resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE)) + { + return false; + } } if (LLPipeline::sRenderDeferred) @@ -618,22 +664,22 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY) bool gi = LLViewerShaderMgr::instance()->getVertexShaderLevel(LLViewerShaderMgr::SHADER_DEFERRED); //allocate deferred rendering color buffers - mDeferredScreen.allocate(resX, resY, GL_RGBA, TRUE, TRUE, LLTexUnit::TT_RECT_TEXTURE, FALSE, samples); - mDeferredDepth.allocate(resX, resY, 0, TRUE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE, samples); - addDeferredAttachments(mDeferredScreen); + if (!mDeferredScreen.allocate(resX, resY, GL_RGBA, TRUE, TRUE, LLTexUnit::TT_RECT_TEXTURE, FALSE, samples)) return false; + if (!mDeferredDepth.allocate(resX, resY, 0, TRUE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE, samples)) return false; + if (!addDeferredAttachments(mDeferredScreen)) return false; - mScreen.allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE, samples); + if (!mScreen.allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE, samples)) return false; #if LL_DARWIN // As of OS X 10.6.7, Apple doesn't support multiple color formats in a single FBO - mEdgeMap.allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE); + if (!mEdgeMap.allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE)) return false; #else - mEdgeMap.allocate(resX, resY, GL_ALPHA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE); + if (!mEdgeMap.allocate(resX, resY, GL_ALPHA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE)) return false; #endif if (shadow_detail > 0 || ssao) { //only need mDeferredLight[0] for shadows OR ssao - mDeferredLight[0].allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE); + if (!mDeferredLight[0].allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, FALSE)) return false; } else { @@ -642,7 +688,7 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY) if (ssao) { //only need mDeferredLight[1] for ssao - mDeferredLight[1].allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, false); + if (!mDeferredLight[1].allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, false)) return false; } else { @@ -651,14 +697,14 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY) if (gi) { //only need mDeferredLight[2] and mGIMapPost for gi - mDeferredLight[2].allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, false); + if (!mDeferredLight[2].allocate(resX, resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE, false)) return false; for (U32 i = 0; i < 2; i++) { #if LL_DARWIN // As of OS X 10.6.7, Apple doesn't support multiple color formats in a single FBO - mGIMapPost[i].allocate(resX,resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE); + if (!mGIMapPost[i].allocate(resX,resY, GL_RGBA, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE)) return false; #else - mGIMapPost[i].allocate(resX,resY, GL_RGB, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE); + if (!mGIMapPost[i].allocate(resX,resY, GL_RGB, FALSE, FALSE, LLTexUnit::TT_RECT_TEXTURE)) return false; #endif } } @@ -685,7 +731,7 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY) { //allocate 4 sun shadow maps for (U32 i = 0; i < 4; i++) { - mShadow[i].allocate(U32(resX*scale),U32(resY*scale), shadow_fmt, TRUE, FALSE, LLTexUnit::TT_RECT_TEXTURE); + if (!mShadow[i].allocate(U32(resX*scale),U32(resY*scale), shadow_fmt, TRUE, FALSE, LLTexUnit::TT_RECT_TEXTURE)) return false; } } else @@ -703,7 +749,7 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY) { //allocate two spot shadow maps for (U32 i = 4; i < 6; i++) { - mShadow[i].allocate(width, height, shadow_fmt, TRUE, FALSE); + if (!mShadow[i].allocate(width, height, shadow_fmt, TRUE, FALSE)) return false; } } else @@ -716,7 +762,7 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY) width = nhpo2(resX)/2; height = nhpo2(resY)/2; - mLuminanceMap.allocate(width,height, GL_RGBA, FALSE, FALSE); + if (!mLuminanceMap.allocate(width,height, GL_RGBA, FALSE, FALSE)) return false; } else { @@ -738,7 +784,7 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY) mEdgeMap.release(); mLuminanceMap.release(); - mScreen.allocate(resX, resY, GL_RGBA, TRUE, TRUE, LLTexUnit::TT_RECT_TEXTURE, FALSE); + if (!mScreen.allocate(resX, resY, GL_RGBA, TRUE, TRUE, LLTexUnit::TT_RECT_TEXTURE, FALSE)) return false; } if (LLPipeline::sRenderDeferred) @@ -750,6 +796,7 @@ void LLPipeline::allocateScreenBuffer(U32 resX, U32 resY) stop_glerror(); + return true; } //static @@ -800,9 +847,23 @@ void LLPipeline::releaseGLBuffers() mWaterRef.release(); mWaterDis.release(); + + for (U32 i = 0; i < 3; i++) + { + mGlow[i].release(); + } + + releaseScreenBuffers(); + + gBumpImageList.destroyGL(); + LLVOAvatar::resetImpostors(); +} + +void LLPipeline::releaseScreenBuffers() +{ + mUIScreen.release(); mScreen.release(); mPhysicsDisplay.release(); - mUIScreen.release(); mDeferredScreen.release(); mDeferredDepth.release(); for (U32 i = 0; i < 3; i++) @@ -821,16 +882,9 @@ void LLPipeline::releaseGLBuffers() { mShadow[i].release(); } - - for (U32 i = 0; i < 3; i++) - { - mGlow[i].release(); - } - - gBumpImageList.destroyGL(); - LLVOAvatar::resetImpostors(); } + void LLPipeline::createGLBuffers() { LLMemType mt_cb(LLMemType::MTYPE_PIPELINE_CREATE_BUFFERS); diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h index e9da25e544..28e6526acd 100644 --- a/indra/newview/pipeline.h +++ b/indra/newview/pipeline.h @@ -113,9 +113,11 @@ public: void resetVertexBuffers(); void resizeScreenTexture(); void releaseGLBuffers(); + void releaseScreenBuffers(); void createGLBuffers(); void allocateScreenBuffer(U32 resX, U32 resY); + bool allocateScreenBuffer(U32 resX, U32 resY, U32 samples); void allocatePhysicsBuffer(); void resetVertexBuffers(LLDrawable* drawable); -- cgit v1.2.3 From 78f1bad0e66a172099b7f3ede033ea5576ee81e7 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 20 Jul 2011 17:56:22 -0500 Subject: SH-2021 Fix for black water at the horizon from occlusion culling madness. --- indra/newview/llvowater.cpp | 6 ++++++ indra/newview/pipeline.cpp | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/indra/newview/llvowater.cpp b/indra/newview/llvowater.cpp index 69ebad61ac..e70ac0a2e7 100644 --- a/indra/newview/llvowater.cpp +++ b/indra/newview/llvowater.cpp @@ -282,6 +282,11 @@ void LLVOWater::updateSpatialExtents(LLVector4a &newMin, LLVector4a& newMax) U32 LLVOWater::getPartitionType() const { + if (mIsEdgePatch) + { + return LLViewerRegion::PARTITION_VOIDWATER; + } + return LLViewerRegion::PARTITION_WATER; } @@ -300,6 +305,7 @@ LLWaterPartition::LLWaterPartition() LLVoidWaterPartition::LLVoidWaterPartition() { + mOcclusionEnabled = FALSE; mDrawableType = LLPipeline::RENDER_TYPE_VOIDWATER; mPartitionType = LLViewerRegion::PARTITION_VOIDWATER; } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 99f8a87b16..dfcc7396ba 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -8029,7 +8029,7 @@ void LLPipeline::generateWaterReflection(LLCamera& camera_in) static LLCullResult ref_result; - if (LLDrawPoolWater::sNeedsDistortionUpdate) + if (LLDrawPoolWater::sNeedsReflectionUpdate) { //initial sky pass (no user clip plane) { //mask out everything but the sky -- cgit v1.2.3 From e52caca712a347cb6e76b429efaba059bd18e4a5 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 20 Jul 2011 23:50:44 -0500 Subject: SH-2048 Fix for invisiprims infecting neighboring prims with their invisi-ness. --- indra/newview/llvovolume.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 40afabdb65..4c137d3394 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -3743,6 +3743,11 @@ bool can_batch_texture(LLFace* facep) return false; } + if (facep->getTexture() && facep->getTexture()->getPrimaryFormat() == GL_ALPHA) + { //can't batch invisiprims + return false; + } + if (facep->isState(LLFace::TEXTURE_ANIM) && facep->getVirtualSize() > MIN_TEX_ANIM_SIZE) { //texture animation breaks batches return false; @@ -4711,6 +4716,7 @@ void LLVolumeGeometryManager::genDrawInfo(LLSpatialGroup* group, U32 mask, std:: } const LLTextureEntry* te = facep->getTextureEntry(); + tex = facep->getTexture(); BOOL is_alpha = (facep->getPoolType() == LLDrawPool::POOL_ALPHA) ? TRUE : FALSE; -- cgit v1.2.3 From aaecc4c53ccbb71628988b10159f403d51836514 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 21 Jul 2011 00:42:48 -0500 Subject: SH-2020 Fix for avatar skin/eyes and trees being bright/black/busted underwater. --- indra/newview/llviewershadermgr.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index a772777495..62d83b516f 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -173,6 +173,7 @@ LLViewerShaderMgr::LLViewerShaderMgr() : mShaderList.push_back(&gWLCloudProgram); mShaderList.push_back(&gAvatarProgram); mShaderList.push_back(&gObjectShinyProgram); + mShaderList.push_back(&gObjectShinyNonIndexedProgram); mShaderList.push_back(&gWaterProgram); mShaderList.push_back(&gAvatarEyeballProgram); mShaderList.push_back(&gObjectSimpleProgram); @@ -187,7 +188,9 @@ LLViewerShaderMgr::LLViewerShaderMgr() : mShaderList.push_back(&gObjectFullbrightShinyProgram); mShaderList.push_back(&gObjectFullbrightShinyWaterProgram); mShaderList.push_back(&gObjectSimpleNonIndexedProgram); + mShaderList.push_back(&gObjectSimpleNonIndexedWaterProgram); mShaderList.push_back(&gObjectFullbrightNonIndexedProgram); + mShaderList.push_back(&gObjectFullbrightNonIndexedWaterProgram); mShaderList.push_back(&gObjectFullbrightShinyNonIndexedProgram); mShaderList.push_back(&gObjectFullbrightShinyNonIndexedWaterProgram); mShaderList.push_back(&gSkinnedObjectSimpleProgram); @@ -204,6 +207,7 @@ LLViewerShaderMgr::LLViewerShaderMgr() : mShaderList.push_back(&gObjectFullbrightWaterProgram); mShaderList.push_back(&gAvatarWaterProgram); mShaderList.push_back(&gObjectShinyWaterProgram); + mShaderList.push_back(&gObjectShinyNonIndexedWaterProgram); mShaderList.push_back(&gUnderWaterProgram); mShaderList.push_back(&gDeferredSunProgram); mShaderList.push_back(&gDeferredBlurLightProgram); -- cgit v1.2.3 From 65d82fe192bdb4eb27766cf02eadaf78012f2817 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 21 Jul 2011 13:10:28 -0500 Subject: SH-2031 Fix for stall in "Cleanup" --- indra/llcommon/llfasttimer_class.cpp | 8 ++++++++ indra/newview/llappviewer.cpp | 12 ++++++++++-- indra/newview/llviewerobjectlist.cpp | 26 +++++++++++++++++++++----- indra/newview/llvoicevivox.cpp | 4 ++-- 4 files changed, 41 insertions(+), 9 deletions(-) diff --git a/indra/llcommon/llfasttimer_class.cpp b/indra/llcommon/llfasttimer_class.cpp index bd594b06cf..675eda2fc5 100644 --- a/indra/llcommon/llfasttimer_class.cpp +++ b/indra/llcommon/llfasttimer_class.cpp @@ -228,6 +228,14 @@ void LLFastTimer::DeclareTimer::updateCachedPointers() // update cached pointer it->mFrameState = &it->mTimer.getFrameState(); } + + // also update frame states of timers on stack + LLFastTimer* cur_timerp = LLFastTimer::sCurTimerData.mCurTimer; + while(cur_timerp->mLastTimerData.mCurTimer != cur_timerp) + { + cur_timerp->mFrameState = &cur_timerp->mFrameState->mTimer->getFrameState(); + cur_timerp = cur_timerp->mLastTimerData.mCurTimer; + } } //static diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index 80ac385e3b..1fef8d005a 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -4015,6 +4015,8 @@ public: static LLFastTimer::DeclareTimer FTM_AUDIO_UPDATE("Update Audio"); static LLFastTimer::DeclareTimer FTM_CLEANUP("Cleanup"); +static LLFastTimer::DeclareTimer FTM_CLEANUP_DRAWABLES("Drawables"); +static LLFastTimer::DeclareTimer FTM_CLEANUP_OBJECTS("Objects"); static LLFastTimer::DeclareTimer FTM_IDLE_CB("Idle Callbacks"); static LLFastTimer::DeclareTimer FTM_LOD_UPDATE("Update LOD"); static LLFastTimer::DeclareTimer FTM_OBJECTLIST_UPDATE("Update Objectlist"); @@ -4291,8 +4293,14 @@ void LLAppViewer::idle() { LLFastTimer t(FTM_CLEANUP); - gObjectList.cleanDeadObjects(); - LLDrawable::cleanupDeadDrawables(); + { + LLFastTimer t(FTM_CLEANUP_OBJECTS); + gObjectList.cleanDeadObjects(); + } + { + LLFastTimer t(FTM_CLEANUP_DRAWABLES); + LLDrawable::cleanupDeadDrawables(); + } } // diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 9f882ee732..48ccc7d035 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -1339,18 +1339,29 @@ void LLViewerObjectList::cleanDeadObjects(BOOL use_timer) S32 num_removed = 0; LLViewerObject *objectp; - for (vobj_list_t::iterator iter = mObjects.begin(); iter != mObjects.end(); ) + + vobj_list_t::reverse_iterator target = mObjects.rbegin(); + + vobj_list_t::iterator iter = mObjects.begin(); + for ( ; iter != mObjects.end(); ) { - // Scan for all of the dead objects and remove any "global" references to them. + // Scan for all of the dead objects and put them all on the end of the list with no ref count ops objectp = *iter; + if (objectp == NULL) + { //we caught up to the dead tail + break; + } + if (objectp->isDead()) { - iter = mObjects.erase(iter); + LLPointer::swap(*iter, *target); + *target = NULL; + ++target; num_removed++; - if (num_removed == mNumDeadObjects) + if (num_removed == mNumDeadObjects || iter->isNull()) { - // We've cleaned up all of the dead objects. + // We've cleaned up all of the dead objects or caught up to the dead tail break; } } @@ -1360,6 +1371,11 @@ void LLViewerObjectList::cleanDeadObjects(BOOL use_timer) } } + llassert(num_removed == mNumDeadObjects); + + //erase as a block + mObjects.erase(mObjects.begin()+(mObjects.size()-mNumDeadObjects), mObjects.end()); + // We've cleaned the global object list, now let's do some paranoia testing on objects // before blowing away the dead list. mDeadObjects.clear(); diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 9dc6b5194e..0db0010688 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -7049,7 +7049,7 @@ LLVivoxProtocolParser::~LLVivoxProtocolParser() XML_ParserFree(parser); } -//static LLFastTimer::DeclareTimer FTM_VIVOX_PROCESS("Vivox Process"); +static LLFastTimer::DeclareTimer FTM_VIVOX_PROCESS("Vivox Process"); // virtual LLIOPipe::EStatus LLVivoxProtocolParser::process_impl( @@ -7059,7 +7059,7 @@ LLIOPipe::EStatus LLVivoxProtocolParser::process_impl( LLSD& context, LLPumpIO* pump) { - //LLFastTimer t(FTM_VIVOX_PROCESS); + LLFastTimer t(FTM_VIVOX_PROCESS); LLBufferStream istr(channels, buffer.get()); std::ostringstream ostr; while (istr.good()) -- cgit v1.2.3 From 764a13a196fb66bf4b3fe4fcf98625a385e99e6e Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 21 Jul 2011 17:35:04 -0500 Subject: SH-2031 Don't do network I/O from the main thread in llcurl. Reviewed by Kelly --- indra/llmessage/llcurl.cpp | 65 +++++++++++++++++++++++++++++------ indra/llmessage/llcurl.h | 2 +- indra/llmessage/llfiltersd2xmlrpc.cpp | 12 +++++++ indra/llmessage/lliohttpserver.cpp | 9 +++++ indra/llmessage/lliosocket.cpp | 7 ++++ indra/llmessage/llioutil.cpp | 5 +++ indra/llmessage/llsdrpcclient.cpp | 6 ++++ indra/llmessage/llsdrpcserver.cpp | 3 ++ indra/llmessage/llurlrequest.cpp | 36 +++++++++++++++++-- indra/newview/llxmlrpctransaction.cpp | 10 +++--- 10 files changed, 137 insertions(+), 18 deletions(-) diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp index 7c8b7e3584..453ffa9db9 100644 --- a/indra/llmessage/llcurl.cpp +++ b/indra/llmessage/llcurl.cpp @@ -579,11 +579,18 @@ void LLCurl::Easy::prepRequest(const std::string& url, //////////////////////////////////////////////////////////////////////////// -class LLCurl::Multi +class LLCurl::Multi : public LLThread { LOG_CLASS(Multi); public: - + + typedef enum + { + PERFORM_STATE_READY=0, + PERFORM_STATE_PERFORMING=1, + PERFORM_STATE_COMPLETED=2 + } ePerformState; + Multi(); ~Multi(); @@ -593,13 +600,17 @@ public: void removeEasy(Easy* easy); S32 process(); - S32 perform(); + void perform(); + virtual void run(); + CURLMsg* info_read(S32* msgs_in_queue); S32 mQueued; S32 mErrorCount; + S32 mPerformState; + private: void easyFree(Easy*); @@ -614,8 +625,10 @@ private: }; LLCurl::Multi::Multi() - : mQueued(0), - mErrorCount(0) + : LLThread("Curl Multi"), + mQueued(0), + mErrorCount(0), + mPerformState(PERFORM_STATE_READY) { mCurlMultiHandle = curl_multi_init(); if (!mCurlMultiHandle) @@ -630,6 +643,7 @@ LLCurl::Multi::Multi() LLCurl::Multi::~Multi() { + llassert(isStopped()); // Clean up active for(easy_active_list_t::iterator iter = mEasyActiveList.begin(); iter != mEasyActiveList.end(); ++iter) @@ -655,8 +669,16 @@ CURLMsg* LLCurl::Multi::info_read(S32* msgs_in_queue) return curlmsg; } +void LLCurl::Multi::perform() +{ + if (mPerformState == PERFORM_STATE_READY) + { + mPerformState = PERFORM_STATE_PERFORMING; + start(); + } +} -S32 LLCurl::Multi::perform() +void LLCurl::Multi::run() { S32 q = 0; for (S32 call_count = 0; @@ -672,13 +694,18 @@ S32 LLCurl::Multi::perform() } mQueued = q; - return q; + mPerformState = PERFORM_STATE_COMPLETED; } S32 LLCurl::Multi::process() { perform(); - + + if (mPerformState != PERFORM_STATE_COMPLETED) + { + return 0; + } + CURLMsg* msg; int msgs_in_queue; @@ -709,6 +736,8 @@ S32 LLCurl::Multi::process() } } } + + mPerformState = PERFORM_STATE_READY; return processed; } @@ -923,6 +952,12 @@ S32 LLCurlRequest::process() if (multi != mActiveMulti && tres == 0 && multi->mQueued == 0) { mMultiSet.erase(curiter); + + while (!multi->isStopped()) + { + apr_sleep(1000); + } + delete multi; } } @@ -963,6 +998,10 @@ LLCurlEasyRequest::LLCurlEasyRequest() LLCurlEasyRequest::~LLCurlEasyRequest() { + while (!mMulti->isStopped()) + { + apr_sleep(1000); + } delete mMulti; } @@ -1059,14 +1098,20 @@ void LLCurlEasyRequest::requestComplete() } } -S32 LLCurlEasyRequest::perform() +void LLCurlEasyRequest::perform() { - return mMulti->perform(); + mMulti->perform(); } // Usage: Call getRestult until it returns false (no more messages) bool LLCurlEasyRequest::getResult(CURLcode* result, LLCurl::TransferInfo* info) { + if (mMulti->mPerformState != LLCurl::Multi::PERFORM_STATE_COMPLETED) + { //we're busy, try again later + return false; + } + mMulti->mPerformState = LLCurl::Multi::PERFORM_STATE_READY; + if (!mEasy) { // Special case - we failed to initialize a curl_easy (can happen if too many open files) diff --git a/indra/llmessage/llcurl.h b/indra/llmessage/llcurl.h index 4ce3fa1078..2f951d6ab8 100644 --- a/indra/llmessage/llcurl.h +++ b/indra/llmessage/llcurl.h @@ -236,7 +236,7 @@ public: void slist_append(const char* str); void sendRequest(const std::string& url); void requestComplete(); - S32 perform(); + void perform(); bool getResult(CURLcode* result, LLCurl::TransferInfo* info = NULL); std::string getErrorString(); diff --git a/indra/llmessage/llfiltersd2xmlrpc.cpp b/indra/llmessage/llfiltersd2xmlrpc.cpp index 812ef7c151..e0ca056a5f 100644 --- a/indra/llmessage/llfiltersd2xmlrpc.cpp +++ b/indra/llmessage/llfiltersd2xmlrpc.cpp @@ -308,6 +308,7 @@ LLFilterSD2XMLRPCResponse::~LLFilterSD2XMLRPCResponse() } +static LLFastTimer::DeclareTimer FTM_PROCESS_SD2XMLRPC_RESPONSE("SD2XMLRPC Response"); // virtual LLIOPipe::EStatus LLFilterSD2XMLRPCResponse::process_impl( const LLChannelDescriptors& channels, @@ -316,6 +317,8 @@ LLIOPipe::EStatus LLFilterSD2XMLRPCResponse::process_impl( LLSD& context, LLPumpIO* pump) { + LLFastTimer t(FTM_PROCESS_SD2XMLRPC_RESPONSE); + PUMP_DEBUG; // This pipe does not work if it does not have everyting. This // could be addressed by making a stream parser for llsd which @@ -382,6 +385,8 @@ LLFilterSD2XMLRPCRequest::~LLFilterSD2XMLRPCRequest() { } +static LLFastTimer::DeclareTimer FTM_PROCESS_SD2XMLRPC_REQUEST("S22XMLRPC Request"); + // virtual LLIOPipe::EStatus LLFilterSD2XMLRPCRequest::process_impl( const LLChannelDescriptors& channels, @@ -390,6 +395,7 @@ LLIOPipe::EStatus LLFilterSD2XMLRPCRequest::process_impl( LLSD& context, LLPumpIO* pump) { + LLFastTimer t(FTM_PROCESS_SD2XMLRPC_REQUEST); // This pipe does not work if it does not have everyting. This // could be addressed by making a stream parser for llsd which // handled partial information. @@ -586,6 +592,8 @@ LLFilterXMLRPCResponse2LLSD::~LLFilterXMLRPCResponse2LLSD() { } +static LLFastTimer::DeclareTimer FTM_PROCESS_XMLRPC2LLSD_RESPONSE("XMLRPC2LLSD Response"); + LLIOPipe::EStatus LLFilterXMLRPCResponse2LLSD::process_impl( const LLChannelDescriptors& channels, buffer_ptr_t& buffer, @@ -593,6 +601,8 @@ LLIOPipe::EStatus LLFilterXMLRPCResponse2LLSD::process_impl( LLSD& context, LLPumpIO* pump) { + LLFastTimer t(FTM_PROCESS_XMLRPC2LLSD_RESPONSE); + PUMP_DEBUG; if(!eos) return STATUS_BREAK; if(!buffer) return STATUS_ERROR; @@ -668,6 +678,7 @@ LLFilterXMLRPCRequest2LLSD::~LLFilterXMLRPCRequest2LLSD() { } +static LLFastTimer::DeclareTimer FTM_PROCESS_XMLRPC2LLSD_REQUEST("XMLRPC2LLSD Request"); LLIOPipe::EStatus LLFilterXMLRPCRequest2LLSD::process_impl( const LLChannelDescriptors& channels, buffer_ptr_t& buffer, @@ -675,6 +686,7 @@ LLIOPipe::EStatus LLFilterXMLRPCRequest2LLSD::process_impl( LLSD& context, LLPumpIO* pump) { + LLFastTimer t(FTM_PROCESS_XMLRPC2LLSD_REQUEST); PUMP_DEBUG; if(!eos) return STATUS_BREAK; if(!buffer) return STATUS_ERROR; diff --git a/indra/llmessage/lliohttpserver.cpp b/indra/llmessage/lliohttpserver.cpp index 3b18a9177c..73e8a69085 100644 --- a/indra/llmessage/lliohttpserver.cpp +++ b/indra/llmessage/lliohttpserver.cpp @@ -140,6 +140,7 @@ private: LLSD mHeaders; }; +static LLFastTimer::DeclareTimer FTM_PROCESS_HTTP_PIPE("HTTP Pipe"); LLIOPipe::EStatus LLHTTPPipe::process_impl( const LLChannelDescriptors& channels, buffer_ptr_t& buffer, @@ -147,6 +148,7 @@ LLIOPipe::EStatus LLHTTPPipe::process_impl( LLSD& context, LLPumpIO* pump) { + LLFastTimer t(FTM_PROCESS_HTTP_PIPE); PUMP_DEBUG; lldebugs << "LLSDHTTPServer::process_impl" << llendl; @@ -428,6 +430,9 @@ protected: /** * LLHTTPResponseHeader */ + +static LLFastTimer::DeclareTimer FTM_PROCESS_HTTP_HEADER("HTTP Header"); + // virtual LLIOPipe::EStatus LLHTTPResponseHeader::process_impl( const LLChannelDescriptors& channels, @@ -436,6 +441,7 @@ LLIOPipe::EStatus LLHTTPResponseHeader::process_impl( LLSD& context, LLPumpIO* pump) { + LLFastTimer t(FTM_PROCESS_HTTP_HEADER); PUMP_DEBUG; LLMemType m1(LLMemType::MTYPE_IO_HTTP_SERVER); if(eos) @@ -630,6 +636,8 @@ void LLHTTPResponder::markBad( << "\n\n"; } +static LLFastTimer::DeclareTimer FTM_PROCESS_HTTP_RESPONDER("HTTP Responder"); + // virtual LLIOPipe::EStatus LLHTTPResponder::process_impl( const LLChannelDescriptors& channels, @@ -638,6 +646,7 @@ LLIOPipe::EStatus LLHTTPResponder::process_impl( LLSD& context, LLPumpIO* pump) { + LLFastTimer t(FTM_PROCESS_HTTP_RESPONDER); PUMP_DEBUG; LLMemType m1(LLMemType::MTYPE_IO_HTTP_SERVER); LLIOPipe::EStatus status = STATUS_OK; diff --git a/indra/llmessage/lliosocket.cpp b/indra/llmessage/lliosocket.cpp index 8c752fbe30..b717e321bf 100644 --- a/indra/llmessage/lliosocket.cpp +++ b/indra/llmessage/lliosocket.cpp @@ -301,6 +301,8 @@ LLIOSocketReader::~LLIOSocketReader() //lldebugs << "Destroying LLIOSocketReader" << llendl; } +static LLFastTimer::DeclareTimer FTM_PROCESS_SOCKET_READER("Socket Reader"); + // virtual LLIOPipe::EStatus LLIOSocketReader::process_impl( const LLChannelDescriptors& channels, @@ -309,6 +311,7 @@ LLIOPipe::EStatus LLIOSocketReader::process_impl( LLSD& context, LLPumpIO* pump) { + LLFastTimer t(FTM_PROCESS_SOCKET_READER); PUMP_DEBUG; LLMemType m1(LLMemType::MTYPE_IO_TCP); if(!mSource) return STATUS_PRECONDITION_NOT_MET; @@ -401,6 +404,7 @@ LLIOSocketWriter::~LLIOSocketWriter() //lldebugs << "Destroying LLIOSocketWriter" << llendl; } +static LLFastTimer::DeclareTimer FTM_PROCESS_SOCKET_WRITER("Socket Writer"); // virtual LLIOPipe::EStatus LLIOSocketWriter::process_impl( const LLChannelDescriptors& channels, @@ -409,6 +413,7 @@ LLIOPipe::EStatus LLIOSocketWriter::process_impl( LLSD& context, LLPumpIO* pump) { + LLFastTimer t(FTM_PROCESS_SOCKET_WRITER); PUMP_DEBUG; LLMemType m1(LLMemType::MTYPE_IO_TCP); if(!mDestination) return STATUS_PRECONDITION_NOT_MET; @@ -555,6 +560,7 @@ void LLIOServerSocket::setResponseTimeout(F32 timeout_secs) mResponseTimeout = timeout_secs; } +static LLFastTimer::DeclareTimer FTM_PROCESS_SERVER_SOCKET("Server Socket"); // virtual LLIOPipe::EStatus LLIOServerSocket::process_impl( const LLChannelDescriptors& channels, @@ -563,6 +569,7 @@ LLIOPipe::EStatus LLIOServerSocket::process_impl( LLSD& context, LLPumpIO* pump) { + LLFastTimer t(FTM_PROCESS_SERVER_SOCKET); PUMP_DEBUG; LLMemType m1(LLMemType::MTYPE_IO_TCP); if(!pump) diff --git a/indra/llmessage/llioutil.cpp b/indra/llmessage/llioutil.cpp index 2e6ee59ff2..8c50fd5069 100644 --- a/indra/llmessage/llioutil.cpp +++ b/indra/llmessage/llioutil.cpp @@ -43,6 +43,8 @@ LLIOPipe::EStatus LLIOFlush::process_impl( return STATUS_OK; } + +static LLFastTimer::DeclareTimer FTM_PROCESS_SLEEP("IO Sleep"); /** * @class LLIOSleep */ @@ -53,6 +55,7 @@ LLIOPipe::EStatus LLIOSleep::process_impl( LLSD& context, LLPumpIO* pump) { + LLFastTimer t(FTM_PROCESS_SLEEP); if(mSeconds > 0.0) { if(pump) pump->sleepChain(mSeconds); @@ -62,6 +65,7 @@ LLIOPipe::EStatus LLIOSleep::process_impl( return STATUS_DONE; } +static LLFastTimer::DeclareTimer FTM_PROCESS_ADD_CHAIN("Add Chain"); /** * @class LLIOAddChain */ @@ -72,6 +76,7 @@ LLIOPipe::EStatus LLIOAddChain::process_impl( LLSD& context, LLPumpIO* pump) { + LLFastTimer t(FTM_PROCESS_ADD_CHAIN); pump->addChain(mChain, mTimeout); return STATUS_DONE; } diff --git a/indra/llmessage/llsdrpcclient.cpp b/indra/llmessage/llsdrpcclient.cpp index 86fe5c7912..91fd070f07 100644 --- a/indra/llmessage/llsdrpcclient.cpp +++ b/indra/llmessage/llsdrpcclient.cpp @@ -82,6 +82,8 @@ bool LLSDRPCResponse::extractResponse(const LLSD& sd) return rv; } +static LLFastTimer::DeclareTimer FTM_SDRPC_RESPONSE("SDRPC Response"); + // virtual LLIOPipe::EStatus LLSDRPCResponse::process_impl( const LLChannelDescriptors& channels, @@ -90,6 +92,7 @@ LLIOPipe::EStatus LLSDRPCResponse::process_impl( LLSD& context, LLPumpIO* pump) { + LLFastTimer t(FTM_SDRPC_RESPONSE); PUMP_DEBUG; LLMemType m1(LLMemType::MTYPE_IO_SD_CLIENT); if(mIsError) @@ -178,6 +181,8 @@ bool LLSDRPCClient::call( return true; } +static LLFastTimer::DeclareTimer FTM_PROCESS_SDRPC_CLIENT("SDRPC Client"); + // virtual LLIOPipe::EStatus LLSDRPCClient::process_impl( const LLChannelDescriptors& channels, @@ -186,6 +191,7 @@ LLIOPipe::EStatus LLSDRPCClient::process_impl( LLSD& context, LLPumpIO* pump) { + LLFastTimer t(FTM_PROCESS_SDRPC_CLIENT); PUMP_DEBUG; LLMemType m1(LLMemType::MTYPE_IO_SD_CLIENT); if((STATE_NONE == mState) || (!pump)) diff --git a/indra/llmessage/llsdrpcserver.cpp b/indra/llmessage/llsdrpcserver.cpp index f87c418fb1..9f776aca72 100644 --- a/indra/llmessage/llsdrpcserver.cpp +++ b/indra/llmessage/llsdrpcserver.cpp @@ -97,6 +97,8 @@ void LLSDRPCServer::clearLock() } } +static LLFastTimer::DeclareTimer FTM_PROCESS_SDRPC_SERVER("SDRPC Server"); + // virtual LLIOPipe::EStatus LLSDRPCServer::process_impl( const LLChannelDescriptors& channels, @@ -105,6 +107,7 @@ LLIOPipe::EStatus LLSDRPCServer::process_impl( LLSD& context, LLPumpIO* pump) { + LLFastTimer t(FTM_PROCESS_SDRPC_SERVER); PUMP_DEBUG; LLMemType m1(LLMemType::MTYPE_IO_SD_SERVER); // lldebugs << "LLSDRPCServer::process_impl" << llendl; diff --git a/indra/llmessage/llurlrequest.cpp b/indra/llmessage/llurlrequest.cpp index 28bd09fc4c..e8e35d00a2 100644 --- a/indra/llmessage/llurlrequest.cpp +++ b/indra/llmessage/llurlrequest.cpp @@ -270,6 +270,8 @@ LLIOPipe::EStatus LLURLRequest::handleError( return status; } +static LLFastTimer::DeclareTimer FTM_PROCESS_URL_REQUEST("URL Request"); + // virtual LLIOPipe::EStatus LLURLRequest::process_impl( const LLChannelDescriptors& channels, @@ -278,6 +280,7 @@ LLIOPipe::EStatus LLURLRequest::process_impl( LLSD& context, LLPumpIO* pump) { + LLFastTimer t(FTM_PROCESS_URL_REQUEST); PUMP_DEBUG; LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST); //llinfos << "LLURLRequest::process_impl()" << llendl; @@ -288,6 +291,8 @@ LLIOPipe::EStatus LLURLRequest::process_impl( const S32 MIN_ACCUMULATION = 100000; if(pump && (mDetail->mByteAccumulator > MIN_ACCUMULATION)) { + static LLFastTimer::DeclareTimer FTM_URL_ADJUST_TIMEOUT("Adjust Timeout"); + LLFastTimer t(FTM_URL_ADJUST_TIMEOUT); // This is a pretty sloppy calculation, but this // tries to make the gross assumption that if data // is coming in at 56kb/s, then this transfer will @@ -335,16 +340,30 @@ LLIOPipe::EStatus LLURLRequest::process_impl( { PUMP_DEBUG; LLIOPipe::EStatus status = STATUS_BREAK; - mDetail->mCurlRequest->perform(); + static LLFastTimer::DeclareTimer FTM_URL_PERFORM("Perform"); + { + LLFastTimer t(FTM_URL_PERFORM); + mDetail->mCurlRequest->perform(); + } + while(1) { CURLcode result; - bool newmsg = mDetail->mCurlRequest->getResult(&result); + + static LLFastTimer::DeclareTimer FTM_PROCESS_URL_REQUEST_GET_RESULT("Get Result"); + + bool newmsg = false; + { + LLFastTimer t(FTM_PROCESS_URL_REQUEST_GET_RESULT); + newmsg = mDetail->mCurlRequest->getResult(&result); + } + if(!newmsg) { // keep processing break; } + mState = STATE_HAVE_RESPONSE; context[CONTEXT_REQUEST][CONTEXT_TRANSFERED_BYTES] = mRequestTransferedBytes; @@ -370,7 +389,11 @@ LLIOPipe::EStatus LLURLRequest::process_impl( link.mChannels = LLBufferArray::makeChannelConsumer( channels); chain.push_back(link); - pump->respond(chain, buffer, context); + static LLFastTimer::DeclareTimer FTM_PROCESS_URL_PUMP_RESPOND("Pump Respond"); + { + LLFastTimer t(FTM_PROCESS_URL_PUMP_RESPOND); + pump->respond(chain, buffer, context); + } mCompletionCallback = NULL; } break; @@ -422,8 +445,11 @@ void LLURLRequest::initialize() mResponseTransferedBytes = 0; } +static LLFastTimer::DeclareTimer FTM_URL_REQUEST_CONFIGURE("URL Configure"); bool LLURLRequest::configure() { + LLFastTimer t(FTM_URL_REQUEST_CONFIGURE); + LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST); bool rv = false; S32 bytes = mDetail->mResponseBuffer->countAfter( @@ -624,6 +650,7 @@ static size_t headerCallback(void* data, size_t size, size_t nmemb, void* user) return header_len; } +static LLFastTimer::DeclareTimer FTM_PROCESS_URL_EXTRACTOR("URL Extractor"); /** * LLContextURLExtractor */ @@ -635,6 +662,7 @@ LLIOPipe::EStatus LLContextURLExtractor::process_impl( LLSD& context, LLPumpIO* pump) { + LLFastTimer t(FTM_PROCESS_URL_EXTRACTOR); PUMP_DEBUG; LLMemType m1(LLMemType::MTYPE_IO_URL_REQUEST); // The destination host is in the context. @@ -713,6 +741,7 @@ void LLURLRequestComplete::responseStatus(LLIOPipe::EStatus status) mRequestStatus = status; } +static LLFastTimer::DeclareTimer FTM_PROCESS_URL_COMPLETE("URL Complete"); // virtual LLIOPipe::EStatus LLURLRequestComplete::process_impl( const LLChannelDescriptors& channels, @@ -721,6 +750,7 @@ LLIOPipe::EStatus LLURLRequestComplete::process_impl( LLSD& context, LLPumpIO* pump) { + LLFastTimer t(FTM_PROCESS_URL_COMPLETE); PUMP_DEBUG; complete(channels, buffer); return STATUS_OK; diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index 257884d921..bd1d2ed7a7 100644 --- a/indra/newview/llxmlrpctransaction.cpp +++ b/indra/newview/llxmlrpctransaction.cpp @@ -394,16 +394,18 @@ bool LLXMLRPCTransaction::Impl::process() } } - const F32 MAX_PROCESSING_TIME = 0.05f; - LLTimer timer; + //const F32 MAX_PROCESSING_TIME = 0.05f; + //LLTimer timer; - while (mCurlRequest->perform() > 0) + mCurlRequest->perform(); + + /*while (mCurlRequest->perform() > 0) { if (timer.getElapsedTimeF32() >= MAX_PROCESSING_TIME) { return false; } - } + }*/ while(1) { -- cgit v1.2.3 From 7b6afd1eba69a61fae87e3f1e7b03d03ee4ea15e Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Thu, 21 Jul 2011 23:33:23 -0500 Subject: SH-2031 Followup to curl threading work -- don't start and stop the thread on every request, use a signal (cuts time spent in Pump IO down from 1-2 ms to 0.1ms) --- indra/llmessage/llcurl.cpp | 45 ++++++++++++++++++++++++++++++++------------- 1 file changed, 32 insertions(+), 13 deletions(-) diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp index 453ffa9db9..2bb36f494c 100644 --- a/indra/llmessage/llcurl.cpp +++ b/indra/llmessage/llcurl.cpp @@ -611,6 +611,9 @@ public: S32 mPerformState; + LLCondition* mSignal; + bool mQuitting; + private: void easyFree(Easy*); @@ -630,6 +633,9 @@ LLCurl::Multi::Multi() mErrorCount(0), mPerformState(PERFORM_STATE_READY) { + mQuitting = false; + mSignal = new LLCondition(NULL); + mCurlMultiHandle = curl_multi_init(); if (!mCurlMultiHandle) { @@ -644,6 +650,10 @@ LLCurl::Multi::Multi() LLCurl::Multi::~Multi() { llassert(isStopped()); + + delete mSignal; + mSignal = NULL; + // Clean up active for(easy_active_list_t::iterator iter = mEasyActiveList.begin(); iter != mEasyActiveList.end(); ++iter) @@ -674,27 +684,31 @@ void LLCurl::Multi::perform() if (mPerformState == PERFORM_STATE_READY) { mPerformState = PERFORM_STATE_PERFORMING; - start(); + mSignal->signal(); } } void LLCurl::Multi::run() { - S32 q = 0; - for (S32 call_count = 0; - call_count < MULTI_PERFORM_CALL_REPEAT; - call_count += 1) + while (!mQuitting) { - CURLMcode code = curl_multi_perform(mCurlMultiHandle, &q); - if (CURLM_CALL_MULTI_PERFORM != code || q == 0) + mSignal->wait(); + S32 q = 0; + for (S32 call_count = 0; + call_count < MULTI_PERFORM_CALL_REPEAT; + call_count += 1) { - check_curl_multi_code(code); - break; - } + CURLMcode code = curl_multi_perform(mCurlMultiHandle, &q); + if (CURLM_CALL_MULTI_PERFORM != code || q == 0) + { + check_curl_multi_code(code); + break; + } + } + mQueued = q; + mPerformState = PERFORM_STATE_COMPLETED; } - mQueued = q; - mPerformState = PERFORM_STATE_COMPLETED; } S32 LLCurl::Multi::process() @@ -823,6 +837,7 @@ void LLCurlRequest::addMulti() { llassert_always(mThreadID == LLThread::currentID()); LLCurl::Multi* multi = new LLCurl::Multi(); + multi->start(); mMultiSet.insert(multi); mActiveMulti = multi; mActiveRequestCount = 0; @@ -952,9 +967,10 @@ S32 LLCurlRequest::process() if (multi != mActiveMulti && tres == 0 && multi->mQueued == 0) { mMultiSet.erase(curiter); - + multi->mQuitting = true; while (!multi->isStopped()) { + multi->mSignal->signal(); apr_sleep(1000); } @@ -988,6 +1004,7 @@ LLCurlEasyRequest::LLCurlEasyRequest() mResultReturned(false) { mMulti = new LLCurl::Multi(); + mMulti->start(); mEasy = mMulti->allocEasy(); if (mEasy) { @@ -998,8 +1015,10 @@ LLCurlEasyRequest::LLCurlEasyRequest() LLCurlEasyRequest::~LLCurlEasyRequest() { + mMulti->mQuitting = true; while (!mMulti->isStopped()) { + mMulti->mSignal->signal(); apr_sleep(1000); } delete mMulti; -- cgit v1.2.3 From c3378885536c5b7d3dd503ed6867cf5d6a8b1370 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 22 Jul 2011 01:07:48 -0500 Subject: SH-2031 Disable usage of glMapBuffer (again). Despite using MapBufferRange, this is still a source of frame stalls. --- indra/newview/featuretable.txt | 4 ++-- indra/newview/featuretable_linux.txt | 4 ++-- indra/newview/featuretable_xp.txt | 2 +- indra/newview/llface.cpp | 14 ++++++++++++++ 4 files changed, 19 insertions(+), 5 deletions(-) diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt index d2d0227f62..67c8b977cf 100644 --- a/indra/newview/featuretable.txt +++ b/indra/newview/featuretable.txt @@ -1,4 +1,4 @@ -version 31 +version 32 // NOTE: This is mostly identical to featuretable_mac.txt with a few differences // Should be combined into one table @@ -247,7 +247,7 @@ RenderShadowDetail 0 0 // GL_ARB_map_buffer_range exists // list MapBufferRange -RenderVBOMappingDisable 1 0 +RenderVBOMappingDisable 1 1 // diff --git a/indra/newview/featuretable_linux.txt b/indra/newview/featuretable_linux.txt index d9b4083016..6e962f3c56 100644 --- a/indra/newview/featuretable_linux.txt +++ b/indra/newview/featuretable_linux.txt @@ -1,4 +1,4 @@ -version 26 +version 27 // NOTE: This is mostly identical to featuretable_mac.txt with a few differences // Should be combined into one table @@ -245,7 +245,7 @@ RenderShadowDetail 0 0 // GL_ARB_map_buffer_range exists // list MapBufferRange -RenderVBOMappingDisable 1 0 +RenderVBOMappingDisable 1 1 diff --git a/indra/newview/featuretable_xp.txt b/indra/newview/featuretable_xp.txt index 6477dab35a..a0245f5369 100644 --- a/indra/newview/featuretable_xp.txt +++ b/indra/newview/featuretable_xp.txt @@ -247,7 +247,7 @@ RenderShadowDetail 0 0 // GL_ARB_map_buffer_range exists // list MapBufferRange -RenderVBOMappingDisable 1 0 +RenderVBOMappingDisable 1 1 // diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 17b6912b63..432e61f6d8 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1051,6 +1051,13 @@ bool LLFace::canRenderAsMask() static LLFastTimer::DeclareTimer FTM_FACE_GET_GEOM("Face Geom"); +static LLFastTimer::DeclareTimer FTM_FACE_GEOM_POSITION("Position"); +static LLFastTimer::DeclareTimer FTM_FACE_GEOM_NORMAL("Normal"); +static LLFastTimer::DeclareTimer FTM_FACE_GEOM_TEXTURE("Texture"); +static LLFastTimer::DeclareTimer FTM_FACE_GEOM_COLOR("Color"); +static LLFastTimer::DeclareTimer FTM_FACE_GEOM_WEIGHTS("Weights"); +static LLFastTimer::DeclareTimer FTM_FACE_GEOM_BINORMAL("Binormal"); +static LLFastTimer::DeclareTimer FTM_FACE_GEOM_INDEX("Index"); BOOL LLFace::getGeometryVolume(const LLVolume& volume, const S32 &f, @@ -1184,6 +1191,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, // INDICES if (full_rebuild) { + LLFastTimer t(FTM_FACE_GEOM_INDEX); mVertexBuffer->getIndexStrider(indicesp, mIndicesIndex, mIndicesCount, map_range); __m128i* dst = (__m128i*) indicesp.get(); @@ -1220,6 +1228,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, if (rebuild_tcoord) { + LLFastTimer t(FTM_FACE_GEOM_TEXTURE); bool do_xform; if (tep) @@ -1621,6 +1630,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, if (rebuild_pos) { + LLFastTimer t(FTM_FACE_GEOM_POSITION); llassert(num_vertices > 0); mVertexBuffer->getVertexStrider(vert, mGeomIndex, mGeomCount, map_range); @@ -1668,6 +1678,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, if (rebuild_normal) { + LLFastTimer t(FTM_FACE_GEOM_NORMAL); mVertexBuffer->getNormalStrider(norm, mGeomIndex, mGeomCount, map_range); normals = (LLVector4a*) norm.get(); @@ -1687,6 +1698,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, if (rebuild_binormal) { + LLFastTimer t(FTM_FACE_GEOM_BINORMAL); mVertexBuffer->getBinormalStrider(binorm, mGeomIndex, mGeomCount, map_range); binormals = (LLVector4a*) binorm.get(); @@ -1706,6 +1718,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, if (rebuild_weights && vf.mWeights) { + LLFastTimer t(FTM_FACE_GEOM_WEIGHTS); mVertexBuffer->getWeight4Strider(wght, mGeomIndex, mGeomCount, map_range); weights = (LLVector4a*) wght.get(); LLVector4a::memcpyNonAliased16((F32*) weights, (F32*) vf.mWeights, num_vertices*4*sizeof(F32)); @@ -1717,6 +1730,7 @@ BOOL LLFace::getGeometryVolume(const LLVolume& volume, if (rebuild_color) { + LLFastTimer t(FTM_FACE_GEOM_COLOR); mVertexBuffer->getColorStrider(colors, mGeomIndex, mGeomCount, map_range); LLVector4a src; -- cgit v1.2.3 From e4a8ef4ce2572db98d08233c58e23d3ec75f30d7 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 22 Jul 2011 02:33:55 -0500 Subject: SH-2031 Cleanup from threaded curl implementation (remove errors/loops on shutdown). --- indra/llcommon/llthread.cpp | 3 ++- indra/llmessage/llcurl.cpp | 38 +++++++++++++++++++++++++++----------- 2 files changed, 29 insertions(+), 12 deletions(-) diff --git a/indra/llcommon/llthread.cpp b/indra/llcommon/llthread.cpp index d9400fb5b3..4063cc730b 100644 --- a/indra/llcommon/llthread.cpp +++ b/indra/llcommon/llthread.cpp @@ -323,7 +323,8 @@ LLMutex::LLMutex(apr_pool_t *poolp) : LLMutex::~LLMutex() { #if MUTEX_DEBUG - llassert_always(!isLocked()); // better not be locked! + //bad assertion, the subclass LLSignal might be "locked", and that's OK + //llassert_always(!isLocked()); // better not be locked! #endif apr_thread_mutex_destroy(mAPRMutexp); mAPRMutexp = NULL; diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp index 2bb36f494c..1e735c4bbd 100644 --- a/indra/llmessage/llcurl.cpp +++ b/indra/llmessage/llcurl.cpp @@ -693,21 +693,25 @@ void LLCurl::Multi::run() while (!mQuitting) { mSignal->wait(); - S32 q = 0; - for (S32 call_count = 0; - call_count < MULTI_PERFORM_CALL_REPEAT; - call_count += 1) + + if (!mQuitting) { - CURLMcode code = curl_multi_perform(mCurlMultiHandle, &q); - if (CURLM_CALL_MULTI_PERFORM != code || q == 0) + S32 q = 0; + for (S32 call_count = 0; + call_count < MULTI_PERFORM_CALL_REPEAT; + call_count += 1) { - check_curl_multi_code(code); - break; - } + CURLMcode code = curl_multi_perform(mCurlMultiHandle, &q); + if (CURLM_CALL_MULTI_PERFORM != code || q == 0) + { + check_curl_multi_code(code); + break; + } + } + mQueued = q; + mPerformState = PERFORM_STATE_COMPLETED; } - mQueued = q; - mPerformState = PERFORM_STATE_COMPLETED; } } @@ -830,6 +834,18 @@ LLCurlRequest::LLCurlRequest() : LLCurlRequest::~LLCurlRequest() { llassert_always(mThreadID == LLThread::currentID()); + + //stop all Multi handle background threads + for (curlmulti_set_t::iterator iter = mMultiSet.begin(); iter != mMultiSet.end(); ++iter) + { + LLCurl::Multi* multi = *iter; + multi->mQuitting = true; + while (!multi->isStopped()) + { + multi->mSignal->signal(); + apr_sleep(1000); + } + } for_each(mMultiSet.begin(), mMultiSet.end(), DeletePointer()); } -- cgit v1.2.3 From 26a9a6929c23eabfef0a53355a392fef0ad26b83 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Fri, 22 Jul 2011 16:22:51 -0500 Subject: SH-2031 Fix for sometimes deadlocking a curl thread. --- indra/llmessage/llcurl.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/indra/llmessage/llcurl.cpp b/indra/llmessage/llcurl.cpp index 1e735c4bbd..0735842dcd 100644 --- a/indra/llmessage/llcurl.cpp +++ b/indra/llmessage/llcurl.cpp @@ -683,7 +683,6 @@ void LLCurl::Multi::perform() { if (mPerformState == PERFORM_STATE_READY) { - mPerformState = PERFORM_STATE_PERFORMING; mSignal->signal(); } } @@ -693,7 +692,7 @@ void LLCurl::Multi::run() while (!mQuitting) { mSignal->wait(); - + mPerformState = PERFORM_STATE_PERFORMING; if (!mQuitting) { S32 q = 0; -- cgit v1.2.3 -- cgit v1.2.3 From 578e44d9b89012d8d4e1352dfd8a2b56b9d58163 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Sun, 24 Jul 2011 15:55:44 -0500 Subject: dummy check in to make hg happy --- indra/newview/featuretable.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt index 22c79a4cbd..b49aaa5d32 100644 --- a/indra/newview/featuretable.txt +++ b/indra/newview/featuretable.txt @@ -1,6 +1,6 @@ version 30 -// NOTE: This is mostly identical to featuretable_mac.txt with a few differences +// NOTE: This is mostly identical to featuretable_mac.txt with a few differences // Should be combined into one table // -- cgit v1.2.3 From b26ff4b4edd7abd320fb7e200195137bd235a7e4 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Mon, 25 Jul 2011 00:00:04 -0500 Subject: SH-2031 Fix for bad vertex shader/fragment shader varying usage. --- indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl | 1 + 1 file changed, 1 insertion(+) diff --git a/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl b/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl index 5a854b4e02..8401208e28 100644 --- a/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/solidcolorV.glsl @@ -10,6 +10,7 @@ void main() { gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; + gl_FrontColor = gl_Color; gl_TexCoord[0] = gl_MultiTexCoord0; } -- cgit v1.2.3 From 723d05e6df1d89b8957aca429b1328834f323150 Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 25 Jul 2011 10:58:11 -0400 Subject: Added tag 2.8.2-start for changeset 54bc7823ad4e --- .hgtags | 1 + 1 file changed, 1 insertion(+) diff --git a/.hgtags b/.hgtags index a66a3cdd33..9f1e925c8d 100644 --- a/.hgtags +++ b/.hgtags @@ -153,3 +153,4 @@ e1ed60913230dd64269a7f7fc52cbc6004f6d52c 2.8.0-start 6866d9df6efbd441c66451debd376d21211de39c 2.7.5-release e1ed60913230dd64269a7f7fc52cbc6004f6d52c DRTVWR-71_2.8.0-beta1 e1ed60913230dd64269a7f7fc52cbc6004f6d52c 2.8.0-beta1 +54bc7823ad4e3a436fef79710f685a7372bbf795 2.8.2-start -- cgit v1.2.3 From 4c32fb04558fba6a5d467be63d6a070e9be6a29d Mon Sep 17 00:00:00 2001 From: Oz Linden Date: Mon, 25 Jul 2011 10:58:48 -0400 Subject: increment viewer version to 2.8.3 --- indra/llcommon/llversionviewer.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/indra/llcommon/llversionviewer.h b/indra/llcommon/llversionviewer.h index 6c1d233425..f98a5398c3 100644 --- a/indra/llcommon/llversionviewer.h +++ b/indra/llcommon/llversionviewer.h @@ -29,7 +29,7 @@ const S32 LL_VERSION_MAJOR = 2; const S32 LL_VERSION_MINOR = 8; -const S32 LL_VERSION_PATCH = 2; +const S32 LL_VERSION_PATCH = 3; const S32 LL_VERSION_BUILD = 0; const char * const LL_CHANNEL = "Second Life Developer"; -- cgit v1.2.3