Search Issue Tracker
Fix in review
[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]. MTLPixelFormatDepth32Float is compatible with texture data types type(s) (
- 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)
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.
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
- Handles.DrawDottedLine does nothing when used in the Editor
- Wrong depth texture when using SetTargetBuffers when anti-aliasing is higher than 1
- .NET 4.6 EqualityComparer.Equals yields different results from .NET 3.5 on UnityEngine.Object
- Adding a specific script to gameObject crashes editor
- Crashes while undo changes after editing two scenes in Hierarchy Window and remove one without save