Fixes for IBM Cell SDK 3.0 by Jochen Roth

This commit is contained in:
johnmccutchan
2007-12-11 19:49:09 +00:00
parent 0bf152cabe
commit 66cdbb9659
15 changed files with 110 additions and 34 deletions

View File

@@ -26,13 +26,23 @@ PROGRAM_ppu := CcdPhysicsDemo
###################################################################### ######################################################################
OBJS = CcdPhysicsDemo.o main.o OBJS = CcdPhysicsDemo.o main.o
CELL_TOP ?= /opt/ibm/cell-sdk/prototype IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi)
ifeq ("$(IBM_CELLSDK_VERSION)","3.0")
CELL_TOP ?= /opt/cell/sdk
CELL_SYSROOT = /opt/cell/sysroot
include $(CELL_TOP)/buildutils/make.footer
else
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
CELL_SYSROOT = $(CELL_TOP)/sysroot
include $(CELL_TOP)/make.footer
endif
######################################################################## ########################################################################
# Libraries, Include paths, Defines # Libraries, Include paths, Defines
######################################################################## ########################################################################
INCLUDE = -DUSE_LIBSPE2 \ INCLUDE = -DUSE_LIBSPE2 \
-I$(CELL_TOP)/sysroot/usr/include \ -I$(CELL_SYSROOT)/usr/include \
-I../ \ -I../ \
-I$(ROOT)/src \ -I$(ROOT)/src \
-I$(ROOT)/Demos/OpenGL \ -I$(ROOT)/Demos/OpenGL \
@@ -55,7 +65,6 @@ INSTALL_FILES = $(PROGRAM_ppu)
######################################################################## ########################################################################
include $(CELL_TOP)/make.footer
$(PPMS): $(PPMS):
cp textures/$@ . cp textures/$@ .

View File

@@ -90,13 +90,9 @@ void BasicDemo::clientMoveAndDisplay()
if (ms > minFPS) if (ms > minFPS)
ms = minFPS; ms = minFPS;
printf("step\n");
if (m_dynamicsWorld) if (m_dynamicsWorld)
m_dynamicsWorld->stepSimulation(ms / 1000000.f); m_dynamicsWorld->stepSimulation(ms / 1000000.f);
printf("step finished\n");
renderme(); renderme();
glFlush(); glFlush();
@@ -175,6 +171,8 @@ void BasicDemo::initPhysics()
#else #else
m_dispatcher = new btCollisionDispatcher(collisionConfiguration); m_dispatcher = new btCollisionDispatcher(collisionConfiguration);
#endif //USE_PARALLEL_DISPATCHER #endif //USE_PARALLEL_DISPATCHER
m_collisionConfiguration = new btDefaultCollisionConfiguration();
#define USE_SWEEP_AND_PRUNE 1 #define USE_SWEEP_AND_PRUNE 1
#ifdef USE_SWEEP_AND_PRUNE #ifdef USE_SWEEP_AND_PRUNE
@@ -200,7 +198,7 @@ void BasicDemo::initPhysics()
sol->setSolverMode(btSequentialImpulseConstraintSolver::SOLVER_RANDMIZE_ORDER); sol->setSolverMode(btSequentialImpulseConstraintSolver::SOLVER_RANDMIZE_ORDER);
m_dynamicsWorld = new btSimpleDynamicsWorld(m_dispatcher,m_overlappingPairCache,m_solver); m_dynamicsWorld = new btSimpleDynamicsWorld(m_dispatcher,m_overlappingPairCache,m_solver);
#else #else
m_dynamicsWorld = new btDiscreteDynamicsWorld(m_dispatcher,m_overlappingPairCache,m_solver); m_dynamicsWorld = new btDiscreteDynamicsWorld(m_dispatcher,m_overlappingPairCache,m_solver,m_collisionConfiguration);
#endif //USE_SIMPLE_DYNAMICS_WORLD #endif //USE_SIMPLE_DYNAMICS_WORLD
m_dynamicsWorld->getDispatchInfo().m_enableSPU = true; m_dynamicsWorld->getDispatchInfo().m_enableSPU = true;
@@ -288,7 +286,7 @@ void BasicDemo::exitPhysics()
//delete dispatcher //delete dispatcher
delete m_dispatcher; delete m_dispatcher;
delete m_collisionConfiguration;
} }

View File

@@ -34,7 +34,7 @@ class BasicDemo : public DemoApplication
btBroadphaseInterface* m_overlappingPairCache; btBroadphaseInterface* m_overlappingPairCache;
btCollisionDispatcher* m_dispatcher; btCollisionDispatcher* m_dispatcher;
btDefaultCollisionConfiguration* m_collisionConfiguration;
btConstraintSolver* m_solver; btConstraintSolver* m_solver;
btCollisionAlgorithmCreateFunc* m_sphereSphereCF; btCollisionAlgorithmCreateFunc* m_sphereSphereCF;

View File

@@ -51,9 +51,17 @@ INSTALL_FILES = $(PROGRAM_ppu)
# make.footer # make.footer
######################################################################## ########################################################################
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
include $(CELL_TOP)/make.footer IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi)
ifeq ("$(IBM_CELLSDK_VERSION)","3.0")
CELL_TOP ?= /opt/cell/sdk
include $(CELL_TOP)/buildutils/make.footer
else
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
include $(CELL_TOP)/make.footer
endif
$(PPMS): $(PPMS):
cp textures/$@ . cp textures/$@ .

View File

@@ -50,9 +50,15 @@ INSTALL_FILES = $(PROGRAM_ppu)
# make.footer # make.footer
######################################################################## ########################################################################
CELL_TOP ?= /opt/ibm/cell-sdk/prototype IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi)
include $(CELL_TOP)/make.footer ifeq ("$(IBM_CELLSDK_VERSION)","3.0")
CELL_TOP ?= /opt/cell/sdk
include $(CELL_TOP)/buildutils/make.footer
else
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
include $(CELL_TOP)/make.footer
endif
$(PPMS): $(PPMS):
cp textures/$@ . cp textures/$@ .

View File

@@ -32,5 +32,13 @@ RenderTexture.o
#### Install directories #### Install directories
INSTALL_DIR = $(ROOT)/lib/ibmsdk/ INSTALL_DIR = $(ROOT)/lib/ibmsdk/
INSTALL_FILES = $(LIBRARY) INSTALL_FILES = $(LIBRARY)
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
include $(CELL_TOP)/make.footer IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi)
ifeq ("$(IBM_CELLSDK_VERSION)","3.0")
CELL_TOP ?= /opt/cell/sdk
include $(CELL_TOP)/buildutils/make.footer
else
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
include $(CELL_TOP)/make.footer
endif

View File

