plugins/colorblindnesscorrection: Fix screen becoming white on intel machines

correction.a is uninitialized. It creates problems on intel machines.

BUG: 479749
This commit is contained in:
Vlad Zahorodnii 2024-01-19 12:31:35 +02:00
parent 0ce01ac30f
commit 4cc94e9462
6 changed files with 24 additions and 36 deletions

View file

@ -24,17 +24,15 @@ void main()
float m = 0.494207 * L + 0.0 * M + 1.24827 * S;
float s = 0.0 * L + 0.0 * M + 1.0 * S;
vec4 error;
vec3 error;
error.r = (0.0809444479 * l) + (-0.130504409 * m) + (0.116721066 * s);
error.g = (-0.0102485335 * l) + (0.0540193266 * m) + (-0.113614708 * s);
error.b = (-0.000365296938 * l) + (-0.00412161469 * m) + (0.693511405 * s);
error.a = 1.0;
vec4 diff = tex - error;
vec4 correction;
vec3 diff = tex.rgb - error;
vec3 correction;
correction.r = 0.0;
correction.g = (diff.r * 0.7) + (diff.g * 1.0);
correction.b = (diff.r * 0.7) + (diff.b * 1.0);
correction = tex + correction;
gl_FragColor = correction * modulation;
gl_FragColor = (tex + vec4(correction, 0.0)) * modulation;
}

View file

@ -27,17 +27,15 @@ void main()
float m = 0.494207 * L + 0.0 * M + 1.24827 * S;
float s = 0.0 * L + 0.0 * M + 1.0 * S;
vec4 error;
vec3 error;
error.r = (0.0809444479 * l) + (-0.130504409 * m) + (0.116721066 * s);
error.g = (-0.0102485335 * l) + (0.0540193266 * m) + (-0.113614708 * s);
error.b = (-0.000365296938 * l) + (-0.00412161469 * m) + (0.693511405 * s);
error.a = 1.0;
vec4 diff = tex - error;
vec4 correction;
vec3 diff = tex.rgb - error;
vec3 correction;
correction.r = 0.0;
correction.g = (diff.r * 0.7) + (diff.g * 1.0);
correction.b = (diff.r * 0.7) + (diff.b * 1.0);
correction = tex + correction;
fragColor = correction * modulation;
fragColor = (tex + vec4(correction, 0.0)) * modulation;
}

View file

@ -24,17 +24,15 @@ void main()
float m = 0.0 * L + 1.0 * M + 0.0 * S;
float s = 0.0 * L + 0.0 * M + 1.0 * S;
vec4 error;
vec3 error;
error.r = (0.0809444479 * l) + (-0.130504409 * m) + (0.116721066 * s);
error.g = (-0.0102485335 * l) + (0.0540193266 * m) + (-0.113614708 * s);
error.b = (-0.000365296938 * l) + (-0.00412161469 * m) + (0.693511405 * s);
error.a = 1.0;
vec4 diff = tex - error;
vec4 correction;
vec3 diff = tex.rgb - error;
vec3 correction;
correction.r = 0.0;
correction.g = (diff.r * 0.7) + (diff.g * 1.0);
correction.b = (diff.r * 0.7) + (diff.b * 1.0);
correction = tex + correction;
gl_FragColor = correction * modulation;
gl_FragColor = (tex + vec4(correction, 0.0)) * modulation;
}

View file

@ -27,17 +27,15 @@ void main()
float m = 0.0 * L + 1.0 * M + 0.0 * S;
float s = 0.0 * L + 0.0 * M + 1.0 * S;
vec4 error;
vec3 error;
error.r = (0.0809444479 * l) + (-0.130504409 * m) + (0.116721066 * s);
error.g = (-0.0102485335 * l) + (0.0540193266 * m) + (-0.113614708 * s);
error.b = (-0.000365296938 * l) + (-0.00412161469 * m) + (0.693511405 * s);
error.a = 1.0;
vec4 diff = tex - error;
vec4 correction;
vec3 diff = tex.rgb - error;
vec3 correction;
correction.r = 0.0;
correction.g = (diff.r * 0.7) + (diff.g * 1.0);
correction.b = (diff.r * 0.7) + (diff.b * 1.0);
correction = tex + correction;
fragColor = correction * modulation;
fragColor = (tex + vec4(correction, 0.0)) * modulation;
}

View file

@ -24,17 +24,15 @@ void main()
float m = 0.0 * L + 1.0 * M + 0.0 * S;
float s = -0.395913 * L + 0.801109 * M + 0.0 * S;
vec4 error;
vec3 error;
error.r = (0.0809444479 * l) + (-0.130504409 * m) + (0.116721066 * s);
error.g = (-0.0102485335 * l) + (0.0540193266 * m) + (-0.113614708 * s);
error.b = (-0.000365296938 * l) + (-0.00412161469 * m) + (0.693511405 * s);
error.a = 1.0;
vec4 diff = tex - error;
vec4 correction;
vec3 diff = tex.rgb - error;
vec3 correction;
correction.r = 0.0;
correction.g = (diff.r * 0.7) + (diff.g * 1.0);
correction.b = (diff.r * 0.7) + (diff.b * 1.0);
correction = tex + correction;
gl_FragColor = correction * modulation;
gl_FragColor = (tex + vec4(correction, 0.0)) * modulation;
}

View file

@ -27,17 +27,15 @@ void main()
float m = 0.0 * L + 1.0 * M + 0.0 * S;
float s = -0.395913 * L + 0.801109 * M + 0.0 * S;
vec4 error;
vec3 error;
error.r = (0.0809444479 * l) + (-0.130504409 * m) + (0.116721066 * s);
error.g = (-0.0102485335 * l) + (0.0540193266 * m) + (-0.113614708 * s);
error.b = (-0.000365296938 * l) + (-0.00412161469 * m) + (0.693511405 * s);
error.a = 1.0;
vec4 diff = tex - error;
vec4 correction;
vec3 diff = tex.rgb - error;
vec3 correction;
correction.r = 0.0;
correction.g = (diff.r * 0.7) + (diff.g * 1.0);
correction.b = (diff.r * 0.7) + (diff.b * 1.0);
correction = tex + correction;
fragColor = correction * modulation;
fragColor = (tex + vec4(correction, 0.0)) * modulation;
}