-
- Posts: 4
- Joined: Tue Jul 05, 2022 5:35 pm
Vulkan or OpenGL ES?
For some context, I want to use the features of the hardware on the raspberry pi 4b (for example ARM NEON and the performance tricks in mesa described here) to optimize 2D/3D rendering . I want to experiment with some throwaway programs to play around with these features, do benchmarks and then maybe create a library which I can use with all those optimizations in the future.
With that said, I don't know if I should learn OpenGL ES or Vulkan. Apparently the latest API versions for both that are supported on the raspberry pi 4b are Vulkan 1.2.217[1] and OpenGL ES 3.1[2]. With which one of these can I currently optimize my programs better? I know Vulkan generally allows you to make more optimizations but does that apply to raspberry pi 4b as well? For example, the ARM NEON I mentioned looks like was made to be used with OpenGL but there is some SDK I have to use to get it to work with Vulkan I think. I know Vulkan is considered more difficult but I'm not on a deadline or anything, just want to learn.
1. https://www.khronos.org/conformance/ado ... ission_700
2. https://www.raspberrypi.com/products/ra ... fications/
With that said, I don't know if I should learn OpenGL ES or Vulkan. Apparently the latest API versions for both that are supported on the raspberry pi 4b are Vulkan 1.2.217[1] and OpenGL ES 3.1[2]. With which one of these can I currently optimize my programs better? I know Vulkan generally allows you to make more optimizations but does that apply to raspberry pi 4b as well? For example, the ARM NEON I mentioned looks like was made to be used with OpenGL but there is some SDK I have to use to get it to work with Vulkan I think. I know Vulkan is considered more difficult but I'm not on a deadline or anything, just want to learn.
1. https://www.khronos.org/conformance/ado ... ission_700
2. https://www.raspberrypi.com/products/ra ... fications/
-
- Posts: 501
- Joined: Mon Apr 06, 2020 3:49 am
Re: Vulkan or OpenGL ES?
Do you love the technical and dry side of programming?
Then start looking at Vulkan.
OpenGL/GLES is much easier to use for someone who's not an experienced graphics programmer.
Personally I would recommend doing some tests in GL with what you think is going to be the most demanding parts of your project and see if it works well enough.
Then start looking at Vulkan.
OpenGL/GLES is much easier to use for someone who's not an experienced graphics programmer.
Personally I would recommend doing some tests in GL with what you think is going to be the most demanding parts of your project and see if it works well enough.
Re: Vulkan or OpenGL ES?
Vulkan is the way forward, both OpenGL and OpenGL ES are effectively deprecated. The multitude of Vulkan wrappers have already had some casualties perhaps showing that pure Vulkan is the eventual preference for many, or the opposite?
Re: Vulkan or OpenGL ES?
RedMarsBlueMoon wrote: ↑Fri Apr 28, 2023 5:30 pmDo you love the technical and dry side of programming?
Then start looking at Vulkan.

