From a06ee28aa650b8d0bf4f82175e30003c668e7968 Mon Sep 17 00:00:00 2001 From: "erwin.coumans" Date: Wed, 30 Nov 2011 18:44:00 +0000 Subject: [PATCH] fix OpenCL kernel --- .../GpuSoftBodySolvers/OpenCL/OpenCLC10/PrepareLinks.cl | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/OpenCLC10/PrepareLinks.cl b/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/OpenCLC10/PrepareLinks.cl index ba3277667..72d46ccce 100644 --- a/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/OpenCLC10/PrepareLinks.cl +++ b/src/BulletMultiThreaded/GpuSoftBodySolvers/OpenCL/OpenCLC10/PrepareLinks.cl @@ -1,9 +1,5 @@ MSTRINGIFY( -float dot3(float4 a, float4 b) -{ - return a.x*b.x + a.y*b.y + a.z*b.z; -} __kernel void @@ -29,8 +25,9 @@ PrepareLinksKernel( float massLSC = g_linksMassLSC[linkID]; float4 linkCurrentLength = nodePreviousPosition1 - nodePreviousPosition0; + linkCurrentLength.w = 0.f; - float linkLengthRatio = dot3(linkCurrentLength, linkCurrentLength)*massLSC; + float linkLengthRatio = dot(linkCurrentLength, linkCurrentLength)*massLSC; linkLengthRatio = 1.0f/linkLengthRatio; g_linksCurrentLength[linkID] = linkCurrentLength;