wined3d: Store the destination shift in struct wined3d_shader_dst_param.

This commit is contained in:
Henri Verbeet 2009-04-10 09:15:06 +02:00 committed by Alexandre Julliard
parent b374e7e36e
commit 22e57d025c
5 changed files with 10 additions and 12 deletions

View File

@ -815,7 +815,7 @@ static void pshader_hw_cnd(const struct wined3d_shader_instruction *ins)
char dst_name[50];
char src_name[3][50];
BOOL sat = ins->dst[0].modifiers & WINED3DSPDM_SATURATE;
DWORD shift = (ins->dst[0].token & WINED3DSP_DSTSHIFT_MASK) >> WINED3DSP_DSTSHIFT_SHIFT;
DWORD shift = ins->dst[0].shift;
/* FIXME: support output modifiers */
@ -847,7 +847,7 @@ static void pshader_hw_cmp(const struct wined3d_shader_instruction *ins)
char dst_wmask[20];
char dst_name[50];
char src_name[3][50];
DWORD shift = (ins->dst[0].token & WINED3DSP_DSTSHIFT_MASK) >> WINED3DSP_DSTSHIFT_SHIFT;
DWORD shift = ins->dst[0].shift;
BOOL sat = ins->dst[0].modifiers & WINED3DSPDM_SATURATE;
/* FIXME: support output modifiers */
@ -876,7 +876,7 @@ static void pshader_hw_dp2add(const struct wined3d_shader_instruction *ins)
char dst_wmask[20];
char dst_name[50];
char src_name[3][50];
DWORD shift = (ins->dst[0].token & WINED3DSP_DSTSHIFT_MASK) >> WINED3DSP_DSTSHIFT_SHIFT;
DWORD shift = ins->dst[0].shift;
BOOL sat = ins->dst[0].modifiers & WINED3DSPDM_SATURATE;
pshader_get_register_name(ins->shader, ins->dst[0].token, dst_name);
@ -970,7 +970,7 @@ static void shader_hw_map2gl(const struct wined3d_shader_instruction *ins)
if (centroid)
FIXME("Unhandled modifier(%#x)\n", mask >> WINED3DSP_DSTMOD_SHIFT);
}
shift = (dst->token & WINED3DSP_DSTSHIFT_MASK) >> WINED3DSP_DSTSHIFT_SHIFT;
shift = dst->shift;
modifier = (saturate && !shift) ? "_SAT" : "";
/* Generate input register names (with modifiers) */
@ -1632,7 +1632,7 @@ static void shader_hw_nrm(const struct wined3d_shader_instruction *ins)
char dst_name[50];
char src_name[50];
char dst_wmask[20];
DWORD shift = (ins->dst[0].token & WINED3DSP_DSTSHIFT_MASK) >> WINED3DSP_DSTSHIFT_SHIFT;
DWORD shift = ins->dst[0].shift;
BOOL sat = ins->dst[0].modifiers & WINED3DSPDM_SATURATE;
pshader_get_register_name(ins->shader, ins->dst[0].token, dst_name);
@ -1659,7 +1659,7 @@ static void shader_hw_sincos(const struct wined3d_shader_instruction *ins)
char dst_name[50];
char src_name[50];
char dst_wmask[20];
DWORD shift = (ins->dst[0].token & WINED3DSP_DSTSHIFT_MASK) >> WINED3DSP_DSTSHIFT_SHIFT;
DWORD shift = ins->dst[0].shift;
BOOL sat = ins->dst[0].modifiers & WINED3DSPDM_SATURATE;
pshader_get_register_name(ins->shader, ins->dst[0].token, dst_name);

View File

@ -219,6 +219,7 @@ static void shader_parse_dst_param(DWORD param, DWORD addr_param, struct wined3d
dst->register_idx = param & WINED3DSP_REGNUM_MASK;
dst->write_mask = param & WINED3DSP_WRITEMASK_ALL;
dst->modifiers = param & WINED3DSP_DSTMOD_MASK;
dst->shift = (param & WINED3DSP_DSTSHIFT_MASK) >> WINED3DSP_DSTSHIFT_SHIFT;
dst->token = param;
dst->addr_token = addr_param;
}

View File

@ -1289,14 +1289,9 @@ static DWORD shader_glsl_append_dst_ext(SHADER_BUFFER *buffer,
{
glsl_dst_param_t glsl_dst;
DWORD mask;
int shift;
mask = shader_glsl_add_dst_param(ins, dst, &glsl_dst);
if (mask)
{
shift = (dst->token & WINED3DSP_DSTSHIFT_MASK) >> WINED3DSP_DSTSHIFT_SHIFT;
shader_addline(buffer, "%s%s = %s(", glsl_dst.reg_name, glsl_dst.mask_str, shift_glsl_tab[shift]);
}
if (mask) shader_addline(buffer, "%s%s = %s(", glsl_dst.reg_name, glsl_dst.mask_str, shift_glsl_tab[dst->shift]);
return mask;
}

View File

@ -184,6 +184,7 @@ static void vshader_set_input(
This->semantics_in[regnum].reg.register_idx = regnum;
This->semantics_in[regnum].reg.write_mask = WINED3DSP_WRITEMASK_ALL;
This->semantics_in[regnum].reg.modifiers = 0;
This->semantics_in[regnum].reg.shift = 0;
This->semantics_in[regnum].reg.token = reg_token;
This->semantics_in[regnum].reg.addr_token = 0;
}

View File

@ -450,6 +450,7 @@ struct wined3d_shader_dst_param
UINT register_idx;
DWORD write_mask;
DWORD modifiers;
DWORD shift;
DWORD token;
DWORD addr_token;
};