Search Issue Tracker
Fixed
Votes
22
Found in
5.3.4f1
Issue ID
786455
Regression
No
[Metal] API provides 32-bit depth texture when a 16-bit texture is expected
How to reproduce:
1. Open attached project
2. Build to iOS
3. Open in Xcode
4. In Xcode, go to Product -> Scheme -> Edit Scheme...
5. In the Options tab change the GPU Frame Capture setting to Metal
6. Build to device
- Note that it crashes before getting to the Splash Screen with this error:
/BuildRoot/Library/Caches/com.apple.xbs/Sources/Metal/Metal-56.7/ToolsLayers/Debug/MTLDebugRenderCommandEncoder.mm:1602: failed assertion `MTLPixelFormat of texture [TempBuffer 2 1920x1080 (MTLPixelFormatDepth32Float)] bound at index 1 is incompatible with texture parameter [MTLDataTypeHalf _CameraDepthTexture[0]]. MTLPixelFormatDepth32Float is compatible with texture data types type(s) (
float
).'
- Reproduced in Version 5.2.4f1 (98095704e6fe), Version 5.3.4p2 (fdf8d87c549e), Version 5.4.0b14 (0d4790749194) on an iPhone 6+ (iOS 9.3.1)
- Not reproducible on an iPhone 5 (iOS 7.1)
RESOLUTION:
As a workaround: please disable the Metal validation setting in the Xcode schema options
Proper solution: search for CameraDepthTexture in your shaders and verify that it uses sampler2D_float, not just sampler2D. Note that ignoring this issue may crash the GPU driver on certain hardware.
Unity will have a warning for this in the future.
Add comment
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- Articulation Body with 'Revolute' Joint Type has erratic behavior when Upper Limit is set to above 360
- WebGL Player fails to render Scene when Terrain with Detail Mesh is added and WebGPU Graphics API is used
- Inconsistent errors are logged when different types are passed into the Query "Q<>" method in UIToolkit and the ancestor VisualElement is null
- Crash on GetMaterialPropertyByIndex when opening a specific Scene
- Discrepancies in the styling are present when using a TSS file instead of a USS file in custom EditorWindow
glowmadejonny
Nov 02, 2016 16:05
It's _CameraDepthTexture - it says it in the error message.
If you go to Edit Scheme... / Options and set Metal API Validation to Disabled, you'll be ok.
justdizzy
Oct 12, 2016 21:26
Any way to figure out which texture is at fault? Maybe a workaround is to resize the texture or add/remove alpha layer?
justdizzy
Oct 12, 2016 19:28
Just verified this is still an issue in 5.4.1p4. As a side note, it only throws the exception for me when launching the app through Xcode, if I launch it directly on device, then the app continues to run.
Ben_SEM
Sep 28, 2016 21:04
Similar issue here on 5.3.4p4 with iOS10 / XCode 8. It is working fine on the same Unity version in iOS9 / XCode 7.
lacost
Sep 26, 2016 12:00
We do have same issues, had to manually switch to OpenGLES2. Now we can alt least work with the app,
justdizzy
Sep 14, 2016 22:48
Instead of adjusting settings in Xcode, in Unity I set the Graphics API in iOS Player Settings to "Metal", unchecking "Auto Graphics API".
I can reproduce the crash with Unity 5.4.0f3 & 5.4.1f1, building with Xcode 8 on device running iOS 10.0.1 (iPad Mini 2 and iPhone 6s), but not iOS 9.3.5 (iPad Air 2). I have not tried side loading a build from Xcode 7