Code Monkey home page Code Monkey logo

blade's Introduction

Blade

Matrix Build Status Docs Crates.io

Blade is a low-level GPU library in Rust with the focus on ergonomics. It's unsafe, it's incomprehensive, but it's small, fast, and actually fun to prototype with!

See motivation, FAQ, and performance for more info.

Platforms

The backend is selected automatically based on the host platform.

Vulkan:

  • Desktop Linux/Windows
  • Android

Metal:

  • Desktop macOS
  • iOS

OpenGL ES:

  • Web

Instructions

Check:

cargo check

Run the minimal example:

cargo run --example mini

OpenGL ES

GLES is also supported at a basic level. It's enabled for wasm32-unknown-unknown target, and can also be force-enabled on native:

RUSTFLAGS="--cfg gles" CARGO_TARGET_DIR=./target-gl cargo test

This path can be activated on all platforms via Angle library. For example, on macOS it's sufficient to place libEGL.dylib and libGLESv2.dylib in the working directory.

WebGL2

Following command will start a web server offering the bunnymark example:

cargo run-wasm --example bunnymark

Vulkan Portability

First, ensure to load the environment from the Vulkan SDK:

cd /opt/VulkanSDK && source setup-env.sh

Vulkan backend can be forced on using "vulkan" config flag. Example invocation that produces a vulkan (portability) build into another target folder:

RUSTFLAGS="--cfg vulkan" CARGO_TARGET_DIR=./target-vk cargo test

blade's People

Contributors

kvark avatar

Stargazers

 avatar

Watchers

 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.