Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat
Issues with iOS Metal - Gideros Forum

Issues with iOS Metal

hgy29hgy29 Maintainer
Hi,

Gideros can target iOS Metal engine instead of OpenGL since 2019.2, and enabling it was made easier in 2019.4, but it is still beta because largely untested. I am opening this thread to collect bug reports regarding Metal support, so that we can make it solid before it becomes a requirement.

Everyone who target iOS should have a go at Metal for testing. Please report here what happens!
+1 -1 (+5 / -0 ) Share on Facebook

Comments

  • hgy29hgy29 Maintainer
    Adding my own crash report, for the record:
    -[MTLDebugRenderCommandEncoder setScissorRect:]:2682: failed assertion `(rect.x(110) + rect.width(642))(752) must be <= render pass width(750)'
    Obviously Metal is more strict than OpenGL. This one is related to setClip()
    +1 -1 (+4 / -0 ) Share on Facebook
  • john26john26 Maintainer
    edited April 17
    I noticed a small bug on iOS+Metal in which some of the text was transparent when it shouldn't be. It's like you have 2 children of the same parent Sprite and set 1 child's alpha and it affects the other child's alpha. I need to get a small demo to prove this...
  • NatWobbleNatWobble Member
    edited June 8
    Hi. Everything seems OK on my iPad but fails on the simulators in XCode.

    After looking around the web it appears that Metal can't run on the simulators and it doesn't look like it will anytime soon, despite the fact that Apple is going to deprecate Open GL [Big Clap for Apple!].

    Is there a boolean anywhere that we can set to run on Open GL, or is Open GL no longer supported by Gideros? It seems to default to metal.

    Really, I just wanted to work out how to deal with the notch properly. I suppose I could always revert to an older version of Gideros and do another build, but is there an easier way? Thanks

    Edit: I just found the checkbox "Enable Metal" under the require plugin but it was unticked. However, the crashes in the simulator were all related to Metal.
  • hgy29hgy29 Maintainer
    Actually both metal and OpenGL codes are compiled in gideros even if you don’t tick ‘enable metal’. But if you don’t enable metal, the code related code isn’t called. What kind of error do you get ?
  • NatWobbleNatWobble Member
    I get these errors when I try to run the app in the Xcode simulators:
    .../EAGLView.h:33:5: Unknown type name 'CAMetalLayer'; did you mean 'CATextLayer'?
    .../EAGLView.m:42:17: Unknown receiver 'CAMetalLayer'; did you mean 'CATextLayer'?
    .../EAGLView.m:52:26: Use of undeclared identifier 'CAMetalLayer'; did you mean 'metalLayer'?
    .../EAGLView.h:34:8: No type or protocol named 'CAMetalDrawable'

    It is only a problem in the XCode simulators. It runs fine on a real device.

    Enable metal wasn't ticked.

    The simulators can't use Metal (mac hardware) but perhaps the app attempts to use Metal because it thinks it is running on a real device - but I'm just guessing.
  • hgy29hgy29 Maintainer
    Ok, those are compilation errors, meaning that the simulator doesn’t have any metal libs, not even stubs. We could change the tick box to #ifdef metal code instead, that should solve it.
  • NatWobbleNatWobble Member
    Thanks. That would be great. Apparently the simulators can't use metal at all because it really needs the correct chips and they won't or can't emulate them on desktop. The XCode simulators aren't full emulators.

    Is there any simple hack for the current version of Gideros or would I need to do a new build with an old version to check how things look in the iPhone x etc?

    If metal is stable on devices, we would still want to use it because of its performance increase and the fact that they are going to deprecate open gl. So if your solution is like a fallback that would be perfect.
  • antixantix Member
    So with metal its really only possible to test on an actual device? I guess its another way for apple to squeeze you into buying more of their stuff :\
  • Apollo14Apollo14 Member
    antix said:

    its another way for apple to squeeze you into buying more of their stuff :\

    You should use more precise and scientific terms:
    "buying more of their crippled shit" or "buying more of their overpriced crap"

    Likes: antix

    > Newcomers roadmap: from where to start learning Gideros
    "What one programmer can do in one month, two programmers can do in two months." - Fred Brooks
    “The more you do coding stuff, the better you get at it.” - Aristotle (322 BC)
    +1 -1 (+1 / -0 ) Share on Facebook
  • antixantix Member
    @Apollo14 hahah, indeed. I checked today and their discount for "poor students" like me is a paltry 2%. They really are a giant bunch of tight-wads
  • hgy29hgy29 Maintainer
    @NatWobble, I changed EAGLView.m code so that references to non existent functions aren’t compiled in if metal isn’t enabled. Actually metal stubs are there on the simulator, but A few metal support libraries are missing.

    See EAGLView.h/.m changes in this commit https://github.com/gideros/gideros/commit/dee68f577b6b3e6db8d192fa2794b68cb5fe6d4a

    Likes: Apollo14, MoKaLux

    +1 -1 (+2 / -0 ) Share on Facebook
  • @hgy29 Thanks. I can confirm that it works now.

    Likes: hgy29

    +1 -1 (+1 / -0 ) Share on Facebook
Sign In or Register to comment.