diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2017-11-05 09:25:33 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-11-05 09:25:33 +0100 |
commit | a89fa34c21103430b1d140ee04c3ae6a433d77ce (patch) | |
tree | 9ecfb36702c2044937c2063f4ef09da62bd7ca1f /thirdparty/bullet/src/Bullet3OpenCL/ParallelPrimitives/b3FillCL.h | |
parent | f7a41c1e309226bd0deb6381e71a5ce005cbe4ef (diff) | |
parent | fb4871c919571d719d27738cc4d7db496a575b57 (diff) | |
download | redot-engine-a89fa34c21103430b1d140ee04c3ae6a433d77ce.tar.gz |
Merge pull request #12641 from AndreaCatania/bullet
Bullet physics wrapper
Diffstat (limited to 'thirdparty/bullet/src/Bullet3OpenCL/ParallelPrimitives/b3FillCL.h')
-rw-r--r-- | thirdparty/bullet/src/Bullet3OpenCL/ParallelPrimitives/b3FillCL.h | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/thirdparty/bullet/src/Bullet3OpenCL/ParallelPrimitives/b3FillCL.h b/thirdparty/bullet/src/Bullet3OpenCL/ParallelPrimitives/b3FillCL.h new file mode 100644 index 0000000000..1609676b9d --- /dev/null +++ b/thirdparty/bullet/src/Bullet3OpenCL/ParallelPrimitives/b3FillCL.h @@ -0,0 +1,63 @@ +#ifndef B3_FILL_CL_H +#define B3_FILL_CL_H + +#include "b3OpenCLArray.h" +#include "Bullet3Common/b3Scalar.h" + +#include "Bullet3Common/shared/b3Int2.h" +#include "Bullet3Common/shared/b3Int4.h" + + +class b3FillCL +{ + + cl_command_queue m_commandQueue; + + cl_kernel m_fillKernelInt2; + cl_kernel m_fillIntKernel; + cl_kernel m_fillUnsignedIntKernel; + cl_kernel m_fillFloatKernel; + + public: + + struct b3ConstData + { + union + { + b3Int4 m_data; + b3UnsignedInt4 m_UnsignedData; + }; + int m_offset; + int m_n; + int m_padding[2]; + }; + +protected: + +public: + + b3FillCL(cl_context ctx, cl_device_id device, cl_command_queue queue); + + virtual ~b3FillCL(); + + void execute(b3OpenCLArray<unsigned int>& src, const unsigned int value, int n, int offset = 0); + + void execute(b3OpenCLArray<int>& src, const int value, int n, int offset = 0); + + void execute(b3OpenCLArray<float>& src, const float value, int n, int offset = 0); + + void execute(b3OpenCLArray<b3Int2>& src, const b3Int2& value, int n, int offset = 0); + + void executeHost(b3AlignedObjectArray<b3Int2> &src, const b3Int2 &value, int n, int offset); + + void executeHost(b3AlignedObjectArray<int> &src, const int value, int n, int offset); + + // void execute(b3OpenCLArray<b3Int4>& src, const b3Int4& value, int n, int offset = 0); + +}; + + + + + +#endif //B3_FILL_CL_H |