d3dx9 [patch 2 / 3]: Avoid useless computations in D3DXMatrixAffineTransformation

Rico Schüller kgbricola at web.de
Mon May 6 05:31:53 CDT 2013


On 05.05.2013 23:01, Nozomi Kodama wrote:
>
> +        FLOAT xw, xx, xy, xz, yw, yy, yz, zw, zz;
>
I'm not very happy with the additional amount of variables...

Please have a look at the attached patches. I think something like the 
first one (d3dx9: Apply rotationcenter only when a rotation is done.) 
should be done but has no influence on your patch (it is only attached, 
because the second patch influences the same part).

1. The amount of variables needed could be reduced to 3 by reordering 
the calculations (see patch 2, lines 36 - 58). This could also be done 
in your patch. Though I'm not sure that's a good idea ... comments and 
other opinions are welcome.

Below this the points are not directly related to your patch:

2. In the next step we could also avoid a couple of multiplications by 
multiplying the scaling and adjusting the constants (see patch 2, lines 
70 - 79).

3. We could also avoid the temps by reordering the calculation (Doing 
rotationcenter before the scaling). This way the tempxx could be avoided 
by using the out matrix directly.

Cheers
Rico
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 1.patch
Type: text/x-patch
Size: 2031 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20130506/c038a547/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 2.patch
Type: text/x-patch
Size: 3768 bytes
Desc: not available
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20130506/c038a547/attachment-0001.bin>


More information about the wine-devel mailing list