Gvr-unity-sdk: Metal on iOS doesn't work *at all*

Created on 27 Sep 2016  路  20Comments  路  Source: googlevr/gvr-unity-sdk

OK, I know the release notes say "Metal is not fully supported on iOS", but still...

Steps to reproduce:

  1. Create a new empty project, import the GVR package and load the Cardboard headset demo
  2. Publish for iOS with Auto Graphics API
  3. Build on Xcode, start -> crash at startup

This happens on both GVR 0.9.1 and 1.0. With OpenGLES2 it works fine.

Phone: iPhone 6s Plus
iOS: 10.0.2
Unity: 5.4.1p2
Xcode:8.0

Xcode debugger says it crashes here:

0x100888b2c <+1500>: b 0x100888b48 ; <+1528> [inlined] GetPrimitiveCount at GfxDeviceMetal.mm:626

Console log from 1.9.1:


-> applicationDidBecomeActive()
GfxDevice: creating device client; threaded=1
Init: screen size 1080x1920
Initializing Metal device caps: Apple A9 GPU
Initialize engine version: 5.4.1p2 (a8ddefd1bf1d)
OnLevelWasLoaded was found on GvrViewer
This message has been deprecated and will be removed in a later version of Unity.
Add a delegate to SceneManager.sceneLoaded instead to get notifications after scene loading has completed

(Filename: Line: 375)

UnloadTime: 1.221083 ms
Built-in distortion correction disabled. Causes: [Requires OpenGL]
GvrViewer:InitDevice()
GvrViewer:Awake()

(Filename: /Users/builduser/buildslave/unity/build/artifacts/generated/common/runtime/UnityEngineDebugBindings.gen.cpp Line: 42)

/BuildRoot/Library/Caches/com.apple.xbs/Sources/Metal/Metal-85.83/ToolsLayers/Debug/MTLDebugRenderCommandEncoder.mm:2699: failed assertion `missing sampler binding at index 0 for _mtlsmp__MainTex[0].'

(lldb)

Console log from 1.0:


-> applicationDidBecomeActive()
GfxDevice: creating device client; threaded=1
Init: screen size 1080x1920
Initializing Metal device caps: Apple A9 GPU
Initialize engine version: 5.4.1p2 (a8ddefd1bf1d)
UnloadTime: 1.118416 ms
/BuildRoot/Library/Caches/com.apple.xbs/Sources/Metal/Metal-85.83/ToolsLayers/Debug/MTLDebugRenderCommandEncoder.mm:2699: failed assertion `missing sampler binding at index 0 for _mtlsmp__MainTex[0].'

(lldb)

Most helpful comment

All 20 comments

Yes. This is a known issue as mentioned. It'll be fixed in our next release, but if it's critical to you I suggest you drop back to 0.9.1.

I downgrade to 0.9.1 and I am using Xcode 8 and I am still getting the same error.
Does anybody have another solution?

same here :( I have error "failed assertion `missing sampler binding at index 0 for _mtlsmp__MainTex[0]" running 0.9.1 and xcode 8

Unfortunately I encoured the error just now. GearVR version v1.0.1 and xcode8.

Just mentioning since @nathanmartz said it'll be fixed in the next release.

Has this been fixed? Please let me know! I just tried it with xcode 8 and im facing this issue

I had the issue when I had a UI scene with jpgs in it. If I only run the 3D scene it works.

I have a 3d scene with an imported fbx model. Its a single fbx model with materials applied to it. Im not sure whats happening at this point. It works on the play mode in the editor but crashes when i try to launch it as an iOS app.

Is this a problem with the fbx? Or something to do with the latest version of xcode. I use xcode 8 and unity 5.4.

me too. looking forward to repair

Apple reject non iOS 10.1 compliant apps, we're facing same problem as this thread with :

iOS 10.1, XCode 8.1, Mac OS Sierra, Unity 5.4.2p1 and Cardboard 9

I also have had this issue. Have you got an ETA for a fix?

iOS 10.1, XCode 8.0, Mac OS El Capitan, Unity 5.4.2f2

Works for me, thanks @marymg78

Worked like a charm @marymg78 appreciate it!

Just wanted to check in if the issue has been resolved yet? I am using @marymg78 's workaround for now and it works like a charm however.

still broken, I guess.

@nathanmartz This issue may need to be reopened as 0.9.1 did not resolve it. Thanks!

All i want to know is what's the bad effect when Metal is disabled.

Can anybody tell me something? Thx

@eapenzhan well metal is the low level graphics API on Apple devices. So you can't exactly "disable" it

@z3t0 Thank you for the reply.

So when we disable Metal API Validation, it's just disable the validation part, not the actual API. Is that right?

Was this page helpful?
0 / 5 - 0 ratings