Imagination PowerVR SDK Blog

eglSwapBuffers displays before rendering has finished.



I’m developing a app on GPD XD plus which has PowerVR GX6250 using Android NDK.
The displayed images after eglSwapBuffers are called seem the images which didn’t finish the rendering.
Do you have any suggestions?

My App has view extended from SurfaceView.

After surfaceChanged, initialize EGL

Every time drawing has done, call eglSwapBuffers.

Other devices( NVidia X1 K1, Qualcomm adreno) works fine with my code.


Hi Shinya,

Could you record a trace using the PVRTrace tool from our SDK? The Trace may give us some clues as to what exactly is happening here.



Hi Shinya,

I have to reckon that we haven’t seen this problem before. This is just a guess, but I would say that it is caused by the multi-threading synchronization and the eglMakeCurrent calls. The surface might be changed mid-rendering.
Does the same problem happen if you disable asynchronous rendering?And if you add an “artificial” slow down?
We haven’t tried yet to build your application. Do you have a prebuilt APK we can have a look at?

Best regards.



I’ve obtained PVRTrace data. Can you check frames from 700 to 710?


Hi Shinya,

Many thanks for sending the trace. We will have a look and we’ll get back to you.




Is there any progress?


Hi Shinya,

Apologies for the late reply.

We’ve been analyzing your trace file. We were able to recreate the issue. It appears it is a bug in our drivers. The issue stems from the way the driver interprets the access flags when mapping the buffer.

A temporary work around can be implemented by going to the file ygles.c on line 518 when calling glMapBufferRange, add the GL_MAP_UNSYNCHRONIZED_BIT to the access flags.

I’ll pass the issue to the driver team and hopefully we’ll have a permanent fix implemented as soon as possible.

Thank you,