<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">2017-02-14 13:13 GMT+01:00 Pekka Paalanen <span dir="ltr"><<a href="mailto:ppaalanen@gmail.com" target="_blank">ppaalanen@gmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">On Tue, 14 Feb 2017 12:58:33 +0100<br>
Cédric Legrand <<a href="mailto:legrand.cedric.01@gmail.com">legrand.cedric.01@gmail.com</a>> wrote:<br>
<br>
> 2017-02-13 15:40 GMT+01:00 Pekka Paalanen <<a href="mailto:ppaalanen@gmail.com">ppaalanen@gmail.com</a>>:<br>
><br>
</span><span class="gmail-"><br>
> I'm still unable to get hardware acceleration with the<br>
> EGL_WL_bind_wayland_display extension working (question 3). I'm pretty sure<br>
> I missed a little stupid detail, but I can't get what exactly. If someone<br>
> could at least point me to a typical workflow, this may help me.<br>
<br>
</span>Maybe follow what Weston does with it?<br>
<br>
<a href="https://cgit.freedesktop.org/wayland/weston/tree/libweston/gl-renderer.c?id=1.99.92#n1997" rel="noreferrer" target="_blank">https://cgit.freedesktop.org/<wbr>wayland/weston/tree/libweston/<wbr>gl-renderer.c?id=1.99.92#n1997</a><br>
<br>
gl_renderer_attach() -> gl_renderer_attach_egl()<br>
<br>
You do handle different wl_buffer types (wl_shm, EGL, ...) accordingly,<br>
right?<br>
<br>
<br>
Thanks,<br>
pq<br>
</blockquote></div><br></div><div class="gmail_extra">Yep, this is what I'm doing. To be precise, here is my total workflow:<br></div><div class="gmail_extra">- After the server EGL display initialization, i call eglBindWaylandDisplayWL. I just saw that, unlike weston, I'm binding the wl_display after the context and surface creation. Weston does it right after eglChooseConfig. Does it matter?<br></div><div class="gmail_extra">- When the surface gets mapped, I create a texture for it with glGenTextures.<br></div><div class="gmail_extra">- On the wl_surface.attach event, I assign the buffer's wl_resource to the surface.<br></div><div class="gmail_extra">- On the wl_surface.commit event, I set the buffer texture (detailed below).<br></div><div class="gmail_extra">- Once the surface is drawn, I send the wl_buffer.release and the wl_callback.done events.<br><br></div><div class="gmail_extra">The texture filling with EGL buffer:<br></div><div class="gmail_extra">- I get the buffer size with eglQueryWaylandBufferWL<br></div><div class="gmail_extra">- I create an image with eglCreateImageKHR<br></div><div class="gmail_extra">- I bind the surface texture with glBindTexture<br></div><div class="gmail_extra">- I assign the buffer with glEGLImageTargetTexture2DOES, giving it the image.<br><br></div><div class="gmail_extra">Some notes:<br></div><div class="gmail_extra">- I know that I don't check the format, on my system I get ARGB8888, so I'm always using the GL_TEXTURE_2D atm.<br></div><div class="gmail_extra">- I also know that I miss some cleaning, I just want to make it work atm.<br></div><div class="gmail_extra">- wl_shm buffers work well, the only difference with an EGL buffer is the texture filling. All the other steps use exactly the same code.<br></div><div class="gmail_extra">- I'm rendering to a X11 window. I don't need anything special at window creation, do I?<br><br></div><div class="gmail_extra">Thanks,<br></div><div class="gmail_extra">Cédric Legrand<br></div></div>