[PATCH 5/6] wined3d: Pack interpolation modes.

Józef Kucia joseph.kucia at gmail.com
Wed Oct 18 15:52:47 CDT 2017


On Wed, Oct 18, 2017 at 2:58 PM, Henri Verbeet <hverbeet at gmail.com> wrote:
> On 18 October 2017 at 00:25, Józef Kucia <jkucia at codeweavers.com> wrote:
>> +static inline DWORD wined3d_extract_bits(const DWORD *bitstream,
>> +        unsigned int offset, unsigned int count)
>> +{
>> +    const unsigned int word_bit_count = sizeof(*bitstream) * CHAR_BIT;
>> +    const unsigned int idx = offset / word_bit_count;
>> +    const unsigned int shift = offset % word_bit_count;
>> +    DWORD mask = (1u << count) - 1;
> It's not an issue in this patch, but note that the above doesn't work
> for count > 31. We probably don't care about count > 32, but we may
> care about count == 32. Specifically, "1u << 32" is undefined, but in
> practice tends to evaluate as "1u << 0".

I think that this function is unlikely to be useful with count == 32.
Using a 32-bit data type directly would be a preferred approach in
majority of cases.



More information about the wine-devel mailing list