Bug: Nested Masks Cause Masked Images To Be Invisible On Galaxy S3

Wow, I had no idea there were such different versions of the SIII.  I checked wikipedia http://en.wikipedia.org/wiki/Samsung_Galaxy_S_III  and it looks like our SIII’s have different SoCs, CPUs, and GPUs!  I looked up the device you have that exhibits the problem, the HTC Evo 4G, to see what it had in common with my SIII:  They both have Qualcomm Snapdragon SoC/CPUs with embedded Adreno GPUs.  Doesn’t mean much to me, but perhaps that will help you narrow down the issue.  

 

Thanks again and talk to you later this week.

 

-Stephen 

And these answers in a Stackoverflow thread titled “glDepthMask(GL_FALSE) trashes the frame bugger on some GPUs” that seems related to Adreno GPUs:

 

“The problem was that glDepthMask needs to be true when calling glClearDepth. This apparently only applies to Adreno GPUs, not to PowerVR GPUs.”

 

“I was having the same problem; but I never actually invoke glClearDepth(). Instead, I just made sure glDepthMask was true at the end of each frame, and the scene stopped getting trashed. This seems like a bug in either Android or the GPU driver; it’s occurred on 3 different Android devices for me.”

 

Not sure if this is on the right track but it could indicate a larger issue with more than just our two specific devices if there’s something funny about the Adreno-Android combo.

Hi Danny,

Any news or progress on the nested masks issue? I’ve tested using build 1049 and still have the problem of invisible images on the Galaxy S3. I’ve got my app shipped on Nook, Kindle Fire, and iOS, but this bug is holding me up from shipping on generic Android (Google Play and non Kindle Amazon stores). It’s part of a major feature for my app and I haven’t found a workaround that doesn’t use nested masks.

-Stephen [import]uid: 9422 topic_id: 36305 reply_id: 145737[/import]

Just to let everyone else who is reading this know, Stephen and I figured this out.  This issue was cause by a graphics hardware limitation due to these particular devices having max texture units of 2, the minimum allowed.

You can determine what the max texture units by calling the following function…

<lua>system.getInfo(“maxTextureUnits”)

We’ve updated our API documentation about “maxTexturesUnits” here…

http://docs.coronalabs.com/api/library/system/getInfo.html#maxtextureunits

Thanks for taking the time to work with us on this one Stephen!

Many thanks, Joshua, for getting to the bottom of this.  It’s a bit of a shock to me that the SIII I have has such a major hardware limitation, while in so many other ways it is state of the art.  Boo to the bean counter who decided to shave a few pennies off the design of this phone, and boo to Samsung for having totally different hardware hiding behind a shell called the SIII.  

Anyway, by detecting the # of texture units using system.getInfo(“maxTextureUnits”) I should be able to disable the mask on the child image only for those hardware limited phones.  The images won’t look as good without the mask applied, but at least they won’t be invisible.   

Waaaah. No love for me. 

 

And I can’t seem to find a working link to the public bug tracker to see if bug 21180 is in the pipe.   Did the link get lost in the new forum re-shuffle?

Hello Stephen,

 

Regarding selecting remote photos from Google+, Picasa, DropBox, etc… we’ve added support for this as of daily build #1041.

 

Regarding the masking issue, there is currently no one available to look into this issue yet.  Would you mind doing a quick test  for us first?  It’ll help shorten the time for us to address this issue.

Does this nested masking issue happen with the last release build #971?

http://developer.coronalabs.com/downloads/corona-sdk

 

This is to help us identify if this issue was caused by a code change on our end or if this is a device specific issue that has always existed.  I suspect it is an OpenGL driver bug specific to the SIII which we would have to work-around.

Hi Joshua,

 

I just tested my revised sample Flashlight project using build #971 on my S3 and the nested, masked object still renders invisibly.  So the bug is still present on the older build.  I guess that means it’s an OpenGL driver bug on the SIII.  Should also I assume that bug is also present on the S2, the new S4, and other late model Samsung Android phones?  

 

Thanks for taking a look at this.

 

-Stephen

Stephen,

 

