fix OpenCL kernel
This commit is contained in:
@@ -1,9 +1,5 @@
|
|||||||
MSTRINGIFY(
|
MSTRINGIFY(
|
||||||
|
|
||||||
float dot3(float4 a, float4 b)
|
|
||||||
{
|
|
||||||
return a.x*b.x + a.y*b.y + a.z*b.z;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
__kernel void
|
__kernel void
|
||||||
@@ -29,8 +25,9 @@ PrepareLinksKernel(
|
|||||||
float massLSC = g_linksMassLSC[linkID];
|
float massLSC = g_linksMassLSC[linkID];
|
||||||
|
|
||||||
float4 linkCurrentLength = nodePreviousPosition1 - nodePreviousPosition0;
|
float4 linkCurrentLength = nodePreviousPosition1 - nodePreviousPosition0;
|
||||||
|
linkCurrentLength.w = 0.f;
|
||||||
|
|
||||||
float linkLengthRatio = dot3(linkCurrentLength, linkCurrentLength)*massLSC;
|
float linkLengthRatio = dot(linkCurrentLength, linkCurrentLength)*massLSC;
|
||||||
linkLengthRatio = 1.0f/linkLengthRatio;
|
linkLengthRatio = 1.0f/linkLengthRatio;
|
||||||
|
|
||||||
g_linksCurrentLength[linkID] = linkCurrentLength;
|
g_linksCurrentLength[linkID] = linkCurrentLength;
|
||||||
|
|||||||
Reference in New Issue
Block a user