elm-explorations/webgl

Parallelise shader compilation and programs linking

Opened this issue · 0 comments

w0rm commented

The first frame may take a while to render because the WebGL scene may be composed out of different combinations of shaders.

WebGL best practices recommend that the shader compilation and program linking should be run in parallel.

This would probably require the following steps:

  1. Loop through all the entities and initiate the shader compilation and figure out all the programs that need to be linked
  2. Loop through the programs to start linking these
  3. Loop through the programs again to check the linking status
  4. Loop through all the entities to draw them