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

wined3d: Use wined3d_bit_scan() in vshader_get_input().

parent 8350e026
......@@ -3578,24 +3578,24 @@ static BOOL match_usage(BYTE usage1, BYTE usage_idx1, BYTE usage2, BYTE usage_id
return FALSE;
}
BOOL vshader_get_input(const struct wined3d_shader *shader,
BYTE usage_req, BYTE usage_idx_req, unsigned int *regnum)
bool vshader_get_input(const struct wined3d_shader *shader,
uint8_t usage_req, uint8_t usage_idx_req, unsigned int *regnum)
{
WORD map = shader->reg_maps.input_registers;
uint32_t map = shader->reg_maps.input_registers & 0xffff;
unsigned int i;
for (i = 0; map; map >>= 1, ++i)
while (map)
{
if (!(map & 1)) continue;
i = wined3d_bit_scan(&map);
if (match_usage(shader->u.vs.attributes[i].usage,
shader->u.vs.attributes[i].usage_idx, usage_req, usage_idx_req))
{
*regnum = i;
return TRUE;
return true;
}
}
return FALSE;
return false;
}
static HRESULT shader_init(struct wined3d_shader *shader, struct wined3d_device *device,
......
......@@ -5759,8 +5759,8 @@ void find_ps_compile_args(const struct wined3d_state *state, const struct wined3
BOOL position_transformed, struct ps_compile_args *args,
const struct wined3d_context *context) DECLSPEC_HIDDEN;
BOOL vshader_get_input(const struct wined3d_shader *shader,
BYTE usage_req, BYTE usage_idx_req, unsigned int *regnum) DECLSPEC_HIDDEN;
bool vshader_get_input(const struct wined3d_shader *shader,
uint8_t usage_req, uint8_t usage_idx_req, unsigned int *regnum) DECLSPEC_HIDDEN;
void find_vs_compile_args(const struct wined3d_state *state, const struct wined3d_shader *shader,
struct vs_compile_args *args, const struct wined3d_context *context) DECLSPEC_HIDDEN;
......
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