Forums - glBlitFramebuffer flip/rotation problem

23 posts / 0 new
Last post
glBlitFramebuffer flip/rotation problem
crazii
Join Date: 8 Sep 14
Posts: 13
Posted: Thu, 2015-03-26 21:46

When Android app layout settings is default: 

glBilitFramebuffer is flipped VERTICALLY & HORIZONTALLY (diagonally) on Kindle fire HDX 7''

result correct on Nexus 5

When app layout is forced to landscape:

result correct on Kindle fire HDX ''

90 DEGREE ROTATED on Nexus 5

 

Here's the code exactly I'm using: the width & height is the size of texture attached to drawFBO, also is the EGLSurface's size

bool GLESContextEGL::swapBuffers(GLuint drawFBO, size_t width, size_t height)
{
::glBindFramebuffer(GL_READ_FRAMEBUFFER, drawFBO);
assert( ::glGetError() == GL_NO_ERROR );
::glBindFramebuffer(GL_DRAW_FRAMEBUFFER, 0);
assert( ::glGetError() == GL_NO_ERROR );
GLint w = (GLint)width;
GLint h = (GLint)height;
::glBlitFramebuffer(0, 0, w, h, 0, 0, w, h, GL_COLOR_BUFFER_BIT, GL_NEAREST );
assert( ::glGetError() == GL_NO_ERROR );
bool ret = ::eglSwapBuffers(mDisplay, mSurface) == EGL_TRUE;
::glBindFramebuffer(GL_READ_FRAMEBUFFER, 0);
assert( ::glGetError() == GL_NO_ERROR );
::glBindFramebuffer(GL_DRAW_FRAMEBUFFER, drawFBO);
assert( ::glGetError() == GL_NO_ERROR );
assert(ret);
return ret;
}

  • Up0
  • Down0
crazii
Join Date: 8 Sep 14
Posts: 13
Posted: Mon, 2015-03-30 02:10

when in landscape mode, the result is 90 degree rotated and looks as if still in portrait mode, but also streched.

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Mon, 2015-03-30 07:55

We had looked at a similar problem a few months ago, but believed the issue was fixed in our newest drivers, and that these drivers needed to get propagated out by Google in an updated build.  Not sure about the Kindle Fire HDX.

1) Can you let us know the build versions and dates for both devices?

2) Is there a log file for the Kindle Fire HDX that shows the Adreno driver version/date?

3) Do you have a sample apk that demonstrates the problem with the above code?

 

 

  • Up0
  • Down0
crazii
Join Date: 8 Sep 14
Posts: 13
Posted: Wed, 2015-04-01 05:56

Nexus 5: android version 4.4.4, kernel version: 3.4.0-gd59db4e, date: Monday March 17 15:16:36 PDT 2014.

It's been update just now and I believe it's the latest.

I'll update Kindle HDX device info later, with an APK & OBB.

  • Up0
  • Down0
crazii
Join Date: 8 Sep 14
Posts: 13
Posted: Thu, 2015-04-02 03:50

Kindle Fire HDX 3rd gen has the latest version: Fire OS 4.5.3

Here's my shared APK & OBB:

https://drive.google.com/folderview?id=0B-jwAxcRPTTafmNob2l0OXRRR1VGUTJF...

Note: put the OBB in root folder of sdcard and the APK will work. this APK will also demostrate another problem I posted here.

  • Up0
  • Down0
crazii
Join Date: 8 Sep 14
Posts: 13
Posted: Thu, 2015-04-02 04:43
On Kindle Fire HDX 3rd gen:
04-02 19:41:46.472 22949 23205 Adreno-EGL <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build:  ()
04-02 19:41:46.472 22949 23205 Adreno-EGL OpenGL ES Shader Compiler Version: E031.24.02.09
04-02 19:41:46.472 22949 23205 Adreno-EGL Build Date: 10/09/14 Thu
 
  • Up0
  • Down0
Evan
Join Date: 5 Mar 13
Posts: 34
Posted: Mon, 2015-04-13 17:49

I think we're seeing a variation of this problem on devices running Lollipop. On a Nexus 7 (2013) the picture is flipped vertically (but not stretched or otherwise distorted). When I downgrade the device to 4.4.2 then I see the rotated and stretched problem as described in this issue. We are also blitting from fbo -> EGL back buffer. I see the same problem on a Moto X 2nd Gen, but not on Nexus 6, so it seems to be confined to Adreno 3XX devices? I'll try to post an APK for you guys tomorrow.

  • Up0
  • Down0