I tested the sample project that you gave us with your bug report.  Unfortunately, I was not able to reproduce this issue on our Samsung Galaxy SIII.  In fact, it worked on the following devices:

  • Samsung Galaxy SIII

  • Samsung Galaxy Nexus

  • 1st generation Droid

 

That said, I was able to reproduce this issue on the following device:

  • HTC Evo 4G

 

I’ve confirmed that this issue happen on the HTC device with Corona build #971 (the last release) and build #1055.

 

Unfortunately, we don’t know what the root cause is yet.  It is most likely an OpenGL driver bug that we have to work-around, like I mentioned up above.  Those are some of the hardest to track down.  The last OpenGL driver bug we worked-around took us about 6 months of off-and-on work to isolate.  So, unfortunately, it’s impossible for us to give you a time estimate.  The best we can do is for you and I to keep testing this on multiple devices and Android versions to isolate what exactly causes this issue.

 

What I find curious is why this issue happens to your SIII device and not ours.

Is your SIII device rooted?

Can you also tell me what Android OS version it is running please?

Ok, great to know you at least can reproduce the issue.  Troubling that you can’t reproduce it on the same device I can, though.   Other than version of  Android what other factors could possibly explain that?

 

FYI, My S3 is not rooted, and it is running Android v. 4.1.2.  Is your S3 running a different version?  Other info. for my S3:  Hardware v. L710.14, Model SPH_L710, Kernel v. 3.0.31-944783.

 

Understood re: the difficulty of tracking these types of bugs down.  Sounds like a nightmare.  I wish I could help!

 

-Stephen

My Galaxy SIII is different than yours…

Model: GT-I9300

Android OS Version: 4.1.2

Kernel Version: 3.0.31-789635

 

Yeah, something I’ve noticed about the SII and SIII devices is that there are a lot of different models/variations of them.  It seems like SII  and SIII is more of a brand.

 

We’ll figure something out.  I’ll contact you about this later this week.

Wow, I had no idea there were such different versions of the SIII.  I checked wikipedia http://en.wikipedia.org/wiki/Samsung_Galaxy_S_III  and it looks like our SIII’s have different SoCs, CPUs, and GPUs!  I looked up the device you have that exhibits the problem, the HTC Evo 4G, to see what it had in common with my SIII:  They both have Qualcomm Snapdragon SoC/CPUs with embedded Adreno GPUs.  Doesn’t mean much to me, but perhaps that will help you narrow down the issue.  

 

Thanks again and talk to you later this week.

 

-Stephen 

And these answers in a Stackoverflow thread titled “glDepthMask(GL_FALSE) trashes the frame bugger on some GPUs” that seems related to Adreno GPUs:

 

“The problem was that glDepthMask needs to be true when calling glClearDepth. This apparently only applies to Adreno GPUs, not to PowerVR GPUs.”

 

“I was having the same problem; but I never actually invoke glClearDepth(). Instead, I just made sure glDepthMask was true at the end of each frame, and the scene stopped getting trashed. This seems like a bug in either Android or the GPU driver; it’s occurred on 3 different Android devices for me.”

 

Not sure if this is on the right track but it could indicate a larger issue with more than just our two specific devices if there’s something funny about the Adreno-Android combo.

Just to let everyone else who is reading this know, Stephen and I figured this out.  This issue was cause by a graphics hardware limitation due to these particular devices having max texture units of 2, the minimum allowed.

You can determine what the max texture units by calling the following function…

<lua>system.getInfo(“maxTextureUnits”)

We’ve updated our API documentation about “maxTexturesUnits” here…

http://docs.coronalabs.com/api/library/system/getInfo.html#maxtextureunits

Thanks for taking the time to work with us on this one Stephen!

Many thanks, Joshua, for getting to the bottom of this.  It’s a bit of a shock to me that the SIII I have has such a major hardware limitation, while in so many other ways it is state of the art.  Boo to the bean counter who decided to shave a few pennies off the design of this phone, and boo to Samsung for having totally different hardware hiding behind a shell called the SIII.  

Anyway, by detecting the # of texture units using system.getInfo(“maxTextureUnits”) I should be able to disable the mask on the child image only for those hardware limited phones.  The images won’t look as good without the mask applied, but at least they won’t be invisible.