| PathEngine home | previous: | next: |
The Cell processor is treated as a GCC based build platform in terms of the supplied build scripts,
so refer to
Two platform codes are used when building for the Cell processor,
with 'Cell' designating a PPU build target and 'CellSPU' designating an SPU build target.
There is no 'CellSPU' platform specific archive, however, with all the relevant files included
in the 'Cell' archive.
To build on the PPU just follow the standard GCC build instructions with the PATHENGINE_PLATFORM environment variable set to 'Cell'.
Note that the supplied configuration assumes straightforward gcc command lines, so these will in many cases need to be changed to match your build environment (by editing the relevant strings in 'SDKRoot/code/buildScripts/PlatformConfig.py').
Note that shared object linkage is not supported on the Cell platform, so static linkage will need to be used.
PathEngine includes the following SPU specific components:
The key component here is the 'CollisionCore' library.
This is an agressively optimised version of PathEngine's pathfinding agent line collision test data structures and code paths,
which make it possible to load an independant PathEngine 'collision core' into SPU local store for some
fairly large meshes (e.g. for our 'Thainesford' benchmark mesh),
and to then perform completely asynchronous dispatch of the core line test query.
The 'CollisionCoreDispatch' exe takes care of mailbox communication with the PPU, and DMAing in the relevant data structures.
The process for building the SPU components is essentially the same standard GCC based build process, but with the PATHENGINE_PLATFORM environment variable set, in this case, to 'CellSPU', and with "python Make.py CollisionCoreDispatch" used instead place of "python Make.py PathEngine".
This will then build both the 'CollisionCore' static library and the 'CollisionCoreDispatch' exe.
The SPU collision core is designed for extremely minimal linkage with the main SDK.
The required data structures are compiled into a single binary data chunk, which can be built by calling into the main SDK, and then DMAed over onto the SPU.
Queries are then posted to the SPU, and results returned, via SPU mailbox.
A working example of these processes is provided in 'SDKRoot/LinkageExamples/DispatchToSPU',
which demonstrates how to call into the main SDK to obtain a collision core data chunk corresponding to the preprocess for a given mesh and shape combination,
and also how to then query the collision core on the SPU through the mailbox.
The example also demonstrates batched query execution, and provides timing comparisons for various query scenarios.
To build the example, setup environmental variables as for the PPU,
change directory to 'SDKRoot/LinkageExamples/DispatchToSPU', and then
run "python Build.py".
This should generate a file 'DispatchToSPU.exe' which can then be run from the same directory.
Note that the example is based on a linux run-time environment with libspe2,
but this is just used for SPU code loading and mailbox communications and it should be straightforward to
adapt the relevant code to other run-time environments.
| Documentation for PathEngine release 5.16 - Copyright © 2002-2008 PathEngine | next: |