[PATCH] d3dx9_36: Implement D3DXCheckTextureRequirements + tests

Ben Klein shacklein at gmail.com
Mon Apr 19 05:43:58 CDT 2010


On 19 April 2010 19:43, Henri Verbeet <hverbeet at gmail.com> wrote:
> On 19 April 2010 09:43, Christian Costa <titan.costa at wanadoo.fr> wrote:
>> +BOOL is_pow2(UINT num)
>> +{
>> +    UINT i;
>> +
>> +    if (!num) return FALSE;
>> +    for (i = 0; num >> 1; i++) num >>= 1;
>> +
>> +    return (num << i) == num;
>> +}
> This should at least be static. You can also just replace it with
> "return !(num & (num - 1));". You don't care about 0, since you
> already check that earlier in D3DXCheckTextureRequirements().
> make_pow2() can probably be simplified as well.

I guess it depends on how many times this function will be used
whether or not 0 should be checked as well.



More information about the wine-devel mailing list