ptitSeb / gl4es

GL4ES is a OpenGL 2.1/1.5 to GL ES 2.0/1.1 translation library, with support for Pandora, ODroid, OrangePI, CHIP, Raspberry PI, Android, Emscripten and AmigaOS4.
http://ptitseb.github.io/gl4es/
MIT License
711 stars 160 forks source link

Is it compatible with qemu? #391

Open dontknowhy opened 2 years ago

dontknowhy commented 2 years ago

Screenshot_20220729_150833.jpg I tried to load gl4es to make virtio-vga-gl works However,QEMU doesn't want to detect my virgl-server(not virgl_test_server)… How do I get virtio-vga-gl to work?

ptitSeb commented 2 years ago

I don't know what you are trying to do: where is gl4es here: inside qemu vm or outside?

dontknowhy commented 2 years ago

I don't know what you are trying to do: where is gl4es here: inside qemu vm or outside?

LD_PRELOAD(Copied to /usr/lib/aarch64-linux-gnu/libGL.so.1 later) outside My device is an Android device without OpenGL support. Now i have working virgl server(I can use it to process OpenGLES) And now i need virgl server to process gl4es so i can have a full hardware accelerated OpenGL. So i need to make it works on QEMU(VirGL>GL4ES>QEMU>QEMU's VirtIO-VGA-GL>Guest System). My device has a Mali G77 MC9 GPU.And i'm sure VirGL is working.

ptitSeb commented 2 years ago

Not sure about you shema: gl4es should run outside of Qemu, in your host system, trnslating VirGL call to GLES2.

ptitSeb commented 2 years ago

But what I don't know is what kind of OpenGL context VirGL expect. Does 2.1 is enough? Also, how VirGL opengl OpenGL library? using dlopen I guess. Try maybe to use LD_DEBUG=libs to see what kind of libs qemu is openning and how does it goes (maybe there are some missing export in gl4es).

dontknowhy commented 2 years ago

But what I don't know is what kind of OpenGL context VirGL expect. Does 2.1 is enough? Also, how VirGL opengl OpenGL library? using dlopen I guess. Try maybe to use LD_DEBUG=libs to see what kind of libs qemu is openning and how does it goes (maybe there are some missing export in gl4es).

1.My virgl server can run glmark2-es2,So she can support OpenGLES 2 2.I exported LD_DEBUG=libs,And i got this: Screenshot_20220730_111250.jpg BV1GJ411x7h7

dontknowhy commented 2 years ago

But what I don't know is what kind of OpenGL context VirGL expect. Does 2.1 is enough? Also, how VirGL opengl OpenGL library? using dlopen I guess. Try maybe to use LD_DEBUG=libs to see what kind of libs qemu is openning and how does it goes (maybe there are some missing export in gl4es).

Screenshot_20220806_160532.jpg well… It seems like QEMU need display supports OpenGL.

dontknowhy commented 2 years ago

But what I don't know is what kind of OpenGL context VirGL expect. Does 2.1 is enough? Also, how VirGL opengl OpenGL library? using dlopen I guess. Try maybe to use LD_DEBUG=libs to see what kind of libs qemu is openning and how does it goes (maybe there are some missing export in gl4es).

uhh... I'm now trying to use gtk with gl=on And QEMU was normaly crashed(native OpenGLES) And then i tried to export MESA_GLES_VERSION_OVERRIDE=1.00,And it still doesn't work. At the last time,I tried to run QEMU with LD_PRELOAD=/usr/lib/gl4es/libGL.so.1(gtk supports OpenGL1.1) However, gl4es stops in the startup phase, and qemu cannot start because of this. How can i complete gl4es to make it works?(i'm using VirGL,so i only have EGL and OpenGLES3.2)