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

« back to all changes in this revision

Viewing changes to tests/bullet/src/BulletMultiThreaded/GpuSoftBodySolvers/DX11/HLSL/UpdatePositionsFromVelocities.hlsl

  • 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
cbuffer UpdatePositionsFromVelocitiesCB : register( b0 )
 
4
{
 
5
        int numNodes;
 
6
        float solverSDT;
 
7
        int padding1;
 
8
        int padding2;
 
9
};
 
10
 
 
11
 
 
12
StructuredBuffer<float4> g_vertexVelocities : register( t0 );
 
13
 
 
14
RWStructuredBuffer<float4> g_vertexPreviousPositions : register( u0 );
 
15
RWStructuredBuffer<float4> g_vertexCurrentPosition : register( u1 );
 
16
 
 
17
 
 
18
[numthreads(128, 1, 1)]
 
19
void 
 
20
UpdatePositionsFromVelocitiesKernel( uint3 Gid : SV_GroupID, uint3 DTid : SV_DispatchThreadID, uint3 GTid : SV_GroupThreadID, uint GI : SV_GroupIndex )
 
21
{
 
22
        int vertexID = DTid.x;
 
23
        if( vertexID < numNodes )
 
24
        {       
 
25
                float3 previousPosition = g_vertexPreviousPositions[vertexID].xyz;
 
26
                float3 velocity = g_vertexVelocities[vertexID].xyz;
 
27
                
 
28
                float3 newPosition = previousPosition + velocity*solverSDT;
 
29
                
 
30
                g_vertexCurrentPosition[vertexID] = float4(newPosition, 0.f);
 
31
                g_vertexPreviousPositions[vertexID] = float4(newPosition, 0.f);
 
32
        }
 
33
}
 
34
 
 
35
);
 
 
b'\\ No newline at end of file'