@@ -4,13 +4,25 @@ __ARCH_BITS__ := 32
NARROWPHASEDIR=./SpuNarrowPhaseCollisionTask NARROWPHASEDIR=./SpuNarrowPhaseCollisionTask
SPU_TASKFILE=$(NARROWPHASEDIR)/SpuGatheringCollisionTask SPU_TASKFILE=$(NARROWPHASEDIR)/SpuGatheringCollisionTask
IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi)
ifeq ("$(IBM_CELLSDK_VERSION)","3.0")
CELL_TOP ?= /opt/cell/sdk
CELL_SYSROOT := /opt/cell/sysroot
include $(CELL_TOP)/buildutils/make.footer
else
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
CELL_SYSROOT := $(CELL_TOP)/sysroot
include $(CELL_TOP)/make.footer
endif
RM=rm -f RM=rm -f
OUTDIR=./out OUTDIR=./out
DEBUGFLAG=-DNDEBUG DEBUGFLAG=-DNDEBUG
LIBOUTDIR=../../lib/ibmsdk LIBOUTDIR=../../lib/ibmsdk
COLLISIONDIR=../../src/BulletCollision COLLISIONDIR=../../src/BulletCollision
MATHDIR=../../src/LinearMath MATHDIR=../../src/LinearMath
CELLSDKDIR=/opt/ibm/cell-sdk
ARCHITECTUREFLAG=-m$(__ARCH_BITS__) ARCHITECTUREFLAG=-m$(__ARCH_BITS__)
ifeq "$(__ARCH_BITS__)" "64" ifeq "$(__ARCH_BITS__)" "64"
SPU_DEFFLAGS= -DUSE_LIBSPE2 -D__SPU__ -DUSE_ADDR64 SPU_DEFFLAGS= -DUSE_LIBSPE2 -D__SPU__ -DUSE_ADDR64
@@ -18,7 +30,7 @@ else
SPU_DEFFLAGS= -DUSE_LIBSPE2 -D__SPU__ SPU_DEFFLAGS= -DUSE_LIBSPE2 -D__SPU__
endif endif
SPU_GCC=/usr/bin/spu-gcc SPU_GCC=/usr/bin/spu-gcc
SPU_INCLUDEDIR= -I. -I$(CELLSDKDIR)/prototype/sysroot/usr/spu/include -I../../src -I$(NARROWPHASEDIR) SPU_INCLUDEDIR= -I. -I$(CELL_SYSROOT)/usr/spu/include -I../../src -I$(NARROWPHASEDIR)
#SPU_CFLAGS= $(DEBUGFLAG) -W -Wall -Winline -Os -c -include spu_intrinsics.h -include stdbool.h #SPU_CFLAGS= $(DEBUGFLAG) -W -Wall -Winline -Os -c -include spu_intrinsics.h -include stdbool.h
SPU_CFLAGS= $(DEBUGFLAG) -W -Wall -Winline -O3 -mbranch-hints -fomit-frame-pointer -ftree-vectorize -finline-functions -ftree-vect-loop-version -ftree-loop-optimize -ffast-math -fno-rtti -fno-exceptions -c -include spu_intrinsics.h -include stdbool.h SPU_CFLAGS= $(DEBUGFLAG) -W -Wall -Winline -O3 -mbranch-hints -fomit-frame-pointer -ftree-vectorize -finline-functions -ftree-vect-loop-version -ftree-loop-optimize -ffast-math -fno-rtti -fno-exceptions -c -include spu_intrinsics.h -include stdbool.h
@@ -37,9 +49,9 @@ else
endif endif
PPU_CFLAGS= $(ARCHITECTUREFLAG) $(DEBUGFLAG) -W -Wall -Winline -O3 -c -mabi=altivec -maltivec -include altivec.h -include stdbool.h PPU_CFLAGS= $(ARCHITECTUREFLAG) $(DEBUGFLAG) -W -Wall -Winline -O3 -c -mabi=altivec -maltivec -include altivec.h -include stdbool.h
PPU_INCLUDEDIR= -I. -I$(CELLSDKDIR)/prototype/sysroot/usr/include -I../../src -I$(NARROWPHASEDIR) PPU_INCLUDEDIR= -I. -I$(CELL_SYSROOT)/usr/include -I../../src -I$(NARROWPHASEDIR)
PPU_LFLAGS= $(ARCHITECTUREFLAG) -Wl,-m,elf$(__ARCH_BITS__)ppc PPU_LFLAGS= $(ARCHITECTUREFLAG) -Wl,-m,elf$(__ARCH_BITS__)ppc
PPU_LIBRARIES= -lstdc++ -lsupc++ -lgcc -lgcov -lspe2 -lpthread -L../../lib/ibmsdk -lbulletcollision -lbulletdynamics -lbulletmath -L$(CELLSDKDIR)/prototype/sysroot/usr/lib$(__ARCH_BITS__) -R$(CELLSDKDIR)/prototype/sysroot/usr/lib PPU_LIBRARIES= -lstdc++ -lsupc++ -lgcc -lgcov -lspe2 -lpthread -L../../lib/ibmsdk -lbulletcollision -lbulletdynamics -lbulletmath -L$(CELL_SYSROOT)/usr/lib$(__ARCH_BITS__) -R$(CELL_SYSROOT)/usr/lib
PPU_AR=/usr/bin/ar PPU_AR=/usr/bin/ar
MakeOut : MakeOut :

View File

