vulkan/wsi: Convert usage of -1 to UINT32_MAX.
authorBas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Mon, 27 Jul 2020 09:52:24 +0000 (11:52 +0200)
committerMarge Bot <eric+marge@anholt.net>
Mon, 27 Jul 2020 11:30:22 +0000 (11:30 +0000)
The integers are unsigned so they do the same but this makes it
locally more clear what happened.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6071>

src/vulkan/wsi/wsi_common_wayland.c
src/vulkan/wsi/wsi_common_x11.c

index 23f5765c57c1a0273119dad25f376197e3fd77e0..e219b263fc5541c449d2744206409d4d05fac188 100644 (file)
@@ -551,7 +551,7 @@ wsi_wl_surface_get_capabilities(VkIcdSurfaceBase *surface,
    /* There is no real maximum */
    caps->maxImageCount = 0;
 
-   caps->currentExtent = (VkExtent2D) { -1, -1 };
+   caps->currentExtent = (VkExtent2D) { UINT32_MAX, UINT32_MAX };
    caps->minImageExtent = (VkExtent2D) { 1, 1 };
    caps->maxImageExtent = (VkExtent2D) {
       wsi_device->maxImageDimension2D,
@@ -695,7 +695,7 @@ wsi_wl_surface_get_present_rectangles(VkIcdSurfaceBase *surface,
       /* We don't know a size so just return the usual "I don't know." */
       *rect = (VkRect2D) {
          .offset = { 0, 0 },
-         .extent = { -1, -1 },
+         .extent = { UINT32_MAX, UINT32_MAX },
       };
    }
 
index 306dcd9a73e98a9850eeb91b0c2d9881cf6711bd..566926845f966cd5429aaafd968f51858b8d72bb 100644 (file)
@@ -512,7 +512,7 @@ x11_surface_get_capabilities(VkIcdSurfaceBase *icd_surface,
        * to come back from the compositor.  In that case, we don't know the
        * size of the window so we just return valid "I don't know" stuff.
        */
-      caps->currentExtent = (VkExtent2D) { -1, -1 };
+      caps->currentExtent = (VkExtent2D) { UINT32_MAX, UINT32_MAX };
       caps->minImageExtent = (VkExtent2D) { 1, 1 };
       caps->maxImageExtent = (VkExtent2D) {
          wsi_device->maxImageDimension2D,
@@ -681,7 +681,7 @@ x11_surface_get_present_rectangles(VkIcdSurfaceBase *icd_surface,
           */
          *rect = (VkRect2D) {
             .offset = { 0, 0 },
-            .extent = { -1, -1 },
+            .extent = { UINT32_MAX, UINT32_MAX },
          };
       }
       free(geom);