[PATCH 5/6] wined3d: Pack interpolation modes.
hverbeet at gmail.com
Wed Oct 18 07:58:39 CDT 2017
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".
More information about the wine-devel