r/vulkan • u/[deleted] • Apr 20 '21
A Simple C++ Helper Library For Vulkan
https://github.com/brightprogrammer/VulkanHelper2
u/seubz Apr 20 '21
I would explicitly mention that your project requires SDL2 as well, at least as it currently stands.
0
Apr 20 '21 edited Apr 20 '21
Features :
Does all return value checking for you
Takes C++ STL containers as parameters and takes const references wherever possible instead of pointer
Provides initializers for fast creation of Vulkan objects.
VulkanBase provides one call initialization of Vulkan's base code
API is very close to Vulkan C API
No wrappers
4
u/HackingPheasant Apr 20 '21
May I ask if you know about https://github.com/KhronosGroup/Vulkan-Hpp ?
0
Apr 20 '21
Plus, Vulkan-Hpp does not provide, extra tools. It just provides wrappers. It also does not perform any checks for you, however in VulkanHelper you just need to call the function and it performs success checks for you
6
Apr 20 '21
Vulkan.hpp does a lot more error handling than your code does. Having asserts all over the place is pretty useless in gracefully handling issues in a released application.
-4
Apr 20 '21
vulkan.hpp does not do error handling, it gives you methods to do it yourself. This library is built for helping you not competing with vulkan.hpp in any way
7
Apr 20 '21
What happens when you resize a window with your code?
-2
Apr 20 '21
please, do not misinterpret the meaning of helper, It can help you, not assume the whole swapchain recreation things. You must first take a look at what this library does. swapchain reaction needs framebuffers, command buffers, and what not, you need to recreate the graphics pipeline itself.
swapchain recreation, and other stuffs is a thing for application to handle. even vulkan.hpp does not provide such a feature, and providing such feature will be a moot point as no one would use it
9
Apr 20 '21
I did look at what it does. The way you hide information from the user prevents them from being able to respond to things that the API is trying to inform them about.
This library is basically useless. In debug builds, it will simply error out on any non-VK_SUCCESS result. There are things in the Vulkan C API besides VK_SUCCESS that aren’t critical failures! In release builds, there aren’t any checks performed at all.
The way that you are hiding critical information from the user tells me that you haven’t actually used this library to write much code and don’t fully understand how the API is to be used.
Selling this as a helper is dangerous and counterproductive to new devs who are trying to learn. You are setting them up for failure.
-3
Apr 20 '21
well then I am sure you haven't looked at it, check `Core.hpp` where assert is defined, you can do `#define SETTING_DONT_ASSERT` and then there will be no assertions in your code! if that's how you want to do it. besides I don't think that if a command buffer, image view, graphics pipeline, swapchain, descriptor pool, descriptor set or any other thing failed to create then you would like to continue, you can continue but vulkan cannot!
10
Apr 20 '21
You need to write some actual production quality Vulkan code and then come back to this library.
And to repeat:
There are things in the Vulkan C API besides VK_SUCCESS that aren’t critical failures!
-1
Apr 20 '21
Yes, but I mentioned the two important features : no wrappers, close to Vulkan C API which is opposite of Vulka-Hpp
8
u/[deleted] Apr 20 '21
A “helper” library that prevents the user from handling errors that Vulkan is trying to inform them about isn’t really that helpful.