Imported Upstream version 2.81
[platform/upstream/libbullet.git] / src / BulletMultiThreaded / GpuSoftBodySolvers / OpenCL / OpenCLC10 / UpdateFixedVertexPositions.cl
1 MSTRINGIFY(\r
2         \r
3 __kernel void \r
4 UpdateFixedVertexPositions(\r
5         const uint numNodes,\r
6         __global int * g_anchorIndex,\r
7         __global float4 * g_vertexPositions,\r
8         __global float4 * g_anchorPositions GUID_ARG)\r
9 {\r
10         unsigned int nodeID = get_global_id(0);\r
11 \r
12         if( nodeID < numNodes )\r
13         {               \r
14                 int anchorIndex  = g_anchorIndex[nodeID];\r
15                 float4 position = g_vertexPositions[nodeID];\r
16 \r
17                 if ( anchorIndex >= 0 )\r
18                 {\r
19                         float4 anchorPosition = g_anchorPositions[anchorIndex];\r
20                         g_vertexPositions[nodeID] = anchorPosition;\r
21                 }\r
22         }               \r
23 }\r
24 \r
25 );\r