Description
-
VkBool32 presentSupport
should be assigned toVK_FALSE
instead offalse
inVkBootstrap.cpp
. -
VkAllocationCallbacks* allocation_callbacks
should be assigned tonullptr
instead ofVK_NULL_HANDLE
inVkBootstrap.h
because callbacks are pointers, not handles. -
The problem of usage of
VkBool32
inVkBootstrap.h
andVkBootstrap.cpp
for fields is in such initialization:
memset(fields, UINT8_MAX, sizeof(VkBool32) * field_capacity);
After setting every byte to 0xFF
(UINT8_MAX
), every VkBool32
field becomes 0xFFFFFFFF
.
While boolean context works as expected in the current code for fields initalized in such a way, a comparison against VK_TRUE
would fail because VK_TRUE
(1U
) is not equal to 0xFFFFFFFF
, which sounds bad for a field of type VkBool32
even though there are currently no comparisons against VK_TRUE
.
I would simply change the type of fields from VkBool32
to uint8_t
. Then when fields become "enabled" after setting every byte to UINT8_MAX
, they don't have to be equal to VK_TRUE
because the type is not VkBool32
. Boolean context should still work as expected.