[25/49] wined3d: Pass the correct mask to
shader_glsl_add_src_param() in pshader_glsl_texreg2ar,
use the correct source swizzle
H. Verbeet
hverbeet at gmail.com
Mon Jan 15 12:33:24 CST 2007
AR corresponds to .wx, not .yz.
Changelog:
- Pass the correct mask to shader_glsl_add_src_param() in
pshader_glsl_texreg2ar
- Use the correct source swizzle
-------------- next part --------------
---
dlls/wined3d/glsl_shader.c | 20 +++++++++-----------
1 files changed, 9 insertions(+), 11 deletions(-)
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c
index 6b80eaf..461c153 100644
--- a/dlls/wined3d/glsl_shader.c
+++ b/dlls/wined3d/glsl_shader.c
@@ -1799,19 +1799,17 @@ void pshader_glsl_texbem(SHADER_OPCODE_ARG* arg) {
/** Process the WINED3DSIO_TEXREG2AR instruction in GLSL
* Sample 2D texture at dst using the alpha & red (wx) components of src as texture coordinates */
void pshader_glsl_texreg2ar(SHADER_OPCODE_ARG* arg) {
-
- char tmpLine[255];
- char dst_str[100], src0_str[100];
- char dst_reg[50], src0_reg[50];
- char dst_mask[6], src0_mask[6];
- DWORD src0_regnum = arg->src[0] & WINED3DSP_REGNUM_MASK;
+ char src0_str[100];
+ char src0_reg[50];
+ char src0_mask[6];
+ DWORD sampler_idx = arg->dst & WINED3DSP_REGNUM_MASK;
+ char dst_mask[6];
- shader_glsl_add_dst_param(arg, arg->dst, 0, dst_reg, dst_mask, dst_str);
- shader_glsl_add_src_param_old(arg, arg->src[0], arg->src_addr[0], src0_reg, src0_mask, src0_str);
+ shader_glsl_append_dst(arg->buffer, arg);
+ shader_glsl_get_write_mask(arg->dst, dst_mask);
+ shader_glsl_add_src_param(arg, arg->src[0], arg->src_addr[0], WINED3DSP_WRITEMASK_ALL, src0_reg, src0_mask, src0_str);
- shader_glsl_add_dst_old(arg->dst, dst_reg, dst_mask, tmpLine);
- shader_addline(arg->buffer, "%stexture2D(Psampler%u, %s.yz))%s;\n",
- tmpLine, src0_regnum, dst_reg, dst_mask);
+ shader_addline(arg->buffer, "texture2D(Psampler%u, %s.wx)%s);\n", sampler_idx, src0_reg, dst_mask);
}
/** Process the WINED3DSIO_TEXREG2GB instruction in GLSL
More information about the wine-patches
mailing list