diff --git a/src/BulletMultiThreaded/SequentialThreadSupport.cpp b/src/BulletMultiThreaded/SequentialThreadSupport.cpp index 32447299e..986a75101 100644 --- a/src/BulletMultiThreaded/SequentialThreadSupport.cpp +++ b/src/BulletMultiThreaded/SequentialThreadSupport.cpp @@ -87,3 +87,7 @@ void SequentialThreadSupport::stopSPU() m_activeSpuStatus.clear(); } +void SequentialThreadSupport::setNumTasks(int numTasks) +{ + printf("SequentialThreadSupport::setNumTasks(%d) is not implemented and has no effect\n",numTasks); +} diff --git a/src/BulletMultiThreaded/SequentialThreadSupport.h b/src/BulletMultiThreaded/SequentialThreadSupport.h index cb8f48f1f..9ad606789 100644 --- a/src/BulletMultiThreaded/SequentialThreadSupport.h +++ b/src/BulletMultiThreaded/SequentialThreadSupport.h @@ -78,6 +78,8 @@ public: ///tell the task scheduler we are done with the SPU tasks virtual void stopSPU(); + virtual void setNumTasks(int numTasks); + }; #endif //SEQUENTIAL_THREAD_SUPPORT_H diff --git a/src/BulletMultiThreaded/SpuGatheringCollisionDispatcher.cpp b/src/BulletMultiThreaded/SpuGatheringCollisionDispatcher.cpp index 9f6a14363..2cec7ea7d 100644 --- a/src/BulletMultiThreaded/SpuGatheringCollisionDispatcher.cpp +++ b/src/BulletMultiThreaded/SpuGatheringCollisionDispatcher.cpp @@ -213,4 +213,3 @@ void SpuGatheringCollisionDispatcher::dispatchAllCollisionPairs(btOverlappingPai btCollisionDispatcher::dispatchAllCollisionPairs(pairCache,dispatchInfo,dispatcher); } } - diff --git a/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp b/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp index c6e211677..911262bd8 100644 --- a/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp +++ b/src/BulletMultiThreaded/SpuNarrowPhaseCollisionTask/SpuGatheringCollisionTask.cpp @@ -50,7 +50,7 @@ #define SPE_CACHELINE_SIZE 128 #define SPE_CACHE_SET_TAGID(set) 15 ///make sure that spe_cache.h is below those defines! -#include "spe_cache.h" +#include "software_cache/cache/include/spe_cache.h" int g_CacheMisses=0; @@ -101,8 +101,8 @@ bool gUseEpa = false; ///Make sure no destructors are called on this memory struct CollisionTask_LocalStoreMemory { - ATTRIBUTE_ALIGNED16(char bufferProxy0[16]); - ATTRIBUTE_ALIGNED16(char bufferProxy1[16]); + ATTRIBUTE_ALIGNED16(char bufferProxy0[sizeof(btBroadphaseProxy)+16]); + ATTRIBUTE_ALIGNED16(char bufferProxy1[sizeof(btBroadphaseProxy)+16]); ATTRIBUTE_ALIGNED16(btBroadphaseProxy* gProxyPtr0); ATTRIBUTE_ALIGNED16(btBroadphaseProxy* gProxyPtr1); @@ -901,18 +901,9 @@ void processCollisionTask(void* userPtr, void* lsMemPtr) if (userInfo == 2 && pair.m_algorithm && pair.m_pProxy0 && pair.m_pProxy1) { - - - - dmaSize = sizeof(SpuContactManifoldCollisionAlgorithm); - - dmaPpuAddress2 = (ppu_address_t)pair.m_algorithm; - - cellDmaGet(&lsMem.gSpuContactManifoldAlgo, dmaPpuAddress2 , dmaSize, DMA_TAG(1), 0, 0); - //cellDmaWaitTagStatusAll(DMA_MASK(1)); - - - + dmaSize = sizeof(SpuContactManifoldCollisionAlgorithm); + dmaPpuAddress2 = (ppu_address_t)pair.m_algorithm; + cellDmaGet(&lsMem.gSpuContactManifoldAlgo, dmaPpuAddress2 , dmaSize, DMA_TAG(1), 0, 0); //snPause(); @@ -922,27 +913,21 @@ void processCollisionTask(void* userPtr, void* lsMemPtr) dmaSize = sizeof(btBroadphaseProxy); - dmaPpuAddress2 = (ppu_address_t)pair.m_pProxy0; + //stallingUnalignedDmaSmallGet(lsMem.gProxyPtr0, dmaPpuAddress2 , dmaSize); + void* tmpPtr = cellDmaSmallGetReadOnly(&lsMem.bufferProxy0, dmaPpuAddress2 , dmaSize,DMA_TAG(1), 0, 0); + lsMem.gProxyPtr0 = (btBroadphaseProxy*) tmpPtr; - lsMem.gProxyPtr0 = (btBroadphaseProxy*) lsMem.bufferProxy0; - stallingUnalignedDmaSmallGet(lsMem.gProxyPtr0, dmaPpuAddress2 , dmaSize); + dmaSize = sizeof(btBroadphaseProxy); + dmaPpuAddress2 = (ppu_address_t)pair.m_pProxy1; + tmpPtr = cellDmaSmallGetReadOnly(&lsMem.bufferProxy1, dmaPpuAddress2 , dmaSize,DMA_TAG(1), 0, 0); + + lsMem.gProxyPtr1 = (btBroadphaseProxy*)tmpPtr; + + cellDmaWaitTagStatusAll(DMA_MASK(1)); collisionPairInput.m_persistentManifoldPtr = (ppu_address_t) lsMem.gSpuContactManifoldAlgo.getContactManifoldPtr(); collisionPairInput.m_isSwapped = false; - - - dmaSize = sizeof(btBroadphaseProxy); - - dmaPpuAddress2 = (ppu_address_t)pair.m_pProxy1; - - lsMem.gProxyPtr1 = (btBroadphaseProxy*) lsMem.bufferProxy1; - stallingUnalignedDmaSmallGet(lsMem.gProxyPtr1, dmaPpuAddress2 , dmaSize); - - - //btCollisionObject* colObj0 = (btCollisionObject*)gProxy0.m_clientObject; - //btCollisionObject* colObj1 = (btCollisionObject*)gProxy1.m_clientObject; - if (1) { @@ -968,7 +953,7 @@ void processCollisionTask(void* userPtr, void* lsMemPtr) - cellDmaWaitTagStatusAll(DMA_MASK(1)); + //??cellDmaWaitTagStatusAll(DMA_MASK(1)); if (1) diff --git a/src/BulletMultiThreaded/btThreadSupportInterface.h b/src/BulletMultiThreaded/btThreadSupportInterface.h index 5d4a0162d..11ed1d8a0 100644 --- a/src/BulletMultiThreaded/btThreadSupportInterface.h +++ b/src/BulletMultiThreaded/btThreadSupportInterface.h @@ -37,6 +37,10 @@ public: ///tell the task scheduler we are done with the SPU tasks virtual void stopSPU()=0; + + ///tell the task scheduler to use no more than numTasks tasks + virtual void setNumTasks(int numTasks)=0; + }; #endif //THREAD_SUPPORT_INTERFACE_H