三重缓冲真的可以免费提升性能吗?
因此,我读了很多有关 openGL、GPU 和图形的文章,并且经常提到三重缓冲可以免费提升性能。我知道为什么它有帮助;实际上,您可以进行垂直同步,而不受 60、30、20、15 等帧速率选择的限制,因此您实际上可以实现 55fps。但这实际上有成本吗?直观上,我预计三重缓冲会延迟一帧的输出,从而为所有内容添加非常小的延迟。
So I've been reading a lot about openGL and gpus and graphics in general, and triple buffering is semi-frequently mentioned as giving a free performance boost. I know why it helps; in effect, you can do v-sync without being limited to a framerate choice of 60 or 30 or 20 or 15 or etc, so you can actually achieve, say, 55fps. But is there actually a cost to this? Intuitively, I'd expect triple buffering to delay output by one frame, adding a very small lag to everything.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在 55 FPS 下,一帧略低于 20 毫秒。因此,它并不是完全免费,但几乎总是物有所值。
不过,在 15 FPS 下,这种情况就非常明显了。 (顺便说一句,这是一台 POS 笔记本电脑。大多数 3D 游戏对我来说运行速度都这么快。有些甚至更慢。)
有些人注意到延迟,尤其是在较低帧速率下,有时三重缓冲无法按预期工作。 (特别是在 OpenGL 中,硬件不能很好支持的东西可以回退到(可能非常慢)软件模拟。现在应该不是什么大问题,但是呃。)所以大多数使用三重缓冲的程序也包括一个禁用它的选项。您可能想考虑做同样的事情。
At 55 FPS, one frame is a bit under 20ms. So it's not quite free, but it's almost always well worth the cost.
At 15 FPS, though, it can be pretty noticeable. (BTW, this is a POS laptop. Most 3D games run about that fast for me. Some even slower.)
Some people notice the lag, especially at lower frame rates, and sometimes triple buffering doesn't work quite as expected. (In OpenGL, in particular, something that's not supported well by the hardware can fall back to (potentially very slow) software emulation. Shouldn't be much of an issue these days, but eh.) So most programs that use triple buffering also include an option to disable it. You may want to consider doing the same.
摘自优秀的“实时渲染”一书 (http://www.realtimerendering.com/ )由 Akenine-Möller 等人撰写,第 835 页,这几乎总结了您在回答自己的问题时已经建议的内容,考虑到滞后:
A quote from the excellent "Real-Time Rendering" book (http://www.realtimerendering.com/) by Akenine-Möller and others, page 835, which pretty much sums up what you have already suggested in the answer to your own question, considering lag: