- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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 !
Link Copied
1 Reply
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi
Thanks for this report
Are you facing the failure during build or execution of the kernel?
Thanks, Shiri
Thanks for this report
Are you facing the failure during build or execution of the kernel?
Thanks, Shiri

Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page