User avatar
johannesl
Posts: 17
Joined: Thu May 23, 2013 8:38 pm

OpenGL on Buster on both Pi 3 and Pi 4

Thu Jun 27, 2019 10:59 pm

My Raspberry Pi 4 just arrived and I got to try out the new Raspbian Buster both on the Pi 4 and the Pi 3.

Good news: the usual OpenGLES things found in /opt/vc/src still works great out-of-the-box with Raspbian Buster on the Pi 3 (thus probably all earlier devices as well). This means you are not forced to use X11 and the new v3d driver on your existing devices and that you can still do OpenGLES on the zero without X11 using up all memory.

Pi 4: Trying to run the OpenGLES examples from /opt/vc/src fails. This is due to the Pi 4 missing the previous vc4 driver so to do any OpenGL at all on the Pi 4 you need to use the new v3d mesa driver (which is activated by default on the Pi 4) and run your things in X11. Initial tests with openarena on the Pi 4 gives weak performance compared to how Quake3 runs on the Pi 3 and I have yet to find any good best-practices / runnable demos that runs great (but maybe I havn't dug deep enough into these forums yet?).

My advice for anyone looking to do OpenGLES programming on the Pi is to use your existing Pi 2 or Pi 3 and toy around with those hello_pi examples that can be found in /opt/vc/src. Also have a look at the excellent work that paddyg has been doing here in the forum. There's also a Quake 1 port that runs great if you want to dive deep into code. Hopefully in 6-12 months things have matured a bit and more examples are available, ideally examples that are buildable for both the battle tested legacy vc4 driver and the new v3d driver which is required on the Pi 4.

For some inspiration as to what you can build, have a look at this example running on a Raspberry Pi 2:
https://www.youtube.com/watch?v=vgoi1n-x6ms

User avatar
leilei
Posts: 20
Joined: Wed Jun 26, 2019 2:26 am

Re: OpenGL on Buster on both Pi 3 and Pi 4

Fri Jun 28, 2019 12:40 am

OpenArena's assets use way more texture switching than Quake3 and there's a lot of flares which mean a lot of depth reading per frame (which is worse in high resolutions). There's also the purely software-driven "shader" system that would not be trivial to rewrite for a shader-driven pipeline without breaking compatibility with existing assets in various ways. In its currently released state, i'd highly advise against benchmarking with it.

There's no GLES backend in OA proper in any of the releases, but there is a broken one in our official engine repository, which does not have any optimal rendering paths and is backported from pelya's Android version and I don't know how far that can be adapted to becoming an EGL backend for the Pi - and even then, it'll probably still be slow for the lack of multitexturing and the assets being a mess without any foresight about embedded GPUs, and officially there's no graphics programming manpower to bring it to my desires (GL1.x/SDL1.2 base, with additional backends). It's just only me adding features to the GL1.x/GL2 hybrid renderer in the code/renderer_oa/ directory for the future content reboot that uses them (particles, atlases/texture pages, eyes).

User avatar
Gavinmc42
Posts: 4068
Joined: Wed Aug 28, 2013 3:31 am

Re: OpenGL on Buster on both Pi 3 and Pi 4

Fri Jun 28, 2019 1:26 am

I use Gentoo64 on 3B+ for my OpenGL testing.
Raspbian is based on Debian and plays it safe.
This new Buster seems better but is not as fast as Gentoo64 unless I did something wrong?

My benchmark tests are the mesa demo examples.
Not only are they single file based they are readable, which helps as I am on the steep part of the learning curve ;)

Going to be interesting now that we have OpenGLES 3.2 to play with as well in the VC6.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

Brian Beuken
Posts: 177
Joined: Fri Jan 29, 2016 12:51 pm

Re: OpenGL on Buster on both Pi 3 and Pi 4

Mon Jul 01, 2019 6:57 am

Not sure that the Pi4 does actually have v3d mesa driver in place? I had to install libgles2-mesa-dev and after a bit of effort managed to get the Pi to work like any other stock Linux SBC, but the frame rate was appalling. I'm guessing that there is no actual hardware GPU driver available?
Very old computer game programmer, now teaching very young computer game programmers, some very bad habits.
Wrote some book about coding Pi's and SBC's, it's out now...go get it!
http://www.scratchpadgames.net/

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7578
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: OpenGL on Buster on both Pi 3 and Pi 4

Mon Jul 01, 2019 7:24 am

