|
|
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.
> The first error I'm coming across is in the method dents (cuDents for me) :
>
> __device__ static void cuDents (VECTOR EPoint, TNORMAL *Tnormal, VECTOR normal)
> {
> DBL noise;
> VECTOR stucco_turb;
>
> noise = cuNoise (EPoint, (TPATTERN*)Tnormal); THIS LINE HAS THE ERROR
>
> noise = noise * noise * noise * Tnormal->Amount;
>
> /* Get normal displacement value. */
> cuDNoise(stucco_turb, EPoint);
>
> /* Displace "normal". */
> cuVAddScaledEq(normal, noise, stucco_turb);
> }
>
> The next error appears in the function do_Average_Normals :
>
> __device__ static void cuDo_Average_Normals (VECTOR EPoint,TNORMAL
> *Tnormal,VECTOR normal, INTERSECTION *Inter)
> {
> int i;
> BLEND_MAP *Map = Tnormal->Blend_Map; ERROR ON THIS LINE
> SNGL Value;
> SNGL Total = 0.0;
> VECTOR V1,V2;
>
> cuMake_Vector (V1, 0.0, 0.0, 0.0);
>
> for (i = 0; i < Map->Number_Of_Entries; i++)
> {
> Value = Map->Blend_Map_Entries[i].value;
>
> cuAssign_Vector(V2,normal);
>
> cuPerturb_Normal(V2,Map->Blend_Map_Entries[i].Vals.Tnormal,EPoint, Inter);
> ERROR ON THIS LINE ^ AS WELL
>
> cuVAddScaledEq(V1,Value,V2);
>
> Total += Value;
> }
>
> cuVInverseScale(normal,V1,Total);
> }
>
> The first error has just the ( of (TPATTERN *) highlighted in red as an error
> and nothing else.
>
> The second error has Tnormal highlighted as the error.
>
> The third error has Map highlighted as the error
>
>
>
> The three errors I receive above, in order, in full text are :
>
> Error: Argument of type "TPATTERN * " is incompatible with parameter of type
> "TPATTERN * "
>
> TNORMAL *Tnormal
> Error: A value of type "BLEND_MAP * " cannot be used to initialize an entity of
> type "BLEND_MAP * "
>
> and
>
> BLEND_MAP *Map
> Error: argument of type "TNORMAL * " is incompatible with parameter of type
> "TNORMAL * "
>
>
> Hope this is of more help
>
>
> Le_Forgeron <jgr### [at] freefr> wrote:
>> Le 29/03/2011 18:06, Aidy nous fit lire :
>>> Version 3.6.2, yes.
>>> Using Visual Studio 2010 so the compile that comes with that.
>>> What do you mean by my flag??
>>
>> The option of your compiler (project/setting/compiler/... that kind of
>> things)
>>
>>>
>>> The two errors I provided are repeated a few times just with different data
>>> types.
>>
>> What is the EXACT text of the errors, (or is it your version of it) ?
>> It's painful enough to try to understand an error message without adding
>> layer(s) of grease...
>>
>> Please provide a FULL copy of the error message (not it's
>> interpretation) as well as at least the code of the calling function
>> (from start of function to at least the error line!)
>>
>> Cristal ball currently broken, please help with accurate data.
>>
>>> All of the errors however complain about a data type not being compatible
>>> with its own kind.
>>>
>>> A few of the lines with errors are :
>>>
>>> noise = cuNoise (EPoint, (TPATTERN*)Tnormal);
>>>
>>> BLEND_MAP *Map = Tnormal->Blend_Map;
>>>
>>> cuPerturb_Normal(V2,Map->Blend_Map_Entries[i].Vals.Tnormal,EPoint, Inter);
>>>
>>
>> No such code as cuNoise & cuPerturb_Normal... Can you be playing odd
>> with some Const ?
>>
>>
>>>
>>> There are others but the error messages are all much the same.
>>> The method names are slightly different but this is due to the work that I am
>>> doing. This code may be being interpreted by the NVCC compiler but I'm not sure.
>>> I still don't understand why the error is occurring though.
>>
>>>>
>>>> Could you please provide the error lines' number ?
>>>> (or a copy-paste of the errors)
>>>
>>>
>>>
>>>
>
>
>
>
Post a reply to this message
|
|