top | item 12149993

Introducing Vulkan-Hpp – Open-Source Vulkan C++ API

130 points| gulpahum | 9 years ago |github.com | reply

70 comments

order
[+] overcast|9 years ago|reply
Enjoying Vulkan so far in the recently patched Doom, which netted me a minimum 10% increase in frames per second. I really hope this gets adopted / patched into current games, and those on the horizon. Seems like a big win for cross platform development.
[+] SolarNet|9 years ago|reply
The problem is that Vulkan isn't so much a replacement for OpenGL as it is a library that you can use to write OpenGL in the first place, it's another layer removed, and hence requires quite a lot of work to integrate.
[+] Hello71|9 years ago|reply
So hold on. Assuming that I understand C++ linking right, you're saying that I should include this 17000-line file in every single cpp unit in my application that uses Vulkan APIs? And people wonder why C++ programs compile so slowly.
[+] banachtarski|9 years ago|reply
You may understand the mechanics of C++ linking (although I doubt it because including a header has nothing to do with linkage, I'm assuming you mean ADL, overload resolution, etc), but it doesn't seem you understand the mechanics of how C++ compilers are built and optimized. Furthermore, how many cpp units do you expect to require the Vulkan API? If it's much more than a few dozen, I would argue you haven't organized your engine well. Source: former graphics engineer.
[+] sjolsen|9 years ago|reply
>And people wonder why C++ programs compile so slowly.

People have been aware of this problem for some time. It's one of the reasons the C++ community is trying to develop a proper module system (or was the last time I checked, which was a while back).

[+] gulpahum|9 years ago|reply
The new Vulkan C++ API from Khronos is based on vkcpp. Here's examples for vkcpp to give an idea how code with the C++ API looks like:

https://github.com/jherico/Vulkan

Here's a basic tutorial with comments for the Vulkan C API. Vulkan is a very low level API, so there's a lot of code. It should be straightforward to port the C tutorial to use the C++ API.

http://av.dfki.de/~jhenriques/development.html

[+] izym|9 years ago|reply
This is what was previously the vkcpp project from Nvidia, which seems to have been transferred to the Khronos group.
[+] kayamon|9 years ago|reply
A lot of their "improvements" could be done just by using C99 designated initializers.
[+] loeg|9 years ago|reply
I don't know why this is downvoted. Several of the author's claims about C are just wrong. Modern C compilers can warn you about most of these, and literal initializers eliminate the missed zero initializations.
[+] astrange|9 years ago|reply
And why are they claiming C doesn't have type-safe enums?
[+] BinaryIdiot|9 years ago|reply
Whoa now that is cool! Are there any games out there that currently use this C++ API of Vulkan? Very curious to know if there are any major issues with using it versus the direct C API.

I'm not very knowledge regarding Vulkan so hopefully that isn't a stupid question but I want to brush up on my C++ skills and play with this!

Also how similar is Vulkan to SDL? I used to use SDL quite a bit back in the day and it was awesome but I'm assuming Vulkan is far more comprehensive?

[+] Narishma|9 years ago|reply
> Also how similar is Vulkan to SDL?

They are not. You use SDL to create and manage your window and handle input, and use Vulkan or OpenGL to draw to that window.

[+] riotdash|9 years ago|reply
As a game developer I'm pretty excited about this. There is really no reason to use DX12 backend anymore in the future game development, because of the ease of development, performance and multiplatform features of the Vulkan.
[+] subb|9 years ago|reply
I think the pain point of DX12 is it's incompatibility with Windows 7 (and 8). However, Windows 10 is getting a lot of traction and has surpassed Windows 7 in gamers market share (see http://store.steampowered.com/hwsurvey/directx/).

With that in mind, if you are working on a AAA game that will come out in a couple of years, your target platforms will most likely be PS4, Xbox One and Windows 10. With those three, Vulkan doesn't make sense; DX12 will be used on Windows and Xbox One, and PS4 has its own proprietary API. Why complicate things with another API if you can use (almost) the same implementation for Xbox One and Windows 10?

If Windows 7 proves itself to be still somewhat popular amongs gamers, then Vulkan might be used to port games to this platform, since it's similar to DX12 so it will be way easier than a DX11 port.

However, right now, if game developers wants to use the latest API, Vulkan is a good choice since you will still be able to target Windows 7. If a lot of big games are released with Vulkan within 2 years, then it might slow down Windows 10's adoption and the market share of Vulkan systems (Windows Vista and up) will stay greater than the DX12 one (Windows 10) for longer. But for how many years? At one point, Windows 10 (or whatever's after) will dominate and the backward compatibility of Vulkan will stop being a useful marketing point.

So I'm not sure why you say there's no reason to use DX12. There's many. There's also a lot of good reasons to choose Vulkan that I didn't talk about here. I just don't see how Vulkan can dominates the Windows market, much like OpenGL.

[+] pjmlp|9 years ago|reply
Except the little detail that there is zero Vulkan support on:

- iOS

- macOS

- PSP, PS3, PS4

- Wii U, 3DS

- XBox 360, ONE

- any Android version < Android 7

- UWP

[+] dmytroi|9 years ago|reply
Well, considering game industry experience with OpenGL on Windows (which is in short - it doesn't work on production scale) as a game developer I, unfortunately, really doubt that it will gain any traction on Windows based platforms.
[+] lubesGordi|9 years ago|reply
Vulkan is an NVIDIA gpu api. https://www.khronos.org/vulkan/
[+] Nekit1234007|9 years ago|reply
> Vulkan is an NVIDIA gpu api

Your statement couldnʼt have been more misleading. Vulkan is a cross{vendor,platform} API, based on AMD Mantle.

[+] vuldin|9 years ago|reply
I wish I could somehow flag or block people who make such false comments disguised as fact. Less than 30 seconds looking into Vulkan would have told anyone almost the opposite if what you came up with.
[+] SwellJoe|9 years ago|reply
As I understand it, the goal is a cross-platform GPU API, not specific to nVidia.
[+] banachtarski|9 years ago|reply
Just to add to the issues with this statement, Vulkan doesn't necessarily target a "GPU" since a CPU can also render frames just fine. More accurately, Vulkan, like DX12 is a graphics/compute API, with the distinction between graphics and compute pretty blurred at this point.
[+] lubesGordi|9 years ago|reply
Whoa holy smokes yeah I missed the mark on that one. So Vulkan is a replacement for openGL, essentially a new api to gpu's in general? Is that closer to it? In the future I'll phrase the statement as a question if I'm not 100% clear on it. Sorry for the noise.
[+] Asooka|9 years ago|reply
Actually it's AMD gpu api and it wasn't certain for a while if nVidia would get behind it.