SDL: Fixed the return value of SDL_Vulkan_CreateSurface() on the Vivante platform

From 9e331d235f676c78bb70a3009e6768d40e848c65 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <[EMAIL REDACTED]>
Date: Wed, 10 Jul 2024 20:32:47 -0700
Subject: [PATCH] Fixed the return value of SDL_Vulkan_CreateSurface() on the
 Vivante platform

---
 src/video/SDL_vulkan_internal.h |  8 ++++----
 src/video/SDL_vulkan_utils.c    | 16 ++++++++--------
 2 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/src/video/SDL_vulkan_internal.h b/src/video/SDL_vulkan_internal.h
index cd3b6e89080bb..f07e592904986 100644
--- a/src/video/SDL_vulkan_internal.h
+++ b/src/video/SDL_vulkan_internal.h
@@ -63,10 +63,10 @@ extern VkExtensionProperties *SDL_Vulkan_CreateInstanceExtensionsList(
  * using the DisplayKHR extension.
  * This needs to be passed an instance that was created with the VK_KHR_DISPLAY_EXTENSION_NAME
  * extension. */
-extern SDL_bool SDL_Vulkan_Display_CreateSurface(void *vkGetInstanceProcAddr,
-                                                 VkInstance instance,
-                                                 const struct VkAllocationCallbacks *allocator,
-                                                 VkSurfaceKHR *surface);
+extern int SDL_Vulkan_Display_CreateSurface(void *vkGetInstanceProcAddr,
+                                            VkInstance instance,
+                                            const struct VkAllocationCallbacks *allocator,
+                                            VkSurfaceKHR *surface);
 
 /* Platform independent base function for destroying the Vulkan surface. Unlike surface
  * creation, surface destruction doesn't require platform specific extensions like
diff --git a/src/video/SDL_vulkan_utils.c b/src/video/SDL_vulkan_utils.c
index 216cd140501b6..bb42b4933b87a 100644
--- a/src/video/SDL_vulkan_utils.c
+++ b/src/video/SDL_vulkan_utils.c
@@ -174,10 +174,10 @@ static const VkDisplayPlaneAlphaFlagBitsKHR alphaModes[4] = {
     VK_DISPLAY_PLANE_ALPHA_PER_PIXEL_PREMULTIPLIED_BIT_KHR,
 };
 
-SDL_bool SDL_Vulkan_Display_CreateSurface(void *vkGetInstanceProcAddr_,
-                                          VkInstance instance,
-                                          const struct VkAllocationCallbacks *allocator,
-                                          VkSurfaceKHR *surface)
+int SDL_Vulkan_Display_CreateSurface(void *vkGetInstanceProcAddr_,
+                                     VkInstance instance,
+                                     const struct VkAllocationCallbacks *allocator,
+                                     VkSurfaceKHR *surface)
 {
     PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr =
         (PFN_vkGetInstanceProcAddr)vkGetInstanceProcAddr_;
@@ -447,7 +447,7 @@ SDL_bool SDL_Vulkan_Display_CreateSurface(void *vkGetInstanceProcAddr_,
 
     if (physicalDeviceIndex == physicalDeviceCount) {
         SDL_SetError("No usable displays found or requested display out of range");
-        return SDL_FALSE;
+        goto error;
     }
 
     createInfo.sType = VK_STRUCTURE_TYPE_DISPLAY_SURFACE_CREATE_INFO_KHR;
@@ -457,14 +457,14 @@ SDL_bool SDL_Vulkan_Display_CreateSurface(void *vkGetInstanceProcAddr_,
     result = vkCreateDisplayPlaneSurfaceKHR(instance, &createInfo, allocator, surface);
     if (result != VK_SUCCESS) {
         SDL_SetError("vkCreateDisplayPlaneSurfaceKHR failed: %s", SDL_Vulkan_GetResultString(result));
-        return SDL_FALSE;
+        goto error;
     }
     SDL_LogDebug(SDL_LOG_CATEGORY_VIDEO, "vulkandisplay: Created surface");
-    return SDL_TRUE;
+    return 0;
 
 error:
     SDL_free(physicalDevices);
-    return SDL_FALSE;
+    return -1;
 }
 
 void SDL_Vulkan_DestroySurface_Internal(void *vkGetInstanceProcAddr_,