Brian Beuken wrote:
Mon Jul 01, 2019 6:57 am
Not sure that the Pi4 does actually have v3d mesa driver in place? I had to install libgles2-mesa-dev and after a bit of effort managed to get the Pi to work like any other stock Linux SBC, but the frame rate was appalling. I'm guessing that there is no actual hardware GPU driver available?
I have no idea what you have done, but there most certainly is full support for the V3D gpu. https://gitlab.freedesktop.org/mesa/mes ... ys/v3d/drm and the various other V3D bits within that mesa repo.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Brian Beuken
Posts: 177
Joined: Fri Jan 29, 2016 12:51 pm

Re: OpenGL on Buster on both Pi 3 and Pi 4

Mon Jul 01, 2019 7:34 am

ok, well perhaps we have a pro]blem of my not understanding the process, which is more than likely as I dislike all forms of linux intensely had have very limited working knowledge of it... I have not pulled anything from github, only

apt-get install libgles2-mesa-dev
apt-get install xorg-dev


If there is some other process needed to get drivers in place, can you provide a detailed explaination for an out of the box Pi4?
Very old computer game programmer, now teaching very young computer game programmers, some very bad habits.
Wrote some book about coding Pi's and SBC's, it's out now...go get it!
http://www.scratchpadgames.net/

DeluxePixel
Posts: 3
Joined: Mon Jul 01, 2019 8:12 am

Re: OpenGL on Buster on both Pi 3 and Pi 4

Mon Jul 01, 2019 8:18 am

6by9 wrote:
Mon Jul 01, 2019 7:24 am
I have no idea what you have done, but there most certainly is full support for the V3D gpu. https://gitlab.freedesktop.org/mesa/mes ... ys/v3d/drm and the various other V3D bits within that mesa repo.
I'm wondering if there is full support for the V3D gpu in the rpi4 then why do all the previous demos using the vc4 driver fail. To be specific, will there be a way of using the new hardware without having to use X11? Or does it work but we there is a slightly different way of initialising things?

User avatar
Gavinmc42
Posts: 4068
Joined: Wed Aug 28, 2013 3:31 am

Re: OpenGL on Buster on both Pi 3 and Pi 4

Mon Jul 01, 2019 8:25 am

Install the mesa-utils then glxinfo will tell you what you have.
I get glxgears 60fps on Buster on a Pi4.

I would have expected these to be on Buster as standard, perhaps next version?
Been playing OpenGL games for 3 days now :D
Still some tweaking but much better than old Raspbian and Pi3B+.

Only my 3B+'s I run Gentoo64 and OpenGL is pretty good.
I'm dancing on Rainbows.
Raspberries are not Apples or Oranges

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24191
Joined: Sat Jul 30, 2011 7:41 pm

Re: OpenGL on Buster on both Pi 3 and Pi 4

Mon Jul 01, 2019 8:30 am

DeluxePixel wrote:
Mon Jul 01, 2019 8:18 am
6by9 wrote:
Mon Jul 01, 2019 7:24 am
I have no idea what you have done, but there most certainly is full support for the V3D gpu. https://gitlab.freedesktop.org/mesa/mes ... ys/v3d/drm and the various other V3D bits within that mesa repo.
I'm wondering if there is full support for the V3D gpu in the rpi4 then why do all the previous demos using the vc4 driver fail. To be specific, will there be a way of using the new hardware without having to use X11? Or does it work but we there is a slightly different way of initialising things?
There is a completely new Mesa/DRM driver that uses the VC6 (note, 6) on the Pi4. AIUI, this is OpenGL compliant, so the OpenGLES (with some Pi VC4 specific stuff) compliant demo apps won't work in all cases, they need to be modified to initialise the display in the correct way.

I'm no expert on what is required, (e.g. initialisation, X11) but will try and find out.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

Brian Beuken
Posts: 177
Joined: Fri Jan 29, 2016 12:51 pm

Re: OpenGL on Buster on both Pi 3 and Pi 4

Mon Jul 01, 2019 8:42 am

jamesh wrote:
Mon Jul 01, 2019 8:30 am
DeluxePixel wrote:
Mon Jul 01, 2019 8:18 am
6by9 wrote:
Mon Jul 01, 2019 7:24 am
I have no idea what you have done, but there most certainly is full support for the V3D gpu. https://gitlab.freedesktop.org/mesa/mes ... ys/v3d/drm and the various other V3D bits within that mesa repo.
I'm wondering if there is full support for the V3D gpu in the rpi4 then why do all the previous demos using the vc4 driver fail. To be specific, will there be a way of using the new hardware without having to use X11? Or does it work but we there is a slightly different way of initialising things?
There is a completely new Mesa/DRM driver that uses the VC6 (note, 6) on the Pi4. AIUI, this is OpenGL compliant, so the OpenGLES (with some Pi VC4 specific stuff) compliant demo apps won't work in all cases, they need to be modified to initialise the display in the correct way.

