IL2CPP Gui-Mask performance

Hi, I’m using Gui Mask Script in my game menus and after I switch to IL2CPP from Mono2x I get big performance slowdown (30-40 fps IL2CPP against 60 fps Mono2x). I use Release build schemes in Unity3d and xCode.

Is it known problem with IL2CPP? Maybe someone found any workaround?

Thanks.

@litebox

I’m not aware of any existing bug reports we have on this issue. Can you submit a bug report and provide the project that demonstrates this? We would love to have a look and correct it.

Hi, I investigate in problem and found few things:

Test on iPad mini 2 Retina: 45 fps IL2CPP against 60 fps Mono2x
Test on iPhone 5c: 60 fps on both backends.

I will make a demo scene and send a report.

In Unity3d 5.2 roadmap I see “2D rectangle mask clipping that does not use stencil buffer” - perhaps this is also improved performance of using Masks?

@litebox

Thanks for the information, we would definitely like to have a look at this issue. I’m not familiar with the “2D rectangle mask clipping that does not use stencil buffer” feature specifically, but I suspect that you are correct.

While I was trying to isolate problem to provide test scene I understand, that problem not in IL2CPP but in Metal API.
I used flag Automatic Graphics API and it looks like with Mono2x Unity choose OpenGLES2 or OpenGLES3 and I had 60 fps. But when I switch to IL2CPP Unity starts using Metal. After I forced to OpenGLES2 the problem is disappeared.

Top Profile: game session with 3d scene and opened menu (new GUI system and masks) - IL2CPP, Automatic Graphics API
Bottom Profile: same session with 3d scene (menu was closed) - IL2CPP, Automatic Graphics API

Game session with game 3d scene and opened menu (new GUI system and masks) - IL2CPP, forced OpenGLES2

Again, this problem is actual only for iPad mini 2 Retina (maybe Unity chooses different API for iPad and iPhone)

The problem was solved by moving to OpenGLES2

1 Like

@litebox

If you can submit a bug report, this looks like something our iOS team should probably investigate.