Bug 460239 - KAlgebra 3D graphs are not plotted on the PinePhone due to shader error
Summary: KAlgebra 3D graphs are not plotted on the PinePhone due to shader error
Status: RESOLVED FIXED
Alias: None
Product: analitza
Classification: Frameworks and Libraries
Component: analitzaplot (other bugs)
Version First Reported In: unspecified
Platform: Manjaro Linux
: NOR normal
Target Milestone: ---
Assignee: Aleix Pol
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-10-11 13:40 UTC by Kevin Kofler
Modified: 2022-11-13 00:07 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 22.12
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kevin Kofler 2022-10-11 13:40:18 UTC
SUMMARY
3D graph plots in KAlgebra Mobile are not rendered.

STEPS TO REPRODUCE
1. Install kalgebra on the PinePhone. I am using Manjaro ARM Plasma Mobile.
2. Run KAlgebra Mobile from the menu.
3. Go to Graph 3D.
4. Touch the circled + button to open the popup.
5. Touch the + button in the popup to add the example sin x*sin y plot. You can also try any other function. It does not make a difference.

OBSERVED RESULT
The plot area remains completely black.

EXPECTED RESULT
The 3D graph is rendered.

SOFTWARE/OS VERSIONS
Manjaro ARM Plasma Mobile
Pine64 PinePhone (1.2) (Allwinner A64 / Cortex A53 aarch64)
KDE Plasma Version: 5.25.5
KDE Frameworks Version: 5.98.0
Qt Version: 5.15.6
kalgebra 22.08.1-1 (Manjaro ARM Package)

ADDITIONAL INFORMATION
This is the terminal output. I believe the first error to be the root cause and the remaining ones to be followups that ultimately lead to nothing at all being rendered:

QOpenGLShader::compile(Fragment): 0:4(2): error: No precision specified in this scope for type `float'

*** Problematic Fragment shader source code ***
#ifdef GL_KHR_blend_equation_advanced
#extension GL_ARB_fragment_coord_conventions : enable
#extension GL_KHR_blend_equation_advanced : enable
#endif
#ifndef GL_FRAGMENT_PRECISION_HIGH
#define highp mediump
#endif
#line 1
uniform mediump vec4 color;
void main(void)
{
   float w = 10.*gl_FragCoord.w;
   highp vec4 zvec = vec4(w, w, w, 1.0);   gl_FragColor = mix(color, zvec, vec4(.5,.5,.5,1.));
}
***
QOpenGLShader::link: error: program lacks a fragment shader

QOpenGLShader::link: error: program lacks a fragment shader

QOpenGLShaderProgram::uniformLocation(matrix): shader program is not linked
QOpenGLShaderProgram::attributeLocation(vertex): shader program is not linked
QOpenGLShaderProgram::attributeLocation(normal): shader program is not linked
QOpenGLShaderProgram::attributeLocation(vertex): shader program is not linked
QOpenGLShaderProgram::uniformLocation(color): shader program is not linked
QOpenGLShaderProgram::uniformLocation(color): shader program is not linked
QOpenGLShaderProgram::uniformLocation(color): shader program is not linked
QOpenGLShaderProgram::attributeLocation(vertex): shader program is not linked
QOpenGLShaderProgram::uniformLocation(color): shader program is not linked
QOpenGLShader::link: error: program lacks a fragment shader

QOpenGLShaderProgram::uniformLocation(matrix): shader program is not linked
QOpenGLShaderProgram::attributeLocation(vertex): shader program is not linked
QOpenGLShaderProgram::attributeLocation(normal): shader program is not linked
QOpenGLShaderProgram::attributeLocation(vertex): shader program is not linked
QOpenGLShaderProgram::uniformLocation(color): shader program is not linked
QOpenGLShaderProgram::uniformLocation(color): shader program is not linked
QOpenGLShaderProgram::uniformLocation(color): shader program is not linked
QOpenGLShaderProgram::attributeLocation(vertex): shader program is not linked
QOpenGLShaderProgram::uniformLocation(color): shader program is not linked
Comment 1 Kevin Kofler 2022-10-11 13:41:20 UTC
And in case it matters:
Kernel version: 5.19.11-1-MANJARO-ARM
Comment 2 Kevin Kofler 2022-10-11 13:47:15 UTC
And I am using the qt5-es2-{base,declarative,multimedia} (OpenGL ES) builds.
Comment 3 Kevin Kofler 2022-10-11 13:53:22 UTC
Looks like the offending code is actually part of analitza(plot).
I am using: analitza 22.08.1-1
Comment 4 Kevin Kofler 2022-10-11 13:55:50 UTC
Apparently a regression from this 2015 commit:
https://invent.kde.org/education/analitza/-/commit/80a3833ee306ee62ef61126d31fd7649bc7394af
Comment 5 Kevin Kofler 2022-10-11 13:58:26 UTC
I guess it should say "highp float w = …" instead of "float w = …".
Comment 6 Kevin Kofler 2022-11-02 02:47:28 UTC
Ping? Aleix, can you please look into this? Or anybody else? It looks to me like this should be a one-word fix (see my comments above), though I am not by any means an expert for OpenGL shaders.
Comment 7 Aleix Pol 2022-11-03 01:26:39 UTC
Git commit 2af6c7ddbd5d961dc0aefda0e08367fb2cf1d858 by Aleix Pol.
Committed on 03/11/2022 at 01:25.
Pushed by apol into branch 'master'.

analitzaplot: Fix 3D plots on the pinephone

It complains about the lack of precision on the float there whereas
elsewhere it doesn't. Adding the highp still works on other devices so
we have all bases covered.

M  +1    -1    analitzaplot/plotter3d_es.cpp

https://invent.kde.org/education/analitza/commit/2af6c7ddbd5d961dc0aefda0e08367fb2cf1d858
Comment 8 Aleix Pol 2022-11-03 01:27:41 UTC
There you go, it was exactly what you said.
Comment 9 Aleix Pol 2022-11-03 01:28:14 UTC
Git commit 9f32552760eaf462a79356011ed117a4ce03a62a by Aleix Pol Gonzalez, on behalf of Aleix Pol.
Committed on 03/11/2022 at 01:28.
Pushed by apol into branch 'release/22.08'.

analitzaplot: Fix 3D plots on the pinephone

It complains about the lack of precision on the float there whereas
elsewhere it doesn't. Adding the highp still works on other devices so
we have all bases covered.


(cherry picked from commit 2af6c7ddbd5d961dc0aefda0e08367fb2cf1d858)

M  +1    -1    analitzaplot/plotter3d_es.cpp

https://invent.kde.org/education/analitza/commit/9f32552760eaf462a79356011ed117a4ce03a62a
Comment 10 Kevin Kofler 2022-11-03 03:56:36 UTC
Thanks a lot!
Comment 11 Kevin Kofler 2022-11-13 00:07:39 UTC
Unfortunately, this missed 22.08.3 by 2 days, and there is no 22.08.4 planned, so 22.12(.0) will likely be the first release to ship the fix.