Commit b28bd67f authored by H. Verbeet's avatar H. Verbeet Committed by Alexandre Julliard

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.
parent 16cf4141
......@@ -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';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment