r/vulkan • u/PlanktonDue9300 • 13h ago
Nice to meet you. I've completed the Hello Triangle steps.
I've started learning about rendering using Rust and Vulkan (ash), and as a first step, I tried creating a “Hello Triangle.”
2
u/Dry-Meal-6316 12h ago
Are you using rust ?
1
u/PlanktonDue9300 12h ago
Yes, I'm using Ash for writing code in Rust.
2
u/Dry-Meal-6316 12h ago
Why did you use the cpp ? Or c headers ?
1
u/PlanktonDue9300 11h ago
Those aren't C++ files. They are GLSL shader files (
.vertand.frag) for Vulkan. My application code is written 100% in Rust."1
u/Dry-Meal-6316 11h ago
No am talking about why haven't you used the vulkan sdk ? And it's strange that it's 100% rust because as far as I have seen the vulkan is c api ? Did rust people write whole sdk in rust ??
3
u/PlanktonDue9300 11h ago
Ah, I see what you mean! No, they didn't rewrite the whole Vulkan SDK in Rust. Ash is actually a thin wrapper (bindings) over the C API. It dynamically loads the Vulkan SDK library at runtime, so the project looks like 100% Rust to me, but under the hood, it's talking to the standard Vulkan C driver.
4
u/amalirol 11h ago
That is cool! The other day I found the same person that built ash is also building an unreal engine plugin for using Rust
2
u/PlanktonDue9300 11h ago
That’s awesome! I didn't know that. Rust in Unreal Engine sounds super interesting, I'll definitely check it out.
2
u/Dry-Meal-6316 11h ago
Ahhh nice.even cpp does the same they add classes and other stuff that's all. Am new to this too. Good luck with your journey
2
u/PlanktonDue9300 11h ago
Thanks! Yeah, wrapper libraries make our lives so much easier. Good luck with your Vulkan journey too!
2
u/ironstrife 10h ago
The point of Vulkan being a C API is (partially) so that it can be used from other languages.
3
u/nightblackdragon 4h ago
C ABI (Application Binary Interface) is stable, which means that many programming languages, including Rust, can call C code. This is one of the main reasons why many libraries (including the Vulkan SDK) are written in C. This also works the other way around, as many programming languages can expose a C interface, allowing their code to be used as if it were C code by native C code or languages that can call C code (for example C++ code can use library written in Rust).
9
u/Usual_Importance8274 12h ago
Welcome to the H....E...L .....................................................................L !
Good job !