Is there a way to cache slow WebGL shader compilation if the shader never changes?
问题 I have a WebGL shader which compiles perceptually immediately (Chrome on Windows 7) when I have this: void main(void) { if (antialias_level == 1) gl_FragColor = NewtonIteration((gl_FragCoord.xy + offset) / zoom); else if (antialias_level == 2) gl_FragColor = (NewtonIteration((gl_FragCoord.xy + offset + vec2(-0.25, -0.25)) / zoom) + NewtonIteration((gl_FragCoord.xy + offset + vec2(0.25, 0.25)) / zoom)) * 0.5; } But it takes a very long time (~10 sec) to compile this: void main(void) { if