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.
This commit is contained in:
parent
16cf41413b
commit
b28bd67fd9
|
@ -725,6 +725,10 @@ static DWORD shader_glsl_get_write_mask(const DWORD param, char *write_mask) {
|
||||||
char *ptr = write_mask;
|
char *ptr = write_mask;
|
||||||
DWORD mask = param & WINED3DSP_WRITEMASK_ALL;
|
DWORD mask = param & WINED3DSP_WRITEMASK_ALL;
|
||||||
|
|
||||||
|
/* 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) {
|
if (mask != WINED3DSP_WRITEMASK_ALL) {
|
||||||
*ptr++ = '.';
|
*ptr++ = '.';
|
||||||
if (param & WINED3DSP_WRITEMASK_0) *ptr++ = 'x';
|
if (param & WINED3DSP_WRITEMASK_0) *ptr++ = 'x';
|
||||||
|
@ -732,6 +736,7 @@ static DWORD shader_glsl_get_write_mask(const DWORD param, char *write_mask) {
|
||||||
if (param & WINED3DSP_WRITEMASK_2) *ptr++ = 'z';
|
if (param & WINED3DSP_WRITEMASK_2) *ptr++ = 'z';
|
||||||
if (param & WINED3DSP_WRITEMASK_3) *ptr++ = 'w';
|
if (param & WINED3DSP_WRITEMASK_3) *ptr++ = 'w';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
*ptr = '\0';
|
*ptr = '\0';
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue