Fwd: Re: [PATCH 2/5] d3dx9_36: Implemented ID3DXConstantTable_SetIntArray and ID3DXConstantTable_SetInt (Try 5)

2011-03-30 Thread Rico Schüller
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 float

Fwd: [PATCH 2/5] d3dx9_36: Implemented ID3DXConstantTable_SetIntArray and ID3DXConstantTable_SetInt (Try 5)

2011-03-29 Thread Travis Athougies
>> 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 th

Re: [PATCH 2/5] d3dx9_36: Implemented ID3DXConstantTable_SetIntArray and ID3DXConstantTable_SetInt (Try 5)

2011-03-28 Thread 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

Re: [PATCH 2/5] d3dx9_36: Implemented ID3DXConstantTable_SetIntArray and ID3DXConstantTable_SetInt (Try 5)

2011-03-28 Thread Travis Athougies
2011/3/28 Rico Schüller : > Hi, > > this and the previous patch (1/5) are doing the same thing? Is there a > reason why they could not use the same code base? > > e.g. > ID3DXConstantTable_SetIntArray(iface, device, constant, n, count) > { >    return ID3DXConstantTable_SetFloatArray(iface, device,

Re: [PATCH 2/5] d3dx9_36: Implemented ID3DXConstantTable_SetIntArray and ID3DXConstantTable_SetInt (Try 5)

2011-03-28 Thread Rico Schüller
Hi, this and the previous patch (1/5) are doing the same thing? Is there a reason why they could not use the same code base? e.g. ID3DXConstantTable_SetIntArray(iface, device, constant, n, count) { return ID3DXConstantTable_SetFloatArray(iface, device, constant, n, count); } Also I'd pr

Re: [PATCH 2/5] d3dx9_36: Implemented ID3DXConstantTable_SetIntArray and ID3DXConstantTable_SetInt

2011-02-09 Thread Matteo Bruni
2011/2/9 Travis Athougies : > > On Feb 8, 2011, at 4:10 AM, Matteo Bruni wrote: > >>> +       /* We need the for loop, since we need to convert the integer to >>> a float */ >>> +        for (i = 0; i < count && i < desc.RegisterCount; i++) >>> +        { >>> +            row[0] = (float)n[i]; >>

Re: [PATCH 2/5] d3dx9_36: Implemented ID3DXConstantTable_SetIntArray and ID3DXConstantTable_SetInt

2011-02-08 Thread Travis Athougies
On Feb 8, 2011, at 4:10 AM, Matteo Bruni wrote: + /* We need the for loop, since we need to convert the integer to a float */ +for (i = 0; i < count && i < desc.RegisterCount; i++) +{ +row[0] = (float)n[i]; The cast is unneeded, and the comment above is

Re: [PATCH 2/5] d3dx9_36: Implemented ID3DXConstantTable_SetIntArray and ID3DXConstantTable_SetInt

2011-02-08 Thread Matteo Bruni
> +       /* We need the for loop, since we need to convert the integer to a > float */ > +        for (i = 0; i < count && i < desc.RegisterCount; i++) > +        { > +            row[0] = (float)n[i]; The cast is unneeded, and the comment above is too.