使用层支持NSOpenGLView的性能较差 [英] poor performance using layer-backed NSOpenGLView

查看:349
本文介绍了使用层支持NSOpenGLView的性能较差的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在更新我的OS X应用程序使用层支持视图,所以我可以有Cocoa视图在我的OpenGL渲染(我还没有添加任何Cocoa视图)。没有图层,我得到60fps。有层,小于15fps。

I'm updating my OS X app to use layer-backed views, so I can have Cocoa views on top of my OpenGL rendering (I haven't added any Cocoa views yet). Without layers, I get 60fps. With layers, less than 15fps. My iOS version, where everything is layer-backed, gets 60fps.

我启用了层次支持:

我还必须设置该图层的背景颜色为黑色,以避免糟糕的合成(我使用OpenGL混合,因此缓冲区中的最终alpha值不适用于CA合成)。

I also had to set the layer's background color to black to avoid bad compositing (I use OpenGL blending, so the final alpha values in the buffer aren't correct for CA compositing).

根据仪器,大部分的渲染时间花在CA :: Transaction :: commit:

According to Instruments, most of the rendering time is spent in CA::Transaction::commit:

我已尝试清除建议的Alpha频道

I tried clearing the alpha channel as recommended here, but this seems to be just an alternative to setting the layer's background color to black.

我在OS X 10.10 Yosemite。

I'm on OS X 10.10 Yosemite.

推荐答案

根据苹果开发者论坛上的帖子,这似乎是OS X 10.10中的一个错误。

According to posts on the Apple developer forums, this appears to be a bug in OS X 10.10.

这篇关于使用层支持NSOpenGLView的性能较差的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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