~ubuntu-branches/ubuntu/saucy/emscripten/saucy-proposed

« back to all changes in this revision

Viewing changes to tests/bullet/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/OpenCLC10/Integrate.cl

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2013-05-02 13:11:51 UTC
  • Revision ID: package-import@ubuntu.com-20130502131151-q8dvteqr1ef2x7xz
Tags: upstream-1.4.1~20130504~adb56cb
ImportĀ upstreamĀ versionĀ 1.4.1~20130504~adb56cb

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
MSTRINGIFY(
 
2
 
 
3
// Node indices for each link
 
4
 
 
5
 
 
6
 
 
7
__kernel void
 
8
IntegrateKernel( 
 
9
        const int numNodes,
 
10
        const float solverdt,
 
11
        __global float * g_vertexInverseMasses,
 
12
        __global float4 * g_vertexPositions,
 
13
        __global float4 * g_vertexVelocity,
 
14
        __global float4 * g_vertexPreviousPositions,
 
15
        __global float4 * g_vertexForceAccumulator GUID_ARG)
 
16
{
 
17
        int nodeID = get_global_id(0);
 
18
        if( nodeID < numNodes )
 
19
        {       
 
20
                float4 position   = g_vertexPositions[nodeID];
 
21
                float4 velocity   = g_vertexVelocity[nodeID];
 
22
                float4 force      = g_vertexForceAccumulator[nodeID];
 
23
                float inverseMass = g_vertexInverseMasses[nodeID];
 
24
                
 
25
                g_vertexPreviousPositions[nodeID] = position;
 
26
                velocity += force * inverseMass * solverdt;
 
27
                position += velocity * solverdt;
 
28
                
 
29
                g_vertexForceAccumulator[nodeID] = (float4)(0.f, 0.f, 0.f, 0.0f);
 
30
                g_vertexPositions[nodeID]        = position;
 
31
                g_vertexVelocity[nodeID]         = velocity;    
 
32
        }
 
33
}
 
34
 
 
35
);
 
 
b'\\ No newline at end of file'