@@ -760,7 +760,7 @@ SIMD_FORCE_INLINE int getShapeTypeSize(int shapeType)
default: default:
btAssert(0); btAssert(0);
//unsupported shapetype, please add here //unsupported shapetype, please add here
break; return 0;
} }
} }

View File

@@ -18,4 +18,5 @@ subject to the following restrictions:
btThreadSupportInterface::~btThreadSupportInterface() btThreadSupportInterface::~btThreadSupportInterface()
{ {
} }

View File

@@ -39,4 +39,5 @@ public:
virtual void stopSPU()=0; virtual void stopSPU()=0;
}; };
#endif //THREAD_SUPPORT_INTERFACE_H #endif //THREAD_SUPPORT_INTERFACE_H

View File

@@ -70,6 +70,7 @@ public:
btPersistentManifold(void* body0,void* body1,int bla) btPersistentManifold(void* body0,void* body1,int bla)
: m_body0(body0),m_body1(body1),m_cachedPoints(0) : m_body0(body0),m_body1(body1),m_cachedPoints(0)
{ {
(void)bla;
} }
SIMD_FORCE_INLINE void* getBody0() { return m_body0;} SIMD_FORCE_INLINE void* getBody0() { return m_body0;}

View File

@@ -91,5 +91,14 @@ btUniformScalingShape.o
#### Install directories #### Install directories
INSTALL_DIR = $(ROOT)/lib/ibmsdk INSTALL_DIR = $(ROOT)/lib/ibmsdk
INSTALL_FILES = $(LIBRARY_ppu) INSTALL_FILES = $(LIBRARY_ppu)
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
include $(CELL_TOP)/make.footer IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi)
ifeq ("$(IBM_CELLSDK_VERSION)","3.0")
CELL_TOP ?= /opt/cell/sdk
include $(CELL_TOP)/buildutils/make.footer
else
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
include $(CELL_TOP)/make.footer
endif

View File

@@ -40,6 +40,14 @@ btWheelInfo.o
#### Install directories #### Install directories
INSTALL_DIR = $(ROOT)/lib/ibmsdk INSTALL_DIR = $(ROOT)/lib/ibmsdk
INSTALL_FILES = $(LIBRARY_ppu) INSTALL_FILES = $(LIBRARY_ppu)
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
include $(CELL_TOP)/make.footer IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi)
ifeq ("$(IBM_CELLSDK_VERSION)","3.0")
CELL_TOP ?= /opt/cell/sdk
include $(CELL_TOP)/buildutils/make.footer
else
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
include $(CELL_TOP)/make.footer
endif

View File

@@ -26,5 +26,14 @@ btQuickprof.o
#### Install directories #### Install directories
INSTALL_DIR = $(ROOT)/lib/ibmsdk INSTALL_DIR = $(ROOT)/lib/ibmsdk
INSTALL_FILES = $(LIBRARY_ppu) INSTALL_FILES = $(LIBRARY_ppu)
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
include $(CELL_TOP)/make.footer IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi)
ifeq ("$(IBM_CELLSDK_VERSION)","3.0")
CELL_TOP ?= /opt/cell/sdk
include $(CELL_TOP)/buildutils/make.footer
else
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
include $(CELL_TOP)/make.footer
endif

View File

@@ -1,10 +1,16 @@
#### Visit Bullet library ibmsdk dirs and build code #### Visit Bullet library ibmsdk dirs and build code
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
DIRS := \ DIRS := \
../BulletCollision/ibmsdk \ ../BulletCollision/ibmsdk \
../BulletDynamics/ibmsdk \ ../BulletDynamics/ibmsdk \
../LinearMath/ibmsdk ../LinearMath/ibmsdk
IBM_CELLSDK_VERSION := $(shell if [ -d /opt/cell ]; then echo "3.0"; fi)
include $(CELL_TOP)/make.footer ifeq ("$(IBM_CELLSDK_VERSION)","3.0")
CELL_TOP ?= /opt/cell/sdk
include $(CELL_TOP)/buildutils/make.footer
else
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
include $(CELL_TOP)/make.footer
endif