Compile GLSL shader asynchronously or in a different thread on Android
问题 I'm writing an effect filter for Android devices, which has two-dimension loops in the fragment shader. For most of the devices, the shader can be compiled and run in reasonable time, but some of the devices takes several minutes to compile the shader at the first time. My fragment shader has a heavy two-dimension kernel convolution: const lowp int KERNEL_RADIUS = 19; .... for (int y = -KERNEL_RADIUS; y <= KERNEL_RADIUS; y++) { for (int x = -KERNEL_RADIUS; x <= KERNEL_RADIUS; x++) { .... } }