You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I'm having a difficult time trying to efficiently exchange data between wgpu and wayland. In order to display an image on wayland I need to attach wl_buffer that contains the image to a surface, on there end. My issue is that I'm not exactly sure how can I create a buffer on a GPU that will be accessible by both wayland trough wl_buffer, and by wgpu trough wgpu::buffer.
In Smithay/client-toolkit there is a good example that creates a wgpu::Surface and uses it to configure and render the image, however I don't believe this is an option for me because I have to copy some data from another wl_buffer provided to me by the system. This is easily achieved by just using wl_buffer.copy(&wl_buffer) or I'm getting back to square one were I need to find a way to get data from wl_buffer to wgpu::buffer.
Wayland allows me to create a wl_buffer from dmabuf fd so if I will be able to allocate data on my gpu and get dmabuf fd my issue will essentialy be solved but I haven't found a way to export dmabuf fd from a wgpu::Buffer or even just import data to wgpu::Buffer from dmabuf fd, so I'm at a loss right now.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello, I'm having a difficult time trying to efficiently exchange data between wgpu and wayland. In order to display an image on wayland I need to attach wl_buffer that contains the image to a surface, on there end. My issue is that I'm not exactly sure how can I create a buffer on a GPU that will be accessible by both wayland trough wl_buffer, and by wgpu trough wgpu::buffer.
In Smithay/client-toolkit there is a good example that creates a wgpu::Surface and uses it to configure and render the image, however I don't believe this is an option for me because I have to copy some data from another wl_buffer provided to me by the system. This is easily achieved by just using
wl_buffer.copy(&wl_buffer)
or I'm getting back to square one were I need to find a way to get data from wl_buffer to wgpu::buffer.Wayland allows me to create a wl_buffer from dmabuf fd so if I will be able to allocate data on my gpu and get dmabuf fd my issue will essentialy be solved but I haven't found a way to export dmabuf fd from a wgpu::Buffer or even just import data to wgpu::Buffer from dmabuf fd, so I'm at a loss right now.
Beta Was this translation helpful? Give feedback.
All reactions