I'm trying to well merge all separated parts I've developed and tested one by one separately.
I'm in trouble during Rendering() pass. Deeply I need to "re-order" some functions call to avoid overhead of useless functions.
My rendering function calls are:
- [shader] glLinkProgram(...);
- [shader] glUseProgram(...);
- [shader] set Uniform Buffer Object with some data
- for each Mesh do...
- [texture] glActiveTexture(...);
- [texture] glBindTexture(...);
- [texture] glUniform1i(...);
- [texture] glBindSampler(...);
- [vbo] glBindBuffer(GL_ARRAY_BUFFER...);
- [vbo] glEnableVertexAttribArray(...);
- [vbo] glVertexAttribPointer(...);
- [vbo] glDrawInstanced(...);
I was wondering if I could remove latest 2 [texture] calls.
I think it's useless to bind together Samplers and Textures each loop cycle.
This binding is static and it doesn't change.
Is it possibile to do something to avoid few function calls?
Thanks for your help!