Commit 576e44e0 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Use wined3d_bit_scan() in shader_arb_generate_pshader().

parent 59b06fdb
......@@ -3512,17 +3512,18 @@ static GLuint shader_arb_generate_pshader(const struct wined3d_shader *shader,
BOOL dcl_td = FALSE;
BOOL want_nv_prog = FALSE;
struct arb_pshader_private *shader_priv = shader->backend_data;
DWORD map;
BOOL custom_linear_fog = FALSE;
uint32_t map;
char srgbtmp[4][4];
char ftoa_tmp[17];
unsigned int i, found = 0;
for (i = 0, map = reg_maps->temporary; map; map >>= 1, ++i)
map = reg_maps->temporary;
while (map)
{
if (!(map & 1)
|| (shader->u.ps.color0_mov && i == shader->u.ps.color0_reg)
i = wined3d_bit_scan(&map);
if ((shader->u.ps.color0_mov && i == shader->u.ps.color0_reg)
|| (reg_maps->shader_version.major < 2 && !i))
continue;
......@@ -3681,12 +3682,12 @@ static GLuint shader_arb_generate_pshader(const struct wined3d_shader *shader,
/* Base Declarations */
shader_generate_arb_declarations(shader, reg_maps, buffer, gl_info, NULL, &priv_ctx);
for (i = 0, map = reg_maps->bumpmat; map; map >>= 1, ++i)
map = reg_maps->bumpmat;
while (map)
{
unsigned char bump_const;
if (!(map & 1)) continue;
i = wined3d_bit_scan(&map);
bump_const = compiled->numbumpenvmatconsts;
compiled->bumpenvmatconst[bump_const].const_num = WINED3D_CONST_NUM_UNUSED;
compiled->bumpenvmatconst[bump_const].texunit = i;
......
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