I'm no expert on what is required, (e.g. initialisation, X11) but will try and find out.
Hi James,
I know how to get an X11 system set up and running using mesa libs, and that for the moment appears to be what I have but it shows no hardware acceleration, only mesa emulation as a result its running painfully slow and overheating the CPU as it stresses out.

ok I'm really struggling for clairity here, are you telling me, we have no OpenGLES2.0 but we do have OpenGL? (the exact version is unclear)
Do I get these new Mesa drivers with apt-get install gles2-mesa-dev?
Is that apt-get going to provide OpenGLES2.0 acceleration?
Will a project written for GLES2.0 on a Pi3 compile and run, on a Pi4 ie is it backward compatable?
Do I need to set something up in raspi-config?
Why is the Pi4, not able to build OpenGLES2.0 and 3.0 projects out of the box?
Very old computer game programmer, now teaching very young computer game programmers, some very bad habits.
Wrote some book about coding Pi's and SBC's, it's out now...go get it!
http://www.scratchpadgames.net/

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24191
Joined: Sat Jul 30, 2011 7:41 pm

Re: OpenGL on Buster on both Pi 3 and Pi 4

Mon Jul 01, 2019 8:51 am

Brian Beuken wrote:
Mon Jul 01, 2019 8:42 am
jamesh wrote:
Mon Jul 01, 2019 8:30 am
DeluxePixel wrote:
Mon Jul 01, 2019 8:18 am


I'm wondering if there is full support for the V3D gpu in the rpi4 then why do all the previous demos using the vc4 driver fail. To be specific, will there be a way of using the new hardware without having to use X11? Or does it work but we there is a slightly different way of initialising things?
There is a completely new Mesa/DRM driver that uses the VC6 (note, 6) on the Pi4. AIUI, this is OpenGL compliant, so the OpenGLES (with some Pi VC4 specific stuff) compliant demo apps won't work in all cases, they need to be modified to initialise the display in the correct way.

I'm no expert on what is required, (e.g. initialisation, X11) but will try and find out.
Hi James,
I know how to get an X11 system set up and running using mesa libs, and that for the moment appears to be what I have but it shows no hardware acceleration, only mesa emulation as a result its running painfully slow and overheating the CPU as it stresses out.

ok I'm really struggling for clairity here, are you telling me, we have no OpenGLES2.0 but we do have OpenGL? (the exact version is unclear)
Do I get these new Mesa drivers with apt-get install gles2-mesa-dev?
Is that apt-get going to provide OpenGLES2.0 acceleration?
Will a project written for GLES2.0 on a Pi3 compile and run, on a Pi4 ie is it backward compatable?
Do I need to set something up in raspi-config?
Why is the Pi4, not able to build OpenGLES2.0 and 3.0 projects out of the box?
Everything is installed by default, the Mesa drivers are running by default. AFAIK, you just recompile your OpenGL app and it works. You should not need to install anything, and if you have, you have probably broken the system and need to start again from scratch.

OpenGL max compat profile v2.1.
OpenGLES1 profile 1.1
OpenGLES23 profile 3.0

(glxinfo provides these numbers, installed as part of mesa-utils)
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

User avatar
PeterO
Posts: 5156
Joined: Sun Jul 22, 2012 4:14 pm

Re: OpenGL on Buster on both Pi 3 and Pi 4

Mon Jul 01, 2019 8:54 am

jamesh wrote:
Mon Jul 01, 2019 8:51 am

Everything is installed by default,
Not quite... You still need to manually install the mesa development package.
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24191
Joined: Sat Jul 30, 2011 7:41 pm

Re: OpenGL on Buster on both Pi 3 and Pi 4

Mon Jul 01, 2019 9:12 am

PeterO wrote:
Mon Jul 01, 2019 8:54 am
jamesh wrote:
Mon Jul 01, 2019 8:51 am

Everything is installed by default,
Not quite... You still need to manually install the mesa development package.
PeterO
Ah, fair point. I was thinking more on 'getting mesa and the desktop running' rather than compiling. What the specific library you need to install to compile?
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

Brian Beuken
Posts: 177
Joined: Fri Jan 29, 2016 12:51 pm

