Commit c265f2f2 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Use wined3d_bit_scan() in wined3d_context_gl_map_fixed_function_samplers().

parent d6a7918a
...@@ -3570,18 +3570,16 @@ static void wined3d_context_gl_map_fixed_function_samplers(struct wined3d_contex ...@@ -3570,18 +3570,16 @@ static void wined3d_context_gl_map_fixed_function_samplers(struct wined3d_contex
{ {
const struct wined3d_d3d_info *d3d_info = context_gl->c.d3d_info; const struct wined3d_d3d_info *d3d_info = context_gl->c.d3d_info;
unsigned int i, tex; unsigned int i, tex;
WORD ffu_map; uint32_t ffu_map;
ffu_map = context_gl->c.fixed_function_usage_map; ffu_map = context_gl->c.fixed_function_usage_map;
if (d3d_info->limits.ffp_textures == d3d_info->limits.ffp_blend_stages if (d3d_info->limits.ffp_textures == d3d_info->limits.ffp_blend_stages
|| context_gl->c.lowest_disabled_stage <= d3d_info->limits.ffp_textures) || context_gl->c.lowest_disabled_stage <= d3d_info->limits.ffp_textures)
{ {
for (i = 0; ffu_map; ffu_map >>= 1, ++i) while (ffu_map)
{ {
if (!(ffu_map & 1)) i = wined3d_bit_scan(&ffu_map);
continue;
if (context_gl->tex_unit_map[i] != i) if (context_gl->tex_unit_map[i] != i)
{ {
wined3d_context_gl_map_stage(context_gl, i, i); wined3d_context_gl_map_stage(context_gl, i, i);
...@@ -3594,11 +3592,9 @@ static void wined3d_context_gl_map_fixed_function_samplers(struct wined3d_contex ...@@ -3594,11 +3592,9 @@ static void wined3d_context_gl_map_fixed_function_samplers(struct wined3d_contex
/* Now work out the mapping */ /* Now work out the mapping */
tex = 0; tex = 0;
for (i = 0; ffu_map; ffu_map >>= 1, ++i) while (ffu_map)
{ {
if (!(ffu_map & 1)) i = wined3d_bit_scan(&ffu_map);
continue;
if (context_gl->tex_unit_map[i] != tex) if (context_gl->tex_unit_map[i] != tex)
{ {
wined3d_context_gl_map_stage(context_gl, i, tex); wined3d_context_gl_map_stage(context_gl, i, tex);
......
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