First post, by kjliew
As an introduction, this is *NOT* an upstream endorsed QEMU feature. QEMU native virgil3D/virtio-GPU provides support for complete OpenGL/GLES acceleration for Linux guests from Linux hosts. There were efforts started in 2018 to support Windows guests, but progress seemed to be at halt at the moment. Even the codes posted on GitHub are hard to rebuild because it requires Microsoft tools and SDKs.
Looking at how 3Dfx did standalone OpenGL for Voodoo/Voodoo2, it is in fact a viable solution to use the same concept in VM for full-screen OpenGL rendering, much simpler than writing a complete OpenGL ICD and interaction with GDI/DirectX/Display drivers. So In addition to 3Dfx Glide pass-through, QEMU can now support full host OpenGL acceleration through MESA GL pass-through with the focus for playing full-screen OpenGL Windows games. The Glide API is very similar to OpenGL. The learning from Glide pass-through was leveraged tremendously with similar guest push model and pass-through mechanism of command/data FIFOs but greatly enlarged to handle the data sets of OpenGL. No Microsoft tools and SDKs are required at all.
I presume it is currently at OpenGL 1.1 complete and includes some popular GL extensions that were widely used for OpenGL games in years 1997-2002 such as
ARB_multitexture, ARB_compiled_vertex_array etc. While dgVoodoo2 has been great for Glide Windows games on Windows, Linux aren't so lucky. Fortunately, most of the late Glide games (2000+) also support OpenGL as OpenGL started gaining popularity. The addition of MESA GL pass-through greatly addresses the shortcomings of OpenGlide for Linux KVM gaming. Furthermore, switching to OpenGL also enables higher visual qualities such as 32-bit color and high-res textures.
For Glide-only games without the option for OpenGL, there is also another option of running OpenGL-based Glide wrappers on guests. Current MESA GL pass-through supports enough OpenGL capabilities for the highly capable Zeckensack's Glide wrapper and Sven's Glide3-to-OpenGL wrapper for Diablo II. Games such as NFS Porsche 2000, Titanium Mechwarriors 2 series and Diablo II run perfectly flawless with the OpenGL wrappers at high resolution at the speed of modern CPU virtualization.
Other OpenGL games tested running great (high FPS 35~60, full details, equivalent or better than Glide using dgVoodoo2) are GLQuake1/Quake2/Quake3, Half Life, Unreal/UT99, Homeworld, Serious Sam TFE, Hitman Code 47. Much higher details OpenGL games (typically after year 2001) may run at 30FPS or lower, for eg. BloodRayne1 (2001) and enable water reflection kills another 6~7FPS.
UT2003 and Doom3 (2004) are able to run but at <5 FPS.
Testing is always ad hoc and per-game basis, typically involves analyzing the game GL calls trace then implement/fix new existing GL functions pass-through. As usual, QEMU source code overlay is provided at my GitHub and if you are interested to try out, then you will need to be able to apply the patch and build QEMU from source.