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

feat: add support to ARM devices (and older hardware) #1160

Merged
merged 13 commits into from
Jan 26, 2022

Conversation

derezzedex
Copy link
Member

@derezzedex derezzedex commented Dec 16, 2021

This PR aims to add support to ARM devices and older hardware.
Since this depends on hecrj/glow_glyph#5, the main idea of those changes are basically the same, so check that first.

Changes

To maximize compatibility, this PR does a couple of things:

  • Add targets for armv7 and aarch64.
  • Separate the quad pipeline into core and compatibility.
  • Create and select different shaders based on context version.
  • Add a Setting field to allow developers to try OpenGL ES first (this should be better for embedded devices).

There are also some "quality of life" changes:

  • Add some logging to the changed areas (and env_logger to game_of_life).
  • Export iced_winit::conversion in iced_glutin.
  • Export glow and winit on their iced_ version.
  • Fixes a problem with the integration_opengl example. (Fix memory leak in opengl integration example #1181)
  • Improve documentation related to current built-in renderers.

Closes #428.
Closes #931.

@derezzedex derezzedex marked this pull request as ready for review January 5, 2022 00:21
Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! Really nice job here 🥳

In the future, once offscreen rendering lands, it'd be great to test the output of both pipelines (potentially in CI) to ensure minimal differences!

In any case, I left just a couple of suggestions! Let me know what you think.

glow/src/backend.rs Outdated Show resolved Hide resolved
glow/README.md Show resolved Hide resolved
docker/README.md Outdated
### Raspberry Pi 3/4 (64 bits)
```
$ docker build -t iced-rs/aarch64 -f Dockerfile.aarch64-unknown-linux-gnu .
```
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this docker folder is generic enough to become a standalone repository for all of the Rust ecosystem!

Instead of including it here, I believe we could create a GitHub Action to easily cross-compile any Rust project for Raspberry Pis. I'll gladly help you out with this!

Once we do that, we could then change the build workflow to additionally build binaries of the todos example for the Raspberry Pis and make sure we keep everything compatible moving forward.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right now the Dockerfiles are tailored to iced, but if we wanted we could upload the images to 'Docker Hub'.
This could be useful to developers cross-compiling their iced apps, meaning they could build using our Dockerfile:

FROM iced-rs/iced:arm64

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the idea! I have created an organization in Docker Hub and a new iced-rs/docker repository.

Let me know your username in Docker Hub and I will add you.

Copy link
Member

@hecrj hecrj Jan 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have added a workflow in iced-rs/docker to build the images in GitHub CI and push them to Docker Hub.

Also, I have removed the docker folder in 33d52b5 and added a todos_raspberry job to the build workflow in 522368e. Everything seems to work nicely!

It'd be great if you could try the binaries from this GitHub CI run in the Pis.

Copy link
Member

@hecrj hecrj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, Richard!

If you agree with my latest changes, I think this ship is ready to sail! 🚢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Done
2 participants