elm-explorations / webgl

Functional rendering with WebGL in Elm
https://package.elm-lang.org/packages/elm-explorations/webgl/latest/
BSD 3-Clause "New" or "Revised" License
116 stars 17 forks source link

Parallelise shader compilation and programs linking #33

Open w0rm opened 4 years ago

w0rm commented 4 years ago

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