Commit 24dcef9
committed
Add multitexturing to adjacent-merge draw batcher
Historically we broke up draw batches by texture, viewport or blend
mode. If any of those changed, a new batch was opened and the previous
one was submitted to the GPU as it could no longer be appended to
without violating ordering constraints.
This commit adds a vertex attribute used to select among a set of
textures, limited by the maximum texture sampler count the OpenGL ES
implementation supports. As long as no more than that many textures are
used in adjacent draw calls they can all be merged into a single draw
call.
With an implementation that supports 16 texture samplers, a typical
passive skill tree can be drawn in around six draw calls with correct
draw ordering.1 parent f61322a commit 24dcef9
1 file changed
Lines changed: 269 additions & 118 deletions
0 commit comments