Advertisement

API Performance

Started by August 14, 2018 04:46 PM
4 comments, last by Hodgman 6 years, 5 months ago

I know that is a noob question but, between OpenGL 2.0 and OpenGL ES 2.0, which one got better performance to desktop and/or mobile devices?

I have read in somewhere that the performance opengl is based on code but some games we can compare oepngl version performances, so idk.

Which one of both use less CPU & GPU/ got better performance?

 

Thanks :)

This is a hard question to answer, because any comparison of graphics API's will inevitably depend on the drivers you are using, the operating system, etc. However, OpenGL and OpenGL ES are very similar (who would have guessed?), but in many cases are mutually exclusive. Mobile systems don't really support "regular" OpenGL, so your only option is OpenGL ES. Some desktop vendors only support OpenGL (like Intel, I believe), whereas others support both GL and GLES (Nvidia). You'd have to talk to one of the driver developers to be sure, but my suspicion is that a huge chunk of the driver code is shared between GL and GLES, if both are supported. There is not likely to be any performance difference, because the API's are so similar.

On another front: OpenGL ES is missing a lot of modern features that "regular" OpenGL has, and many of those modern features are aimed at performance. For example, modern OpenGL ES still doesn't support direct state access, which is a handy extension for avoiding pointless bind/unbind calls. Since it's missing some of those performance-centric features, OpenGL ES should be a little bit slower, all other things being equal. If you stick to the stuff that is more-or-less identical between GL and GLES, then I would be surprised to see a difference on the same hardware.

Advertisement

APIs themselves don't have performance, only implementations of APIs have performance.

Trying to compare all implementations with OpenGL and all implementations of OpenGL ES is pretty much meaningless, as performance of an implementation depends on the particular use-case, hardware, and API implementation. The only way to get a number for that is to test all possible combinations, which will take longer than your lifetime, since "use-case" alone already has pretty much an infinite number of variations.

Perhaps you should reconsider what you really want to know.

While API design features can impact potential performance (hence Direct3D12 and Vulkan existing rather than just magic "better implementation or drivers" for D3D11 and OpenGL), OpenGL and OpenGL ES are very similar (OpenGL ES largely being a subset), but also largely aimed at different platforms (also WebGL is based on OpenGL ES), so the question is rather what are you targeting?

If you want to support mobiles, you will be wanting OpenGL ES. On desktops you are likely to want full OpenGL, but since that is largely a superset, reusing OpenGL ES code is largely possible, although you would still need some changes if not using a higher level framework/library (e.g. to setup the window and context, plus many other features like input and audio).

On 8/15/2018 at 2:46 AM, totosi32 said:

between OpenGL 2.0 and OpenGL ES 2.0, which one got better performance to desktop and/or mobile devices?

OpenGL 2.x is only for (extremely old) desktops.
OpenGL 3.x is only for (old) desktops.
OpenGL 4.x is only for (recent) desktops.

OpenGL ES x.y is only for mobiles.

If you're writing code for Android, use OpenGL ES.
If you're writing code for iPhone, use Metal.
If you're writing code for old desktops, use OpenGL 3.x (or Direct3D11 feature level 10).
If you're writing code for recent desktops, use OpenGL 4.x (or Direct3D11, or Direct3D12, or Vulkan).

This topic is closed to new replies.

Advertisement