diff options
Diffstat (limited to 'indra')
-rw-r--r-- | indra/llrender/llvertexbuffer.cpp | 63 | ||||
-rw-r--r-- | indra/newview/featuretable.txt | 10 | ||||
-rw-r--r-- | indra/newview/featuretable_linux.txt | 10 | ||||
-rw-r--r-- | indra/newview/featuretable_mac.txt | 10 | ||||
-rw-r--r-- | indra/newview/featuretable_xp.txt | 10 |
5 files changed, 85 insertions, 18 deletions
diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 3197866fa9..4a0b964e61 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -968,11 +968,11 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran if (useVBOs()) { - if (!sDisableVBOMapping && gGLManager.mHasMapBufferRange) + if (sDisableVBOMapping || gGLManager.mHasMapBufferRange) { if (count == -1) { - count = mNumVerts; + count = mNumVerts-index; } bool mapped = false; @@ -985,6 +985,7 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran if (expand_region(region, index, count)) { mapped = true; + break; } } } @@ -992,7 +993,7 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran if (!mapped) { //not already mapped, map new region - MappedRegion region(type, map_range ? -1 : index, count); + MappedRegion region(type, !sDisableVBOMapping && map_range ? -1 : index, count); mMappedVertexRegions.push_back(region); } } @@ -1089,7 +1090,7 @@ U8* LLVertexBuffer::mapVertexBuffer(S32 type, S32 index, S32 count, bool map_ran map_range = false; } - if (map_range) + if (map_range && !sDisableVBOMapping) { return mMappedData; } @@ -1113,11 +1114,11 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range) if (useVBOs()) { - if (!sDisableVBOMapping && gGLManager.mHasMapBufferRange) + if (sDisableVBOMapping || gGLManager.mHasMapBufferRange) { if (count == -1) { - count = mNumIndices; + count = mNumIndices-index; } bool mapped = false; @@ -1128,13 +1129,14 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range) if (expand_region(region, index, count)) { mapped = true; + break; } } if (!mapped) { //not already mapped, map new region - MappedRegion region(TYPE_INDEX, map_range ? -1 : index, count); + MappedRegion region(TYPE_INDEX, !sDisableVBOMapping && map_range ? -1 : index, count); mMappedIndexRegions.push_back(region); } } @@ -1217,7 +1219,7 @@ U8* LLVertexBuffer::mapIndexBuffer(S32 index, S32 count, bool map_range) map_range = false; } - if (map_range) + if (map_range && !sDisableVBOMapping) { return mMappedIndexData; } @@ -1243,9 +1245,26 @@ void LLVertexBuffer::unmapBuffer(S32 type) if(sDisableVBOMapping) { - stop_glerror(); - glBufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, getSize(), mMappedData); - stop_glerror(); + if (!mMappedVertexRegions.empty()) + { + stop_glerror(); + for (U32 i = 0; i < mMappedVertexRegions.size(); ++i) + { + 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; + glBufferSubDataARB(GL_ARRAY_BUFFER_ARB, offset, length, mMappedData+offset); + stop_glerror(); + } + + mMappedVertexRegions.clear(); + } + else + { + stop_glerror(); + glBufferSubDataARB(GL_ARRAY_BUFFER_ARB, 0, getSize(), mMappedData); + stop_glerror(); + } } else { @@ -1285,9 +1304,25 @@ void LLVertexBuffer::unmapBuffer(S32 type) { if(sDisableVBOMapping) { - stop_glerror(); - glBufferSubDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0, getIndicesSize(), mMappedIndexData); - stop_glerror(); + if (!mMappedIndexRegions.empty()) + { + for (U32 i = 0; i < mMappedIndexRegions.size(); ++i) + { + const MappedRegion& region = mMappedIndexRegions[i]; + S32 offset = region.mIndex >= 0 ? sizeof(U16)*region.mIndex : 0; + S32 length = sizeof(U16)*region.mCount; + glBufferSubDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, offset, length, mMappedIndexData+offset); + stop_glerror(); + } + + mMappedIndexRegions.clear(); + } + else + { + stop_glerror(); + glBufferSubDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, 0, getIndicesSize(), mMappedIndexData); + stop_glerror(); + } } else { diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt index 1d29c5b597..4da155efda 100644 --- a/indra/newview/featuretable.txt +++ b/indra/newview/featuretable.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 @@ -48,6 +48,7 @@ RenderTransparentWater 1 1 RenderTreeLODFactor 1 1.0 RenderUseImpostors 1 1 RenderVBOEnable 1 1 +RenderVBOMappingDisable 1 1 RenderVolumeLODFactor 1 2.0 UseStartScreen 1 1 UseOcclusion 1 1 @@ -187,6 +188,7 @@ RenderDeferredSSAO 1 1 RenderShadowDetail 1 2 RenderFSAASamples 1 8 + // // Class Unknown Hardware (unknown) // @@ -243,6 +245,12 @@ 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_linux.txt b/indra/newview/featuretable_linux.txt index 9daa5a5b29..dab73dc3d1 100644 --- a/indra/newview/featuretable_linux.txt +++ b/indra/newview/featuretable_linux.txt @@ -1,4 +1,4 @@ -version 24 +version 25 // NOTE: This is mostly identical to featuretable_mac.txt with a few differences // Should be combined into one table @@ -48,6 +48,7 @@ RenderTransparentWater 1 1 RenderTreeLODFactor 1 1.0 RenderUseImpostors 1 1 RenderVBOEnable 1 1 +RenderVBOMappingDisable 1 1 RenderVolumeLODFactor 1 2.0 UseStartScreen 1 1 UseOcclusion 1 1 @@ -242,6 +243,13 @@ 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_mac.txt b/indra/newview/featuretable_mac.txt index d7b4128ca2..a1e25aae08 100644 --- a/indra/newview/featuretable_mac.txt +++ b/indra/newview/featuretable_mac.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 @@ -48,6 +48,7 @@ RenderTransparentWater 1 1 RenderTreeLODFactor 1 1.0 RenderUseImpostors 1 1 RenderVBOEnable 1 1 +RenderVBOMappingDisable 1 1 RenderVolumeLODFactor 1 2.0 UseStartScreen 1 1 UseOcclusion 1 1 @@ -245,6 +246,13 @@ RenderDeferredSSAO 0 0 RenderShadowDetail 0 0 // +// No GL_ARB_map_buffer_range +// +list NoMapBufferRange +RenderVBOMappingDisable 1 0 + + +// // "Default" setups for safe, low, medium, high // list safe diff --git a/indra/newview/featuretable_xp.txt b/indra/newview/featuretable_xp.txt index 0a23b4d6a6..abe4ec9928 100644 --- a/indra/newview/featuretable_xp.txt +++ b/indra/newview/featuretable_xp.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 @@ -48,6 +48,7 @@ RenderTransparentWater 1 1 RenderTreeLODFactor 1 1.0 RenderUseImpostors 1 1 RenderVBOEnable 1 1 +RenderVBOMappingDisable 1 1 RenderVolumeLODFactor 1 2.0 UseStartScreen 1 1 UseOcclusion 1 1 @@ -245,6 +246,13 @@ RenderDeferredSSAO 0 0 RenderShadowDetail 0 0 // +// No GL_ARB_map_buffer_range +// +list NoMapBufferRange +RenderVBOMappingDisable 1 0 + + +// // "Default" setups for safe, low, medium, high // list safe |