dmaivel / sharedgl

An OpenGL implementation enabling 3D acceleration for Windows and Linux guests in QEMU
MIT License
56 stars 2 forks source link

How to Accelerate All Windows in Windows? #1

Open HeliosHub opened 3 weeks ago

HeliosHub commented 3 weeks ago

sharedgl can accelerate applications use opengl. If I want to accelerate all Windows in Qemu Windows, how to implement?

dmaivel commented 3 weeks ago

I believe accelerating the entire system will require implementing a render-only / full graphics WDDM driver (see here). I haven't done much experimentation with implementing a WDDM driver yet, but you can look through the following sources to get an idea of how you could implement a render-only driver:

Note that there are a handful of existing display-only drivers, which can serve as good starting points (just know that you will have to implement all the render-specific DDIs on top of the existing display-specific DDIs):

You most likely will need to write an additional usermode driver as well, but you can look at Mesa's d3d10umd or the VC4 source for that. You may also want to take a look at the source for IVSHMEM on acquiring the shared memory device, which in this case should act as the GPU device.

I am open to contributions, so don't hesitate to send a pull request if you make any progress. If I ever make any progress on implementing a WDDM driver (no promises), I'll be sure to update this project to include it.

HeliosHub commented 3 weeks ago

I believe accelerating the entire system will require implementing a render-only / full graphics WDDM driver (see here). I haven't done much experimentation with implementing a WDDM driver yet, but you can look through the following sources to get an idea of how you could implement a render-only driver:

Note that there are a handful of existing display-only drivers, which can serve as good starting points (just know that you will have to implement all the render-specific DDIs on top of the existing display-specific DDIs):

You most likely will need to write an additional usermode driver as well, but you can look at Mesa's d3d10umd or the VC4 source for that. You may also want to take a look at the source for IVSHMEM on acquiring the shared memory device, which in this case should act as the GPU device.

I am open to contributions, so don't hesitate to send a pull request if you make any progress. If I ever make any progress on implementing a WDDM driver (no promises), I'll be sure to update this project to include it.

Thank you for your reply. I have another question I would like to ask you. VirtualBox also has a display only driver, but it is smoother than the DOD driver of QXL. Do you know why?

dmaivel commented 3 weeks ago

I think QXL appears choppier due to a hardcoded limitation in QEMU, not QXL itself. The frame rate of QEMU is artificially capped to around ~33 FPS, so it won't appear as smooth.

I am not well-versed with VirtualBox, but it does appear that they offer a WDDM driver with rendering capabilities, if 3D acceleration is enabled.