add gjk/epa (host only), possibly improve convex-convex with many edge-edge tests

more preparation towards persistent/incremental contact cache
This commit is contained in:
erwincoumans
2013-07-31 23:22:43 -07:00
parent 7992ff816b
commit 34de49d8a4
24 changed files with 3020 additions and 118 deletions

View File

@@ -15,6 +15,8 @@ static const char* sapFastCL= \
"*/\n"
"//Originally written by Erwin Coumans\n"
"\n"
"#define NEW_PAIR_MARKER -1\n"
"#define REMOVED_PAIR_MARKER -2\n"
"\n"
"typedef struct \n"
"{\n"
@@ -179,9 +181,11 @@ static const char* sapFastCL= \
" int curPair = atomic_inc(addedHostPairsCount);\n"
" if (curPair<maxCapacity)\n"
" {\n"
" \n"
" addedHostPairsGPU[curPair].x = newPair.x;\n"
" addedHostPairsGPU[curPair].y = newPair.y;\n"
" addedHostPairsGPU[curPair].z = NEW_PAIR_MARKER;\n"
" addedHostPairsGPU[curPair].w = NEW_PAIR_MARKER;\n"
"\n"
" }\n"
" }\n"
"\n"
@@ -210,6 +214,8 @@ static const char* sapFastCL= \
" \n"
" removedHostPairsGPU[curPair].x = removedPair.x;\n"
" removedHostPairsGPU[curPair].y = removedPair.y;\n"
" removedHostPairsGPU[curPair].z = REMOVED_PAIR_MARKER;\n"
" removedHostPairsGPU[curPair].w = REMOVED_PAIR_MARKER;\n"
"\n"
" }\n"
" }\n"
@@ -275,6 +281,9 @@ static const char* sapFastCL= \
" \n"
" addedHostPairsGPU[curPair].x = newPair.x;\n"
" addedHostPairsGPU[curPair].y = newPair.y;\n"
" addedHostPairsGPU[curPair].z = NEW_PAIR_MARKER;\n"
" addedHostPairsGPU[curPair].w = NEW_PAIR_MARKER;\n"
"\n"
" }\n"
" }\n"
" \n"
@@ -303,6 +312,8 @@ static const char* sapFastCL= \
" \n"
" removedHostPairsGPU[curPair].x = removedPair.x;\n"
" removedHostPairsGPU[curPair].y = removedPair.y;\n"
" removedHostPairsGPU[curPair].z = REMOVED_PAIR_MARKER;\n"
" removedHostPairsGPU[curPair].w = REMOVED_PAIR_MARKER;\n"
" }\n"
" }\n"
" \n"
@@ -398,7 +409,9 @@ static const char* sapFastCL= \
" int4 tmpPair;\n"
" tmpPair.x = myPairs[p].x;\n"
" tmpPair.y = myPairs[p].y;\n"
" \n"
" tmpPair.z = NEW_PAIR_MARKER;\n"
" tmpPair.w = NEW_PAIR_MARKER;\n"
"\n"
" pairsOut[curPair+p] = tmpPair; //flush to main memory\n"
" }\n"
" }\n"
@@ -432,7 +445,8 @@ static const char* sapFastCL= \
" int4 tmpPair;\n"
" tmpPair.x = myPairs[p].x;\n"
" tmpPair.y = myPairs[p].y;\n"
" \n"
" tmpPair.z = NEW_PAIR_MARKER;\n"
" tmpPair.w = NEW_PAIR_MARKER;\n"
" pairsOut[curPair+p] = tmpPair; //flush to main memory\n"
" }\n"
" }\n"