Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
23 Views

Beta SDK : crash 2 ...

Hi,

I have just add a small set of line of code in my kernel and it crash ! (I don't have this crash with AMD SDK by example).
My code looks like this (rayHit : is a __local variable) :
...
float3 normal, tangent;
AnalyseNormalAndTangent(rayHit->index, &normal, &tangent, scene->vertices, scene->tris, rayHit->b1, rayHit->b2);
Where :
inline void AnalyseNormalAndTangent(
uint hitIndex,
clVector3* normal,
clVector3* tangent,
__global Vertex* vertices,
__global Triangle* tris,
float b1, float b2)
{
...
*normal = normalize(b0 * n0 + b1 * n1 + b2 * n2);
/** REMOVE TO AVOID THE CRASH **/
if (fabs((*normal).x) > fabs((*normal).y))
{
float invLen = 1.f / sqrt((*normal).x * (*normal).x + (*normal).z * (*normal).z);
(*tangent).x = -(*normal).z * invLen;
(*tangent).y = 0.f;
(*tangent).z = (*normal).x * invLen;
}
else
{
float invLen = 1.f / sqrt((*normal).y * (*normal).y + (*normal).z * (*normal).z);
(*tangent).x = 0.f;
(*tangent).y = (*normal).z * invLen;
(*tangent).z = -(*normal).y * invLen;
}
/** REMOVE TO AVOID THE CRASH **/
}
If I remove the code in "REMOVE TO AVOID THE CRASH" I got no crash !!!
It sounds that the access to "normal" cause a crash !
How can I debug this... or help you to fix it ? ! It seems that it is a bug of the SDK !
0 Kudos
1 Reply
Employee
23 Views

Hi
Thanks for this report
Are you facing the failure during build or execution of the kernel?
Thanks, Shiri
0 Kudos