Vulkan provides much lower level access to the GPU - the original Mantle became an API independent user space driver layer - so many details have to be managed, but the benefit is you can control those details.
Because I want to run on older Pis, I'm using OpenGL ES for a new little project, but expect to port to Vulkan eventually.
In fact, if your priority is learning, writing or just grabbing an existing simple OpenGL ES program and porting it to Vulkan might be a good exercise.
I haven't played with these demos, but the 9.0 version definitely has some Vulkan samples: https://archive.mesa3d.org/demos/
-
- Posts: 4
- Joined: Tue Jul 05, 2022 5:35 pm
Re: Vulkan or OpenGL ES?
Thanks for the replies. I'm gonna go with Vulkan then.
Re: Vulkan or OpenGL ES?
OpenGL is very deprecated, some 5 years since 4.6 but its far from dead. I am aware of at least two Unis with comp sci graphics modules that teach on mainly openGL with a bit of rasterisation on the CPU side to show what's happening under the covers. It's much easier way to work on the GPU with shaders beyond the abstractions like sdl2 and sfml.
I think OpenGL is surviving because of the much higher effort to entry into Vulkan.
I think OpenGL is surviving because of the much higher effort to entry into Vulkan.
-
- Posts: 47
- Joined: Wed Jun 07, 2017 6:00 am
Re: Vulkan or OpenGL ES?
Vulkan is purely for optimized speed, and needs much more tedious works to make something start, as it exposes more API details such as command buffer. In my experience, OpenGL needs several hundreds lines to make draw trivial triangle, and I believe Vulkan would need several times more.
As Vulkan and OpenGL are both managed by Khronos, you can consider Vulkan as the de-facto successor of OpenGL. However you probably don't need to worry about the deprecation of OpenGL as there are plenty amount of old devices even only supports GLES 2.
In my opinion, if you are completely new for GPU programming, you can choose any API you like as the underlying rendering pipeline are same. Their difference is the extent of exposure to you.
As Vulkan and OpenGL are both managed by Khronos, you can consider Vulkan as the de-facto successor of OpenGL. However you probably don't need to worry about the deprecation of OpenGL as there are plenty amount of old devices even only supports GLES 2.
In my opinion, if you are completely new for GPU programming, you can choose any API you like as the underlying rendering pipeline are same. Their difference is the extent of exposure to you.
Re: Vulkan or OpenGL ES?
That's what ChatGPT is forjiandingzhe wrote: ↑Tue May 02, 2023 8:44 amOpenGL needs several hundreds lines to make draw trivial triangle, and I believe Vulkan would need several times more.

