You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
VkBool32 presentSupport should be assigned to VK_FALSE instead of false in VkBootstrap.cpp.
VkAllocationCallbacks* allocation_callbacks should be assigned to nullptr instead of VK_NULL_HANDLE in VkBootstrap.h because callbacks are pointers, not handles.
The problem of usage of VkBool32 in VkBootstrap.h and VkBootstrap.cpp for fields is in such initialization:
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.
The text was updated successfully, but these errors were encountered:
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:After setting every byte to
0xFF
(UINT8_MAX
), everyVkBool32
field becomes0xFFFFFFFF
.While boolean context works as expected in the current code for fields initalized in such a way, a comparison against
VK_TRUE
would fail becauseVK_TRUE
(1U
) is not equal to0xFFFFFFFF
, which sounds bad for a field of typeVkBool32
even though there are currently no comparisons againstVK_TRUE
.I would simply change the type of fields from
VkBool32
touint8_t
. Then when fields become "enabled" after setting every byte toUINT8_MAX
, they don't have to be equal toVK_TRUE
because the type is notVkBool32
. Boolean context should still work as expected.The text was updated successfully, but these errors were encountered: