[vbox-dev] Source code of VBoxEGL.so and VBoxOGL*.so

Michael Thayer michael.thayer at oracle.com
Fri Dec 2 08:23:43 GMT 2016


(Re-sending, as I forgot to reply to the list.)

02.12.2016 07:12, Roger wrote:
 > I want to know whether the source code of VBoxEGL.so and VBoxOGL*.so
 > are available? What I want to do is that I want to see whether it is
 > possible to create an OpenGL ES driver for android-x86 for
 > VirtualBox. The source code of VBoxEGL and VBoxOGL should be a good
 > reference to do that.

Hello Roger,

The short story is that they live in the VirtualBox source directory
src/VBox/Additions/common/crOpenGL[1].  The slightly longer one is that
VBoxOGL.so implements an OpenGL and a GLX library by respectively
marshalling OpenGL calls into a data stream which is sent to the host (I
haven't looked into how feedback from the host graphics card is handled)
and talking to the guest X server to find out things like guest window
position, so that 3D content can be placed on top of the right guest
windows (try dragging guest windows with 3D content in them to
understand the approach and its drawbacks).  VBoxEGL.so is the only one
I wrote and therefore know, and it is simply an X11-only EGL
implementation wrapped around the GLX one.

[1] 
https://www.virtualbox.org/browser/vbox/trunk/src/VBox/Additions/common/crOpenGL

Naively I would assume that the most efficient way of solving your
problem would be to leave the OpenGL part as untouched as possible and
to look at writing an EGL library suited to Android (unfortunately I
don't know much about how Android does EGL) by reworking the GLX
implementation.  I would expect that it could live inside VBoxEGL.so
alongside the current one (we use the same dubious trick as Mesa does or
did in eglGetDisplay()[2] to determine the EGL implementation
requested).  It would also be nice if your EGL could be easily extended
to work with a replacement libgbm.so to provide acceleration for Wayland
if someone is interested in doing that.

[2] 
https://www.virtualbox.org/browser/vbox/trunk/src/VBox/Additions/common/crOpenGL/egl.c?rev=63206#L134

I would greatly appreciate it if you could write up what you learn about
the 3D implementation into something we can put on the wiki for other
developers.  If you do that then feel free to copy and paste from this
message if it is helpful.

Regards,

Michael
-- 
Michael Thayer | VirtualBox engineer
ORACLE Deutschland B.V. & Co. KG | Werkstr. 24 | D-71384 Weinstadt

ORACLE Deutschland B.V. & Co. KG
Hauptverwaltung: Riesstraße 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603

Komplementärin: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande Handelsregister 
der Handelskammer Midden-Nederland, Nr. 30143697
Geschäftsführer: Alexander van der Ven, Jan Schultheiss, Val Maher



More information about the vbox-dev mailing list