Code Monkey home page Code Monkey logo

voodoo's Introduction

Voodoo - A high-performance Vulkan® API for Rust

Supported platforms

Features:

  • An intuitive and idiomatic interface
  • Zero additional overhead
    • No unnecessary allocations
    • No intermediate structs or extra copying
    • Builders compile to direct assignment
  • Thread-safe allocation / destruction
    • Safety escape hatches available everywhere
  • A minimum of boilerplate
  • Non-opinionated and nothing hidden
  • Complete API coverage

Getting Started

Ensure that Vulkan drivers are installed for your device. Add the following to your project's Cargo.toml:

[dependencies]
voodoo = "0.3.1"

And add the following to your crate root (lib.rs or main.rs):

extern crate voodoo;

Example

Create an instance:

extern crate voodoo;

use voodoo::{Result as VdResult, Instance, ApplicationInfo, Loader};
use std::ffi::CString;

/// Initializes and returns a new loader and instance with all available
/// extension function pointers loaded.
fn init_instance() -> VdResult<Instance> {
    let app_name = CString::new("Hello!")?;

    let app_info = ApplicationInfo::builder()
        .application_name(&app_name)
        .application_version((1, 0, 0))
        .api_version((1, 0, 0))
        .build();

    let loader = Loader::new()?;

    Instance::builder()
        .application_info(&app_info)
        .enabled_extensions(&loader.enumerate_instance_extension_properties()?)
        .build(loader)
}

fn main() {
    let _instance = init_instance().unwrap();
}

See hello.rs for a complete, working example adapted from https://vulkan-tutorial.com/.

hello.rs screenshot:

hello_example_screenshot.jpg

Status

  • API coverage:
    • Core: 100%
    • Extensions: 70%
  • Documentation: 30%
  • Stability: 97%

Other Vulkan libraries in Rust

For a higher level, more opinionated, easier to use Vulkan API that does more for you see the Vulkano project.

Other low-ish level Rust libraries include dacite and ash. See vks for a direct ffi interface.


“Vulkan and the Vulkan logo are registered trademarks of the Khronos Group Inc.”

voodoo's People

Contributors

c0gent avatar hobogenized avatar gabrielmajeri avatar acgaudette avatar

Watchers

shadowkun avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.