Using vulkan rendered image with gtkmm

Looking to get an image rendered with Vulkan into a Gtk::image. Is this anyway , possible with gtkmm-4 ?

If by “image rendered with Vulkan” you mean doing some Vulkan rendering, then: no, GTK does not support that.

At most, you have two options:

  • download the data as a bytes buffer from Vulkan into a GdkTexture
  • create a GL texture object and then use it with GdkGLTexture

Was looking use the texture in such a way to avoid the gpu->cpu download. Is there a way, that I can write a custom Vulkan render for a given gtk window/widget? And if so, will it be possible to create a dockable window with vulkan and dock it to another normal gtk window?

No, there is no way to do that. GTK works with multiple rendering API (GL, GLES, Cairo, and optionally Vulkan), using a deferred tree of rendering operations, so you cannot “take over” the rendering in a widget by itself. At most you can render on some offscreen surface/memory buffer, and use the GdkTexture and GtkSnapshot API to let GTK’s rendering pipeline take care of rendering the buffer when needed.

No, there’s no such thing.

Thanks a lot for the quick responses.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.