# 🤘 Saxaboom runtime [![Actions Status](https://github.com/Traverse-Research/saxaboom/actions/workflows/ci.yml/badge.svg)](https://github.com/Traverse-Research/saxaboom/actions) [![Latest version](https://img.shields.io/crates/v/saxaboom-runtime.svg?logo=rust)][`saxaboom-runtime`] [![Documentation](https://img.shields.io/docsrs/saxaboom-runtime/latest?logo=docs.rs)](https://docs.rs/saxaboom-runtime) ![Apache](https://img.shields.io/badge/license-Apache-blue.svg) [![Contributor Covenant](https://img.shields.io/badge/contributor%20covenant-v1.4%20adopted-ff69b4.svg)](../CODE_OF_CONDUCT.md) [![Banner](../banner.png)](https://traverseresearch.nl) [`saxaboom-runtime`] provides the runtime `repr(C)` definitions for structures and interop with the [`metal`] crate needed to make use of the `metallib` shaders generated by [`saxaboom`] (bindings for [Metal shader converter]). ## Usage After compiling your `DXIL` shaders to `metallib` using [`saxaboom`], follow these steps in your render backend. Add this to your `Cargo.toml`: ```toml [dependencies] saxaboom-runtime = "0.2.0-beta.1" ``` Example to create a descriptor to a buffer: ```rust,no_run use saxaboom_runtime::ffi::IRDescriptorTableEntry; let gpu_address = 0; // TODO: Read from metal::Buffer::gpu_address() let metadata = IRDescriptorTableEntry::buffer_metadata(todo!("Fill saxaboom_runtime::BufferView")); let buffer_descriptor = IRDescriptorTableEntry::buffer(gpu_address, metadata); ``` [Metal shader converter]: https://developer.apple.com/metal/shader-converter/ [`saxaboom`]: https://crates.io/crates/saxaboom [`saxaboom-runtime`]: https://crates.io/crates/saxaboom-runtime [`metal`]: https://crates.io/crates/metal