Some questions about porting virgl_test_server.
Hi. That is not request to patch anything, that is only one big question. I am working on project Termux. We have mesa with virgl driver enabled in both proot and termux environment. That is not a problem. Also there are some projects enabling support for rendering using mesa driver. That is mittorn's fork (outdated) and virgl_test_server compiled with zink support.
My target is to compile virglrenderer in termux with Android's libEGL and libGLESv1/v2/v3.
vrend_winsys_egl.c
seems to be complicated and tied to mesa and gbm. Both of them can not be used on Android without exposing private API's so I decided to use vrend_winsys_glx.c
as a base, with replacing glx-related functions to android-egl-related. I consider to start it with --use--surfaceless-egl to avoid creating any surface.
I consider to start virgl_test_server in the same mount/pid namespace I start X server, so it will be accessible.
My plan is to render everything to surfaceless EGL context and then glReadPixel
from render target to some buffer created with XShmCreateImage
or buffer mapped to fd shared to Xserver (with help of xcb_shm_attach_fd
or xcb_shm_create_segment
).
A question is:
Where should I get drawable window/pixmap id related to render target? I need that id to use it with xcb_shm_put_image
. What is the best way implementing this behaviour?
I know it will be less fast than native rendering, but in proot we have only llvmpipe. Even vtest renderer with zink backend faster than llvm pipe. I only need to know better way to patch this to make it draw to X server.
Thanks in advance, Nath.