vulkan/wsi: Convert bit tests to bool with != 0

Otherwise the bool result could be some value other than 0 or 1.

Fixes: d7938de8 ("vulkan/wsi: don't support present with queues where blit is unsupported")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26706>
This commit is contained in:
Jesse Natalie
2023-12-14 16:32:02 -08:00
committed by Marge Bot
parent 19175e474b
commit 2ea04ef69b
2 changed files with 2 additions and 2 deletions

View File

@@ -782,7 +782,7 @@ wsi_GetPhysicalDeviceSurfaceSupportKHR(VkPhysicalDevice physicalDevice,
VkResult res = iface->get_support(surface, wsi_device,
queueFamilyIndex, pSupported);
if (res == VK_SUCCESS) {
bool blit = wsi_device->queue_supports_blit & BITFIELD64_BIT(queueFamilyIndex);
bool blit = (wsi_device->queue_supports_blit & BITFIELD64_BIT(queueFamilyIndex)) != 0;
*pSupported = (bool)*pSupported && blit;
}

View File

@@ -114,7 +114,7 @@ wsi_GetPhysicalDeviceWin32PresentationSupportKHR(VkPhysicalDevice physicalDevice
{
VK_FROM_HANDLE(vk_physical_device, pdevice, physicalDevice);
struct wsi_device *wsi_device = pdevice->wsi_device;
return wsi_device->queue_supports_blit & BITFIELD64_BIT(queueFamilyIndex);
return (wsi_device->queue_supports_blit & BITFIELD64_BIT(queueFamilyIndex)) != 0;
}
VKAPI_ATTR VkResult VKAPI_CALL