adding check on low number of vertices fixes Mac OSX crash
This commit is contained in:
@@ -189,8 +189,8 @@ int clipFaceGlobal(__global const float4* pVtxIn, int numVertsIn, float4 planeNo
|
|||||||
float ds, de;
|
float ds, de;
|
||||||
int numVertsOut = 0;
|
int numVertsOut = 0;
|
||||||
//double-check next test
|
//double-check next test
|
||||||
// if (numVertsIn < 2)
|
if (numVertsIn < 2)
|
||||||
// return 0;
|
return 0;
|
||||||
|
|
||||||
float4 firstVertex=pVtxIn[numVertsIn-1];
|
float4 firstVertex=pVtxIn[numVertsIn-1];
|
||||||
float4 endVertex = pVtxIn[0];
|
float4 endVertex = pVtxIn[0];
|
||||||
@@ -239,8 +239,8 @@ int clipFace(const float4* pVtxIn, int numVertsIn, float4 planeNormalWS,float pl
|
|||||||
float ds, de;
|
float ds, de;
|
||||||
int numVertsOut = 0;
|
int numVertsOut = 0;
|
||||||
//double-check next test
|
//double-check next test
|
||||||
// if (numVertsIn < 2)
|
if (numVertsIn < 2)
|
||||||
// return 0;
|
return 0;
|
||||||
|
|
||||||
float4 firstVertex=pVtxIn[numVertsIn-1];
|
float4 firstVertex=pVtxIn[numVertsIn-1];
|
||||||
float4 endVertex = pVtxIn[0];
|
float4 endVertex = pVtxIn[0];
|
||||||
|
|||||||
@@ -568,8 +568,8 @@ static const char* satClipKernelsCL= \
|
|||||||
" float ds, de;\n"
|
" float ds, de;\n"
|
||||||
" int numVertsOut = 0;\n"
|
" int numVertsOut = 0;\n"
|
||||||
" //double-check next test\n"
|
" //double-check next test\n"
|
||||||
" // if (numVertsIn < 2)\n"
|
" if (numVertsIn < 2)\n"
|
||||||
" // return 0;\n"
|
" return 0;\n"
|
||||||
" \n"
|
" \n"
|
||||||
" float4 firstVertex=pVtxIn[numVertsIn-1];\n"
|
" float4 firstVertex=pVtxIn[numVertsIn-1];\n"
|
||||||
" float4 endVertex = pVtxIn[0];\n"
|
" float4 endVertex = pVtxIn[0];\n"
|
||||||
@@ -615,8 +615,8 @@ static const char* satClipKernelsCL= \
|
|||||||
" float ds, de;\n"
|
" float ds, de;\n"
|
||||||
" int numVertsOut = 0;\n"
|
" int numVertsOut = 0;\n"
|
||||||
"//double-check next test\n"
|
"//double-check next test\n"
|
||||||
"// if (numVertsIn < 2)\n"
|
" if (numVertsIn < 2)\n"
|
||||||
"// return 0;\n"
|
" return 0;\n"
|
||||||
" float4 firstVertex=pVtxIn[numVertsIn-1];\n"
|
" float4 firstVertex=pVtxIn[numVertsIn-1];\n"
|
||||||
" float4 endVertex = pVtxIn[0];\n"
|
" float4 endVertex = pVtxIn[0];\n"
|
||||||
" \n"
|
" \n"
|
||||||
|
|||||||
Reference in New Issue
Block a user