Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Will not run on pinephone #1

Closed
dvdsk opened this issue Dec 4, 2020 · 12 comments
Closed

Will not run on pinephone #1

dvdsk opened this issue Dec 4, 2020 · 12 comments
Assignees
Labels
bug Something isn't working

Comments

@dvdsk
Copy link
Owner

dvdsk commented Dec 4, 2020

Iced depends on either a Vulkan or OpenGL backend (opengl via glow). The shaders for Iced are written in GLSL 3.3 and the pinephones old Mali 400 mp2 GPU only supports up to OpenGL ES 1.0 and OpenGL 1.2.

Two possible paths forward:

  • rewrite all shaders used by iced (at least glow_glyph) to one of those versions.
  • find a different UI library

Need to investigate what shaders need to be translated. One way of doing that could be to remove all shader code and lower the version to 1.2 then see if the shaders compile on the pinephone.

@dvdsk dvdsk added the bug Something isn't working label Dec 4, 2020
@dvdsk
Copy link
Owner Author

dvdsk commented Dec 4, 2020

This glow-glyph fork has OpenGL ES 3.0 instead of OpenGL 3.0 https://github.com/tedsta/glow_glyph/blob/master/src/shader/vertex.vert

@dvdsk
Copy link
Owner Author

dvdsk commented Dec 4, 2020

More OpenGL 3.3 shaders found

@dvdsk
Copy link
Owner Author

dvdsk commented Dec 4, 2020

Iced seems to have a plan for a software rendering option in the future for now its probably better to see if there is another gui framework and otherwise give up....

@dvdsk dvdsk self-assigned this Dec 4, 2020
@dvdsk
Copy link
Owner Author

dvdsk commented Dec 4, 2020

@black-puppydog
Copy link
Contributor

This is why I was asking whether you had compiled in on the PP over on HN. :P
But I don't know enough about this (never written GL anything in my life) so I didn't want to say "it doesn't work".

Do you have preferences for a different UI framework?

@dvdsk
Copy link
Owner Author

dvdsk commented Dec 5, 2020

I only got a pinephone yesterday, but certainly learned a lesson here :). Its a pitty since I just got streaming audio working the day before.

I had one computer graphics course in OpenGL, so this weekend I am trying to see if I can backport/transpile the shaders to GLSL ES 1.0. Starting with glow_glyph. I got that compiling and running without panics by disabling a part of the shader and transpiling the rest. The hard part will be to rewrite the disabled part, since it uses a hardware feature not available on GLSL ES 1.0

If that doesn't go anywhere I'll see which frameworks I can get running on the phone. I would prefer something cross platform, if this works out I want to add some kind of syncing feature.

@black-puppydog
Copy link
Contributor

black-puppydog commented Dec 6, 2020

BTW in case you hadn't seen this, this is the only issue for iced where mobile is really discussed.
It's not deep discussion. But the dev doesn't seem to be against it, it's just a matter of resources.

(But since in that issue, everyone is talking about android/iOS, it might be worth creating a new issue and clarifying how it differs in scope/purpose)

@dvdsk
Copy link
Owner Author

dvdsk commented Dec 6, 2020

BTW in case you hadn't seen this, this is the only issue for iced where mobile is really discussed.
It's not deep discussion. But the dev doesn't seem to be against it, it's just a matter of resources.

(But since in that issue, everyone is talking about android/iOS, it might be worth creating a new issue and clarifying how it differs in scope/purpose)

I might be missing a link in there? Assuming this issue, the only thing I really fear is scrolling. I know buttons will work since touch presses should map to mouse clicks, no idea how scrolling would be done.... kinda hoping the OS takes care of it. We shall see :)

@dvdsk
Copy link
Owner Author

dvdsk commented Dec 6, 2020

Update regarding the OpenGL issue, my fork of iced_glyph can now display a single letter*! yay... making it fully functional should be easy enough now.

  • Then I need to change some things about the way the data is presented to the GPU to save on gpu memory to prevent this new old opengl work from being horribly inefficient.
  • Then port the iced shaders
  • And finally put it all behind a feature flag and pull request

* though I cant see it on the pinephone as the window is larger then the screen.... Ill assume all is well and check back once we can write the screen full of text again.

@black-puppydog
Copy link
Contributor

I might be missing a link in there?

I should really get more sleep some day 🙈
If you have a usb-c dock, you can try and hook it up to a screen to see? That's how I usually work around the window size issues.

@dvdsk
Copy link
Owner Author

dvdsk commented Dec 30, 2020

I now have a fork of iced that works on the pinephone (you will need the feature glow_OpenGL2ES enabled when using that fork for something else).

Switching to that allows the app to run on the PinePhone 🎉

@dvdsk dvdsk closed this as completed Dec 30, 2020
@dvdsk
Copy link
Owner Author

dvdsk commented Jul 22, 2021

Relevent: iced-rs/iced#931

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants