How to use Vulkan in C#?

Madie

New Member
Messages
3
Reaction score
2
Basically everything I find on how to use the Vulkan API and set up basic rendering is for C++ and for some reason can't get them working in C# (I don't have a lot of experience with either language). Does anybody have any good tutorials or know where I could find them?
 
We have samples coming soon, but join us on discord if you haven’t already!

People are already starting to share their Vulkan code in Brutal
 
Hi, I made a sample project to learn how to use brutal myself. I wrote the parts that I know from Vulkan C++ and had AI fix my mistakes and assumptions. So full disclosure, while this is not vibe coded, I did use AI assistance for learning purposes. It uses Vulkan on Windows and Linux, OpenGL on Macs. I have not gotten around to use MoltenVK for this on Mac yet.

Link to repo: https://github.com/ardahamamcioglu/HelloBrutal.git
 
Thank you for making BRUTAL public!
I like C# and I like having the freedom of coding whatever while having some level of abstraction from the busy work.
 
Hi, I made a sample project to learn how to use brutal myself. I wrote the parts that I know from Vulkan C++ and had AI fix my mistakes and assumptions. So full disclosure, while this is not vibe coded, I did use AI assistance for learning purposes. It uses Vulkan on Windows and Linux, OpenGL on Macs. I have not gotten around to use MoltenVK for this on Mac yet.

Link to repo: https://github.com/ardahamamcioglu/HelloBrutal.git
Amazing, thanks a lot!

Personally I don't mind AI usage as long as it's used as a tool, so no worries there.
 
Hi, I made a sample project to learn how to use brutal myself. I wrote the parts that I know from Vulkan C++ and had AI fix my mistakes and assumptions. So full disclosure, while this is not vibe coded, I did use AI assistance for learning purposes. It uses Vulkan on Windows and Linux, OpenGL on Macs. I have not gotten around to use MoltenVK for this on Mac yet.

Link to repo: https://github.com/ardahamamcioglu/HelloBrutal.git
Looking at the new examples dropped by @Rian Drake and after having a look at yours yesterday I noticed he uses this line as a 'cleaner' way to do the "Prefer Vulkan" check.

if (Platform.IsMacOS)
Glfw.WindowHint(GlfwWindowHint.OpenGlForwardCompat, 1);

Not saying its better just wanted to share <3
I will probably use this way for prototyping
 
I should check his examples. In the end I just turned it into a universal check for vulkan instead of a mac only thing. I am working on a branch that auto discovers vulkan SDK on mac so you don't have to run
Code
source ~/VulkanSDK/*/setup-env.sh && dotnet run
to run the application with vulkan.
 
Back
Top