I am trying to capture rendered image( developed in Qt's QML qquickrendercontrol example) using framebuffer with OpenGL API "glReadPixels" but it takes 1.8 seconds to read the pixel data. which is not acceptable, since i need the image capture at least 100ms. I have binded the OpenGL using texture ID. I have no issue while rendering, it so fast. While I am running same application in PC(Core i5 ) it takes 11 to 15ms to capture the same image. But when it comes to IMX6 capturing takes 1.8 seconds.
I have used following API's but all it takes 1.8 seconds
1. Using direct openGL API glReadPixels
2. QOpenGLFramebufferObject:: toImage()
3. grabToImage() API of QML Item.
Is there any other workaround to capture the framebuffer without blocking the rendering thread?
It is not clear if the issue is on GPU side or CPU side, please add vprofiler to your code in order to check if glReadPixels is causing this delay. also The sample code in GPU SDK shows how to directly upload a texture (instead of using glTexImage2D). this could be use to also download the texture faster than glReadPixels, Or the better way to do that is using virtual framebuffers, please check the virtual buffer driver: