Closed Bug 711687 Opened 11 years ago Closed 2 years ago

Investigate asynchronous texture upload


(Firefox for Android Graveyard :: General, defect, P4)



(Not tracked)



(Reporter: pcwalton, Unassigned)


It seems that we may be able to do asynchronous texture upload. See this thread:

One of the Android engineers states that the browser (presumably the stock Honeycomb browser) uses this technique, so we should definitely investigate it IMHO.

This would presumably be done similarly to the gralloc stuff, and in fact it uses most of the same calls. The main difference is that we use EGL_GL_TEXTURE_2D_KHR instead of EGL_NATIVE_BUFFER_ANDROID in the call to eglCreateImageKHR().
This would be a fallback in case gralloc isn't supported on the device.
I experimented with this today. Turns out that this is not possible, except maybe on Honeycomb/ICS. The stock Android EGL drivers on everything Gingerbread and below fail on the eglCreateImageKHR() call if passed anything but EGL_NATIVE_BUFFER_ANDROID. Sigh.

It is also impossible to do texture sharing between threads. The only way to do it in EGL is to use eglImage. It is likewise impossible to do asynchronous texture upload using PBOs, as PBOs are unsupported on Android.

The end result is that on non-grallocable devices it's looking like there's no alternative to the slow glTexImage2D(). Android on Gingerbread and below is extremely hostile to performant texture upload. The best we can do is to double buffer, chop up the texture, and throttle the number of glTexImage2D() calls to a small number per frame. I've already prototyped this (slicing is quite easy with glDrawTexfOES); it should be relatively easy to implement.
Priority: -- → P4
We have completed our launch of our new Firefox on Android. The development of the new versions use GitHub for issue tracking. If the bug report still reproduces in a current version of [Firefox on Android nightly]( an issue can be reported at the [Fenix GitHub project]( If you want to discuss your report please use [Mozilla's chat]( server and join the [#fenix]( channel.
Closed: 2 years ago
Resolution: --- → INCOMPLETE
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.