Commit f7d87706 authored by Rico Schüller's avatar Rico Schüller Committed by Alexandre Julliard

d3dx9: Use all 32 bits as mask.

parent 98ef0ca8
......@@ -1216,7 +1216,7 @@ static inline void fill_texture(const struct pixel_format_desc *format, BYTE *po
for (c = 0; c < 4; c++)
{
float comp_value;
DWORD i, v;
DWORD i, v, mask32 = format->bits[c] == 32 ? ~0U : ((1 << format->bits[c]) - 1);
switch (c)
{
......@@ -1242,12 +1242,12 @@ static inline void fill_texture(const struct pixel_format_desc *format, BYTE *po
if (format->shift[c] > i)
{
mask = ((1 << format->bits[c]) - 1) << (format->shift[c] - i);
mask = mask32 << (format->shift[c] - i);
byte = (v << (format->shift[c] - i)) & mask;
}
else
{
mask = ((1 << format->bits[c]) - 1) >> (i - format->shift[c]);
mask = mask32 >> (i - format->shift[c]);
byte = (v >> (i - format->shift[c])) & mask;
}
pos[i / 8] |= byte;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment