r/GraphicsProgramming • • 4d ago

Question How different really are D3D12 and Vulkan?

I am mainly a D3D and HLSL programmer and I want to learn Vulkan for cross-platforming. But how different really are they? I know a bit of OpenGL, and it is VERY different from Direct3d 11, which I used a lot.

Direct3d 12 is harder than D3d11, so it took me a long while to understand things more in-depth. Will at the very least some of that knowledge of D3d12 come in handy while learning Vulkan?

I've heard there are D3D12 concepts that do not exist in Vulkan and vice-versa. The biggest difference I am aware of is that D3D is more C++-styled while Vulkan is more C-styled.

27 Upvotes

12 comments sorted by

•

u/AutoModerator 4d 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.

26

u/aleques-itj 4d ago

The core are close conceptually.

There's differences, but also means to close the gap a bit more now. Like VK_EXT_descriptor_heap, and D3D12 enhanced barriers. I don't think you'll find anything too radical or baffling for the most part.

Yes, the C/C++ difference is a thing. It's not really a big deal IMO.

Vulkan is still much more verbose, though. It's super chatty to a comical degree, even compared to D3D12.

7

u/El_RoviSoft 4d ago

If you write in C++, you tend to write your own libraries and wrappers anyway so verbosity isn’t a big deal either, imho

2

u/nullptr777 12h ago

Yeah, I actually love the Vulkan C API for this. It's all just structs and manual object management, then I get to wrap it however I want. Couldn't be simpler.

12

u/torrent7 4d ago

They're both wrappers over the same hardware and share most concepts. The venn diagram isnt a perfect circle, but you shouldn't have any problems if you truly understand dx12.

Theres a vulkan c++ wrapper id recommend 

4

u/Afiery1 4d ago

Genuinely almost identical, to the point where there are production implementations of D3D12 using Vulkan (vkd3d) and production implementations of Vulkan using D3D12 (dozen).

1

u/aman2218 4d ago

The concepts are broadly the same (with different nomenclature used for various Objects), but there are some differences too. Vulkan is far more verbose when it comes to allocating a resources and defining synchronisation primitives. Although, it has becoming a bit more startightforward with recent extensions and libraries like VMA.

But yeah, they general understanding of trh workflow in D3D12, will make it relatively easier to follow vulkan concepts.

1

u/bonghotdogwater 3d ago

I’d just use a vulkan wrapper, core concepts are quite literally the same with different wording and variable names, vulkan is just verbose as shit

1

u/Alex_D77 4d ago

I would use https://github.com/NVIDIA-RTX/Donut which allows me not to think about the differences

2

u/S48GS 3d ago

Donut does not provide any ray tracing passes or even maintain acceleration structures (AS'es).

No KTX2 textures (but DDS textures are supported)

another GLES3-feature-level framework...

1

u/Alex_D77 3d ago edited 3d ago

For RT there are RTXPT or RTXGI as extension of donut framework + streamline sdk as DLSS5 extention etc