Rust Vulkan Samples

A collection of cross-platform Vulkan samples written using the Rust programming language

.

Currently supports Windows/OSX/Linux and Android.

Setup

Rust Setup

Install Rust

Chocolatey : choco install rustup --pre

Additional requirements for building dependencies

  • Python
  • CMake
  • Ninja
  • Git
Chocolatey : choco install python --pre
             choco install cmake
             choco install ninja
             choco install git

Required environment variables

  • CMAKE (set to path of cmake executable)

Android Setup

The following steps are required to build for android

Prerequisites

Android NDK/SDK:

  • Standalone NDK

  • SDK Command line tools or SDK/NDoco install android-sdk Packaged With Android Studio

  • After installing SDK run 'sdk manager' from the bin folder and install latest build tools

Chocolatey: choco install android-ndk android-sdk

Required environment variables

  • ANDROID_NDK_ROOT
  • ANDROID_SDK_ROOT
  • ANDROID_HOME (same as ANDROID_SDK_ROOT)

Add Android Targets

'rustup target add aarch64-linux-android armv7-linux-androideabi i686-linux-android'

Update Cargo Config

NOTE: As far as I can tell environment variables are not supported so you will need to hardcode your NDK path. If you find otherwise please let me know so I can update accordingly.

Add the following to ~/.cargo/config (add file if it doesn't exist):

[target.aarch64-linux-android]
ar = "[ANDROID_NDK_HOME]/toolchains/llvm/prebuilt/windows-x86_64/bin/aarch64-linux-android-ar"
linker = "[ANDROID_NDK_HOME]/toolchains/llvm/prebuilt/windows-x86_64/bin/aarch64-linux-android30-clang.cmd"

[target.armv7-linux-androideabi]
ar = "[ANDROID_NDK_HOME]/toolchains/llvm/prebuilt/windows-x86_64/bin/arm-linux-androideabi-ar"
linker = "[ANDROID_NDK_HOME]/ndk-bundle/toolchains/llvm/prebuilt/windows-x86_64/bin/armv7a-linux-androideabi30-clang.cmd"

[target.i686-linux-android]
ar = "[ANDROID_NDK_HOME]/toolchains/llvm/prebuilt/windows-x86_64/bin/i686-linux-android-ar"
linker = "[ANDROID_NDK_HOME]/toolchains/llvm/prebuilt/windows-x86_64/bin/i686-linux-android30-clang.cmd"

Cargo APK Builder

Cargo APK builder must be installed to build android apks:

'cargo install cargo-apk'

JDK

If you get errors when signing package you likely need to update jdk to latest version:

JDK Installation

 Chocolatey: choco install openjdk

Clippy (optional)

Clippy is a helpful rust linter that can be installed as follows:

'rustup component add clippy-preview'
(use rustup component list to see up to date name)

Build Steps

Windows/OSX/Linux

cargo build --example [example_name]
cargo run --example [example_name]

Android

cargo apk build --example [example_name]
cargo apk run --example [example_name]

Notes

  • It is not necesarry to do build and run steps seperately
  • 'example_name' can be any one of the root file names inside of root example folder
Issues

Collection of the latest Issues

timwillett4

timwillett4

0

It appears to be another Vulkano issue. It returns an error or LAYER_NOT_PRESENT even though there are no requested layers.

@TODO - file another bug with Vulkano

Information - Updated Sep 24, 2021

Stars: 0
Forks: 0
Issues: 1
IDE

3.5K

Rust Language Server (RLS)

The RLS provides a server that runs in the background, providing IDEs,

Rust Language Server (RLS)

rust-analyzer is a modular compiler frontend for the Rust language

It also contains some tips & tricks to help you be more productive when using rust-analyzer

rust-analyzer is a modular compiler frontend for the Rust language

Rust lang bookmarking tool

Rust and Rocket used bookmarking tool for search bar

Rust lang bookmarking tool

A study note of Rust language

The Rust Programming Language

A study note of Rust language

Rust Language Security

execrices: RUSTSEC-2021-0001

Rust Language Security

False Positive for rust-lang/rust#83583

The deprecation lint proc_macro_derive_resolution_fallback is intended to catch proc macro generated code that refers to items from parent modules that should not be in scope:

False Positive for rust-lang/rust#83583

rust_icu: low-level rust language bindings for the ICU library

See: The latest version of this file is available at

rust_icu: low-level rust language bindings for the ICU library

Classic Snake game written in Rust Lang

This is my first program/game in Rust Lang to measure myself and learn more

Classic Snake game written in Rust Lang

Rust lang exercises

Personal tips and drills in my journey as a beginner rustacean

Rust lang exercises
Facebook Instagram Twitter GitHub Dribbble
Privacy