[prev in list] [next in list] [prev in thread] [next in thread] 

List:       wine-devel
Subject:    Fwd: Re: [PATCH 2/5] d3dx9_36: Implemented
From:       Rico_Schüller <kgbricola () web ! de>
Date:       2011-03-30 10:56:15
Message-ID: 4D930C4F.3090103 () web ! de
[Download RAW message or body]

Forwarding to the list.

Am 28.03.2011 20:47, schrieb David Laight:
>>  Ints and floats are represented differently and so, if we want to put
>>  an integer array into floating point registers, we need to have casts.
>>  If you were to simply call SetFloatArray, you would get nonsense
>>  values in the floating point registers.
>  Even using casts will fall foul of the C aliasing rules - which
>  mean that the compiler can assume that a read of type will not be
>  modified by a write to a different type so can be reorderd (unless
>  one of the types is 'char').
>
>  Not only that, but there are systems that will fault is an invalid
>  FP bit pattern is loaded into an FP register.
>
>  	David
>
My example wasn't very well chosen. So conversation (casts) between the
different types is necessary. It was meant the way to reuse some of the
code. Because I think ID3DXConstantTable_SetIntArray and
ID3DXConstantTable_SetFloatArray could share a lot of code. This will
probably be the same for ID3DXConstantTable_SetBoolArray.

Cheers
Rico



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic