Dealing with OpenGL ES 2.0 driver errors

I am currently porting a 3D C ++ game from iOS to Android using the NDK. Rendering is done using GLES2. When I finished rewriting all the platform-specific things and first launched the full game, I noticed errors during processing - sometimes only parts of the geometry appeared, sometimes huge triangles flickered around the screen, etc. Etc....

I tested it on a Galaxy Nexus 4.1.2. glGetError() returns nothing. In addition, the game worked perfectly on all iOS devices. I began to suspect a driver error and after hours of hunting I found out that using VAO ( GL_OES_vertex_array_object ) caused problems. The same renderer worked perfectly without HLW and produced garbage from HLW.

I found this error report in Google Code . I also saw the same report on IMG forums , and an employee confirmed that this is really a driver error.

All this made me wonder - how can I handle cases of confirmed driver errors? I see 2 options:

  • Do not use VAO on Android devices.
  • Blacklist individual devices and driver versions rather than using VAO on these devices.

I do not like both options.
Option number 1 will penalize all users who have a good driver. VAOs really improve performance, and I think itโ€™s very bad to ignore them, because one device has an error.
Option number 2 is quite difficult to do correctly. I can not test every Android device for broken drivers, and I expect the list will be constantly changing, which makes it difficult to work.

Any suggestions? Is there a way to detect such driver errors at runtime without manually testing each device?

+4
source share
1 answer

Errors in OpenGL ES drivers on Android is a well-known thing, so it is quite possible to have an error in the driver. Especially if you use some advanced (not very well tested) features like GL extensions.

In a large Android project, we usually combat these problems using the following checklist:

  • Test and debug our own code carefully and check the OpenGL specifications to make sure we are not abusing the API.
  • Google for the problem (!!!)
  • Contact your chip set provider (they usually have a form on their website to send bugs from developers, but as soon as you send 2-3 real bugs, you will find out direct emails from people who can help) and show them your code. Sometimes they find errors in the driver, sometimes they find the wrong use of the API ...
  • If the function does not work on multiple devices, just create a workaround or return to the traditional rendering path.
  • If this feature is not supported by most first-class devices - just do not use it, you can add it later, as soon as the market is ready for it.
+1
source

Source: https://habr.com/ru/post/1443534/


All Articles