On 25/03/07, Stefan Dösinger stefan@codeweavers.com wrote:
With the glsl suggestions from Henri :-)
- shader_addline(arg->buffer, "(%s.xy + bumpenvmat * %s.xy)%s);\n",
src0_param.reg_name, src1_param.reg_name, dst_mask);
MSDN states that the source parameters can have swizzles and modifiers. Unless, you can prove that's not true, the code should become:
void pshader_glsl_bem(SHADER_OPCODE_ARG* arg) { glsl_src_param_t src0_param, src1_param;
shader_glsl_append)dst(arg->buffer, arg); shader_glsl_add_src_param(arg, arg->src[0], arg->src_addr[0], WINED3DSP_WRITEMASK_0|WINED3DSP_WRITEMASK_1, &src0_param); shader_glsl_add_src_param(arg, arg->src[1], arg->src_addr[1], WINED3DSP_WRITEMASK_0|WINED3DSP_WRITEMASK_1, &src1_param); shader_addline(arg->buffer, "%s + bumpenvmat * %s);\n", src0_param.param_str, src1_param.param_str); }
Normally you would have to take the destination write mask into account as well, but for this instruction it's always .xy.