From b28bd67fd9a117a5261c93e1da123b81b3ebea5a Mon Sep 17 00:00:00 2001 From: "H. Verbeet" Date: Mon, 15 Jan 2007 19:30:35 +0100 Subject: [PATCH] wined3d: Fixup the write mask for gl_FogFragCoord and gl_PointSize. gl_FogFragCoord and gl_PointSize are floats rather than vec4s in GLSL, so they shouldn't have a destination swizzle, and the write mask we return should consist of only the first component. --- dlls/wined3d/glsl_shader.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 7d88e0ed022..51c7d32518f 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -725,12 +725,17 @@ static DWORD shader_glsl_get_write_mask(const DWORD param, char *write_mask) { char *ptr = write_mask; DWORD mask = param & WINED3DSP_WRITEMASK_ALL; - if (mask != WINED3DSP_WRITEMASK_ALL) { - *ptr++ = '.'; - if (param & WINED3DSP_WRITEMASK_0) *ptr++ = 'x'; - if (param & WINED3DSP_WRITEMASK_1) *ptr++ = 'y'; - if (param & WINED3DSP_WRITEMASK_2) *ptr++ = 'z'; - if (param & WINED3DSP_WRITEMASK_3) *ptr++ = 'w'; + /* gl_FogFragCoord and glPointSize are floats, fixup the write mask. */ + if ((shader_get_regtype(param) == WINED3DSPR_RASTOUT) && ((param & WINED3DSP_REGNUM_MASK) != 0)) { + mask = WINED3DSP_WRITEMASK_0; + } else { + if (mask != WINED3DSP_WRITEMASK_ALL) { + *ptr++ = '.'; + if (param & WINED3DSP_WRITEMASK_0) *ptr++ = 'x'; + if (param & WINED3DSP_WRITEMASK_1) *ptr++ = 'y'; + if (param & WINED3DSP_WRITEMASK_2) *ptr++ = 'z'; + if (param & WINED3DSP_WRITEMASK_3) *ptr++ = 'w'; + } } *ptr = '\0';