Re: OpenGL on Buster on both Pi 3 and Pi 4

Mon Jul 01, 2019 9:25 am

jamesh wrote:
Mon Jul 01, 2019 8:51 am

Everything is installed by default, the Mesa drivers are running by default. AFAIK, you just recompile your OpenGL app and it works. You should not need to install anything, and if you have, you have probably broken the system and need to start again from scratch.

OpenGL max compat profile v2.1.
OpenGLES1 profile 1.1
OpenGLES23 profile 3.0

(glxinfo provides these numbers, installed as part of mesa-utils)
hmmm no, thats not my experience at all and again clarity is not here.. OpenGL or OpenGLES? I've never written anything on OpenGL on the Pi, always GLES2.0 and would like to continue and expand to OpenGLES3.0. I cant currently do that out of the box.
I am happy to make the switch to X11 but if i can't get the the EGL to validate , I can't get acceleration. This maybe due to an access issue, i will try again tonight on a local execute to see if that is an issue.


Overall, i'm aware this is a new system with a redesigned graphics system which has amazing potential, but at the moment, its just confusing and there's a lot of contradicory info on the forums. Getting the hello triangle demos working is one thing, getting a large project that relies on acceleration is quite another and I feel I'm in the dark here.
Very old computer game programmer, now teaching very young computer game programmers, some very bad habits.
Wrote some book about coding Pi's and SBC's, it's out now...go get it!
http://www.scratchpadgames.net/

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24191
Joined: Sat Jul 30, 2011 7:41 pm

Re: OpenGL on Buster on both Pi 3 and Pi 4

Mon Jul 01, 2019 9:44 am

Brian Beuken wrote:
Mon Jul 01, 2019 9:25 am
jamesh wrote:
Mon Jul 01, 2019 8:51 am

Everything is installed by default, the Mesa drivers are running by default. AFAIK, you just recompile your OpenGL app and it works. You should not need to install anything, and if you have, you have probably broken the system and need to start again from scratch.

OpenGL max compat profile v2.1.
OpenGLES1 profile 1.1
OpenGLES23 profile 3.0

(glxinfo provides these numbers, installed as part of mesa-utils)
hmmm no, thats not my experience at all and again clarity is not here.. OpenGL or OpenGLES? I've never written anything on OpenGL on the Pi, always GLES2.0 and would like to continue and expand to OpenGLES3.0. I cant currently do that out of the box.
I am happy to make the switch to X11 but if i can't get the the EGL to validate , I can't get acceleration. This maybe due to an access issue, i will try again tonight on a local execute to see if that is an issue.


Overall, i'm aware this is a new system with a redesigned graphics system which has amazing potential, but at the moment, its just confusing and there's a lot of contradicory info on the forums. Getting the hello triangle demos working is one thing, getting a large project that relies on acceleration is quite another and I feel I'm in the dark here.
Those are the version of the different API's that are supported, so both OpenGL 2.1 and OpenGLES 3.0 are supported on Pi4. You should be able to do that 'out of the box', with the proviso you need to install the dev packages mentioned above.

You will need to make changes to the surface, I believe you no longer use EGL, but DRM to provide a rendering surface. Will check on that. DRM is now the standard Linux mechanism in this area.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

Brian Beuken
Posts: 177
Joined: Fri Jan 29, 2016 12:51 pm

Re: OpenGL on Buster on both Pi 3 and Pi 4

Mon Jul 01, 2019 9:55 am

jamesh wrote:
Mon Jul 01, 2019 9:44 am

Those are the version of the different API's that are supported, so both OpenGL 2.1 and OpenGLES 3.0 are supported on Pi4. You should be able to do that 'out of the box', with the proviso you need to install the dev packages mentioned above.

You will need to make changes to the surface, I believe you no longer use EGL, but DRM to provide a rendering surface. Will check on that. DRM is now the standard Linux mechanism in this area.
Well again no, there's no OpenGLES3.0 libs on the Buster clean install (though I might need to double check)
I will burn a fresh image and try again, but I did that already with my 1st attempt. Its quite troubling that Pi3 projects cannot be built to run as is...

however, am sure things will improve, and someone will provide the kind of idiots guide I need.
Very old computer game programmer, now teaching very young computer game programmers, some very bad habits.
Wrote some book about coding Pi's and SBC's, it's out now...go get it!
http://www.scratchpadgames.net/

User avatar
PeterO
Posts: 5156
Joined: Sun Jul 22, 2012 4:14 pm

