Android glShaderBinary

1 answer

Binary shader formats are vendor specific. For every other vendor, there is a different mechanism for compiling shaders into a binary file. Therefore, to support most Android devices, you either need to compile the shaders for a specific provider offline, or do it online (using the GL_OES_get_program binary extension) and, of course, also provide the glsl source as a reserve.

Here is a list of the OpenGL ES 2.0 SDK from some of the popular GPU manufacturers. It either includes the standalone GLSL shader compiler, or the GLSL binary shader documentation:

ARM Mali provides a malisc that can compile shaders on the command line of your host.

Qualcomm Adreno actually allows you to get the GLSL shader binary code at runtime using glGetProgramBinaryOES , but not offline. At least that's what the documents in the Adreno SDK say.

The PowerVR SDK also claims that its GPU allows you to get the GLSL shader binary code at runtime using glGetProgramBinaryOES .

Function

glGetProgramBinaryOES comes from the GL_OES_get_program_binary extension .

+16
source

All Articles