wined3d: Use wined3d_bit_scan() in vshader_get_input().

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2022-01-26 15:43:41 +01:00 committed by Alexandre Julliard
parent 8350e026e8
commit dc990b6b2b
2 changed files with 10 additions and 10 deletions

View File

@ -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,

View File

@ -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;