Experimental OpenGL acceleration path for v86 using a virtual PCI device, GL4ES, and WebGL #1611
Replies: 4 comments
|
Game video: |
|
Hi @copy, thank you for your great work on v86. I’m not sure whether this experimental rendering approach would be useful to the project, but I would really appreciate your feedback. At the moment, CPU usage remains to 100%. Further improvements to CPU emulation and I/O performance would significantly improve the gaming experience on Windows 2k/XP |
|
Cool stuff. I'm certainly interested in having this in the v86 repository, if it becomes a bit more mature. But before we go there, have considered existing protocols, e.g. virtio-gpu or gfxstream? Or at least making v86gl_pci.js a custom virtio device? Regarding performance, if you provide me a working disk image and precise build instructions, I would like to have a look. There may be some unoptimised instructions (e.g. fpu or simd) that could be fixed quickly. |
|
@speedyHKjournalist Great work! I’m exploring a different architecture with BottleShip: intercepting Win32, OpenGL and DirectX calls through HLE rather than passing them through a fully emulated guest system. https://github.com/jenissimo/bottleship Maybe we should cross the streams and compare notes? 😄 |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi everyone,
Inspired by the work of @SuperMaxusa, @Vort, and @temorot, I have implemented an experimental OpenGL rendering path for v86 with help from GPT.
The current pipeline is:
Windows OpenGL application
↓
opengl32.dll proxy
↓
v86gl.sys Windows driver
↓
v86 virtual PCI device
↓
GL4ES compiled with Emscripten
↓
OpenGL ES
↓
WebGL
With this implementation, Warcraft III can now run in OpenGL mode at approximately 10–15 FPS in v86.
This is still an experimental proof of concept, but the basic rendering path is working.
Components
v86 fork with the virtual PCI device
v86 PCI device fork
The fork adds v86gl_pci.js, which implements a full-duplex virtual PCI device for communication between the Windows guest and the browser-side OpenGL renderer.
Windows OpenGL proxy
opengl32.dll
This DLL replaces the guest-side system OpenGL library and serializes OpenGL calls before sending them to the virtual PCI device.
Windows guest driver
v86gl.sys
This Windows driver communicates with the v86 virtual PCI device and transfers commands and responses between the guest and the JavaScript side.
Virtual PCI device
v86gl_pci.js
This provides the bidirectional transport layer between the guest driver and the browser-side renderer.
GL4ES WebAssembly build
GL4ES / libglwasm
GL4ES is compiled with Emscripten and translates the received desktop OpenGL calls into OpenGL ES calls, which are then rendered through WebGL.
Current result
Warcraft III is now able to render both the user interface and the 3D world correctly in OpenGL mode.
The current performance is around 10–15 FPS, depending on the scene and host system.
Test page:
https://retrogaming.dpdns.org/game.html?id=warcraft3
The next step is to integrate WineD3D for Windows XP, allowing Direct3D 8 and Direct3D 9 calls to be translated into OpenGL and forwarded through the existing rendering bridge.
All reactions