Page 1 of 1

btGenerateInternalEdgeInfo double vertex buffer locking

Posted: Fri Feb 17, 2012 10:29 am
by note173
It seems that btGenerateInternalEdgeInfo locks vertex buffer of striding mesh interface twice:

Before the (triangleIndex, numFaces) loop:

Code: Select all

...
meshInterface->getLockedReadOnlyVertexIndexBase(&vertexbase,numverts,	type,stride,&indexbase,indexstride,numfaces,indicestype,partId);
...
then, in the end of the loop:

Code: Select all

    trimeshShape->processAllTriangles(&connectivityProcessor,aabbMin,aabbMax);
}
which tries to lock the same buffer again during callback:

Code: Select all

		virtual void processNode(int nodeSubPart, int nodeTriangleIndex)
		{
			const unsigned char *vertexbase;
			int numverts;
			PHY_ScalarType type;
			int stride;
			const unsigned char *indexbase;
			int indexstride;
			int numfaces;
			PHY_ScalarType indicestype;
			

			m_meshInterface->getLockedReadOnlyVertexIndexBase(
				&vertexbase,
				numverts,
				type,
				stride,
				&indexbase,
				indexstride,
				numfaces,
				indicestype,
				nodeSubPart);
I'm using ogre, and in desktop GL hardware buffers implementation it throws an exception while trying to lock an already locked buffer.
I also don't see where btGenerateInternalEdgeInfo unlocks the buffer.