Re: OpenGL on Buster on both Pi 3 and Pi 4

Mon Jul 01, 2019 9:59 am

Brian Beuken wrote:
Mon Jul 01, 2019 9:25 am
jamesh wrote:
Mon Jul 01, 2019 8:51 am

Everything is installed by default, the Mesa drivers are running by default. AFAIK, you just recompile your OpenGL app and it works. You should not need to install anything, and if you have, you have probably broken the system and need to start again from scratch.

OpenGL max compat profile v2.1.
OpenGLES1 profile 1.1
OpenGLES23 profile 3.0

(glxinfo provides these numbers, installed as part of mesa-utils)
hmmm no, thats not my experience at all and again clarity is not here.. OpenGL or OpenGLES? I've never written anything on OpenGL on the Pi, always GLES2.0 and would like to continue and expand to OpenGLES3.0. I cant currently do that out of the box.
I am happy to make the switch to X11 but if i can't get the the EGL to validate , I can't get acceleration. This maybe due to an access issue, i will try again tonight on a local execute to see if that is an issue.


Overall, i'm aware this is a new system with a redesigned graphics system which has amazing potential, but at the moment, its just confusing and there's a lot of contradicory info on the forums. Getting the hello triangle demos working is one thing, getting a large project that relies on acceleration is quite another and I feel I'm in the dark here.
Brian,

Until you've tried to build your code locally on the PI and not using the remote Visual Studio tool to run it I think all bet are off as to what is causing your problems.

PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24191
Joined: Sat Jul 30, 2011 7:41 pm

Re: OpenGL on Buster on both Pi 3 and Pi 4

Mon Jul 01, 2019 10:03 am

Brian Beuken wrote:
Mon Jul 01, 2019 9:55 am
jamesh wrote:
Mon Jul 01, 2019 9:44 am

Those are the version of the different API's that are supported, so both OpenGL 2.1 and OpenGLES 3.0 are supported on Pi4. You should be able to do that 'out of the box', with the proviso you need to install the dev packages mentioned above.

You will need to make changes to the surface, I believe you no longer use EGL, but DRM to provide a rendering surface. Will check on that. DRM is now the standard Linux mechanism in this area.
Well again no, there's no OpenGLES3.0 libs on the Buster clean install (though I might need to double check)
I will burn a fresh image and try again, but I did that already with my 1st attempt. Its quite troubling that Pi3 projects cannot be built to run as is...

however, am sure things will improve, and someone will provide the kind of idiots guide I need.
There's a difference between having the drivers installed so that apps will run out of the box (this is the case), and having the development libraries installed so you can build you own applications (you need to install those). Is that where the confusion is? Notwithstanding PeterO's comment above which could also be a big issue.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

User avatar
dividuum
Posts: 189
Joined: Sun Jun 16, 2013 1:18 pm
Location: Germany
Contact: Website

Re: OpenGL on Buster on both Pi 3 and Pi 4

Mon Jul 01, 2019 10:04 am

Is there any good documentation on DRM and all the other APIs that are used now? https://01.org/linuxgraphics/gfx-docs/d ... index.html seems to document the driver side point of view. Even the man pages link to non-existing documentation pages (for example drmModePageFlip). Only somewhat complete documentation seems to be this doxygen nvidia document. Or is reading through https://gitlab.freedesktop.org/mesa/drm the suggested way?
info-beamer hosted - A user and programmer friendly digital signage platform for the Pi: https://info-beamer.com/hosted

User avatar
PeterO
Posts: 5156
Joined: Sun Jul 22, 2012 4:14 pm

Re: OpenGL on Buster on both Pi 3 and Pi 4

Mon Jul 01, 2019 10:05 am

jamesh wrote:
Mon Jul 01, 2019 9:44 am
You will need to make changes to the surface, I believe you no longer use EGL, but DRM to provide a rendering surface. Will check on that. DRM is now the standard Linux mechanism in this area.
Not quite, EGL is still used, its dispmanx that has been replaced by X11 as the lower layer.
You need to be able to provide and Xwindow id to eglCreateWindowSurface rather than a EGL_DISPMANX_WINDOW_T
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

User avatar
dividuum
Posts: 189
Joined: Sun Jun 16, 2013 1:18 pm
Location: Germany
Contact: Website

Re: OpenGL on Buster on both Pi 3 and Pi 4

Mon Jul 01, 2019 10:12 am

