mirror of
https://github.com/bulletphysics/bullet3
synced 2024-12-13 21:30:09 +00:00
The 'static' storage-class specifier is not supported in OpenCL.
This is documented in Section 6.8 (g) in OpenCL 1.1 specification.
This commit is contained in:
parent
51970941b4
commit
ad6fb3afc1
@ -21,6 +21,7 @@
|
||||
#ifndef B3_MPR_PENETRATION_H
|
||||
#define B3_MPR_PENETRATION_H
|
||||
|
||||
#include "Bullet3Common/shared/b3PlatformDefinitions.h"
|
||||
#include "Bullet3Common/shared/b3Float4.h"
|
||||
#include "Bullet3Collision/NarrowPhaseCollision/shared/b3RigidBodyData.h"
|
||||
#include "Bullet3Collision/NarrowPhaseCollision/shared/b3ConvexPolyhedronData.h"
|
||||
@ -151,7 +152,7 @@ inline b3Float4 b3LocalGetSupportVertex(b3Float4ConstArg supportVec,__global con
|
||||
}
|
||||
|
||||
|
||||
static void b3MprConvexSupport(int pairIndex,int bodyIndex, b3ConstArray(b3RigidBodyData_t) cpuBodyBuf,
|
||||
B3_STATIC void b3MprConvexSupport(int pairIndex,int bodyIndex, b3ConstArray(b3RigidBodyData_t) cpuBodyBuf,
|
||||
b3ConstArray(b3ConvexPolyhedronData_t) cpuConvexData,
|
||||
b3ConstArray(b3Collidable_t) cpuCollidables,
|
||||
b3ConstArray(b3Float4) cpuVertices,
|
||||
@ -370,7 +371,7 @@ inline void b3ExpandPortal(b3MprSimplex_t *portal,
|
||||
|
||||
|
||||
|
||||
static int b3DiscoverPortal(int pairIndex, int bodyIndexA, int bodyIndexB, b3ConstArray(b3RigidBodyData_t) cpuBodyBuf,
|
||||
B3_STATIC int b3DiscoverPortal(int pairIndex, int bodyIndexA, int bodyIndexB, b3ConstArray(b3RigidBodyData_t) cpuBodyBuf,
|
||||
b3ConstArray(b3ConvexPolyhedronData_t) cpuConvexData,
|
||||
b3ConstArray(b3Collidable_t) cpuCollidables,
|
||||
b3ConstArray(b3Float4) cpuVertices,
|
||||
@ -505,7 +506,7 @@ static int b3DiscoverPortal(int pairIndex, int bodyIndexA, int bodyIndexB, b3Co
|
||||
}
|
||||
|
||||
|
||||
static int b3RefinePortal(int pairIndex,int bodyIndexA, int bodyIndexB, b3ConstArray(b3RigidBodyData_t) cpuBodyBuf,
|
||||
B3_STATIC int b3RefinePortal(int pairIndex,int bodyIndexA, int bodyIndexB, b3ConstArray(b3RigidBodyData_t) cpuBodyBuf,
|
||||
b3ConstArray(b3ConvexPolyhedronData_t) cpuConvexData,
|
||||
b3ConstArray(b3Collidable_t) cpuCollidables,
|
||||
b3ConstArray(b3Float4) cpuVertices,
|
||||
@ -547,7 +548,7 @@ static int b3RefinePortal(int pairIndex,int bodyIndexA, int bodyIndexB, b3Const
|
||||
return -1;
|
||||
}
|
||||
|
||||
static void b3FindPos(const b3MprSimplex_t *portal, b3Float4 *pos)
|
||||
B3_STATIC void b3FindPos(const b3MprSimplex_t *portal, b3Float4 *pos)
|
||||
{
|
||||
|
||||
b3Float4 zero = b3MakeFloat4(0,0,0,0);
|
||||
@ -758,7 +759,7 @@ inline float b3MprVec3PointTriDist2(const b3Float4 *P,
|
||||
}
|
||||
|
||||
|
||||
static void b3FindPenetr(int pairIndex,int bodyIndexA, int bodyIndexB, b3ConstArray(b3RigidBodyData_t) cpuBodyBuf,
|
||||
B3_STATIC void b3FindPenetr(int pairIndex,int bodyIndexA, int bodyIndexB, b3ConstArray(b3RigidBodyData_t) cpuBodyBuf,
|
||||
b3ConstArray(b3ConvexPolyhedronData_t) cpuConvexData,
|
||||
b3ConstArray(b3Collidable_t) cpuCollidables,
|
||||
b3ConstArray(b3Float4) cpuVertices,
|
||||
@ -811,7 +812,7 @@ static void b3FindPenetr(int pairIndex,int bodyIndexA, int bodyIndexB, b3ConstA
|
||||
}
|
||||
}
|
||||
|
||||
static void b3FindPenetrTouch(b3MprSimplex_t *portal,float *depth, b3Float4 *dir, b3Float4 *pos)
|
||||
B3_STATIC void b3FindPenetrTouch(b3MprSimplex_t *portal,float *depth, b3Float4 *dir, b3Float4 *pos)
|
||||
{
|
||||
// Touching contact on portal's v1 - so depth is zero and direction
|
||||
// is unimportant and pos can be guessed
|
||||
@ -827,7 +828,7 @@ static void b3FindPenetrTouch(b3MprSimplex_t *portal,float *depth, b3Float4 *dir
|
||||
b3MprVec3Scale(pos, 0.5);
|
||||
}
|
||||
|
||||
static void b3FindPenetrSegment(b3MprSimplex_t *portal,
|
||||
B3_STATIC void b3FindPenetrSegment(b3MprSimplex_t *portal,
|
||||
float *depth, b3Float4 *dir, b3Float4 *pos)
|
||||
{
|
||||
|
||||
|
@ -20,6 +20,8 @@ inline int b3AtomicAdd (volatile int *p, int val)
|
||||
}
|
||||
|
||||
#define __global
|
||||
|
||||
#define B3_STATIC static
|
||||
#else
|
||||
//keep B3_LARGE_FLOAT*B3_LARGE_FLOAT < FLT_MAX
|
||||
#define B3_LARGE_FLOAT 1e18f
|
||||
@ -32,6 +34,8 @@ inline int b3AtomicAdd (volatile int *p, int val)
|
||||
#define b3Sqrt native_sqrt
|
||||
#define b3Sin native_sin
|
||||
#define b3Cos native_cos
|
||||
|
||||
#define B3_STATIC
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
@ -17,8 +17,6 @@ static const char* mprKernelsCL= \
|
||||
" */\n"
|
||||
"#ifndef B3_MPR_PENETRATION_H\n"
|
||||
"#define B3_MPR_PENETRATION_H\n"
|
||||
"#ifndef B3_FLOAT4_H\n"
|
||||
"#define B3_FLOAT4_H\n"
|
||||
"#ifndef B3_PLATFORM_DEFINITIONS_H\n"
|
||||
"#define B3_PLATFORM_DEFINITIONS_H\n"
|
||||
"struct MyTest\n"
|
||||
@ -38,6 +36,14 @@ static const char* mprKernelsCL= \
|
||||
"#define b3Sqrt native_sqrt\n"
|
||||
"#define b3Sin native_sin\n"
|
||||
"#define b3Cos native_cos\n"
|
||||
"#define B3_STATIC\n"
|
||||
"#endif\n"
|
||||
"#endif\n"
|
||||
"#ifndef B3_FLOAT4_H\n"
|
||||
"#define B3_FLOAT4_H\n"
|
||||
"#ifndef B3_PLATFORM_DEFINITIONS_H\n"
|
||||
"#ifdef __cplusplus\n"
|
||||
"#else\n"
|
||||
"#endif\n"
|
||||
"#endif\n"
|
||||
"#ifdef __cplusplus\n"
|
||||
@ -509,7 +515,7 @@ static const char* mprKernelsCL= \
|
||||
" }\n"
|
||||
" return supVec;\n"
|
||||
"}\n"
|
||||
"static void b3MprConvexSupport(int pairIndex,int bodyIndex, b3ConstArray(b3RigidBodyData_t) cpuBodyBuf, \n"
|
||||
"B3_STATIC void b3MprConvexSupport(int pairIndex,int bodyIndex, b3ConstArray(b3RigidBodyData_t) cpuBodyBuf, \n"
|
||||
" b3ConstArray(b3ConvexPolyhedronData_t) cpuConvexData, \n"
|
||||
" b3ConstArray(b3Collidable_t) cpuCollidables,\n"
|
||||
" b3ConstArray(b3Float4) cpuVertices,\n"
|
||||
@ -682,7 +688,7 @@ static const char* mprKernelsCL= \
|
||||
" }\n"
|
||||
" }\n"
|
||||
"}\n"
|
||||
"static int b3DiscoverPortal(int pairIndex, int bodyIndexA, int bodyIndexB, b3ConstArray(b3RigidBodyData_t) cpuBodyBuf, \n"
|
||||
"B3_STATIC int b3DiscoverPortal(int pairIndex, int bodyIndexA, int bodyIndexB, b3ConstArray(b3RigidBodyData_t) cpuBodyBuf, \n"
|
||||
" b3ConstArray(b3ConvexPolyhedronData_t) cpuConvexData, \n"
|
||||
" b3ConstArray(b3Collidable_t) cpuCollidables,\n"
|
||||
" b3ConstArray(b3Float4) cpuVertices,\n"
|
||||
@ -792,7 +798,7 @@ static const char* mprKernelsCL= \
|
||||
" }\n"
|
||||
" return 0;\n"
|
||||
"}\n"
|
||||
"static int b3RefinePortal(int pairIndex,int bodyIndexA, int bodyIndexB, b3ConstArray(b3RigidBodyData_t) cpuBodyBuf, \n"
|
||||
"B3_STATIC int b3RefinePortal(int pairIndex,int bodyIndexA, int bodyIndexB, b3ConstArray(b3RigidBodyData_t) cpuBodyBuf, \n"
|
||||
" b3ConstArray(b3ConvexPolyhedronData_t) cpuConvexData, \n"
|
||||
" b3ConstArray(b3Collidable_t) cpuCollidables,\n"
|
||||
" b3ConstArray(b3Float4) cpuVertices,\n"
|
||||
@ -826,7 +832,7 @@ static const char* mprKernelsCL= \
|
||||
" }\n"
|
||||
" return -1;\n"
|
||||
"}\n"
|
||||
"static void b3FindPos(const b3MprSimplex_t *portal, b3Float4 *pos)\n"
|
||||
"B3_STATIC void b3FindPos(const b3MprSimplex_t *portal, b3Float4 *pos)\n"
|
||||
"{\n"
|
||||
" b3Float4 zero = b3MakeFloat4(0,0,0,0);\n"
|
||||
" b3Float4* b3mpr_vec3_origin = &zero;\n"
|
||||
@ -1000,7 +1006,7 @@ static const char* mprKernelsCL= \
|
||||
" }\n"
|
||||
" return dist;\n"
|
||||
"}\n"
|
||||
"static void b3FindPenetr(int pairIndex,int bodyIndexA, int bodyIndexB, b3ConstArray(b3RigidBodyData_t) cpuBodyBuf, \n"
|
||||
"B3_STATIC void b3FindPenetr(int pairIndex,int bodyIndexA, int bodyIndexB, b3ConstArray(b3RigidBodyData_t) cpuBodyBuf, \n"
|
||||
" b3ConstArray(b3ConvexPolyhedronData_t) cpuConvexData, \n"
|
||||
" b3ConstArray(b3Collidable_t) cpuCollidables,\n"
|
||||
" b3ConstArray(b3Float4) cpuVertices,\n"
|
||||
@ -1043,7 +1049,7 @@ static const char* mprKernelsCL= \
|
||||
" iterations++;\n"
|
||||
" }\n"
|
||||
"}\n"
|
||||
"static void b3FindPenetrTouch(b3MprSimplex_t *portal,float *depth, b3Float4 *dir, b3Float4 *pos)\n"
|
||||
"B3_STATIC void b3FindPenetrTouch(b3MprSimplex_t *portal,float *depth, b3Float4 *dir, b3Float4 *pos)\n"
|
||||
"{\n"
|
||||
" // Touching contact on portal's v1 - so depth is zero and direction\n"
|
||||
" // is unimportant and pos can be guessed\n"
|
||||
@ -1055,7 +1061,7 @@ static const char* mprKernelsCL= \
|
||||
" b3MprVec3Add(pos, &b3MprSimplexPoint(portal, 1)->v2);\n"
|
||||
" b3MprVec3Scale(pos, 0.5);\n"
|
||||
"}\n"
|
||||
"static void b3FindPenetrSegment(b3MprSimplex_t *portal,\n"
|
||||
"B3_STATIC void b3FindPenetrSegment(b3MprSimplex_t *portal,\n"
|
||||
" float *depth, b3Float4 *dir, b3Float4 *pos)\n"
|
||||
"{\n"
|
||||
" \n"
|
||||
|
@ -23,6 +23,7 @@ static const char* primitiveContactsKernelsCL= \
|
||||
"#define b3Sqrt native_sqrt\n"
|
||||
"#define b3Sin native_sin\n"
|
||||
"#define b3Cos native_cos\n"
|
||||
"#define B3_STATIC\n"
|
||||
"#endif\n"
|
||||
"#endif\n"
|
||||
"#ifdef __cplusplus\n"
|
||||
|
@ -50,6 +50,7 @@ static const char* satClipKernelsCL= \
|
||||
"#define b3Sqrt native_sqrt\n"
|
||||
"#define b3Sin native_sin\n"
|
||||
"#define b3Cos native_cos\n"
|
||||
"#define B3_STATIC\n"
|
||||
"#endif\n"
|
||||
"#endif\n"
|
||||
"#ifdef __cplusplus\n"
|
||||
|
@ -164,6 +164,7 @@ static const char* satConcaveKernelsCL= \
|
||||
"#define b3Sqrt native_sqrt\n"
|
||||
"#define b3Sin native_sin\n"
|
||||
"#define b3Cos native_cos\n"
|
||||
"#define B3_STATIC\n"
|
||||
"#endif\n"
|
||||
"#endif\n"
|
||||
"#ifdef __cplusplus\n"
|
||||
|
@ -164,6 +164,7 @@ static const char* satKernelsCL= \
|
||||
"#define b3Sqrt native_sqrt\n"
|
||||
"#define b3Sin native_sin\n"
|
||||
"#define b3Cos native_cos\n"
|
||||
"#define B3_STATIC\n"
|
||||
"#endif\n"
|
||||
"#endif\n"
|
||||
"#ifdef __cplusplus\n"
|
||||
|
@ -35,6 +35,7 @@ static const char* batchingKernelsCL= \
|
||||
"#define b3Sqrt native_sqrt\n"
|
||||
"#define b3Sin native_sin\n"
|
||||
"#define b3Cos native_cos\n"
|
||||
"#define B3_STATIC\n"
|
||||
"#endif\n"
|
||||
"#endif\n"
|
||||
"#ifdef __cplusplus\n"
|
||||
|
@ -35,6 +35,7 @@ static const char* batchingKernelsNewCL= \
|
||||
"#define b3Sqrt native_sqrt\n"
|
||||
"#define b3Sin native_sin\n"
|
||||
"#define b3Cos native_cos\n"
|
||||
"#define B3_STATIC\n"
|
||||
"#endif\n"
|
||||
"#endif\n"
|
||||
"#ifdef __cplusplus\n"
|
||||
|
@ -35,6 +35,7 @@ static const char* integrateKernelCL= \
|
||||
"#define b3Sqrt native_sqrt\n"
|
||||
"#define b3Sin native_sin\n"
|
||||
"#define b3Cos native_cos\n"
|
||||
"#define B3_STATIC\n"
|
||||
"#endif\n"
|
||||
"#endif\n"
|
||||
"#ifdef __cplusplus\n"
|
||||
|
@ -35,6 +35,7 @@ static const char* solverSetupCL= \
|
||||
"#define b3Sqrt native_sqrt\n"
|
||||
"#define b3Sin native_sin\n"
|
||||
"#define b3Cos native_cos\n"
|
||||
"#define B3_STATIC\n"
|
||||
"#endif\n"
|
||||
"#endif\n"
|
||||
"#ifdef __cplusplus\n"
|
||||
|
@ -510,7 +510,7 @@ typedef struct
|
||||
} ConstBufferSSD;
|
||||
|
||||
|
||||
static __constant const int gridTable4x4[] =
|
||||
__constant const int gridTable4x4[] =
|
||||
{
|
||||
0,1,17,16,
|
||||
1,2,18,19,
|
||||
@ -518,7 +518,7 @@ static __constant const int gridTable4x4[] =
|
||||
16,19,3,34
|
||||
};
|
||||
|
||||
static __constant const int gridTable8x8[] =
|
||||
__constant const int gridTable8x8[] =
|
||||
{
|
||||
0, 2, 3, 16, 17, 18, 19, 1,
|
||||
66, 64, 80, 67, 82, 81, 65, 83,
|
||||
|
@ -35,6 +35,7 @@ static const char* solverSetup2CL= \
|
||||
"#define b3Sqrt native_sqrt\n"
|
||||
"#define b3Sin native_sin\n"
|
||||
"#define b3Cos native_cos\n"
|
||||
"#define B3_STATIC\n"
|
||||
"#endif\n"
|
||||
"#endif\n"
|
||||
"#ifdef __cplusplus\n"
|
||||
@ -514,14 +515,14 @@ static const char* solverSetup2CL= \
|
||||
" float m_scale;\n"
|
||||
" int m_nSplit;\n"
|
||||
"} ConstBufferSSD;\n"
|
||||
"static __constant const int gridTable4x4[] = \n"
|
||||
"__constant const int gridTable4x4[] = \n"
|
||||
"{\n"
|
||||
" 0,1,17,16,\n"
|
||||
" 1,2,18,19,\n"
|
||||
" 17,18,32,3,\n"
|
||||
" 16,19,3,34\n"
|
||||
"};\n"
|
||||
"static __constant const int gridTable8x8[] = \n"
|
||||
"__constant const int gridTable8x8[] = \n"
|
||||
"{\n"
|
||||
" 0, 2, 3, 16, 17, 18, 19, 1,\n"
|
||||
" 66, 64, 80, 67, 82, 81, 65, 83,\n"
|
||||
|
@ -35,6 +35,7 @@ static const char* solverUtilsCL= \
|
||||
"#define b3Sqrt native_sqrt\n"
|
||||
"#define b3Sin native_sin\n"
|
||||
"#define b3Cos native_cos\n"
|
||||
"#define B3_STATIC\n"
|
||||
"#endif\n"
|
||||
"#endif\n"
|
||||
"#ifdef __cplusplus\n"
|
||||
|
@ -25,6 +25,7 @@ static const char* updateAabbsKernelCL= \
|
||||
"#define b3Sqrt native_sqrt\n"
|
||||
"#define b3Sin native_sin\n"
|
||||
"#define b3Cos native_cos\n"
|
||||
"#define B3_STATIC\n"
|
||||
"#endif\n"
|
||||
"#endif\n"
|
||||
"#ifdef __cplusplus\n"
|
||||
|
Loading…
Reference in New Issue
Block a user