Phobos
Phobos is a Vulkan abstraction library aiming to create Vulkan applications more easily. It provides abstractions to automatically manage common Vulkan problems like synchronization and resource management. At the same time, it aims to expose the full Vulkan API without major limitations.
At the moment, the project is highly WIP, and not all these goals have been fully achieved yet. It is developed together with a rendering engine using it, so features are currently added as needed.
What does Phobos do?
- All Vulkan initialization from a single configuration structure.
- Manage per-frame synchronization with the presentation engine.
- GPU futures, fully integrated with Rust futures.
- More formally,
Future<Output = T>
is implemented forphobos::Fence<T>
.
- More formally,
- Provide a task graph that can be used to automatically synchronize resources in your renderer.
- Automatic image layout transitions.
- Automatic renderpass declarations.
- Automatic memory barriers for buffers.
- Virtual resources, meaning actual resources are only bound to a graph at record time. This allows general-purpose graphs to be re-used if desired.
- Safe wrappers for Vulkan objects.
- No
unsafe
in the public API, except when accessing raw Vulkan handles. - Descriptor sets are completely hidden. Simply bind resources directly to the command buffer.
- Automatic pipeline management.
- Shader reflection to automatically generate pipeline layouts.
- Works for both GLSL and HLSL.
- Currently only one can be enabled at a time.
- Automatic double buffering of resources that need it.
- A linear allocator for per-frame allocations like uniform buffers.
- Typed command buffers per queue type.
- Automatically thread safe command buffer recording.
- Easily batch together submits into one
vkQueueSubmit
call and synchronize them with semaphores using theSubmitBatch
utility. - Automatically create a shader binding table for your ray tracing pipeline.
- Object pools for reusing fences, local allocators, etc.
- Easy integration with FSR2 through the
fsr2-sys
crate.
What does Phobos not do?
- Implement a renderer for you. It simply exposes the Vulkan API.
- Support mobile GPUs. Phobos is optimized for desktop GPUs and makes no effort to support mobile GPUs.
Example
For more elaborate examples, please check the examples folder.
use *;
Support
Visit the docs.rs page, or open an issue.
Planned features
- Expose more Vulkan API features.