Does Android glTexSubImage2D Work At All?
Does anyone have working code using glTexSubImage2D() on Android, preferably开发者_运维问答 via the NDK but even just in Java?
In my code glTexImage2D() works fine, but glTexSubImage2D() on the same texture at the same point in the code doesn't. The same code runs OK on my desktop system. Are there any hidden gotchas to using glTexSubImage2D() on Android?
In our experience the problem that glTexSubImage2D() won't work well only occurs in HTC Android phones - at least in models we tried: Desire HD, Desire Z, and X315E. It doesn't occur in Windows PC or in Motorola Android phones.
We found the reason to our problem is that probably HTC drivers have an bug, because even the GL_UNPACK_ALIGNMENT is set to 4, glTexSubImage2D() still treats the pixels you passed to it as not-aligned. I.e. it seems that glTexSubImage2D() always uses 1, rather than the real value you or the OpenGL set, as the value of GL_UNPACK_ALIGNMENT. However, in Windows PC and Motorola Android phones, this function uses the correct GL_UNPACK_ALIGNMENT value.
精彩评论