cancel
Showing results for 
Search instead for 
Did you mean: 

OpenCL

spectral
Adept II

Compilator error

I have the following code. And I got this error :

 

error: operand of "*" must be a pointer

   rayHit->P += RAY_EPSILON * rayHit->Ng;

 

 

If I do "rayHit->Ng * RAY_EPSILON" I have no problem.

Some precision, Ng is a float3 and RAY_EPISOLON is a #define.

void faceForward(RayHit* rayHit, float3* wo) { rayHit->P += RAY_EPSILON * rayHit->Ng; }

0 Kudos
Reply
2 Replies
himanshu_gautam
Grandmaster

Compilator error

viewon01,

I tried to check that but was not able to reproduce it. So I guess it has been fixed already internally. Can you please provide a small test kernel to reproduce it so that I can be sure.

0 Kudos
Reply
eugenek
Journeyman III

Compilator error

The compiler tries to interpret '*' as an unary operator. It would do that if it does not see anything on the left hand of '*'. For example, if RAY_EPSILON is defined as


#define RAY_EPSILON

without any value.

But in that case 'rayHit->Ng * RAY_EPSILON' would throw a different error at you.


How exactly did you define RAY_EPSILON?

0 Kudos
Reply