enable SIMD for Apple OSX Intel
compile fixes for _btGpu_computeGridSize undefined in libBulletMultiThreaded http://code.google.com/p/bullet/issues/detail?id=246
This commit is contained in:
@@ -19,6 +19,7 @@ subject to the following restrictions:
|
|||||||
#include "BulletMultiThreaded/btGpuUtilsSharedCode.h"
|
#include "BulletMultiThreaded/btGpuUtilsSharedCode.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h"
|
#include "BulletCollision/CollisionDispatch/btEmptyCollisionAlgorithm.h"
|
||||||
|
|
||||||
#include "btGpuDemoPairCache.h"
|
#include "btGpuDemoPairCache.h"
|
||||||
|
|||||||
@@ -13,9 +13,6 @@ subject to the following restrictions:
|
|||||||
3. This notice may not be removed or altered from any source distribution.
|
3. This notice may not be removed or altered from any source distribution.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "BulletMultiThreaded/btGpuDefines.h"
|
|
||||||
#include "BulletMultiThreaded/btGpuUtilsSharedDefs.h"
|
|
||||||
#include "BulletMultiThreaded/btGpuUtilsSharedCode.h"
|
|
||||||
|
|
||||||
#include "BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h"
|
#include "BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h"
|
||||||
#include "BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.h"
|
#include "BulletMultiThreaded/SpuContactManifoldCollisionAlgorithm.h"
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ ${BULLET_PHYSICS_SOURCE_DIR}/src ${BULLET_PHYSICS_SOURCE_DIR}/Demos/OpenGL }
|
|||||||
)
|
)
|
||||||
|
|
||||||
LINK_LIBRARIES(
|
LINK_LIBRARIES(
|
||||||
OpenGLSupport BulletDynamics BulletCollision LinearMath ${GLUT_glut_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}
|
OpenGLSupport BulletMultiThreaded BulletDynamics BulletCollision LinearMath ${GLUT_glut_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}
|
||||||
)
|
)
|
||||||
|
|
||||||
ADD_EXECUTABLE(AppGpu3dDemo
|
ADD_EXECUTABLE(AppGpu3dDemo
|
||||||
|
|||||||
@@ -60,6 +60,10 @@
|
|||||||
/* Define to 1 if you have the <windows.h> header file. */
|
/* Define to 1 if you have the <windows.h> header file. */
|
||||||
#undef HAVE_WINDOWS_H
|
#undef HAVE_WINDOWS_H
|
||||||
|
|
||||||
|
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
||||||
|
*/
|
||||||
|
#undef LT_OBJDIR
|
||||||
|
|
||||||
/* Name of package */
|
/* Name of package */
|
||||||
#undef PACKAGE
|
#undef PACKAGE
|
||||||
|
|
||||||
|
|||||||
@@ -57,7 +57,7 @@ subject to the following restrictions:
|
|||||||
// Specific methods implementation
|
// Specific methods implementation
|
||||||
|
|
||||||
//SSE gives errors on a MSVC 7.1
|
//SSE gives errors on a MSVC 7.1
|
||||||
#ifdef BT_USE_SSE
|
#if defined (BT_USE_SSE) && defined (WIN32)
|
||||||
#define DBVT_SELECT_IMPL DBVT_IMPL_SSE
|
#define DBVT_SELECT_IMPL DBVT_IMPL_SSE
|
||||||
#define DBVT_MERGE_IMPL DBVT_IMPL_SSE
|
#define DBVT_MERGE_IMPL DBVT_IMPL_SSE
|
||||||
#define DBVT_INT0_IMPL DBVT_IMPL_SSE
|
#define DBVT_INT0_IMPL DBVT_IMPL_SSE
|
||||||
|
|||||||
@@ -13,6 +13,11 @@ subject to the following restrictions:
|
|||||||
3. This notice may not be removed or altered from any source distribution.
|
3. This notice may not be removed or altered from any source distribution.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
///The 3 following lines include the CPU implementation of the kernels, keep them in this order.
|
||||||
|
#include "BulletMultiThreaded/btGpuDefines.h"
|
||||||
|
#include "BulletMultiThreaded/btGpuUtilsSharedDefs.h"
|
||||||
|
#include "BulletMultiThreaded/btGpuUtilsSharedCode.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#include "LinearMath/btAlignedAllocator.h"
|
#include "LinearMath/btAlignedAllocator.h"
|
||||||
|
|||||||
@@ -102,13 +102,13 @@ void btSoftRigidDynamicsWorld::solveSoftBodiesConstraints()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void btSoftRigidDynamicsWorld::addSoftBody(btSoftBody* body)
|
void btSoftRigidDynamicsWorld::addSoftBody(btSoftBody* body,short int collisionFilterGroup,short int collisionFilterMask)
|
||||||
{
|
{
|
||||||
m_softBodies.push_back(body);
|
m_softBodies.push_back(body);
|
||||||
|
|
||||||
btCollisionWorld::addCollisionObject(body,
|
btCollisionWorld::addCollisionObject(body,
|
||||||
btBroadphaseProxy::DefaultFilter,
|
collisionFilterGroup,
|
||||||
btBroadphaseProxy::AllFilter);
|
collisionFilterMask);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -50,7 +50,7 @@ public:
|
|||||||
|
|
||||||
virtual void debugDrawWorld();
|
virtual void debugDrawWorld();
|
||||||
|
|
||||||
void addSoftBody(btSoftBody* body);
|
void addSoftBody(btSoftBody* body,short int collisionFilterGroup=btBroadphaseProxy::DefaultFilter,short int collisionFilterMask=btBroadphaseProxy::AllFilter);
|
||||||
|
|
||||||
void removeSoftBody(btSoftBody* body);
|
void removeSoftBody(btSoftBody* body);
|
||||||
|
|
||||||
|
|||||||
@@ -128,6 +128,31 @@ inline int btGetVersion()
|
|||||||
#else
|
#else
|
||||||
//non-windows systems
|
//non-windows systems
|
||||||
|
|
||||||
|
#if (defined (__APPLE__) && defined (__i386__))
|
||||||
|
#define BT_USE_SSE
|
||||||
|
#include <emmintrin.h>
|
||||||
|
|
||||||
|
#define SIMD_FORCE_INLINE inline
|
||||||
|
///@todo: check out alignment methods for other platforms/compilers
|
||||||
|
#define ATTRIBUTE_ALIGNED16(a) a __attribute__ ((aligned (16)))
|
||||||
|
#define ATTRIBUTE_ALIGNED128(a) a __attribute__ ((aligned (128)))
|
||||||
|
#ifndef assert
|
||||||
|
#include <assert.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(DEBUG) || defined (_DEBUG)
|
||||||
|
#define btAssert assert
|
||||||
|
#else
|
||||||
|
#define btAssert(x)
|
||||||
|
#endif
|
||||||
|
|
||||||
|
//btFullAssert is optional, slows down a lot
|
||||||
|
#define btFullAssert(x)
|
||||||
|
#define btLikely(_c) _c
|
||||||
|
#define btUnlikely(_c) _c
|
||||||
|
|
||||||
|
#else
|
||||||
|
|
||||||
#define SIMD_FORCE_INLINE inline
|
#define SIMD_FORCE_INLINE inline
|
||||||
///@todo: check out alignment methods for other platforms/compilers
|
///@todo: check out alignment methods for other platforms/compilers
|
||||||
///#define ATTRIBUTE_ALIGNED16(a) a __attribute__ ((aligned (16)))
|
///#define ATTRIBUTE_ALIGNED16(a) a __attribute__ ((aligned (16)))
|
||||||
@@ -148,7 +173,7 @@ inline int btGetVersion()
|
|||||||
#define btFullAssert(x)
|
#define btFullAssert(x)
|
||||||
#define btLikely(_c) _c
|
#define btLikely(_c) _c
|
||||||
#define btUnlikely(_c) _c
|
#define btUnlikely(_c) _c
|
||||||
|
#endif //__APPLE__
|
||||||
|
|
||||||
#endif // LIBSPE2
|
#endif // LIBSPE2
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user