Commits

davep committed 9460abb Merge

merge

Comments (0)

Files changed (6)

indra/llrender/llvertexbuffer.cpp

 	if (useVBOs())
 	{
 
-		if (!sDisableVBOMapping && gGLManager.mHasMapBufferRange)
+		if (sDisableVBOMapping || gGLManager.mHasMapBufferRange)
 		{
 			if (count == -1)
 			{
-				count = mNumVerts;
+				count = mNumVerts-index;
 			}
 
 			bool mapped = false;
 					if (expand_region(region, index, count))
 					{
 						mapped = true;
+						break;
 					}
 				}
 			}
 			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);
 			}
 		}
 		map_range = false;
 	}
 	
-	if (map_range)
+	if (map_range && !sDisableVBOMapping)
 	{
 		return mMappedData;
 	}
 
 	if (useVBOs())
 	{
-		if (!sDisableVBOMapping && gGLManager.mHasMapBufferRange)
+		if (sDisableVBOMapping || gGLManager.mHasMapBufferRange)
 		{
 			if (count == -1)
 			{
-				count = mNumIndices;
+				count = mNumIndices-index;
 			}
 
 			bool mapped = false;
 				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);
 			}
 		}
 		map_range = false;
 	}
 
-	if (map_range)
+	if (map_range && !sDisableVBOMapping)
 	{
 		return mMappedIndexData;
 	}
 
 		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
 		{
 	{
 		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
 		{

indra/newview/featuretable.txt

-version 28
+version 29
 
 // NOTE: This is mostly identical to featuretable_mac.txt with a few differences
 // Should be combined into one table
 RenderTreeLODFactor			1	1.0
 RenderUseImpostors			1	1
 RenderVBOEnable				1	1
+RenderVBOMappingDisable		1	1
 RenderVolumeLODFactor		1	2.0
 UseStartScreen				1	1
 UseOcclusion				1	1
 RenderShadowDetail			1	2
 RenderFSAASamples			1	8
 
+
 //
 // Class Unknown Hardware (unknown)
 //
 RenderDeferredSSAO			0	0
 RenderShadowDetail			0	0
 
+//
+// No GL_ARB_map_buffer_range
+//
+list NoMapBufferRange
+RenderVBOMappingDisable		1	0
+
 
 //
 // "Default" setups for safe, low, medium, high

indra/newview/featuretable_linux.txt

-version 24
+version 25
 
 // NOTE: This is mostly identical to featuretable_mac.txt with a few differences
 // Should be combined into one table
 RenderTreeLODFactor			1	1.0
 RenderUseImpostors			1	1
 RenderVBOEnable				1	1
+RenderVBOMappingDisable		1	1
 RenderVolumeLODFactor		1	2.0
 UseStartScreen				1	1
 UseOcclusion				1	1
 RenderDeferredSSAO			0	0
 RenderShadowDetail			0	0
 
+//
+// No GL_ARB_map_buffer_range
+//
+list NoMapBufferRange
+RenderVBOMappingDisable		1	0
+
+
 
 // "Default" setups for safe, low, medium, high
 //

indra/newview/featuretable_mac.txt

-version 25
+version 26
 
 // NOTE: This is mostly identical to featuretable_mac.txt with a few differences
 // Should be combined into one table
 RenderTreeLODFactor				1	1.0
 RenderUseImpostors				1	1
 RenderVBOEnable					1	1
+RenderVBOMappingDisable		1	1
 RenderVolumeLODFactor			1	2.0
 UseStartScreen				1	1
 UseOcclusion					1	1
 RenderShadowDetail			0	0
 
 //
+// No GL_ARB_map_buffer_range
+//
+list NoMapBufferRange
+RenderVBOMappingDisable		1	0
+
+
+//
 // "Default" setups for safe, low, medium, high
 //
 list safe

indra/newview/featuretable_xp.txt

-version 28
+version 29
 
 // NOTE: This is mostly identical to featuretable_mac.txt with a few differences
 // Should be combined into one table
 RenderTreeLODFactor			1	1.0
 RenderUseImpostors			1	1
 RenderVBOEnable				1	1
+RenderVBOMappingDisable		1	1
 RenderVolumeLODFactor		1	2.0
 UseStartScreen				1	1
 UseOcclusion				1	1
 RenderShadowDetail			0	0
 
 //
+// No GL_ARB_map_buffer_range
+//
+list NoMapBufferRange
+RenderVBOMappingDisable		1	0
+
+
+//
 // "Default" setups for safe, low, medium, high
 //
 list safe

indra/newview/llfloatermodelpreview.cpp

 		mPreviewScale = (mModelLoader->mExtents[1] - mModelLoader->mExtents[0]) * 0.5f;
 	}
 
-	setPreviewTarget(mPreviewScale.magVec()*2.f);
+	setPreviewTarget(mPreviewScale.magVec()*10.f);
 }
 
 void LLModelPreview::generateNormals()
 	LLVector3 target_pos = mPreviewTarget+offset;
 
 	F32 z_near = 0.001f;
-	F32 z_far = mCameraDistance+mPreviewScale.magVec()+mCameraOffset.magVec();
+	F32 z_far = mCameraDistance*10.0f+mPreviewScale.magVec()+mCameraOffset.magVec();
 
 	if (skin_weight)
 	{