2 Replies Latest reply on Mar 3, 2011 3:14 PM by eugenek

    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; }

        • Compilator error


          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.

            • 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?