Evan
Join Date: 5 Mar 13
Posts: 34
Posted: Mon, 2015-04-13 18:25

Here's a build that should show the problem - https://www.dropbox.com/s/j14v7bcy0xevpws/HpsSandbox.apk?dl=0. Just choose the BNC sample from the first page and rotate the device to landscape if it isn't already and you'll see the stretched picture in 4.4 and the upside down one in 5.0 (and 5.1).

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Wed, 2015-04-15 08:22

Evan - We tried this build on our current 8084 and 8994 (both w.Android 5.0.2) devkits, as well as on a Nexus 6 (Android 5.1) and in all cases we didn't see a stretched picture and the image appears right side up (orange part on top, green part on bottom..background gradient is purple on top, white on bottom)

On a Nexus 7 w/Android 4.4.4, we're getting an INSTALL_FAILED_OLDER_SDK message when installing.

 

 

  • Up0
  • Down0
Evan
Join Date: 5 Mar 13
Posts: 34
Posted: Wed, 2015-04-15 10:57

Sorry about that, can you try this build instead: https://www.dropbox.com/s/jkz0111dmousk62/HPSSandbox-debug.apk?dl=0, this should install onto your 4.4.4 Nexus 7 and show the squashed and rotated problem. If you updated that Nexus 7 to 5.0 and run either this or the previous build I posted then you should see the upside down (but not rotated) landscape image. Our Nexus 6 hasn't showed any of the these types of problems in landscape.

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Thu, 2015-04-16 10:21

Hi Evan..

We did run this our Nexus 7 w/4.4.4 and notice that when started in landscape the part is rendering upside down  (green ontop of orange) compared to the Nexus 6 w/5.1 (orange on top of green).  We're not seeing a squashed artifact.

We're also not seeing a difference between Nexus 7 w/5.0.2 vs Nexus 7 w/4.4.4.   Both show green on top of orange.

Also, we're not able to doing profiling with the app with the Adreno Profiler, so we can't scrub the frame and look at the draw calls - is there a particular frame delimiter that is being used?

  • Up0
  • Down0
Evan
Join Date: 5 Mar 13
Posts: 34
Posted: Thu, 2015-04-16 11:13

There should be an eglSwapBuffers call at the end of every frame. I don't have access to all the tablets today that I've been testing with, but I do have a Nexus 4 w/5.0.1 and Moto X 2nd gen w/5.0 that both show the upside problem. Whether the picture is squashed vs. upside down doesn't make a big difference to us since they're both are wrong, I just thought the squashed issue sounded like the problem reported by the OP in this thread. I see there's a 5.1 update available for the Nexus 4, I'll try installing that and see if there's any change.

  • Up0
  • Down0
Evan
Join Date: 5 Mar 13
Posts: 34
Posted: Fri, 2015-04-17 08:39

The nexus 4 w/5.1 still shows the upside down landscape problem.

  • Up0
  • Down0
Muzza
Join Date: 4 Dec 12
Posts: 4
Posted: Mon, 2015-04-27 07:21

HTC One (Adreno 320) running Android 4.4.2 has the same problem.

glBlitFramebuffer from a framebuffer to the EGL buffer results in it being flipped both horizontally and vertically.

The bug does NOT show up on a Nexus 7 (2013 - Adreno 320) running Android 5.0.2

 

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Mon, 2015-04-27 12:46

It would be helpful if all of you could provide the Android log files for the runs where the results of glBlitFramebuffer are incorrect.

  • Up0
  • Down0
Muzza
Join Date: 4 Dec 12
Posts: 4
Posted: Sun, 2015-05-03 22:01

I don't understand. There is nothing in the logs related to the bug. What exactly do you want from them?

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Mon, 2015-05-04 08:04

Logs would help identify the exact Adreno driver version that is being used in the builds where glBlitFramebuffer is showing incorrect results.

  • Up0
  • Down0
Evan
Join Date: 5 Mar 13
Posts: 34
Posted: Mon, 2015-05-04 09:27

Is this the info you're looking for? This is for the Moto X:

