Search Issue Tracker
[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.
- Backgrounds of Editor windows are changed to a texture when method ImageConversion.LoadImage is called
- Lightmapper is slow when using "Always Refresh"
- [VerticalLayoutGroup] Children position is not updated when a child's scale is animated
- [Android] Can't relocate the caret in Input Fields when Hide Mobile Input option is being used
- Multiple Edge Colliders 2D can be edited at the same time, every Edge Collider's "Edit Collider" button is highlighted