mirror of
https://github.com/bulletphysics/bullet3
synced 2025-01-11 18:00:06 +00:00
a few modifications to BulletMultiThreaded, add 'setNumTasks' to interface, reorganize DMA transfers to allow larger btBroadphaseProxy size
This commit is contained in:
parent
512c0f167e
commit
b6f0434832
@ -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);
|
||||
}
|
||||
|
@ -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
|
||||
|
@ -213,4 +213,3 @@ void SpuGatheringCollisionDispatcher::dispatchAllCollisionPairs(btOverlappingPai
|
||||
btCollisionDispatcher::dispatchAllCollisionPairs(pairCache,dispatchInfo,dispatcher);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user