Experimenting Underway To Support Mesa Vulkan Drivers Written In Rust

Written by Michael Larabel in Mesa on 2 February 2023 at 12:10 PM EST. 20 Comments
While there is Rusticl as the first Rust language code within Mesa as a modern OpenCL implementation in Gallium3D, for possible future driver efforts there is some initial exploratory work being done around coming up with bindings to support writing of Vulkan drivers with Rust.

Faith Ekstrand of Collabora wrote a blog post today about the exploration work being done for Rust usage within Mesa Vulkan drivers. Additionally, there is a draft merge request adding some preliminary infrastructure and abstractions for Vulkan drivers written in Rust.

Among the design goals for this work are for the Rust Vulkan driver wrappers to be as clean and "Rust-like" as possible, tracking mutability and lifetimes, and using Vulkan allocators whenever possible.

Rust bindings started for Vulkan drivers.

This effort is off to a nice start but Faith Ekstrand concludes the blog post with, "What I've done so far barely scratches the surface of what we need to do to fully wrap the Mesa Vulkan runtime into something Rust-friendly. As I have time, I hope to do further experiments and write more blog posts about my findings. So far, for the problems I've looked at, I've been able to find solutions which will keep the majority of the driver code ergonomic and, most importantly, safe."

Another important takeaway is: "I don't expect to see any actual Mesa Vulkan drivers in Rust for a few years yet. My current goal is merely to explore the possibility." Aside from any new reverse-engineered drivers to come for smaller hardware targets, it's unlikely anytime soon we'll see any of the major Mesa Vulkan drivers be rewritten in Rust for the sake of rewriting it in Rust.
Related News
About The Author
Michael Larabel

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.

Popular News This Week