From 51b6528224b67e1a4517044fd45f94fd29a12510 Mon Sep 17 00:00:00 2001 From: BearOso Date: Sat, 4 May 2024 15:43:54 -0500 Subject: [PATCH] Vulkan: Fix a couple of unsigned/signed warnings. --- vulkan/vulkan_context.cpp | 2 +- vulkan/vulkan_swapchain.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/vulkan/vulkan_context.cpp b/vulkan/vulkan_context.cpp index 4c951cbe..f8bd76c0 100644 --- a/vulkan/vulkan_context.cpp +++ b/vulkan/vulkan_context.cpp @@ -204,7 +204,7 @@ bool Context::init_device(int preferred_device) auto device_list = instance->enumeratePhysicalDevices().value; if (preferred_device > -1 && - preferred_device < device_list.size() && + (size_t)preferred_device < device_list.size() && check_extensions(device_list[preferred_device])) { physical_device = device_list[preferred_device]; diff --git a/vulkan/vulkan_swapchain.cpp b/vulkan/vulkan_swapchain.cpp index 12fbc676..762dda15 100644 --- a/vulkan/vulkan_swapchain.cpp +++ b/vulkan/vulkan_swapchain.cpp @@ -126,7 +126,7 @@ bool Swapchain::create(unsigned int desired_num_swapchain_images, int new_width, // If extents aren't reported (Wayland), we have to rely on Wayland to report // the size, so keep current extent. - if (surface_capabilities.currentExtent.width != -1) + if (surface_capabilities.currentExtent.width != UINT32_MAX) extents = surface_capabilities.currentExtent; uint32_t graphics_queue_index = 0;