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.
This commit is contained in:
Simon Ser 2021-06-08 19:40:22 +02:00
parent 0bbecd7e90
commit ae7fcc5ba7

View file

@ -79,12 +79,13 @@ extern const struct wlr_surface_role xwayland_surface_role;
void xwayland_surface_role_commit(struct wlr_surface *wlr_surface) { void xwayland_surface_role_commit(struct wlr_surface *wlr_surface) {
assert(wlr_surface->role == &xwayland_surface_role); 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; 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 ); gpuvis_trace_printf( "xwayland_surface_role_commit wlr_surface %p", wlr_surface );