Added support for IBM CELL SDK (Playstation 3 Linux, CellBlade) SPU Libspe2 compilation/linking. It runs but gives a bus-error, so some DMA alignment issue is still there.

This is interesting, because the same code runs fine on Playstation 3 with the Game SDK.
This commit is contained in:
ejcoumans
2007-10-15 01:07:49 +00:00
parent ffcdb0f93d
commit 31f1ba8e47
2 changed files with 40 additions and 8 deletions

View File

@@ -43,10 +43,20 @@ subject to the following restrictions:
#ifdef USE_PARALLEL_DISPATCHER
#include "../../Extras/BulletMultiThreaded/SpuGatheringCollisionDispatcher.h"
#ifdef WIN32
#include "../../Extras/BulletMultiThreaded/Win32ThreadSupport.h"
#include "../../Extras/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.h"
#endif //WIN32
#ifdef USE_LIBSPE2
#include "../../Extras/BulletMultiThreaded/SpuLibspe2Support.h"
#endif //USE_LIBSPE2
#ifdef USE_PARALLEL_SOLVER
#include "../../Extras/BulletMultiThreaded/SpuParallelSolver.h"
#include "../../Extras/BulletMultiThreaded/SpuSolverTask/SpuParallellSolverTask.h"
#endif //USE_PARALLEL_SOLVER
#endif//USE_PARALLEL_DISPATCHER
@@ -369,20 +379,39 @@ void CcdPhysicsDemo::initPhysics()
btDefaultCollisionConfiguration* collisionConfiguration = new btDefaultCollisionConfiguration();
#ifdef USE_PARALLEL_DISPATCHER
int maxNumOutstandingTasks = 4;
#ifdef USE_WIN32_THREADING
int maxNumOutstandingTasks = 4;//number of maximum outstanding tasks
Win32ThreadSupport* threadSupportCollision = new Win32ThreadSupport(Win32ThreadSupport::Win32ThreadConstructionInfo(
"collision",
processCollisionTask,
createCollisionLocalStoreMemory,
maxNumOutstandingTasks));
#else
///todo other platform threading
#ifdef USE_LIBSPE2
spe_program_handle_t * program_handle;
#ifndef USE_CESOF
program_handle = spe_image_open ("./spuCollision.elf");
if (program_handle == NULL)
{
perror( "SPU OPEN IMAGE ERROR\n");
}
else
{
printf( "IMAGE OPENED\n");
}
#else
extern spe_program_handle_t spu_program;
program_handle = &spu_program;
#endif
SpuLibspe2Support* threadSupportCollision = new SpuLibspe2Support( program_handle, maxNumOutstandingTasks);
#endif //USE_LIBSPE2
///Playstation 3 SPU (SPURS) version is available through PS3 Devnet
///Libspe2 SPU support will be available soon
///pthreads version
/// For Unix/Mac someone could implement a pthreads version of btThreadSupportInterface?
///you can hook it up to your custom task scheduler by deriving from btThreadSupportInterface
#endif

View File

@@ -26,17 +26,21 @@ PROGRAM_ppu := CcdPhysicsDemo
######################################################################
OBJS = CcdPhysicsDemo.o
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
########################################################################
# Libraries, Include paths, Defines
########################################################################
INCLUDE = \
INCLUDE = -DUSE_LIBSPE2 \
-I$(CELL_TOP)/sysroot/usr/include \
-I../ \
-I$(ROOT)/src \
-I$(ROOT)/Demos/OpenGL \
-I$(HOSTINC)
SYS_LIBS := -lglut -lGLU -lGL -lm -lXext -lXmu -lX11
SYS_LIBS := -lspe2 -lglut -lGLU -lGL -lm -lXext -lXmu -lX11
IMPORTS = $(ROOT)/lib/ibmsdk/bulletopenglsupport.a \
IMPORTS = $(ROOT)/lib/ibmsdk/bulletmultithreaded.a \
$(ROOT)/lib/ibmsdk/bulletopenglsupport.a \
$(ROOT)/lib/ibmsdk/bulletdynamics.a \
$(ROOT)/lib/ibmsdk/bulletcollision.a \
$(ROOT)/lib/ibmsdk/bulletmath.a
@@ -50,7 +54,6 @@ INSTALL_FILES = $(PROGRAM_ppu)
# make.footer
########################################################################
CELL_TOP ?= /opt/ibm/cell-sdk/prototype
include $(CELL_TOP)/make.footer