compute best axis on host and OpenCL for 1-axis SAP, based on best variance
This commit is contained in:
@@ -318,3 +318,16 @@ __kernel void scatterKernel( __global const btAabbCL* aabbs, volatile __global
|
||||
|
||||
sortedAabbs[i] = aabbs[sortData[i].y];
|
||||
}
|
||||
|
||||
|
||||
|
||||
__kernel void prepareSumVarianceKernel( __global const btAabbCL* aabbs, __global float4* sum, __global float4* sum2,int numAabbs)
|
||||
{
|
||||
int i = get_global_id(0);
|
||||
if (i>numAabbs)
|
||||
return;
|
||||
float4 s;
|
||||
s = (aabbs[i].m_max+aabbs[i].m_min)*0.5f;
|
||||
sum[i]=s;
|
||||
sum2[i]=s*s;
|
||||
}
|
||||
|
||||
@@ -321,4 +321,17 @@ static const char* sapCL= \
|
||||
" sortedAabbs[i] = aabbs[sortData[i].y];\n"
|
||||
"}\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"\n"
|
||||
"__kernel void prepareSumVarianceKernel( __global const btAabbCL* aabbs, __global float4* sum, __global float4* sum2,int numAabbs)\n"
|
||||
"{\n"
|
||||
" int i = get_global_id(0);\n"
|
||||
" if (i>numAabbs)\n"
|
||||
" return;\n"
|
||||
" float4 s;\n"
|
||||
" s = (aabbs[i].m_max+aabbs[i].m_min)*0.5f;\n"
|
||||
" sum[i]=s;\n"
|
||||
" sum2[i]=s*s; \n"
|
||||
"}\n"
|
||||
"\n"
|
||||
;
|
||||
|
||||
Reference in New Issue
Block a user