poor performance using layer-backed NSOpenGLView

半城伤御伤魂 提交于 2019-12-23 04:47:27

问题


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.

I enabled layer backing thusly:

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).

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

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.

FWIW, here are the settings for my OpenGL view:

I'm on OS X 10.10 Yosemite.


回答1:


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



来源:https://stackoverflow.com/questions/27464133/poor-performance-using-layer-backed-nsopenglview

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!