Stop importing DMA-BUFs into EGL

Make renderer_texture_from_dmabuf a no-op, since we handle client
DMA-BUFs with Vulkan. We're using wlr_buffer_get_dmabuf to directly
access the client-submitted FDs.
This commit is contained in:
Simon Ser 2021-05-20 17:08:19 +02:00
parent 7adcd2fb20
commit cd4c1a4d7d
2 changed files with 20 additions and 2 deletions

View file

@ -2155,6 +2155,16 @@ uint32_t vulkan_texture_get_fbid( VulkanTexture_t vulkanTex )
return ret; return ret;
} }
static void texture_destroy( struct wlr_texture *wlr_texture )
{
VulkanWlrTexture_t *tex = (VulkanWlrTexture_t *)wlr_texture;
delete tex;
}
static const struct wlr_texture_impl texture_impl = {
.destroy = texture_destroy,
};
static void renderer_begin( struct wlr_renderer *renderer, uint32_t width, uint32_t height ) static void renderer_begin( struct wlr_renderer *renderer, uint32_t width, uint32_t height )
{ {
abort(); // unreachable abort(); // unreachable
@ -2225,8 +2235,11 @@ static const struct wlr_drm_format_set *renderer_get_dmabuf_texture_formats( str
static struct wlr_texture *renderer_texture_from_dmabuf( struct wlr_renderer *wlr_renderer, struct wlr_dmabuf_attributes *dmabuf ) static struct wlr_texture *renderer_texture_from_dmabuf( struct wlr_renderer *wlr_renderer, struct wlr_dmabuf_attributes *dmabuf )
{ {
VulkanRenderer_t *renderer = (VulkanRenderer_t *) wlr_renderer; VulkanWlrTexture_t *tex = new VulkanWlrTexture_t();
return wlr_texture_from_dmabuf( renderer->parent, dmabuf ); wlr_texture_init( &tex->base, &texture_impl, dmabuf->width, dmabuf->height );
// TODO: check format/modifier
// TODO: try importing it into Vulkan
return &tex->base;
} }
static bool renderer_resource_is_wl_drm_buffer( struct wlr_renderer *wlr_renderer, struct wl_resource *resource ) static bool renderer_resource_is_wl_drm_buffer( struct wlr_renderer *wlr_renderer, struct wl_resource *resource )

View file

@ -70,6 +70,11 @@ struct VulkanRenderer_t
struct wlr_renderer *parent; struct wlr_renderer *parent;
}; };
struct VulkanWlrTexture_t
{
struct wlr_texture base;
};
class CVulkanTexture class CVulkanTexture
{ {
public: public: