Search code examples
androidopengl-esshaderfragment-shadervertex-shader

Is it possible to debug shaders in Android OpenGL ES 2?


Is there a possibility to debug the shaders (fragment and vertex) in an Android Application with OpenGL-ES 2?

Since we only pass a String with code and a bunch of variables to replace with handles, it is very tedious to find the proper changes that need to be done.

  • Is it possible to write to the Android Log, as in Log.d()

  • Is it possible to use break points and to inspect the current values in the shader calculations?

I am simply not used to write code with a pen anymore and that's what it feels like to code within the shader text code.


Solution

  • No. Remember that the GPU is going to execute every program millions of times (once per vertex, and once per fragment), often with hundreds of threads running concurrently, so any concept of "connect a debugger" is pretty much impossible.