Signed-off-by: Henri Verbeet hverbeet@codeweavers.com --- dlls/wined3d/arb_program_shader.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-)
diff --git a/dlls/wined3d/arb_program_shader.c b/dlls/wined3d/arb_program_shader.c index fc53f78f95d..f040eea410e 100644 --- a/dlls/wined3d/arb_program_shader.c +++ b/dlls/wined3d/arb_program_shader.c @@ -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;