Ekstrand: Exploring Rust for Vulkan drivers, part 1

Post Syndicated from original https://lwn.net/Articles/922008/

Faith Ekstrand begins
an exploration of using the Rust language
to write Vulkan graphics
drivers.

Whenever a Vulkan object is created or destroyed, the parent object
is passed to both the create and destroy functions. This ensures
that the lifetime of the child object is contained within the
lifetime of the parent object. In Rust terms, this means it’s safe
for the child object to contain a non-mutable reference to the
parent object. Vulkan also defines which entrypoint parameters must
be externally synchronized by the client. Externally synchronized
objects follow the same rules as mutable references in Rust.