I need to implement off-screen texture rendering on an ARM device with PowerVR SGX hardware.
Everything is done (using pixel buffers and the OpenGL ES 2.0 API). The only problem that has not been resolved is the very slow glReadPixels function.
I am not an expert in OpenGL ES, so I ask the community: is it possible to convert textures directly into user space? Or maybe there is some way to get the hardware address of the texture memory area? Some other methods (EGL extensions)?
I don't need a one-stop solution that just works for PowerVR hardware.
Update: A little more information about the "slow glReadPixels function". Copy 512x512 RGB texture data to processor memory:
glReadPixels(0, 0, WIDTH, HEIGHT, GL_RGBA, GL_UNSIGNED_BYTE, &arr) takes 210 ms,glReadPixels(0, 0, WIDTH, HEIGHT, GL_BGRA, GL_UNSIGNED_BYTE, &arr) takes 24 ms ( GL_BGRA not standard for glReadPixels, it is a PoverVR extension),memcpy(&arr, &arr2, WIDTH * HEIGHT * 4) takes 5 ms
In the case of large textures, the differences are also greater.
qehgt source share