From ae7fcc5ba75abe3aed700407c8ce6e2496327029 Mon Sep 17 00:00:00 2001 From: Simon Ser Date: Tue, 8 Jun 2021 19:40:22 +0200 Subject: [PATCH] wlserver: get wlr_buffer from VulkanWlrTexture_t This side-steps wlr_client_buffer and ensures we get access to the underlying buffer. This allows us to call wlr_buffer_begin_data_ptr_access to upload shm textures. --- src/wlserver.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/wlserver.cpp b/src/wlserver.cpp index e8c44ff..beab73e 100644 --- a/src/wlserver.cpp +++ b/src/wlserver.cpp @@ -79,12 +79,13 @@ extern const struct wlr_surface_role xwayland_surface_role; void xwayland_surface_role_commit(struct wlr_surface *wlr_surface) { assert(wlr_surface->role == &xwayland_surface_role); - if ( wlr_surface->buffer == NULL ) + VulkanWlrTexture_t *tex = (VulkanWlrTexture_t *) wlr_surface_get_texture( wlr_surface ); + if ( tex == NULL ) { return; } - struct wlr_buffer *buf = wlr_buffer_lock( &wlr_surface->buffer->base ); + struct wlr_buffer *buf = wlr_buffer_lock( tex->buf ); gpuvis_trace_printf( "xwayland_surface_role_commit wlr_surface %p", wlr_surface );