/egui_vulkano

Vulkano rendering backend for egui

Primary LanguageRustGNU General Public License v3.0GPL-3.0

Vulkano backend for egui

Latest version Documentation

This is a drawing backend to use egui with Vulkano. It can be used with egui_winit_platform for input handling.

Usage

let mut egui_painter = egui_vulkano::Painter::new(
    device.clone(), // your vulkano Device
    queue.clone(), // your vulkano Queue
    Subpass::from(render_pass.clone(), 1).unwrap(), // subpass that you set up to render the gui
)
.unwrap();

// ...

// Get the shapes from egui
let (_output, clipped_shapes) = egui_ctx.end_frame();

// Automatically start the next render subpass and draw the gui
egui_painter
    .draw(
        &mut builder, // your vulkano AutoCommandBufferBuilder
        &dynamic_state, // your vulkano DynamicState
        [width, height], // window size
        &egui_ctx, // your egui CtxRef
        clipped_shapes,
    )
    .unwrap();

Check the included working example for more info.

Limitations

At the moment there is no support for user textures. This is my first project with Vulkan/Vulkano and I make no guarantees about performance or correctness. Pull requests are welcome!

Credits

With inspiration from egui_winit_ash_vk_mem, egui_sdl2_gl and egui_glium.