{"id":22389453,"url":"https://github.com/adrien-ben/egui-ash-renderer","last_synced_at":"2025-07-31T07:32:28.845Z","repository":{"id":228017812,"uuid":"772657444","full_name":"adrien-ben/egui-ash-renderer","owner":"adrien-ben","description":"A Vulkan renderer for egui using Ash.","archived":false,"fork":false,"pushed_at":"2024-09-27T11:26:54.000Z","size":731,"stargazers_count":9,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-13T16:55:06.216Z","etag":null,"topics":["ash","egui","rust","vulkan"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/adrien-ben.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-15T16:19:39.000Z","updated_at":"2024-11-03T14:24:45.000Z","dependencies_parsed_at":"2024-03-22T09:26:35.287Z","dependency_job_id":"d14b8596-0c19-4e1c-92c4-8490849efc2d","html_url":"https://github.com/adrien-ben/egui-ash-renderer","commit_stats":null,"previous_names":["adrien-ben/egui-ash-renderer"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrien-ben%2Fegui-ash-renderer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrien-ben%2Fegui-ash-renderer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrien-ben%2Fegui-ash-renderer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrien-ben%2Fegui-ash-renderer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adrien-ben","download_url":"https://codeload.github.com/adrien-ben/egui-ash-renderer/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":228224726,"owners_count":17887844,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ash","egui","rust","vulkan"],"created_at":"2024-12-05T03:11:58.423Z","updated_at":"2025-07-31T07:32:28.832Z","avatar_url":"https://github.com/adrien-ben.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# egui-ash-renderer\n\n[![Version](https://img.shields.io/crates/v/egui-ash-renderer.svg)](https://crates.io/crates/egui-ash-renderer)\n[![Docs.rs](https://docs.rs/egui-ash-renderer/badge.svg)](https://docs.rs/egui-ash-renderer)\n[![Build Status](https://github.com/adrien-ben/egui-ash-renderer/workflows/Build/badge.svg)](https://github.com/adrien-ben/egui-ash-renderer/actions)\n[![Publish Status](https://github.com/adrien-ben/egui-ash-renderer/workflows/Publish/badge.svg)](https://github.com/adrien-ben/egui-ash-renderer/actions)\n\nA Vulkan renderer for [egui][egui] using [Ash][ash].\n\nThis is meant to add support for egui in your existing Vulkan/ash applications. Not a full eframe integration for Vulkan/ash.\n\n![screenshot](capture.png)\n\n## Compatibility\n\n| crate  | egui         | ash          | gpu-allocator (feature) | vk-mem (feature) |\n|--------|--------------|--------------|-------------------------|------------------|\n| 0.9.0  | 0.32         | 0.38         | 0.27                    | 0.4              |\n| 0.8.0  | [0.26, 0.31] | 0.38         | 0.27                    | 0.4              |\n| 0.7.0  | [0.26, 0.30] | 0.38         | 0.27                    | 0.4              |\n| 0.6.0  | [0.26, 0.29] | 0.38         | 0.27                    | 0.4              |\n| 0.5.0  | [0.26, 0.28] | 0.38         | 0.27                    | 0.4              |\n| 0.4.0  | [0.26, 0.28] | [0.34, 0.37] | [0.25, 0.26]            | 0.3              |\n\n## How it works\n\nThe renderer records drawing command to a command buffer supplied by the application. Here is a little breakdown of the features of this crate and how they work.\n\n### Vertex/Index buffers\n\nThe renderer creates a vertex buffer and a index buffer that will be updated every time\n`Renderer::cmd_draw` is called. If the vertex/index count is more than what the buffers can\nactually hold then the buffers are resized (actually destroyed then re-created).\n\n### Frames in flight\n\nThe renderer support having multiple frames in flight. You need to specify the number of frames\nduring initialization of the renderer. The renderer manages one vertex and index buffer per frame.\n\n### No draw call execution\n\nThe `Renderer::cmd_draw` only record commands to a command buffer supplied by the application. It does not submit anything to the gpu.\n\n### sRGB/Linear framebuffer\n\nYou can indicate wether you will target an sRGB framebuffer or not by passing the option `srgb_framebuffer` when initializing the renderer.\nWhen you target an sRGB framebuffer, the fragment shader will output linear color values, otherwise it will convert the colors to sRGB.\n\n### Managed textures\n\nTextures managed by egui must be kept in sync with the renderer. To do so, the user should call `Renderer::set_textures` and \n`Renderer::free_textures`. The former must be call before submitting the command buffer for rendering and the latter must be\ncalled after rendering is complete. Example:\n\n```rust\nlet output = egui_ctx.run(raw_input, |ui| {\n    // ui code ..\n});\n\n// before rendering the ui\nrenderer.set_textures(queue, command_pool, output.textures_delta.set.as_slice()).unwrap();\n\n// rendering code goes here .. (calling cmd_draw, submitting the command buffer, waiting for rendering to be finished...)\n\n// after the rendering is done \nrenderer.free_textures(output.textures_delta.free.as_slice()).unwrap();\n```\n\n\u003e If you have multiple frames in flight you might want to hold a set of textures to free for each frame and call \n`Renderer::free_textures` after waiting for the fence of the previous frame.\n\n### Custom textures\n\nYou can also render used managed textures in egui. You just need to call `Renderer::add_user_texture` and pass a\n`vk::DescriptorSet` compatible with the layout used in the renderer's graphics pipeline \n(see [create_vulkan_descriptor_set_layout](./src/renderer/vulkan.rs)). This will return a `egui::TextureId` that you\ncan use in your ui code. Example:\n\n```rust\nlet user_texture_set: vk::DescriptorSet = ...;\nlet texture_id = renderer.add_user_texture(user_texture_set);\n\nlet output = egui_ctx.run(raw_input, |ui| {\n    let egui_texture = SizedTexture {\n        id: texture_id,\n        size: Vec2 {\n            x: 128.0,\n            y: 128.0,\n        },\n    };\n\n    egui::Image::new(egui_texture).ui(ui);\n});\n\n// When the texture won't be used anymore you can remove it from the renderer\nrenderer.remove_user_texture(texture_id);\n```\n\nYou can find a example using egui managed and user managed textures [here](./examples/textures.rs).\n\n## Features\n\n### gpu-allocator\n\nThis feature adds support for [gpu-allocator][gpu-allocator]. It adds `Renderer::with_gpu_allocator` which takes\na `Arc\u003cMutex\u003cgpu_allocator::vulkan::Allocator\u003e\u003e`. All internal allocator are then done using the allocator.\n\n### vk-mem\n\nThis feature adds support for [vk-mem-rs][vk-mem-rs]. It adds `Renderer::with_vk_mem_allocator` which takes\na `Arc\u003cMutex\u003cvk_mem::Allocator\u003e\u003e`. All internal allocator are then done using the allocator.\n\n### dynamic-rendering\n\nThis feature is useful if you want to integrate the library in an app making use of Vulkan's dynamic rendering.\nWhen enabled, functions that usually takes a `vk::RenderPass` as argument will now take a `DynamicRendering` which\ncontains the format of the color attachment the UI will be drawn to and an optional depth attachment format.\n\n## Integration\n\nYou can find an example of integration with [winit][winit] in the [common module](examples/common/mod.rs) of the examples.\n\n```rust\n// Example with default allocator\nlet renderer = Renderer::with_default_allocator(\n    \u0026vk_instance,\n    vk_physical_device,\n    vk_device.clone(),\n    vk_render_pass,\n    Options::default(),\n).unwrap();\n```\n\n## Examples\n\nYou can run a set of examples by running the following command:\n\n```sh\n# If you want to enable validation layers\nexport VK_LAYER_PATH=$VULKAN_SDK/Bin\nexport VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation\n\n# Or with Powershell\n$env:VK_LAYER_PATH = \"$env:VULKAN_SDK\\Bin\"\n$env:VK_INSTANCE_LAYERS = \"VK_LAYER_KHRONOS_validation\"\n\n# If you changed the shader code (you'll need glslangValidator on you PATH)\n# There is also a PowerShell version (compile_shaders.ps1)\n./scripts/compile_shaders.sh\n\n# Run an example\ncargo run --example \u003cexample\u003e\n\n# Example can be one of the following value:\n# - demo_windows\n# - textures\n```\n\n[egui]: https://github.com/emilk/egui\n[ash]: https://github.com/MaikKlein/ash\n[gpu-allocator]: https://github.com/Traverse-Research/gpu-allocator\n[vk-mem-rs]: https://github.com/gwihlidal/vk-mem-rs\n[winit]: https://github.com/rust-windowing/winit\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrien-ben%2Fegui-ash-renderer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadrien-ben%2Fegui-ash-renderer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrien-ben%2Fegui-ash-renderer/lists"}