Looking through Sascha Willem's C++ Vulkan Demos hosted on GitHub, I noticed that some Functions returned the Datatype VkBool32
.
I was curious to why Khronos didn't use a normal bool when I noticed the Line
typedef uint32_t VkBool32;
in vulkan.h. The uint32_t is defined as
typedef unsigned int uint32_t;
in stdint.h.
My Question is, why does it make Sense to throw away 3 Bytes if a standard Bool would do the Job with just one Byte? My little Recherche showed that there is next to no performance Difference (see Which is faster : if (bool) or if(int)?), and Khronos themselfes said that they wanted to minimize compatibility issues (in this case old C not having a primitive boolean Type) in Order to Focus on modern Code.
(See Trevett's Quote taken from here)
a ground-up redesign, we’re not backwards compatible