wined3d: Use wined3d_bit_scan() in set_glsl_shader_program().
Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
c265f2f2ac
commit
bfac6c990d
|
@ -10231,6 +10231,7 @@ static void set_glsl_shader_program(const struct wined3d_context_gl *context_gl,
|
|||
struct wined3d_shader *pshader = NULL;
|
||||
GLuint reorder_shader_id = 0;
|
||||
struct glsl_program_key key;
|
||||
uint32_t attribs_map;
|
||||
GLuint program_id;
|
||||
unsigned int i;
|
||||
GLuint vs_id = 0;
|
||||
|
@ -10239,7 +10240,6 @@ static void set_glsl_shader_program(const struct wined3d_context_gl *context_gl,
|
|||
GLuint gs_id = 0;
|
||||
GLuint ps_id = 0;
|
||||
struct list *ps_list, *vs_list;
|
||||
WORD attribs_map;
|
||||
struct wined3d_string_buffer *tmp_name;
|
||||
|
||||
if (!(context_gl->c.shader_update_mask & (1u << WINED3D_SHADER_TYPE_VERTEX)) && ctx_data->glsl_program)
|
||||
|
@ -10417,11 +10417,9 @@ static void set_glsl_shader_program(const struct wined3d_context_gl *context_gl,
|
|||
* in order to make the bindings work, and it has to be done prior
|
||||
* to linking the GLSL program. */
|
||||
tmp_name = string_buffer_get(&priv->string_buffers);
|
||||
for (i = 0; attribs_map; attribs_map >>= 1, ++i)
|
||||
while (attribs_map)
|
||||
{
|
||||
if (!(attribs_map & 1))
|
||||
continue;
|
||||
|
||||
i = wined3d_bit_scan(&attribs_map);
|
||||
string_buffer_sprintf(tmp_name, "vs_in%u", i);
|
||||
GL_EXTCALL(glBindAttribLocation(program_id, i, tmp_name->buffer));
|
||||
if (vshader && vshader->reg_maps.shader_version.major >= 4)
|
||||
|
|
Loading…
Reference in New Issue