Hi,
I need to have shader binaries pre-built for Adreno GPUs for OpenGL ES.
With Mali I can use pre-compile the shaders with a compiler, but I understand Adreno SDK does not provide a shader compiler, so the only option is to generate those binaries on a running system.
What are the rules for reusing these?
Do I need to generate them per Android version? Per GPU model? Etc.
Is there any documentation on this topic?
Thanks.
Hi Leo,
The binaries compiled should be considered device specific. Even though they may run in other phones, with variations of GLES runtime, Android version, driver, etc. it's not recommended to assume otherwise.
The typical workflow for this involves:
It's worth noting that when using glProgramBinary you should always error check in case something happened such as binaries did not load correctly, got deleted somehow, etc.
I hope this helps!
Cheers,
Carlos
Hi Carlos,
Thanks a lot for your reply, although it feels a bit dissapointing.
I wanted to ask a quick question:
Do you think it would be very difficult for Qualcomm to do more or less what the rest of the industry does, including platforms like DirectX, Metal and Mali? They all support offline compilation.
I'd say it's more or less extract the compiler code shipped in drivers out to an offline compiler, and package something to suport this... more or less?
I also think this is something many would like to see.
To be honest, it's too bad the workflow we'd really like is crippled because a major supplier, Qualcomm, doesn't provide the software everybody else has.
Also, the alternative to move over to Vulkan is not an option because half the Android devices out there still rely on GL only. Correct?
Thanks again.
Hi Leo,
I understand the dissapointment although this workflow is not Qualcomm specific and in line with the OpenGL ES standard. In OpenGL ES offline compilers tend to be used mostly for static analysis and not meant for runtime execution of binaries. This is the case with Mali as well and they propose the same workflow I described above: https://developer.arm.com/documentation/101863/0702/Introduction/Binary-...
Quote from their guide: "Most compiled shader binaries are specific to a single pairing of GPU hardware version and driver version, so reliance on binary-only shader distribution is not recommended."
Cheers,
Carlos
Well that's too bad, the dissapointment is double now.
Thanks.