d3dx9 [patch 1/3]: Avoid two useless computations

Frédéric Delanoy frederic.delanoy at gmail.com
Sun Apr 7 12:31:04 CDT 2013


On Fri, Apr 5, 2013 at 9:41 AM, Rico Schüller <kgbricola at web.de> wrote:

> On 05.04.2013 09:13, Nozomi Kodama wrote:
>
>>       s = 0.75f;
>> -    if ( order > 2 )
>> -        s += 5.0f / 16.0f;
>> -    if ( order > 4 )
>> -        s -= 3.0f / 32.0f;
>> +    if (order > 2)
>> +        s = 1.0625f;
>> +    if (order > 4)
>> +        s = 0.96875f;
>>       s /= D3DX_PI;
>>
>
>  Doesn't the compiler do that already?


Most likely,since those are literal constants.
Besides, 5.0f / 16.0f is more readable than a pre-computed result.

So I don't think this patch is really useful.

Frédéric
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.winehq.org/pipermail/wine-devel/attachments/20130407/86ccb07b/attachment.html>


More information about the wine-devel mailing list