Viewing Your GPU Workload with the Metal Debugger 利用Metal Debugger来查看显卡工作(排错)

Step through your app’s state on the GPU using various Metal tools in Xcode.
内容:在Xcode中使用Metal变量来步进显卡的程序状态
说明:本文需要结合前面一个程序来熟练 Metal调试。
没有下载内容。

Overview

To understand how the computer runs your app or to debug problems, you typically use a debugger. Traditional传统的 debuggers work by pausing on a single thread, but this doesn’t work very well with Metal apps. Xcode provides提供了 a debugger specifically针对性的调试器 for Metal through its frame capture workflow.

To debug a Metal app with the Metal debugger, you capture捕获 a single frame of animation and examine the commands that the app generated to create it.

In this article, you run the Using a Render Pipeline to Render Primitives example through Xcode’s Metal debugger to learn how to examine a Metal app at runtime. 这篇文档,通过运行《Using a Render Pipeline to render Primitives》例子来运行metal调试器,来学习如何实时检查Metal程序运行。

Enable the Metal Debugger in the Xcode Project

In the Rendering example, go into the project’s build settings and change the Metal compiler options so that the debug information includes source code for your shaders. Set “Produce debugging information” for Debug to “Yes, include source code”.
按下图所示打开Metal调试器
在这里插入图片描述
Apps shipped to customers shouldn’t contain debugging information, so set Release to No.

Capture a Frame 捕获一帧

The Metal Debugger works in conjunction结合 with Xcode’s Metal frame capture feature. To use the Metal Debugger, first you capture a frame using the following steps. 首先使用下面步骤捕获一帧。
Build and run your project. In the case of Using a Render Pipeline to Render Primitives, the app displays a triangle.

在这里插入图片描述
While the app is running, return to Xcode and click the camera icon on the debugging toolbar: 在Xcode版本Version 13.0 (13A233)

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值