4

I downloaded Android NDK r9 and compiled a sample application. I have a Galaxy Nexus smartphone with Android 4.3 upgrade.

How can I find out programmatically if OpenGL ES 3 is supported on my device?

Smirno
  • 73
  • 1
  • 5

2 Answers2

3

The answer is in the Android OpenGLES docs. Essentially, try to create a 3.0 EGLContext, and if that fails you know that 3.0 is not supported.

The page also shows an alternate approach: create a context for a lower level (1.x or 2.x) and use that to call glGetString(GL_VERSION). If the version string indicates that 3.x is supported, you would destroy that context and create a new one.

Update: this approach can be seen in Grafika's EglCore class. Follow what happens when FLAG_TRY_GLES3 is passed to the constructor.

fadden
  • 51,356
  • 5
  • 116
  • 166
  • There should be a note about the reported string returned from that call. Some Implementations return "OpenGL ES X.X" while others return "X.X", so this too is probably vendor specific (I only encountered these 2 variations, but who knows what others there could be ?) – RelativeGames Sep 10 '13 at 23:26
  • 1
    The OpenGL ES 2.0 and 3.0 specs require that the result of glGetString(GL_VERSION) start with "OpenGL ES X.Y", but that can be followed by other implementation-defined stuff. Implementations that don't do that should be failing both the Khronos and Android conformance tests. – Jesse Hall Oct 17 '13 at 17:23
  • I guess (but don't really know) 1.1 context will always return version 1.1 since it's not forward-compatible. You don't have to create an ES3 context anyway, you can dynamically load and use all ES3 features in an ES2 context since ES3 is a superset of ES2. – Triang3l Sep 06 '15 at 07:19
2

First, take a look to Is there a way to check if Android device supports openGL ES 2.0?. Also, take a look to Basemark ES 3.0

Community
  • 1
  • 1
Mihai8
  • 3,113
  • 1
  • 21
  • 31