Re: Mesa 17 Wayland EGL changes

Cédric Legrand <[email protected]>
Newsgroups gmane.comp.video.mesa3d.user
Message-ID <CAEPHVG=k-MYvJg3iYZe-RQnRONjh8avxTsM93=2VEodesHnY=w@mail.gmail.com>
2017-02-14 13:13 GMT+01:00 Pekka Paalanen <[email protected]>:

> On Tue, 14 Feb 2017 12:58:33 +0100
> Cédric Legrand <[email protected]> wrote:
>
> > 2017-02-13 15:40 GMT+01:00 Pekka Paalanen <[email protected]>:
> >
>
> > I'm still unable to get hardware acceleration with the
> > EGL_WL_bind_wayland_display extension working (question 3). I'm pretty
> sure
> > I missed a little stupid detail, but I can't get what exactly. If someone
> > could at least point me to a typical workflow, this may help me.
>
> Maybe follow what Weston does with it?
>
> https://cgit.freedesktop.org/wayland/weston/tree/libweston/
> gl-renderer.c?id=1.99.92#n1997
>
> gl_renderer_attach() -> gl_renderer_attach_egl()
>
> You do handle different wl_buffer types (wl_shm, EGL, ...) accordingly,
> right?
>
>
> Thanks,
> pq
>

Yep, this is what I'm doing. To be precise, here is my total workflow:
- 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?
- When the surface gets mapped, I create a texture for it with
glGenTextures.
- On the wl_surface.attach event, I assign the buffer's wl_resource to the
surface.
- On the wl_surface.commit event, I set the buffer texture (detailed below).
- Once the surface is drawn, I send the wl_buffer.release and the
wl_callback.done events.

The texture filling with EGL buffer:
- I get the buffer size with eglQueryWaylandBufferWL
- I create an image with eglCreateImageKHR
- I bind the surface texture with glBindTexture
- I assign the buffer with glEGLImageTargetTexture2DOES, giving it the
image.

Some notes:
- 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.
- I also know that I miss some cleaning, I just want to make it work atm.
- 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.
- I'm rendering to a X11 window. I don't need anything special at window
creation, do I?

Thanks,
Cédric Legrand

_______________________________________________
mesa-users mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.