POV-Ray : Newsgroups : povray.programming : Type problems : Re: Type problems Server Time
16 Apr 2024 05:15:34 EDT (-0400)
  Re: Type problems  
From: Aidy
Date: 29 Mar 2011 15:05:00
Message: <web.4d922ca1a2992db7674c4bb0@news.povray.org>
OK I've fiddled around with it a bit, and the first error on (TPATTERN *)Tnormal
doesn't appear to be an error to do with the casting. That seems to be working
fine (I created a new TPATTERN * variable and assigned it to the cast Tnormal
without error) however it errors when using that in the method call to cuNoise.

My declaration of cuNoise is :

__device__ INLINE_NOISE DBL cuNoise (VECTOR EPoint,TPATTERN *TPat)

and is inside the texture file, as it was before (i've moved a lot of things
around but all methods are still in the same relative places. e.g methods
originally in texture are now in cuTexture.)

The cuNoise definition clearly requires a TPATTERN pointer, yet I still get the
error? I am including the cuTexture header file where the prototype of the
cuNoise method exists. Everything SEEMS correct, and short of the naming of
methods, it is identical to the original code to the best of my knowledge :(

Le_Forgeron <jgr### [at] freefr> wrote:
> Le 29/03/2011 19:33, Aidy nous fit lire :
> > That is the exact text of the error. I'm not at a stage of being able to compile
> > the code yet, it is simply giving me the errors as if they are syntax errors.
> > But the error messages I've given are the exact messages I am receiving. There
> > is no more information provided :(
> >
>
> Oki... ;-)
>
> Could it be that part of your rewrite (Do_Average_Normals --> cu...) is
> incomplete and conflicting on TNORMAL ? (such as existing in more than
> one form: the povray one and another one ?)
>
> You should search for the definition (in your source tree) of BLEND_MAP,
> TNORMAL & TPATTERN.
>
> From the 3.6.1 unix code (your code might vary):
>
> In source/frame.h, TNORMAL is a struct Tnormal_Struct
> struct Tnormal_Struct
> {
>   TPATTERN_FIELDS
>   SNGL Amount;
>   SNGL Delta; /* NK delta */
> };
>
> TPATTERN is a struct struct Pattern_Struct
> struct Pattern_Struct
> {
>   TPATTERN_FIELDS
> };
>
> TPATTERN_FIELDS is a collection of fields, happily mixing union & struct.
>
> If no reordering occured (such as asking the compiler to compact the
> structure... a nice option which is strongly discouraged with povray),
> there should be no problem to cast a TNORMAL* into a TPATTERN*.
> (as long as both are what we thing they are).
>
> But error on Tnormal make me believe the type TNORMAL is not from
> frame.h for your compilation.
>
> A Windows C++ expert is probably needed.
>
> Now, there is that __device__ keyword... inlining code might have issue
> with structures & casting. You might want to rewrite the casted pointer
> as a reference instead... I do not know if it would work.
>


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.