Re: Vulkan or OpenGL ES?
Several hundred lines if you count the code in the gl3w or whatever your choice of libraries etc.
But excluding the includes (interesting language there) a nice colour blended triangle in OpenGL is just a screenful of code.
But excluding the includes (interesting language there) a nice colour blended triangle in OpenGL is just a screenful of code.
Re: Vulkan or OpenGL ES?
I have run the OpenSceneGraph and VulkanSceneGraph demo app on Pi's.
OSC is a bit slow, VSG is usable.
Twice as fast, if not faster.
Because the Pi is so borderline, the extra speed of Vulkan is useful.
Depends on the applications but learning Vulkan is probably going to be better long term.
There are some other Vulkan libs apart from VSG making it easier to do Vulkan stuff.
How many will work on Pi's?
We don't know what will be in the Pi5 re GPU magic but the next Linux kernel 6+ with Mesa 23+ should be even better on Pi4's.
That might improve OpenGL too.
Running 64Bit OS also adds about a 15% speed advantage.
Manjaro is probably the best OS at the moment to try things until the new Debian is out.
OSC is a bit slow, VSG is usable.
Twice as fast, if not faster.
Because the Pi is so borderline, the extra speed of Vulkan is useful.
Depends on the applications but learning Vulkan is probably going to be better long term.
There are some other Vulkan libs apart from VSG making it easier to do Vulkan stuff.
How many will work on Pi's?
We don't know what will be in the Pi5 re GPU magic but the next Linux kernel 6+ with Mesa 23+ should be even better on Pi4's.
That might improve OpenGL too.
Running 64Bit OS also adds about a 15% speed advantage.
Manjaro is probably the best OS at the moment to try things until the new Debian is out.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges
Raspberries are not Apples or Oranges
-
- Posts: 9564
- Joined: Sat Aug 18, 2012 2:33 pm
Re: Vulkan or OpenGL ES?
there is also several other questions
do you want only 2d rendering, or stuff that requires the 3d core?
do you run under X or bare console?
some API's may be far simpler, if your needs match up
https://www.youtube.com/watch?v=JFmCin3EJIs
this is an example of what you can do with only the 2d core, in bare console
do you want only 2d rendering, or stuff that requires the 3d core?
do you run under X or bare console?
some API's may be far simpler, if your needs match up
https://www.youtube.com/watch?v=JFmCin3EJIs
this is an example of what you can do with only the 2d core, in bare console
-
- Posts: 4
- Joined: Tue Jul 05, 2022 5:35 pm
Re: Vulkan or OpenGL ES?
Is there something Manjaro offers for the raspberry pis that isn't there on Arch on ARM in this context?Gavinmc42 wrote: ↑Wed May 03, 2023 10:04 amI have run the OpenSceneGraph and VulkanSceneGraph demo app on Pi's.
OSC is a bit slow, VSG is usable.
Twice as fast, if not faster.
Because the Pi is so borderline, the extra speed of Vulkan is useful.
Depends on the applications but learning Vulkan is probably going to be better long term.
There are some other Vulkan libs apart from VSG making it easier to do Vulkan stuff.
How many will work on Pi's?
We don't know what will be in the Pi5 re GPU magic but the next Linux kernel 6+ with Mesa 23+ should be even better on Pi4's.
That might improve OpenGL too.
Running 64Bit OS also adds about a 15% speed advantage.
Manjaro is probably the best OS at the moment to try things until the new Debian is out.
-
- Posts: 4
- Joined: Tue Jul 05, 2022 5:35 pm
Re: Vulkan or OpenGL ES?
Yes I was interested in learning how to render things in console similar to that link you posted and kmscube. I think I am not going to continue with Linux anymore though and instead try to do this in OpenBSD because of the goals they list on their website despite it being slower.cleverca22 wrote: ↑Wed May 03, 2023 1:14 pmthere is also several other questions
do you want only 2d rendering, or stuff that requires the 3d core?
do you run under X or bare console?
some API's may be far simpler, if your needs match up
https://www.youtube.com/watch?v=JFmCin3EJIs
this is an example of what you can do with only the 2d core, in bare console
Re: Vulkan or OpenGL ES?
Am I right in thinking that Vulkan for RPi4 is still in development, and not yet included in the standard Raspberry Pi Bullseye images?
Apologies for the tenuously-related question, but I can't find confirmation of this anywhere.
Apologies for the tenuously-related question, but I can't find confirmation of this anywhere.
-
- Raspberry Pi Engineer & Forum Moderator
- Posts: 8404
- Joined: Wed Aug 17, 2011 7:41 pm
- Location: Cambridge
Re: Vulkan or OpenGL ES?
It is supported by latest mesa. But bullseye uses an older stable version of mesa (20.3.5).
So you'll have to build mesa from source (or find someone else who has) to use it.
Re: Vulkan or OpenGL ES?
Thanks for this. There's no real urgency on my part so I'll probably wait until Vulkan finds its way into the official Bullseye (or later) release images.It is supported by latest mesa. But bullseye uses an older stable version of mesa (20.3.5).
So you'll have to build mesa from source (or find someone else who has) to use it.
Re: Vulkan or OpenGL ES?
You could try installing newer drivers with PiKiss, that has worked for me many times.
https://github.com/jmcerrejon/PiKISS/tr ... pts/config
But these days I am just waiting for the new Debian Bookworm, I am over installing Vulkan/Mesa etc.
Been doing it for years but it breaks on the standard update/upgrade
Still learning/waiting for a decent game engine to use it.
https://github.com/jmcerrejon/PiKISS/tr ... pts/config
But these days I am just waiting for the new Debian Bookworm, I am over installing Vulkan/Mesa etc.
Been doing it for years but it breaks on the standard update/upgrade

