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:
[ol]
[li][shader] glLinkProgram(…);[/li][li][shader] glUseProgram(…);[/li][li][shader] set Uniform Buffer Object with some data[/li][li]for each Mesh do…[/li][LIST=1]
[li][texture] glActiveTexture(…);[/li][li][texture] glBindTexture(…);[/li][li][texture] glUniform1i(…);[/li][li][texture] glBindSampler(…);[/li][li][vbo] glBindBuffer(GL_ARRAY_BUFFER…);[/li][li][vbo] glEnableVertexAttribArray(…);[/li][li][vbo] glVertexAttribPointer(…);[/li][li][vbo] glDrawInstanced(…);[/li][/ol]
[li]end_for;[/li][/LIST]
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!