Hi everyone.
I am using Mali-400 GPU, on Allwinner A20, under linux.
I am using egl pixmap surface. Rendering results correct, but every time when i calling glDraw with the same parameters, the runtime of glDraw(only last) slower and slower.
I am checking only glDraw without anything else.
The time of drawing
1 call -- 150ms
2 time repeat -- 240ms( only second call without first)
.
6 time repeat -- 620ms( only 6 call without any other)
I am repeating this
GL_CHECK(glEnableVertexAttribArray(iLocPosition)); GL_CHECK(glVertexAttribPointer(iLocPosition, 2, GL_FLOAT, GL_FALSE, 0, vertex)); time.Start(); LoadDataToTexture( first, second ); time.Stop(); timeOfGPU.loadTime = time.GetTime(); time.Start(); GL_CHECK(glDrawArrays( type, 0, sizeOfVertex )); GL_CHECK(glFinish()); time.Stop(); timeOfGPU.drawTime = time.GetTime(); time.Start(); GL_CHECK(glReadPixels(0, 0, windowW, windowH, GL_RGBA, GL_UNSIGNED_BYTE , result)); time.Stop(); timeOfGPU.retTime = time.GetTime();
Why any new call slower than previews call?
When i was used window surface, this problem solved by eglSwapBuffers...
But now i don't know what is problem...
Thank for any reply.
Thanks for reply.
No, memory not released. But i have no need to release the memory. I am loading the same data to the same texture with the same view port.
And the loading time doesn't change. Changes only drawing time(drawing to same memory, without changing anything).
Hmm.. It's been a while, but I remember something about glFlush() - maybe it's a bad guess.
Actually I'm hoping that someone else will see this thread and be able to give a much more qualified answer.
You're not clearing the render state on each iteration, so you are calling finish to force the intermediate render state to the framebuffer, and then forcing the GPU to re-read and re-render all over again. Mali may handle this in two ways depending on circumstances:
Based on the fact it gets slower and slower on each loop iteration, it would be safe to surmise that the second route is being taken. In general you cannot safely time individual drawcalls on a tile-based architecture without significant performance overheads. The best route for handling framebuffers is outlines in my blog here:
Mali Performance 2: How to Correctly Handle Framebuffers
Cheers, Pete
Thank you very much.