filament icon indicating copy to clipboard operation
filament copied to clipboard

Sharing Vulkan memory object

Open jwinarske opened this issue 4 years ago • 9 comments

Is your feature request related to a problem? Please describe. I need to render to a GL Texture external to Filament, while using Vulkan backend.

Describe the solution you'd like Have RenderTarget share Vulkan memory object, so external to Filament I can implement GL interop code. As the GL memory object needs to be created from a Vulkan memory object.

Describe alternatives you've considered Modified Filament to run on Linux EGL/GLESv2 (1.5/3.2) backend. Hitting issue where Wayland does not support pbuffer. Was asked by @pixelflinger if Vulkan was an option.

OS and backend Linux + Vulkan backend

Useful Vulkan/GL interop patterns documented here: https://eleni.mutantstargoat.com/hikiko/vk-gl-interop-2/ https://eleni.mutantstargoat.com/hikiko/vk-gl-interop-3/

jwinarske avatar Aug 21 '21 18:08 jwinarske

Any thoughts?

jwinarske avatar Aug 23 '21 16:08 jwinarske

No, no thoughts yet.

pixelflinger avatar Aug 24 '21 03:08 pixelflinger

I started implementing Vulkan support in the Flutter Engine embedder. I can factor it such that SKIA optionally renders to a RenderTarget (vkImage or other) which Filament could then use; similar to how Imgui is rendered in samples - Flutter (2D) replacing the "Imgui layer".

jwinarske avatar Aug 25 '21 19:08 jwinarske

/go/embedder-vulkan-support has been merged into main.

jwinarske avatar Sep 01 '21 22:09 jwinarske

Starting PR this week: flutter.dev/go/embedder-vulkan-support

jwinarske avatar Sep 19 '21 14:09 jwinarske

This is interesting, we have sharing mechanisms in place for Android but not other platforms. This bug is a few months old but I'll assume it's still something we need to work on.

prideout avatar Jan 14 '22 19:01 prideout

Hi. Recently ArCore was updated to support Vulkan by exposing a hardware buffer, which the app is supposed to bind to a VkImage. I guess this is still not possible because of this issue?

chakflying avatar May 28 '23 12:05 chakflying

You can implement a new backend for your use case. Just need to maintain your fork

jwinarske avatar May 31 '23 03:05 jwinarske

We recently introduced an API to provide the backend with a client-produced swapchain. I think it might address what you want to do. Please file a feature request there are gaps. Thanks.

poweifeng avatar Jun 02 '23 16:06 poweifeng