Module: wine Branch: master Commit: b28bd67fd9a117a5261c93e1da123b81b3ebea5a URL: http://source.winehq.org/git/wine.git/?a=commit;h=b28bd67fd9a117a5261c93e1da...
Author: H. Verbeet hverbeet@gmail.com Date: Mon Jan 15 19:30:35 2007 +0100
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 files changed, 11 insertions(+), 6 deletions(-)
diff --git a/dlls/wined3d/glsl_shader.c b/dlls/wined3d/glsl_shader.c index 7d88e0e..51c7d32 100644 --- a/dlls/wined3d/glsl_shader.c +++ b/dlls/wined3d/glsl_shader.c @@ -725,12 +725,17 @@ static DWORD shader_glsl_get_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';