05-04 09:23:28.987: I/Adreno-EGL(18116): <qeglDrvAPI_eglInitialize:410>: EGL 1.4 QUALCOMM build: AU_LINUX_ANDROID_LA.BF.1.1.04.04.02.162.107_msm8974_LA.BF.1.1__release_AU ()
05-04 09:23:28.987: I/Adreno-EGL(18116): OpenGL ES Shader Compiler Version: E031.25.01.03
05-04 09:23:28.987: I/Adreno-EGL(18116): Build Date: 10/28/14 Tue
05-04 09:23:28.987: I/Adreno-EGL(18116): Local Branch: mybranch5347513
05-04 09:23:28.987: I/Adreno-EGL(18116): Remote Branch: quic/l_LNX.LA.3.6
05-04 09:23:28.987: I/Adreno-EGL(18116): Local Patches: NONE
05-04 09:23:28.987: I/Adreno-EGL(18116): Reconstruct Branch: AU_LINUX_ANDROID_LA.BF.1.1.04.04.02.162.107 + cb93e16 + f50fe49 + d7c18e6 + 5b9a565 + 0f3a25d + 607156e + 75511aa + e4d16c0 + 686f3eb + 211a271 + dd281ee +  NOTHING
 
I can get the other devices too but it might take a day or so.
  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Tue, 2015-05-05 07:10

Yes the other logs from devices where the rotation is incorrect would be helpful..

-thanks

 

  • Up0
  • Down0
Evan
Join Date: 5 Mar 13
Posts: 34
Posted: Tue, 2015-05-05 10:44

Nexus 7: 05-04 11:50:16.640: I/Adreno-EGL(10425): <qeglDrvAPI_eglInitialize:379>: QUALCOMM Build: 01/15/15, ab0075f, Id3510ff6dc

Nexus 4: 05-05 01:56:18.966: I/Adreno-EGL(3954): <qeglDrvAPI_eglInitialize:379>: QUALCOMM Build: 01/15/15, ab0075f, Id3510ff6dc

I believe these were both flashed to 5.0 with the Google factory images and then OTA updated to 5.1.

 

  • Up0
  • Down0
mhfeldma Moderator
Join Date: 29 Nov 12
Posts: 310
Posted: Wed, 2015-05-06 07:36

Evan - Just confirming - you are seeing the rotation problem on the Moto X, Nexus 4, and Nexus 7, and are they all running Android 5.1?

Muzza - Any information on the HTC device logs?

We're just looking for the logs from the devices where the glBlitFramebuffer rotation is incorrect

 

  • Up0
  • Down0
Evan
Join Date: 5 Mar 13
Posts: 34
Posted: Wed, 2015-05-06 09:37

The Nexus 4 and 7 are running 5.1, the Moto is still at 5.0 (still waiting for an update from T-Mobile I guess).

  • Up0
  • Down0
Muzza
Join Date: 4 Dec 12
Posts: 4
Posted: Fri, 2015-05-08 18:35

This is from Nexus 7 2013 where the bug does NOT show up:

Adreno-EGL: <qeglDrvAPI_eglInitialize:410>: QUALCOMM Build: 10/28/14, c33033c, Ia6306ec328

This is from HTC One which does show the bug:

Adreno-EGL: <qeglDrvAPI_eglInitialize:381>: EGL 1.4 QUALCOMM build: MINGHSUC_AU_LINUX_ANDROID_KK_2.7_RB1.04.04.02.007.047+PATCH[ES]_msm8960_refs/tags/AU_LINUX_ANDROID_KK_2.7_RB1.04.04.02.007.047__release_ENGG ()
Adreno-EGL: OpenGL ES Shader Compiler Version: 17.01.12.SPL
Adreno-EGL: Build Date: 03/25/14 Tue
Adreno-EGL: Local Branch:
Adreno-EGL: Remote Branch: refs/tags/AU_LINUX_ANDROID_KK_2.7_RB1.04.04.02.007.047
Adreno-EGL: Local Patches: c29912293421482fd51b7f36b91ae584f9993d66 Add support for KIT_KAT
Adreno-EGL:                  4b5d3e5bcfa9d9563f740840d7258e1c1efa6d5a egl14: add EGL_ANDROID_image_crop support

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.