ccDrawLine ignores Z-order and draws over all other layers

Hello everyone. I’m new here and I think same applies for this issue. I’ve also posted it on stackoverflow:
http://stackoverflow.com/questions/14608283/ccdrawline-ignores-z-order-and-draws-over-all-other-layers-in-cocos2dx

It’s simple, when I have ccDrawLine() call, it draws over every other layer. But this doesn’t happen on iOS or Android emulators. I could only test on several Android devices, and all has this issue. Any idea what could be wrong?

Version of cocos2dx is 2.1beta3

Thank you.

EDIT: After some research, I’ve found out, that it probably only happens on ARM Mali GPU. I tried it on SGS2 and SGS3. On both the line is drawn over all other nodes/layers/sprites. When tried on SGS1 (PowerVRX GPU), it works as it should (same as in emulator). Maybe I’m missing something but I can’t figure out or find how to make it work on the Mali GPU properly.

Oh, I also have same problem!

In PC or Emulator, it works well… (Line is drawn under the other sprite layers that I set z-order)

However, when it comes to Android device, ccDrawLine covers over all other layers.

I also can not find any solution of it….

I found out, it’s probably the Mali 400 on the SGS2 or SGS3. On Tegra or PowerVR it works as intended. I made it so whenever i dont need the line, I don’t draw it (it’s a beam of laser so when game is paused, i simply don’t draw it). But it’s really strange (the same happens when making direct gl call to glDrawArrays and the type is GL_LINES, GL_LINE_LOOP or GL_LINE_STRIP.