News: 0001370708

  ARM Give a man a fire and he's warm for a day, but set fire to him and he's warm for the rest of his life (Terry Pratchett, Jingo)

Experimenting Underway To Support Mesa Vulkan Drivers Written In Rust

([Mesa] 6 Hours Ago Rust Vulkan Drivers)


While there is [1]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 [2]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.

This effort is off to a nice start but Faith Ekstrand concludes the [3]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.



[1] https://www.phoronix.com/search/Rusticl

[2] https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20298

[3] https://www.collabora.com/news-and-blog/blog/2023/02/02/exploring-rust-for-vulkan-drivers-part-1/



kpedersen

all3f0r1

Developer12

Quackdoc

V1tol

Vorpal

NobodyXu

kpedersen

hiryu

Things past redress and now with me past care.
-- William Shakespeare, "Richard II"