Bug 382668 - Fragment shader in UserDelegate.qml is not GLSL/ES compatible, missing precision specifier
Summary: Fragment shader in UserDelegate.qml is not GLSL/ES compatible, missing precis...
Status: RESOLVED FIXED
Alias: None
Product: plasmashell
Classification: Plasma
Component: Global Theme packages (show other bugs)
Version: master
Platform: Other Linux
: NOR normal
Target Milestone: 1.0
Assignee: Plasma Bugs List
URL:
Keywords: junior-jobs
Depends on:
Blocks:
 
Reported: 2017-07-24 17:57 UTC by Stefan Brüns
Modified: 2017-09-26 21:16 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Stefan Brüns 2017-07-24 17:57:26 UTC
The fragment shader in:

https://cgit.kde.org/plasma-workspace.git/tree/lookandfeel/contents/components/UserDelegate.qml#n102

omits the precision specifiers required for GLSL/ES compatibility, see:

http://doc.qt.io/qt-5/qglshaderprogram.html#writing-portable-shaders

Running e.g. sddm-greeter on a GL/ES 2.0 plattform results in the following error message:

Jul 15 09:11:11 susetest sddm-greeter[6178]: QOpenGLShader::compile(Fragment):
        0:6(2): error: No precision specified in this scope for type `vec4'
        0:7(2): error: No precision specified in this scope for type `float'
        ...

First one refers to "uniform vec4 colorBorder;", next to "float blend = 0.01;".

The vec4 {colorBorder, colorEmpty, colorSource} should be "lowp" (sufficient for color representation), all other (used for coordinate calculations) should be "highp".
Comment 1 Stefan Brüns 2017-09-26 21:16:43 UTC
Git commit 129884c7b02f7123fef48028cf29ac0c3d0c5589 by Stefan Brüns.
Committed on 26/09/2017 at 21:16.
Pushed by bruns into branch 'master'.

[lookandfeel] Fix GLES incompatibilities in UserDelegate shader code

Summary:

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

M  +8    -8    lookandfeel/contents/components/UserDelegate.qml

https://commits.kde.org/plasma-workspace/129884c7b02f7123fef48028cf29ac0c3d0c5589