iOS12导致Metal命令缓冲区执行错误,渲染出现故障或未发生 [英] iOS12 is causing an error on Metal Command Buffer execution, render is glitchy or doesn't occur

查看:1356
本文介绍了iOS12导致Metal命令缓冲区执行错误,渲染出现故障或未发生的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们有一个使用Metal进行渲染的应用.这个应用程式可在执行iOS11的装置上正常运作.在运行iOS12的设备上使用同一应用程序时,我们开始出现故障,有时会挂在渲染中.我们还尝试了针对iOS12的重新编译,并且得到了同样的不良行为.在控制台上,我们收到以下不同消息:

We have an app that uses Metal to render. This app works correctly on devices running iOS11. When using the same app on devices running iOS12, we started getting glitches and sometimes hangs in the rendering. We also tried recompiling for iOS12 and are getting the same bad behavior. On the console we are getting the following different messages:

2018-09-22 09:22:29.508576-0500 OurApp [1286:84481]由于执行期间发生错误,命令缓冲区的执行被中止.丢弃(GPU错误/恢复的受害者)(IOAF代码5)

2018-09-22 09:22:29.508576-0500 OurApp [1286:84481] Execution of the command buffer was aborted due to an error during execution. Discarded (victim of GPU error/recovery) (IOAF code 5)

2018-09-22 09:29:55.654426-0500 OurApp [1286:84625]由于执行期间发生错误,命令缓冲区的执行被中止.导致GPU挂起错误(IOAF代码3)

2018-09-22 09:29:55.654426-0500 OurApp [1286:84625] Execution of the command buffer was aborted due to an error during execution. Caused GPU Hang Error (IOAF code 3)

2018-09-22 09:34:37.718054-0500 OurApp [1286:87354]由于执行期间发生错误,命令缓冲区的执行被中止.被忽略(导致先前/过度的GPU错误)(IOAF代码4)

2018-09-22 09:34:37.718054-0500 OurApp [1286:87354] Execution of the command buffer was aborted due to an error during execution. Ignored (for causing prior/excessive GPU errors) (IOAF code 4)

在出现前两个消息时,渲染似乎出现故障,出现空白屏幕,然后最终在屏幕上进行渲染.对于最后一条消息,实际上不会进行渲染,并且消息将继续显示,直到我们移至其他视图为止.

With the first two messages the rendering seems glitchy, where a blank screen is presented and then finally the rendering occurs on screen. With the last message the rendering doesn't actually occur and the message continues being displayed until we move to a different view.

此应用程序使用SceneKit,实例化SCNView并使用默认的CIContext.它还使用基于物理的照明模型,该模型强制使用Metal渲染器.该应用程序具有简单的SCNNode几何形状,即圆柱体.圆柱体的每个几何对象都有一个正常的纹理(总共3个).相同的漫反射,金属度和粗糙度值将应用于圆柱体的所有几何对象.

This app uses SceneKit, instantiates a SCNView and uses a default CIContext. It also uses the Physically Based Lighting model, which forces the Metal renderer to be used. The app has a simple SCNNode geometry, a cylinder. Each geometry object of the cylinder gets a normal texture (3 in total). The same diffuse, metalness and roughness values are applied to all the geometry objects of the cylinder.

有人遇到过这个问题吗?如果是这样,您是如何解决的?

Has anybody ran into this problem? If so, how did you solve it?

谢谢

更新:问题似乎是在将图像用作场景的照明环境时引起的:

UPDATE: The problem seems to be caused when an image is used as the scene's lighting environment:

let scene = SCNScene()
scene.lightingEnvironment.contents = UIImage(named: "ourLightingEnvironmentImage")

当不使用照明环境时,问题就消失了.这开始看起来像是苹果的bug,我们将提起一个.我们之所以陷入困境,是因为我们需要光照环境才能为我们的应用程序中的模型生成逼真的反射.

When a lighting environment isn't used, the problem goes away. This is starting to look like an Apple bug, we will file one. We are stuck because we need the lighting environment to produce realistic reflections for the models in our app.

推荐答案

这是一个错误,由高分辨率的环境闪电图像引起.

It's a bug, caused by high resolution environment lightning images.

解决方案是调整这些图像的大小,我们现在使用的是1000x500.完美运行.

The solution is to resize these images, 1000x500 is what we are using now. Works perfectly.

这篇关于iOS12导致Metal命令缓冲区执行错误,渲染出现故障或未发生的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