Re: The best way to draw a GL texture from a different process



On 25 May 2018 at 10:23, Jiří Janoušek <janousek jiri gmail com> wrote:

Hello,

My app consists of the main process, where the GTK+ main loop and widgetry
live, and the GPU process, which does OpenGL kung-fu and provides GL
texture and dirty/invalidated rectangles as a result. I have little control
over the GPU process - I can patch it a bit, but I cannot merge the main
and GPU process, for example.

If I understand it correctly, I cannot simply share GL textures between the
processes and use e.g. gdk_cairo_draw_from_gl(). I can transfer the pixel
buffer via IPC, store it in the main process, call
gtk_widget_queue_draw_area(), and finally paint it in the draw signal
handler, but that is slow and involves a lot of copying.

Do you have any suggestions what could be a better way to draw the GL
texture from a different process? With GTK 3.22 and under Xorg.


You can store the texture data as an X11 Pixmap object, and use the
GLX_EXT_texture_from_pixmap extension to get a GL texture object out of a
Pixmap XID.

Ciao,
 Emmanuele.

-- 
https://www.bassi.io
[@] ebassi [@gmail.com]


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]