{"id":13534422,"url":"https://github.com/ash-rs/ash","last_synced_at":"2026-01-15T22:19:03.432Z","repository":{"id":37411044,"uuid":"65640886","full_name":"ash-rs/ash","owner":"ash-rs","description":"Vulkan bindings for Rust","archived":false,"fork":false,"pushed_at":"2025-12-29T04:05:38.000Z","size":10401,"stargazers_count":2186,"open_issues_count":80,"forks_count":213,"subscribers_count":37,"default_branch":"master","last_synced_at":"2026-01-13T19:24:13.831Z","etag":null,"topics":["gamedev","rust","vulkan"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ash-rs.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2016-08-13T23:13:25.000Z","updated_at":"2026-01-12T20:02:11.000Z","dependencies_parsed_at":"2025-12-23T12:03:09.990Z","dependency_job_id":null,"html_url":"https://github.com/ash-rs/ash","commit_stats":{"total_commits":1072,"total_committers":100,"mean_commits":10.72,"dds":0.6166044776119404,"last_synced_commit":"8b0d4c5770edce1d88e2834f8914735a64b25557"},"previous_names":["maikklein/ash"],"tags_count":34,"template":false,"template_full_name":null,"purl":"pkg:github/ash-rs/ash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ash-rs%2Fash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ash-rs%2Fash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ash-rs%2Fash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ash-rs%2Fash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ash-rs","download_url":"https://codeload.github.com/ash-rs/ash/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ash-rs%2Fash/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28472626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T22:13:38.078Z","status":"ssl_error","status_checked_at":"2026-01-15T22:12:11.737Z","response_time":62,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gamedev","rust","vulkan"],"created_at":"2024-08-01T07:01:32.653Z","updated_at":"2026-01-15T22:19:03.426Z","avatar_url":"https://github.com/ash-rs.png","language":"Rust","funding_links":[],"categories":["Rust","Frameworks","GPU Programming","Libraries"],"sub_categories":["Rust"],"readme":"# Ash\n\nA very lightweight wrapper around Vulkan\n\n[![Crates.io Version](https://img.shields.io/crates/v/ash.svg)](https://crates.io/crates/ash)\n[![Documentation](https://docs.rs/ash/badge.svg)](https://docs.rs/ash)\n[![Build Status](https://github.com/ash-rs/ash/actions/workflows/ci.yml/badge.svg)](https://github.com/ash-rs/ash/actions/workflows/ci.yml)\n[![LICENSE](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE-MIT)\n[![LICENSE](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE-APACHE)\n[![Join the chat at https://gitter.im/MaikKlein/ash](https://badges.gitter.im/MaikKlein/ash.svg)](https://gitter.im/MaikKlein/ash?utm_source=badge\u0026utm_medium=badge\u0026utm_campaign=pr-badge\u0026utm_content=badge)\n[![MSRV](https://img.shields.io/badge/rustc-1.69.0+-ab6000.svg)](https://blog.rust-lang.org/2023/04/20/Rust-1.69.0.html)\n\n## Overview\n\n- [x] A true Vulkan API without compromises\n- [x] Convenience features without limiting functionality\n- [x] Additional type safety\n- [x] Device local function pointer loading\n- [x] No validation, everything is **unsafe**\n- [x] Lifetime-safety on structs created with the builder pattern\n- [x] Generated from `vk.xml`\n- [x] Support for Vulkan `1.1`, `1.2`, `1.3`\n- [x] `no_std` support\n\n## ⚠️ Semver compatibility warning\n\nThe Vulkan Video bindings are experimental and still seeing breaking changes in their upstream specification, and are only provided by Ash for early adopters. All related functions and types are semver-exempt [^1] (we allow breaking API changes while releasing Ash with non-breaking semver bumps).\n\n[^1]: `generator` complexity makes it so that we cannot easily hide these bindings behind a non-`default` feature flag, and they are widespread across the generated codebase.\n\n## Features\n\n### Explicit returns with `Result`\n\n```rust\n// function signature\npub fn create_instance(\u0026self,\n                       create_info: \u0026vk::InstanceCreateInfo\u003c'_\u003e,\n                       allocation_callbacks: Option\u003c\u0026vk::AllocationCallbacks\u003c'_\u003e\u003e)\n                       -\u003e Result\u003cInstance, InstanceError\u003e { .. }\nlet instance = entry.create_instance(\u0026create_info, None)\n    .expect(\"Instance creation error\");\n```\n\n### `Vec\u003cT\u003e` instead of mutable slices\n\n```rust\npub fn get_swapchain_images(\u0026self,\n                            swapchain: vk::SwapchainKHR)\n                            -\u003e VkResult\u003cVec\u003cvk::Image\u003e\u003e;\nlet present_images = swapchain_loader.get_swapchain_images_khr(swapchain).unwrap();\n```\n\n_Note_: Functions don't return `Vec\u003cT\u003e` if this would limit the functionality. See `p_next`.\n\n### Slices\n\n```rust\npub fn cmd_pipeline_barrier(\u0026self,\n                            command_buffer: vk::CommandBuffer,\n                            src_stage_mask: vk::PipelineStageFlags,\n                            dst_stage_mask: vk::PipelineStageFlags,\n                            dependency_flags: vk::DependencyFlags,\n                            memory_barriers: \u0026[vk::MemoryBarrier\u003c'_\u003e],\n                            buffer_memory_barriers: \u0026[vk::BufferMemoryBarrier\u003c'_\u003e],\n                            image_memory_barriers: \u0026[vk::ImageMemoryBarrier\u003c'_\u003e]);\n```\n\n### Strongly typed handles\n\nEach Vulkan handle type is exposed as a newtyped struct for improved type safety. Null handles can be constructed with\n`T::null()`, and handles may be freely converted to and from `u64` with `Handle::from_raw` and `Handle::as_raw` for\ninterop with non-Ash Vulkan code.\n\n### Builder pattern\n\n```rust\nlet queue_info = [vk::DeviceQueueCreateInfo::default()\n    .queue_family_index(queue_family_index)\n    .queue_priorities(\u0026priorities)];\n\nlet device_create_info = vk::DeviceCreateInfo::default()\n    .queue_create_infos(\u0026queue_info)\n    .enabled_extension_names(\u0026device_extension_names_raw)\n    .enabled_features(\u0026features);\n\nlet device: Device = instance\n    .create_device(pdevice, \u0026device_create_info, None)\n    .unwrap();\n```\n\n### Pointer chains\n\nUse `base.push(ext)` to insert `ext` at the front of the pointer chain attached to `base`.  If `ext` already contains a valid pointer chain of its own, `unsafe`ly call `extend()` instead.\n\n```rust\nlet mut variable_pointers = vk::PhysicalDeviceVariablePointerFeatures::default();\nlet mut corner = vk::PhysicalDeviceCornerSampledImageFeaturesNV::default();\n\nlet mut device_create_info = vk::DeviceCreateInfo::default()\n    .push(\u0026mut corner)\n    .push(\u0026mut variable_pointers);\n```\n\nThe generic argument of `.push()` only allows valid structs to extend a given struct (known as [`structextends` in the Vulkan registry](https://registry.khronos.org/vulkan/specs/1.3/styleguide.html#extensions-interactions), mapped to `Extends*` traits).\nOnly structs that are listed one or more times in any `structextends` will implement a `.push()`.\n\n### Flags and constants as associated constants\n\n```rust\n// Bitflag\nvk::AccessFlags::COLOR_ATTACHMENT_READ | vk::AccessFlags::COLOR_ATTACHMENT_WRITE\n```\n\n```rust\n// Constant\nvk::PipelineBindPoint::GRAPHICS,\n```\n\n### Debug/Display for Flags\n\n```rust\nlet flag = vk::AccessFlags::COLOR_ATTACHMENT_READ\n        | vk::AccessFlags::COLOR_ATTACHMENT_WRITE;\nprintln!(\"Debug: {:?}\", flag);\nprintln!(\"Display: {}\", flag);\n// Prints:\n// Debug: AccessFlags(110000000)\n// Display: COLOR_ATTACHMENT_READ | COLOR_ATTACHMENT_WRITE\n```\n\n### Function pointer loading\n\nAsh also takes care of loading the function pointers. Function pointers are split into 3 categories.\n\n- Entry: Loads the Vulkan library. Needs to outlive `Instance` and `Device`.\n- Instance: Loads instance level functions. Needs to outlive the `Device`s it has created.\n- Device: Loads device **local** functions.\n\nThe loader is just one possible implementation:\n\n- Device level functions are retrieved on a per device basis.\n- Everything is loaded by default, functions that failed to load are initialized to a function that always panics.\n- Do not call Vulkan 1.1 functions if you have created a 1.0 instance. Doing so will result in a panic.\n\nCustom loaders can be implemented.\n\n### Extension loading\n\nAdditionally, every Vulkan extension has to be loaded explicitly. You can find all extensions directly under `ash::*` in a module with their prefix (e.g. `khr` or `ext`).\n\n```rust\nuse ash::khr;\nlet swapchain_loader = khr::swapchain::Device::new(\u0026instance, \u0026device);\nlet swapchain = swapchain_loader.create_swapchain(\u0026swapchain_create_info).unwrap();\n```\n\n### Raw function pointers\n\nRaw function pointers are available, if something hasn't been exposed yet in the higher level API. Please open an issue if anything is missing.\n\n```rust\ndevice.fp_v1_0().destroy_device(...);\n```\n\n### Support for extension names\n\n```rust\nuse ash::{ext, khr};\n#[cfg(all(unix, not(target_os = \"android\")))]\nfn extension_names() -\u003e Vec\u003c*const i8\u003e {\n    vec![\n        khr::surface::NAME.as_ptr(),\n        khr::xlib_surface::NAME.as_ptr(),\n        ext::debug_utils::NAME.as_ptr(),\n    ]\n}\n```\n\n### Implicit handles\n\nHandles from Instance or Device are passed implicitly.\n\n```rust\npub fn create_command_pool(\u0026self,\n                           create_info: \u0026vk::CommandPoolCreateInfo\u003c'_\u003e)\n                           -\u003e VkResult\u003cvk::CommandPool\u003e;\n\nlet pool = device.create_command_pool(\u0026pool_create_info).unwrap();\n```\n\n### Optional linking\n\nThe default `loaded` cargo feature will dynamically load the default Vulkan library for the current platform with `Entry::load`, meaning that the build environment does not have to have Vulkan development packages installed.\n\nIf, on the other hand, your application cannot handle Vulkan being missing at runtime, you can instead enable the `linked` feature, which will link your binary with the Vulkan loader directly and expose the infallible `Entry::linked`.\n\n### Use in `no_std` environments\n\nAsh can be used in `no_std` environments (with `alloc`) by disabling the `std` feature.\n\n## Example\n\nYou can find the examples [here](https://github.com/ash-rs/ash/tree/master/ash-examples).\nAll examples currently require: the LunarG Validation layers and a Vulkan library that is visible in your `PATH`. An easy way to get started is to use the [LunarG Vulkan SDK](https://lunarg.com/vulkan-sdk/)\n\n#### Windows\n\nMake sure that you have a Vulkan ready driver and install the [LunarG Vulkan SDK](https://lunarg.com/vulkan-sdk/).\n\n#### Linux\n\nInstall a Vulkan driver for your graphics hardware of choice, and (optionally) the [Validation Layers](https://github.com/KhronosGroup/Vulkan-ValidationLayers) via your package manager:\n\n- Arch Linux: https://wiki.archlinux.org/title/Vulkan.\n- Gentoo: https://wiki.gentoo.org/wiki/Vulkan.\n- Ubuntu/Debian: Besides installing a compatible graphics driver, install [`vulkan-validationlayers`](https://packages.ubuntu.com/vulkan-validationlayers) ([Debian](https://packages.debian.org/search?keywords=vulkan-validationlayers)) for the Validation Layers.\n- Other distros: consult your distro documentation and/or package repository for the preferred method to install and use Vulkan.\n\n#### macOS\n\nInstall the [LunarG Vulkan SDK](https://lunarg.com/vulkan-sdk/). The installer puts the SDK in `$HOME/VulkanSDK/\u003cversion\u003e` by default. You will need to set the following environment variables when running cargo:\n\n```sh\nVULKAN_SDK=$HOME/VulkanSDK/\u003cversion\u003e/macOS \\\nDYLD_FALLBACK_LIBRARY_PATH=$VULKAN_SDK/lib \\\nVK_ICD_FILENAMES=$VULKAN_SDK/share/vulkan/icd.d/MoltenVK_icd.json \\\nVK_LAYER_PATH=$VULKAN_SDK/share/vulkan/explicit_layer.d \\\ncargo run ...\n```\n\n### [Triangle](https://github.com/ash-rs/ash/blob/master/ash-examples/src/bin/triangle.rs)\n\nDisplays a triangle with vertex colors.\n\n```sh\ncargo run -p ash-examples --bin triangle\n```\n\n![screenshot](https://i.imgur.com/PQZcL6w.jpg)\n\n### [Texture](https://github.com/ash-rs/ash/blob/master/ash-examples/src/bin/texture.rs)\n\nDisplays a texture on a quad.\n\n```sh\ncargo run -p ash-examples --bin texture\n```\n\n![texture](https://i.imgur.com/trow00H.png)\n\n## Useful resources\n\n### Examples\n\n- [vulkan-tutorial-rust](https://github.com/Usami-Renko/vulkan-tutorial-rust) - A port of [vulkan-tutorial.com](https://vulkan-tutorial.com).\n- [ash-sample-progression](https://github.com/bzm3r/ash-sample-progression) - A port of the LunarG examples.\n- [ash-nv-rt](https://github.com/gwihlidal/ash-nv-rt) A raytracing example for ash.\n\n### Utility libraries\n\n- [vk-sync](https://github.com/gwihlidal/vk-sync-rs) - Simplified Vulkan synchronization logic, written in rust.\n- [vk-mem-rs](https://github.com/gwihlidal/vk-mem-rs) - This crate provides an FFI layer and idiomatic rust wrappers for the excellent AMD Vulkan Memory Allocator (VMA) C/C++ library.\n- [gpu-allocator](https://github.com/Traverse-Research/gpu-allocator) - GPU Memory allocator written in pure Rust for Vulkan and DirectX 12.\n- [lahar](https://github.com/Ralith/lahar) - Tools for asynchronously uploading data to a Vulkan device.\n\n### Libraries that use ash\n\n- [gfx-rs](https://github.com/gfx-rs/gfx) - gfx-rs is a low-level, cross-platform graphics abstraction library in Rust.\n\n## A thanks to\n\n- [Api with no secrets](https://software.intel.com/en-us/articles/api-without-secrets-introduction-to-vulkan-part-1)\n- [Vulkan tutorial](https://jhenriques.net/development.html)\n- [Vulkan examples](https://github.com/SaschaWillems/Vulkan)\n- [Vulkan tutorial](https://vulkan-tutorial.com/)\n- [Vulkano](https://github.com/vulkano-rs/vulkano)\n- [vk-rs](https://github.com/Osspial/vk-rs)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fash-rs%2Fash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fash-rs%2Fash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fash-rs%2Fash/lists"}