PeterO wrote:
Mon Jul 01, 2019 10:05 am
Not quite, EGL is still used, its dispmanx that has been replaced by X11 as the lower layer.
You need to be able to provide and Xwindow id to eglCreateWindowSurface rather than a EGL_DISPMANX_WINDOW_T
Not necessarily: You can also use DRM/GBM(?). See this code (run with ./kmscube -D /dev/dri/card1) linked previously. It calls eglCreateWindowSurface(egl->display, egl->config, (EGLNativeWindowType)gbm->surface, NULL);

When used similarly to that in my existing code, I get some odd screen flickering and pauses from time to time. Not sure why. I haven't tried the X11 variant yet.
info-beamer hosted - A user and programmer friendly digital signage platform for the Pi: https://info-beamer.com/hosted

DeluxePixel
Posts: 3
Joined: Mon Jul 01, 2019 8:12 am

Re: OpenGL on Buster on both Pi 3 and Pi 4

Mon Jul 01, 2019 10:28 am

More to the point, is it possible on the pi4 to use any form of accelerated opengl without using X?

A simple yes or no from someone who knows would be great. :)

User avatar
dividuum
Posts: 189
Joined: Sun Jun 16, 2013 1:18 pm
Location: Germany
Contact: Website

Re: OpenGL on Buster on both Pi 3 and Pi 4

Mon Jul 01, 2019 10:31 am

DeluxePixel wrote:
Mon Jul 01, 2019 10:28 am
More to the point, is it possible on the pi4 to use any form of accelerated opengl without using X?

A simple yes or no from someone who knows would be great. :)
Yes. With the mechanism from my previous post. No X required.
info-beamer hosted - A user and programmer friendly digital signage platform for the Pi: https://info-beamer.com/hosted

User avatar
PeterO
Posts: 5156
Joined: Sun Jul 22, 2012 4:14 pm

Re: OpenGL on Buster on both Pi 3 and Pi 4

Mon Jul 01, 2019 10:35 am

dividuum wrote:
Mon Jul 01, 2019 10:12 am
PeterO wrote:
Mon Jul 01, 2019 10:05 am
Not quite, EGL is still used, its dispmanx that has been replaced by X11 as the lower layer.
You need to be able to provide and Xwindow id to eglCreateWindowSurface rather than a EGL_DISPMANX_WINDOW_T
Not necessarily: You can also use DRM/GBM(?). See this code (run with ./kmscube -D /dev/dri/card1) linked previously. It calls eglCreateWindowSurface(egl->display, egl->config, (EGLNativeWindowType)gbm->surface, NULL);

When used similarly to that in my existing code, I get some odd screen flickering and pauses from time to time. Not sure why. I haven't tried the X11 variant yet.
OK, well then there are two ways :-) But both need egl which James said wasn't needed :-)
I shall give the gbm method a try with my examples, though to be honest my main interest will be using it with X11 so that I can run identical code on all my linux platforms.
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

Brian Beuken
Posts: 177
Joined: Fri Jan 29, 2016 12:51 pm

Re: OpenGL on Buster on both Pi 3 and Pi 4

Mon Jul 01, 2019 10:38 am

again.....hmmm

look the simple fact is, that I've used VisualGDB as a development tool for 4 years now, it fully supports Raspi, and is a standard industry build tool for embeded systems and SBC's. If there is an issue with it on Pi4, then I think it would be wise to identify and fix it, not abandon the tool that a lot of people are using. (If you're not thats fine....but you should try it, its wonderful)

Do I use X11, or DRM (and how do I use DRM, thats new to me), does EGL work or not, are there drivers for OpenGLES2.0 or not......these questions need to be properly answered, and a clear guide put online for people like me who want do code on the native OpenGLES systems that GPU supports.

And as for OpenGLES2.0/3.0/GL2.1, guys, do you realise how much contradicotry advice is flying around here..I have no real idea what to do, but what is clear is that perfectly fine OpenGLES2.0 projects no longer work on the Pi4, without major revision and new configurations, and that really isn't an ideal situation.

I'm going to go take a cold shower and have a lie down, becuase this is alll rather exhausing. I've had my demo projects working on over 50 different SBC's to date, and the Rpis' were always the easiest, now its becoe a minefield that no one seems able to comprehend.

excuse me, the kettle's boiling now, I'm going to have some camomile tea.
Very old computer game programmer, now teaching very young computer game programmers, some very bad habits.
Wrote some book about coding Pi's and SBC's, it's out now...go get it!
http://www.scratchpadgames.net/

Return to “OpenGLES”