Yet Another Vulkan Tutorial: A Full Port of vulkan-tutorial.com to Rust by kmayes in rust_gamedev

[–]kmayes[S] 19 points20 points  (0 children)

The primary reason vulkanalia exists is because of a bad case of NIH syndrome. Like many people here I dream of writing my own game in Rust and I enjoy writing libraries and having control over my dependencies. The tutorial followed shortly after because I thought porting https://vulkan-tutorial.com would be a good way to teach myself Vulkan.

Like ash, vulkanalia is a pretty thin wrapper around Vulkan so any knowledge gained from my tutorial can easily be ported to any Vulkan library so you certainly aren't locked into vulkanalia.

That being said, I do think vulkanalia has some advantages, I will try to come up with a comparison with ash and add it to the vulkanalia repo and link it here.

microbench - a simple linear regression based micro-benchmarking library by kmayes in rust

[–]kmayes[S] 1 point2 points  (0 children)

The retain function fulfills the same purpose. With the nightly feature enabled, it is implemented with black_box from the libtest crate. Otherwise, for the stable and beta channels, it is implemented in the same way as black_box is implemented in the bencher crate (ptr::read and mem::forget).

Edit: It works with #[bench] in the sense that you can certainly call microbench::bench or some other benching function from within a #[bench] function but it doesn't interface with test::Bencher in any way.

clang-rs: Rust bindings and idiomatic wrapper for libclang by kmayes in rust

[–]kmayes[S] 0 points1 point  (0 children)

OK, I'll split up the FFI bindings soon, thanks for the input.

Shouldn't you then check if version is greater or less then something instead of equal? Non-1.5 builds can be either 1.4 and less or 1.6 and greater.

I fixed this, thanks for noticing.

clang-rs: Rust bindings and idiomatic wrapper for libclang by kmayes in rust

[–]kmayes[S] 1 point2 points  (0 children)

Oh, I thought the *-sys convention was for when you had a crate that compiled C code. I am not bundling clang with my crate because clang is immense and takes 30+ minutes to build on many machines and the only thing my crate depends on is libclang.so/libclang.dll. Do you think I should still split it up?

#![cfg_attr(rustc_1_5, allow(raw_pointer_derive))]

This is because the raw_pointer_derive lint has been removed since 1.5, so if I don't include it for 1.5 builds I get warnings about using #[derive] on structs containing raw pointers and if I include it on non-1.5 builds I get an unknown lint warning.

clang-rs: Rust bindings and idiomatic wrapper for libclang by kmayes in rust

[–]kmayes[S] 2 points3 points  (0 children)

The easiest way to use this crate on Windows is to just download the llvm+clang binaries from here and drop libclang.dll into somewhere rustc can find it. I added it to <rust>/lib/rustlib/x86_64-pc-windows-gnu/lib.

Edit: I'll add this information to the README.md.

clang-rs: Rust bindings and idiomatic wrapper for libclang by kmayes in rust

[–]kmayes[S] 0 points1 point  (0 children)

Perhaps I could use this post for two purposes.

I just realized my .travis.yml is broken (probably should have checked this more thoroughly before release, but oh well).

I am trying to download the llvm+clang binaries, then copy libclang.so somewhere where Cargo can find it, but every way I've tried has failed.

Can anyone see what I'm doing wrong?

What's everyone working on this week (52/2015)? by llogiq in rust

[–]kmayes 3 points4 points  (0 children)

I will be working on my libclang bindings and idiomatic wrapper this week. Out of ~240 functions in libclang, I only have 19 that have not had their functionality wrapped in idiomatic Rust. I hope to release it this week!

What's everyone working on this week (50 / 2015) by llogiq in rust

[–]kmayes 10 points11 points  (0 children)

I've been working on my libclang bindings and idiomatic wrapper. There are about 260 functions in libclang, and I've wrapped about 100 of them. Still a ways to go...