Reputation: 115
I found some ways to speed up glReadPixels by OpenGL ES 3.0, but I am not sure if it works or not.
In order to verify, I updated to the latest Android SDK and ADT, and try to use OpenGL ES 3.0. However, I can't find GL_BGRA
definition as I expected, and I don't know how to use glMapBuffer()
. Am I missing something?
To summarize,
If anyone knows, please point me out. Some code snippets would be better. Thanks in advance.
Upvotes: 4
Views: 3208
Reputation: 1260
Not really. I don't know whether you would get performance gains by using BGRA format, but it's worth a try. In ES 2.0, GL_BGRA is only available through extension: EXT_read_format_bgra, so you would need to use the enum GL_BGRA_EXT, and apparently it's the same in OpenGL ES 3.0 too.
Yes, glMapBufferRange is the way to go on OpenGL ES 3.0. It looks like your call is correct, as per your comment. According to spec and man page, glMapBufferRange should not generate GL_INVALID_ENUM errors, so I think something else is wrong here. Make sure the error is not generated by an earlier call.
Upvotes: 1