Commit 129884c7 authored by Stefan Brüns's avatar Stefan Brüns

[lookandfeel] Fix GLES incompatibilities in UserDelegate shader code

Summary:
BUG: 382668

The shader compilation currently fails on GLES with errors like:
"0:6(2): error: No precision specified in this scope for type `vec4'"

GLES requires variable qualifiers like highp/lowp, whereas desktop OpenGL
does not. As QGlShaderProgram adds suitable defines on desktop OpenGL
for these qualifiers, it is safe to add these to a declarations, see:
http://doc.qt.io/qt-5/qglshaderprogram.html#writing-portable-shaders

Reviewers: #plasma, davidedmundson

Reviewed By: #plasma, davidedmundson

Subscribers: plasma-devel

Tags: #plasma

Maniphest Tasks: T7071

Differential Revision: https://phabricator.kde.org/D7770
parent 3cad8d22
......@@ -99,17 +99,17 @@ Item {
uniform highp float qt_Opacity;
uniform lowp sampler2D source;
uniform vec4 colorBorder;
float blend = 0.01;
float innerRadius = 0.47;
float outerRadius = innerRadius + 0.02;
vec4 colorEmpty = vec4(0.0, 0.0, 0.0, 0.0);
uniform lowp vec4 colorBorder;
highp float blend = 0.01;
highp float innerRadius = 0.47;
highp float outerRadius = innerRadius + 0.02;
lowp vec4 colorEmpty = vec4(0.0, 0.0, 0.0, 0.0);
void main() {
vec4 colorSource = texture2D(source, qt_TexCoord0.st);
lowp vec4 colorSource = texture2D(source, qt_TexCoord0.st);
vec2 m = qt_TexCoord0 - vec2(0.5, 0.5);
float dist = sqrt(m.x * m.x + m.y * m.y);
highp vec2 m = qt_TexCoord0 - vec2(0.5, 0.5);
highp float dist = sqrt(m.x * m.x + m.y * m.y);
if (dist < innerRadius)
gl_FragColor = colorSource;
......
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