Still learning/waiting for a decent game engine to use it.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges
Raspberries are not Apples or Oranges
Re: Vulkan or OpenGL ES?
Nice to check on the commits once in a while to see what is happening.
https://gitlab.freedesktop.org/mesa/mes ... com/vulkan
Someone must be using it if issues get identified and fixed/added?
If I am reading v3dv_device.c file correctly it looks like there is some Vulkan 1.3 stuff in there now.
But this says 1.2.246 with mesa 23.1.4
http://vulkan.gpuinfo.org/listdevices.p ... form=linux
And sometimes there is info on progress on the Planet Igalia blog.
I notice a lot of Wayland stuff in commits and search found this.
https://www.phoronix.com/news/MPV-0.36-Released
Hmm, latest MPV we have is 0.32.0 on current Raspberry OS.
Might be interesting to try a Wayland based OS on the Pi?
I guess I would wait for mesa 23.x to show up.
https://www.phoronix.com/news/V3DV-New- ... on-Queries
https://gitlab.freedesktop.org/mesa/mes ... com/vulkan
Someone must be using it if issues get identified and fixed/added?
If I am reading v3dv_device.c file correctly it looks like there is some Vulkan 1.3 stuff in there now.
But this says 1.2.246 with mesa 23.1.4
http://vulkan.gpuinfo.org/listdevices.p ... form=linux
And sometimes there is info on progress on the Planet Igalia blog.
I notice a lot of Wayland stuff in commits and search found this.
https://www.phoronix.com/news/MPV-0.36-Released
Hmm, latest MPV we have is 0.32.0 on current Raspberry OS.
Might be interesting to try a Wayland based OS on the Pi?
I guess I would wait for mesa 23.x to show up.
https://www.phoronix.com/news/V3DV-New- ... on-Queries
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges
Raspberries are not Apples or Oranges
Re: Vulkan or OpenGL ES?
Might be worth tying a new library
https://www.khronos.org/blog/meta-uses- ... cs-library
Some examples too.
https://www.khronos.org/blog/meta-uses- ... cs-library
Some examples too.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges
Raspberries are not Apples or Oranges
Re: Vulkan or OpenGL ES?
im on mesa-23.3-git & mpv-0.36, sway/wayland/vulkan no issue.Gavinmc42 wrote: ↑Wed Jul 26, 2023 1:30 pmNice to check on the commits once in a while to see what is happening.
https://gitlab.freedesktop.org/mesa/mes ... com/vulkan
Someone must be using it if issues get identified and fixed/added?
If I am reading v3dv_device.c file correctly it looks like there is some Vulkan 1.3 stuff in there now.
But this says 1.2.246 with mesa 23.1.4
http://vulkan.gpuinfo.org/listdevices.p ... form=linux
And sometimes there is info on progress on the Planet Igalia blog.
I notice a lot of Wayland stuff in commits and search found this.
https://www.phoronix.com/news/MPV-0.36-Released
Hmm, latest MPV we have is 0.32.0 on current Raspberry OS.
Might be interesting to try a Wayland based OS on the Pi?
I guess I would wait for mesa 23.x to show up.
https://www.phoronix.com/news/V3DV-New- ... on-Queries
https://www.phoronix.com/news/MPV-0.36-Released
Re: Vulkan or OpenGL ES?
Rolled your own OS or off the shelf Linux?im on mesa-23.3-git & mpv-0.36, sway/wayland/vulkan no issue.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges
Raspberries are not Apples or Oranges
- radiolistener
- Posts: 622
- Joined: Thu Aug 03, 2023 6:49 am
Re: Vulkan or OpenGL ES?
Thanks for links.
I have a question. How can I make sure if I'm using Mesa’s VC4 graphics driver as opengl renderer?
glGetString reports renderer V3D 4.2, and Open GL 2.1 Mesa 20.3.5.
It seems that V3D is not VC4. Then how I can install VC4 graphics driver?
I have a question. How can I make sure if I'm using Mesa’s VC4 graphics driver as opengl renderer?
glGetString reports renderer V3D 4.2, and Open GL 2.1 Mesa 20.3.5.
It seems that V3D is not VC4. Then how I can install VC4 graphics driver?
Re: Vulkan or OpenGL ES?
V3D is the Mesa Videocore 3D, VC4/VC6 driver.
V3DV is the Vulkan driver.
Both are aware of the Videocore4/6 differences.
V3DV is the Vulkan driver.
Both are aware of the Videocore4/6 differences.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges
Raspberries are not Apples or Oranges
- radiolistener
- Posts: 622
- Joined: Thu Aug 03, 2023 6:49 am
Re: Vulkan or OpenGL ES?
if V3D uses VC4, then how to check if it really uses it?