Commit 0663eb93 authored by Henri Verbeet's avatar Henri Verbeet Committed by Alexandre Julliard

wined3d: Store the source relative addressing token as a struct wined3d_shader_src_param.

parent d6ee7d59
......@@ -239,14 +239,15 @@ static void shader_parse_dst_param(DWORD param, DWORD addr_param, struct wined3d
dst->addr_token = addr_param;
}
static void shader_parse_src_param(DWORD param, DWORD addr_param, struct wined3d_shader_src_param *src)
static void shader_parse_src_param(DWORD param, const struct wined3d_shader_src_param *rel_addr,
struct wined3d_shader_src_param *src)
{
src->register_type = ((param & WINED3DSP_REGTYPE_MASK) >> WINED3DSP_REGTYPE_SHIFT)
| ((param & WINED3DSP_REGTYPE_MASK2) >> WINED3DSP_REGTYPE_SHIFT2);
src->register_idx = param & WINED3DSP_REGNUM_MASK;
src->modifiers = param & WINED3DSP_SRCMOD_MASK;
src->rel_addr = rel_addr;
src->token = param;
src->addr_token = addr_param;
}
/* Note that this does not count the loop register
......@@ -814,6 +815,7 @@ void shader_generate_main(IWineD3DBaseShader *iface, SHADER_BUFFER* buffer,
const SHADER_OPCODE *opcode_table = This->baseShader.shader_ins;
const SHADER_HANDLER *handler_table = device->shader_backend->shader_instruction_handler_table;
DWORD shader_version = reg_maps->shader_version;
struct wined3d_shader_src_param src_rel_addr[4];
struct wined3d_shader_src_param src_param[4];
struct wined3d_shader_dst_param dst_param;
struct wined3d_shader_instruction ins;
......@@ -908,9 +910,17 @@ void shader_generate_main(IWineD3DBaseShader *iface, SHADER_BUFFER* buffer,
ins.src_count = curOpcode->num_params - curOpcode->dst_token;
for (i = 0; i < ins.src_count; ++i)
{
DWORD param, addr_token = 0;
pToken += shader_get_param(pToken, shader_version, &param, &addr_token);
shader_parse_src_param(param, addr_token, &src_param[i]);
DWORD param, addr_param;
pToken += shader_get_param(pToken, shader_version, &param, &addr_param);
if (param & WINED3DSHADER_ADDRMODE_RELATIVE)
{
shader_parse_src_param(addr_param, NULL, &src_rel_addr[i]);
shader_parse_src_param(param, &src_rel_addr[i], &src_param[i]);
}
else
{
shader_parse_src_param(param, NULL, &src_param[i]);
}
}
/* Call appropriate function for output target */
......
......@@ -467,8 +467,8 @@ struct wined3d_shader_src_param
WINED3DSHADER_PARAM_REGISTER_TYPE register_type;
UINT register_idx;
DWORD modifiers;
const struct wined3d_shader_src_param *rel_addr;
DWORD token;
DWORD addr_token;
};
struct wined3d_shader_instruction
......
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