diff options
author | Oussama <o.boukhelf@gmail.com> | 2019-01-03 14:26:51 +0100 |
---|---|---|
committer | RĂ©mi Verschelde <rverschelde@gmail.com> | 2019-01-07 12:30:35 +0100 |
commit | 22b7c9dfa80d0f7abca40f061865c2ab3c136a74 (patch) | |
tree | 311cd3f22b012329160f9d43810aea429994af48 /thirdparty/bullet/Bullet3OpenCL/BroadphaseCollision/b3GpuGridBroadphase.h | |
parent | a6722cf36251ddcb538e6ebed9fa4950342b68ba (diff) |
Update Bullet to the latest commit 126b676
Diffstat (limited to 'thirdparty/bullet/Bullet3OpenCL/BroadphaseCollision/b3GpuGridBroadphase.h')
-rw-r--r-- | thirdparty/bullet/Bullet3OpenCL/BroadphaseCollision/b3GpuGridBroadphase.h | 68 |
1 files changed, 30 insertions, 38 deletions
diff --git a/thirdparty/bullet/Bullet3OpenCL/BroadphaseCollision/b3GpuGridBroadphase.h b/thirdparty/bullet/Bullet3OpenCL/BroadphaseCollision/b3GpuGridBroadphase.h index ec18c9f716..b76cb43b68 100644 --- a/thirdparty/bullet/Bullet3OpenCL/BroadphaseCollision/b3GpuGridBroadphase.h +++ b/thirdparty/bullet/Bullet3OpenCL/BroadphaseCollision/b3GpuGridBroadphase.h @@ -6,83 +6,75 @@ struct b3ParamsGridBroadphaseCL { - float m_invCellSize[4]; - int m_gridSize[4]; + int m_gridSize[4]; - int getMaxBodiesPerCell() const + int getMaxBodiesPerCell() const { return m_gridSize[3]; } - void setMaxBodiesPerCell(int maxOverlap) + void setMaxBodiesPerCell(int maxOverlap) { m_gridSize[3] = maxOverlap; } }; - class b3GpuGridBroadphase : public b3GpuBroadphaseInterface { protected: - cl_context m_context; - cl_device_id m_device; - cl_command_queue m_queue; + cl_context m_context; + cl_device_id m_device; + cl_command_queue m_queue; - b3OpenCLArray<b3SapAabb> m_allAabbsGPU1; - b3AlignedObjectArray<b3SapAabb> m_allAabbsCPU1; + b3OpenCLArray<b3SapAabb> m_allAabbsGPU1; + b3AlignedObjectArray<b3SapAabb> m_allAabbsCPU1; - b3OpenCLArray<int> m_smallAabbsMappingGPU; + b3OpenCLArray<int> m_smallAabbsMappingGPU; b3AlignedObjectArray<int> m_smallAabbsMappingCPU; - b3OpenCLArray<int> m_largeAabbsMappingGPU; + b3OpenCLArray<int> m_largeAabbsMappingGPU; b3AlignedObjectArray<int> m_largeAabbsMappingCPU; b3AlignedObjectArray<b3Int4> m_hostPairs; - b3OpenCLArray<b3Int4> m_gpuPairs; + b3OpenCLArray<b3Int4> m_gpuPairs; - b3OpenCLArray<b3SortData> m_hashGpu; - b3OpenCLArray<int> m_cellStartGpu; - + b3OpenCLArray<b3SortData> m_hashGpu; + b3OpenCLArray<int> m_cellStartGpu; - b3ParamsGridBroadphaseCL m_paramsCPU; - b3OpenCLArray<b3ParamsGridBroadphaseCL> m_paramsGPU; + b3ParamsGridBroadphaseCL m_paramsCPU; + b3OpenCLArray<b3ParamsGridBroadphaseCL> m_paramsGPU; - class b3RadixSort32CL* m_sorter; + class b3RadixSort32CL* m_sorter; public: - - b3GpuGridBroadphase(cl_context ctx,cl_device_id device, cl_command_queue q ); + b3GpuGridBroadphase(cl_context ctx, cl_device_id device, cl_command_queue q); virtual ~b3GpuGridBroadphase(); - static b3GpuBroadphaseInterface* CreateFunc(cl_context ctx,cl_device_id device, cl_command_queue q) + static b3GpuBroadphaseInterface* CreateFunc(cl_context ctx, cl_device_id device, cl_command_queue q) { - return new b3GpuGridBroadphase(ctx,device,q); + return new b3GpuGridBroadphase(ctx, device, q); } - - + virtual void createProxy(const b3Vector3& aabbMin, const b3Vector3& aabbMax, int userPtr, int collisionFilterGroup, int collisionFilterMask); + virtual void createLargeProxy(const b3Vector3& aabbMin, const b3Vector3& aabbMax, int userPtr, int collisionFilterGroup, int collisionFilterMask); - virtual void createProxy(const b3Vector3& aabbMin, const b3Vector3& aabbMax, int userPtr , int collisionFilterGroup, int collisionFilterMask); - virtual void createLargeProxy(const b3Vector3& aabbMin, const b3Vector3& aabbMax, int userPtr , int collisionFilterGroup, int collisionFilterMask); - - virtual void calculateOverlappingPairs(int maxPairs); - virtual void calculateOverlappingPairsHost(int maxPairs); + virtual void calculateOverlappingPairs(int maxPairs); + virtual void calculateOverlappingPairsHost(int maxPairs); //call writeAabbsToGpu after done making all changes (createProxy etc) virtual void writeAabbsToGpu(); - virtual cl_mem getAabbBufferWS(); - virtual int getNumOverlap(); - virtual cl_mem getOverlappingPairBuffer(); + virtual cl_mem getAabbBufferWS(); + virtual int getNumOverlap(); + virtual cl_mem getOverlappingPairBuffer(); + + virtual b3OpenCLArray<b3SapAabb>& getAllAabbsGPU(); + virtual b3AlignedObjectArray<b3SapAabb>& getAllAabbsCPU(); - virtual b3OpenCLArray<b3SapAabb>& getAllAabbsGPU(); - virtual b3AlignedObjectArray<b3SapAabb>& getAllAabbsCPU(); - virtual b3OpenCLArray<b3Int4>& getOverlappingPairsGPU(); virtual b3OpenCLArray<int>& getSmallAabbIndicesGPU(); virtual b3OpenCLArray<int>& getLargeAabbIndicesGPU(); - }; -#endif //B3_GPU_GRID_BROADPHASE_H
\ No newline at end of file +#endif //B3_GPU_GRID_BROADPHASE_H
\ No newline at end of file |