三重缓冲真的可以免费提升性能吗?

发布于 2024-09-06 05:46:05 字数 169 浏览 7 评论 0原文

因此,我读了很多有关 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

夏末 2024-09-13 05:46:05

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

揽清风入怀 2024-09-13 05:46:05

摘自优秀的“实时渲染”一书 (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:

"Triple buffering has one major advantage over double buffering. Using
it, the system can access the pending buffer while waiting for the vertical
retrace. With double buffering, a swap can stall the graphics pipeline.[...]The
drawback of triple buffering is that the latency increases up to one entire
frame. This increase delays the reaction to user inputs, such as keystrokes
and mouse or joystick moves."

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文