Move texture update code to the begining of rendering logic

Because glTexSubImage2D performs DMA transfer while CPU can do
other jobs.

Signed-off-by: plysan <plysab@gmail.com>