VkRunner ported to Rust

Alejandro Piñeiro apinheiro at igalia.com
Mon Feb 20 21:46:22 UTC 2023


On 20/2/23 16:53, Neil Roberts wrote:
> Hi folks,


Hi Neil!


>
> Does anybody remember VkRunner? It’s a little tool to help write
> shader-based tests for Vulkan. It’s the same concept as Piglit’s
> shader_runner but for Vulkan instead of OpenGL. There are a couple of
> tests using it in Piglit but apart from that it never really got off the
> ground.
>
> Anyway, I’ve been trying to learn some Rust lately and in order to get
> some experience working with a non-trivial project I decided to port
> VkRunner to Rust.

I have been trying to find a time slot to learn Rust too. If you have 
issues around with pending features perhaps one of these days I join 
your initiative.


> The port is now complete and available here:
>
> https://github.com/bpeel/vkrunner/
>
> It’s a drop-in replacement for the original VkRunner so it should be
> possible to start using it in a CI system by just changing the git repo,
> assuming the rust compiler is installed. I was thinking that now that
> Mesa has some Rust code in it anyway it might not be too unreasonable to
> expect CI systems to have the Rust compiler available.
>
> Other than that there’s not much advantage to using one or the other
> except for the warm fuzzy feeling knowing that you’re using a project
> written in a memory-safe language.


If the rust-based vkrunner has the same features and can run the same 
kind of tests that the original c-based vkrunner, I think that using a 
memory-safe language is an advantage that goes beyond just a warm fuzzy 
feeling.

If that is the case, I think that it is a good idea to replace one with 
the other.


> I also took the opportunity to add a
> whole bunch of unit tests so in theory the Rust port might be more
> robust.
>
> It’s currently using Meson as the build system. In the beginning this
> was necessary because I did the port gradually and it’s probably the
> best build system if you have a mix of C and Rust code. Now that the
> port is complete it’d probably be trivial to start using Cargo instead.
> I’m not sure which would be better. It’s not using any external crates
> so it doesn’t really need Cargo for now.
>
> Now that the port is complete it might be nice to start adding more
> features. If anyone else hasn’t taken the plunge to start using Rust yet
> this might be a nice project to get involved in if you fancy helping.
>
> Kind regards,
> – Neil
>


More information about the mesa-dev mailing list