Mythril is C++20 Vulkan rendering framework for Windows, Linux, and MacOS. It aims to provide a easy to create and highly abstracted API for Vulkan, aswell as some bonus features described below.
- RenderGraph implementation, automatically builds and optimizes your described frame.
- Bindless design for textures & samplers.
- Automatic shader reflection.
- Abstracted and easy to use resource descriptors.
- RAII Object System, all Vulkan objects are cleaned up automatically.
- Supported plugin system for commonly used dev tools, currently includes ImGui and Tracy.
int main() {
auto ctx = mythril::CTXBuilder{}
.set_vulkan_cfg({
.app_name = "Cool App Name",
.engine_name = "Cool Engine Name"
})
.set_window_spec({
.title = "Cool Window Name",
.mode = mythril::WindowMode::Windowed,
.width = 640,
.height = 480,
.resizeable = false,
})
.with_default_swapchain()
.build();
mythril::RenderGraph graph;
graph.addGraphicsPass("main")
.attachment({
.texDesc = ctx->getBackBufferTexture(),
.clearValue = {1, 0, 0, 1},
.loadOp = mythril::LoadOp::CLEAR,
.storeOp = mythril::StoreOp::STORE
})
.setExecuteCallback([&](mythril::CommandBuffer& cmd) {
// do absolutely nothing, just begin and end a pass
cmd.cmdBeginRendering();
cmd.cmdEndRendering();
});
graph.compile(*ctx);
bool quit = false;
while(!quit) {
SDL_Event e;
while (SDL_PollEvent(&e)) {
if (e.type == SDL_EVENT_QUIT) quit = true;
}
mythril::CommandBuffer& cmd = ctx->openCommand(mythril::CommandBuffer::Type::Graphics);
graph.execute(cmd);
ctx->submitCommand(cmd);
}
return 0;
}- C++ 20 (Tested on clang 16.0.0 & gcc 13.3.0)
- CMake 3.28+
- Vulkan SDK 1.4.335.0+
You can easily include with CPM.
CPMAddPackage(
NAME mythril
GITHUB_REPOSITORY "externalhost0/Mythril"
GIT_TAG main
)You could also clone as a submodule and add as a subdirectory.
add_subdirectory(mythril)| Option | Default | Description |
|---|---|---|
MYTH_RUN_SAMPLES |
ON |
Enables sample apps. |
MYTH_ENABLE_IMGUI_STANDARD |
OFF |
Installs ImGui (Main Branch) and enables mythril's ImGuiPlugin |
MYTH_ENABLE_IMGUI_DOCKING |
OFF |
Installs ImGui (Docking Branch) and enables mythril's ImGuiPlugin |
MYTH_ENABLE_TESTS |
OFF |
Builds tests directory to be run by CMake. |
MYTH_ENABLE_TRACY |
OFF |
Installs Tracy and enabled mythrils' TracyPlugin |
MYTH_ENABLE_TRACY_GPU |
OFF |
Requires ENABLE_TRACY to be ON, allows GPU timing (CURRENTLY EXPERIMENTAL) |
Note:
MYTH_ENABLE_IMGUI_STANDARDandMYTH_ENABLE_IMGUI_DOCKINGare mutually exclusive!
This project is distributed under the Mozilla Public License Version 2.0, please see LICENSE.txt for more.
- LightweightVK - Basically why Mythril exists, I loved how simply lightweightvk is but found we could abstract even more out of it.

