Draw order optimizations
Opened this issue · 1 comments
heinezen commented
Objects in a render pass should be ordered in such a way that they don't require expensive state switches. We can minimize the changes by clever ordering of objects by
- render target
- shader program
- texture bindings
- vertex format
- uniform buffer bindings
- vertex bindings
- uniform updates
Sorting should happen on-the-fly, i.e. during insertion/removal of new renderables to a render pass.
There is an overview from this talk that shows the estimated cost for each switch:
TheJJ commented
probably each thing just has a priority and we use our heap to get elements one after the other. but it gets trickier due do the dependencies between these actions.