iPhone 着色器分析
我正在使用一系列着色器在 iPhone (3GS/4/iPad) 上执行实时图像处理。 fps 不是我想要的。
有没有什么工具可以帮助我找出瓶颈?
I'm using a series of shaders to perform realtime image processing on the iPhone (3GS/4/iPad). The fps isn't what I'd like it to be.
Are there any tools that I can use to help me work out what the bottlenecks are?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我假设您已经知道模拟器上的性能测试毫无价值,并且您正在真实的金属上进行测试,因此 Instruments 始终是一个很好的起点 - 特别是在您的情况下,您会对
OpenGL ES
和OpenGL ES 分析器
仪器。一般来说,对于 GLSL,OpenGL.org 站点上有一个常见 GLSL 错误的列表。 O'Reilly 实验室的“iPhone 3D 编程”一书有一些进一步的提示,例如避免条件条件中昂贵的操作,以及监视纹理查找。
此外,这还取决于您正在执行哪种图像处理;如果您尝试应用重型 Photoshop 式滤镜,这会导致四核暂停渲染,那么在低端手机上成本会很高。
I assume you already know that performance tests on the Simulator are worthless and that you're testing on real metal, so Instruments is always a good place to start - specifically in your case you'd be interested in the
OpenGL ES
andOpenGL ES Analyzer
instruments.Generally speaking for GLSL, there's a list of common GLSL mistakes at the OpenGL.org site. The O'Reilly labs "iPhone 3D Programming" book has some further hints, such as avoiding expensive operations in conditionals, and watching for texture lookups.
Also, it's going to depend on what kind of image processing you're doing; if you're trying to apply heavy Photoshop-esqe filters that would give a quad-core pause to render, it's going to be costly on a lowly phone.
目前唯一可用的工具是 PVRUniSCo 编辑器,它将为您提供着色器中每行代码的循环计数(尽管似乎仅在 Windows 上)。
The only currently available tool is the PVRUniSCo editor, which will give you a cycle count for each line of code in your shader (though only on Windows, it seems).