goobliata
Posts: 5
Joined: Mon Apr 03, 2017 8:55 pm

OpenGL - performance of new driver

Mon Apr 03, 2017 9:05 pm

Hello,

I've written a few games that support Raspberry Pi now. Up until now I've been using Allegro 5 for which I wrote a simple Raspberry Pi port. The port uses VideoCore and thus the games are fullscreen only.

I just got a Raspberry Pi 2 today. I've been working on a new game that will not be compatible with Raspberry Pi 1 and so I want to use the new OpenGL driver. The game uses SDL2 and it runs (almost) great without any changes! So kudos for that.

My question is, are there plans to improve performance of the new OpenGL driver? Is it even possible? Here are a few factors on why I think it's slow than it needs to be:

One of my old games should be the slowest due to using some advanced shaders and stuff. However on the Raspberry Pi 2 it pretty much hits 60 FPS during normal gameplay. On the other hand, the new game is somewhat simpler, but only runs in a window at reasonable speed at about 720x405 (old game was running 1920x1200). At larger window sizes or fullscreen, it runs very slowly.

Just wondering what we can expect from the new driver in the future. Are there limitations and reasons why it's slower? I've done a fair bit of work with OpenGL and written various ports of game libraries to different systems so maybe if I had an overview of what's going on I could even help...

Anyway I think this is really cool and I'm excited to see how this develops. Another quick question: with OpenGL being the bottleneck (CPU usage is low) would the Raspberry Pi 3 be faster on this game? Is any of the new OpenGL driver CPU bound?

Thanks for your time,

Trent

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

Re: OpenGL - performance of new driver

Tue Apr 04, 2017 11:20 am

The driver it still a prototype, although getting closer to release. I am sure there will be optimisations to be found. You should probably follow Eric Anholt's blog, and check out the github page for the driver.

It's worth noting however, that the driver is OpenGL, but the Pi's only have HW to support OpenGLES. Simplistically, that means that when there is an OpenGL function that has no real HW acceleration options, it is emulated in software on the ARM (or perhaps using the quads or the scaler core on the VC4 - not sure). This can cause bottlenecks. So for best speed, you need to avoid those functions. I do not know which functions...Google will though.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
"My grief counseller just died, luckily, he was so good, I didn't care."

goobliata
Posts: 5
Joined: Mon Apr 03, 2017 8:55 pm

Re: OpenGL - performance of new driver

Tue Apr 04, 2017 2:16 pm

Great info, thanks a lot, should be all I need to get started!

fanoush
Posts: 459
Joined: Mon Feb 27, 2012 2:37 pm

Re: OpenGL - performance of new driver

Tue Apr 04, 2017 2:46 pm

for more info you may check Eric's blog http://anholt.livejournal.com/ or issue tracker https://github.com/anholt/mesa/issues

goobliata
Posts: 5
Joined: Mon Apr 03, 2017 8:55 pm

Re: OpenGL - performance of new driver

Tue Apr 04, 2017 4:46 pm

Perfect, thanks a lot!

dave j
Posts: 116
Joined: Mon Mar 05, 2012 2:19 pm

Re: OpenGL - performance of new driver

Tue Apr 04, 2017 5:40 pm

If you're used to desktop systems it's worth noting that the VC4, in common with most other mobile GPUs, is tile based and this has performance implications. The OpenGL Insights book has a chapter on performance tuning for tile based architectures (which can be downloaded from that link).

goobliata
Posts: 5
Joined: Mon Apr 03, 2017 8:55 pm

Re: OpenGL - performance of new driver

Tue Apr 04, 2017 6:23 pm

Thanks for the link! I've done mobile ports but I will take a look anyway! :)

Kordon
Posts: 7
Joined: Fri Aug 05, 2016 7:45 am

Re: OpenGL - performance of new driver

Tue Apr 04, 2017 8:36 pm

jamesh wrote: It's worth noting however, that the driver is OpenGL, but the Pi's only have HW to support OpenGLES.
Hi,

I use this driver, and my question is does the driver has GLES compatibility, because i use wayland (which is uses egl and GLES).

fanoush
Posts: 459
Joined: Mon Feb 27, 2012 2:37 pm

Re: OpenGL - performance of new driver

Fri Jun 23, 2017 8:06 am

fanoush wrote:for more info you may check Eric's blog http://anholt.livejournal.com/
Just FYI, after few months with no update I found that Eric moved to different blog
https://anholt.github.io/twivc4/
It is a pity he did not update old blog with link to new one.

goobliata
Posts: 5
Joined: Mon Apr 03, 2017 8:55 pm

Re: OpenGL - performance of new driver

Fri Jun 23, 2017 8:28 am

fanoush wrote:
fanoush wrote:for more info you may check Eric's blog http://anholt.livejournal.com/
Just FYI, after few months with no update I found that Eric moved to different blog
https://anholt.github.io/twivc4/
It is a pity he did not update old blog with link to new one.
Thanks for the heads up, I thought things had stalled!

HeadCase
Posts: 51
Joined: Sat Sep 03, 2011 8:11 am

Re: OpenGL - performance of new driver

Thu Jun 29, 2017 8:52 am

Just out of interest, I have been doing some experiments with the new driver via love2d and SDL2. From what I can see Anholt's driver is doing some quite clever stuff with updating the X display. Framerate is mostly dependent on how much changes on the screen from frame to frame so there is some good optimisation happening there. Also, selecting a full screen as opposed to a windowed screen is a slight improvement.

If you use an off screen canvas to do some image manipulation, this has almost no affect on framerate, so that part is working very well. The VC4 seems to be very capable, and Anholt's driver is improving all the time. I have run a demo in a window for more than a week with no issues. It even works over VNC, although that does impact the framerate a fair bit.

Return to “Graphics programming”