[dali_2.3.21] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-physics / third-party / bullet3 / src / Bullet3OpenCL / ParallelPrimitives / b3FillCL.h
1 #ifndef B3_FILL_CL_H
2 #define B3_FILL_CL_H
3
4 #include "b3OpenCLArray.h"
5 #include "Bullet3Common/b3Scalar.h"
6
7 #include "Bullet3Common/shared/b3Int2.h"
8 #include "Bullet3Common/shared/b3Int4.h"
9
10 class b3FillCL
11 {
12         cl_command_queue m_commandQueue;
13
14         cl_kernel m_fillKernelInt2;
15         cl_kernel m_fillIntKernel;
16         cl_kernel m_fillUnsignedIntKernel;
17         cl_kernel m_fillFloatKernel;
18
19 public:
20         struct b3ConstData
21         {
22                 union {
23                         b3Int4 m_data;
24                         b3UnsignedInt4 m_UnsignedData;
25                 };
26                 int m_offset;
27                 int m_n;
28                 int m_padding[2];
29         };
30
31 protected:
32 public:
33         b3FillCL(cl_context ctx, cl_device_id device, cl_command_queue queue);
34
35         virtual ~b3FillCL();
36
37         void execute(b3OpenCLArray<unsigned int>& src, const unsigned int value, int n, int offset = 0);
38
39         void execute(b3OpenCLArray<int>& src, const int value, int n, int offset = 0);
40
41         void execute(b3OpenCLArray<float>& src, const float value, int n, int offset = 0);
42
43         void execute(b3OpenCLArray<b3Int2>& src, const b3Int2& value, int n, int offset = 0);
44
45         void executeHost(b3AlignedObjectArray<b3Int2>& src, const b3Int2& value, int n, int offset);
46
47         void executeHost(b3AlignedObjectArray<int>& src, const int value, int n, int offset);
48
49         //      void execute(b3OpenCLArray<b3Int4>& src, const b3Int4& value, int n, int offset = 0);
50 };
51
52 #endif  //B3_FILL_CL_H