~ubuntu-branches/ubuntu/vivid/emscripten/vivid

« back to all changes in this revision

Viewing changes to tests/bullet/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/OpenCLC10/UpdatePositionsFromVelocities.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
 
 
2
MSTRINGIFY(
 
3
 
 
4
 
 
5
 
 
6
 
 
7
__kernel void 
 
8
UpdatePositionsFromVelocitiesKernel( 
 
9
        const int numNodes,
 
10
        const float solverSDT,
 
11
        __global float4 * g_vertexVelocities,
 
12
        __global float4 * g_vertexPreviousPositions,
 
13
        __global float4 * g_vertexCurrentPosition GUID_ARG)
 
14
{
 
15
        int vertexID = get_global_id(0);
 
16
        if( vertexID < numNodes )
 
17
        {       
 
18
                float4 previousPosition = g_vertexPreviousPositions[vertexID];
 
19
                float4 velocity         = g_vertexVelocities[vertexID];
 
20
                
 
21
                float4 newPosition      = previousPosition + velocity*solverSDT;
 
22
                
 
23
                g_vertexCurrentPosition[vertexID]   = newPosition;
 
24
                g_vertexPreviousPositions[vertexID] = newPosition;
 
25
        }
 
26
}
 
27
 
 
28
);
 
 
b'\\ No newline at end of file'