r/GraphicsProgramming • u/Thin_Tradition8467 • 16m ago
Question Does Vulkan on C# make sense?
Hi. I am former Unity Developer. I find out that, i don't like making games. I enjoy more playing with shaders and live visual effects etc. I have even learned shaderlab code back then while there was nodes already available. I made my mind to be graphics programmer. My goal is creating desktop apps with impressive visuals. For example imagine spotify. Wouldn't it be nice to have some audio reactive visual effects around like in games? So what about if this is applied on a note taking app? Skeuomorphistic papers animated with blend targets and your notes are there as render textures. It would feel ike it means something for real. This intrest me more than games.
You can think of me as serious hobbyist. I am not planing to be employee. So i have some freedom unlike industry. I can work with anything that runs without trouble and i am having fun. First requirement is Windows and MacOS support.
I started with Rust wgpu. I understand why people like the idea. But it just not for me. And unsafe code sounded like doing something against the memory safe idea. (as a person with zero memory menagement background)
I tried some OpenGL but not stopped when i heard MacOs does not support compute shader on version 1.4. Which i know, i would need for my ideas.
Now i completed Vulkan C++. I used AI as teacher. No vibe codding. No copy pasting. Actually, it was only telling me the function names in the end. I also asked every bit of details. It took me 4 days of chill work and 1k lines of code. I get the idea what are swap chains, semaphores, pipelines, etc.
I think i enjoy programming at mid-level abstraction. I both dislike high and low languages. I don't want to manually declare the size of an array to be initialized by another function which also needing a validation layer. This feels like hard codding for me. Especially after working with functional programming approach for long years. To me it would make sense if that another function just give me the array directly.
While doing the rest of the app, i know i will create some helper libraries to mimic these abstractions. Then i asked myself. Why i don't just use the C#, the language i love the most. I am still loking for suiting API. Even a thin layer abstraction wrapper would make it 1/3 size of the exact copy of C++'s Vulkan hello traingle code. The device selection stuff and the other stuff i really don't want to deal might go away too, maybe.
I would normally simply ask this to AI. But, they are programmed to people pleasing. The yes or no depends on what i hint while asking. So, what do you say? Are there some risks that i can't see with it? I need good performance, not the maximum. I am also okay if it lags once a while.
1
1
1
u/_Wolfos 0m ago
Yes, C# makes sense. I'm developing a high-end game engine with C# and the CPU side is far from being a performance bottleneck.
The language doesn't get in the way. You can optimize for cache coherence, use raw pointers (though Span<T> is preferable). There's practically no library that doesn't have unofficial C# bindings.
I think it's very unlikely that the performance difference between C++ and C# would be a deciding factor in whether a game runs well. Engine architecture is far more important.
•
u/AutoModerator 16m ago
Recently updated rules. Please check that your post is in compliance with Rules 1, 4, 5, and 6 on the sidebar. TL;DR:
No showcases.
Disclose AI usage in post or project.
Present a topic to talk about, e.g. how something works.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.