mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-04 13:04:41 +00:00
vulkan: SDL_Vulkan_CreateSurface now returns the usual int (0=ok, -1=error).
Fixes #10091.
This commit is contained in:
@@ -122,11 +122,11 @@ char const* const* Android_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this,
|
||||
return extensionsForAndroid;
|
||||
}
|
||||
|
||||
SDL_bool Android_Vulkan_CreateSurface(SDL_VideoDevice *_this,
|
||||
SDL_Window *window,
|
||||
VkInstance instance,
|
||||
const struct VkAllocationCallbacks *allocator,
|
||||
VkSurfaceKHR *surface)
|
||||
int Android_Vulkan_CreateSurface(SDL_VideoDevice *_this,
|
||||
SDL_Window *window,
|
||||
VkInstance instance,
|
||||
const struct VkAllocationCallbacks *allocator,
|
||||
VkSurfaceKHR *surface)
|
||||
{
|
||||
SDL_WindowData *windowData = window->driverdata;
|
||||
PFN_vkGetInstanceProcAddr vkGetInstanceProcAddr =
|
||||
@@ -139,14 +139,12 @@ SDL_bool Android_Vulkan_CreateSurface(SDL_VideoDevice *_this,
|
||||
VkResult result;
|
||||
|
||||
if (!_this->vulkan_config.loader_handle) {
|
||||
SDL_SetError("Vulkan is not loaded");
|
||||
return SDL_FALSE;
|
||||
return SDL_SetError("Vulkan is not loaded");
|
||||
}
|
||||
|
||||
if (!vkCreateAndroidSurfaceKHR) {
|
||||
SDL_SetError(VK_KHR_ANDROID_SURFACE_EXTENSION_NAME
|
||||
" extension is not enabled in the Vulkan instance.");
|
||||
return SDL_FALSE;
|
||||
return SDL_SetError(VK_KHR_ANDROID_SURFACE_EXTENSION_NAME
|
||||
" extension is not enabled in the Vulkan instance.");
|
||||
}
|
||||
SDL_zero(createInfo);
|
||||
createInfo.sType = VK_STRUCTURE_TYPE_ANDROID_SURFACE_CREATE_INFO_KHR;
|
||||
@@ -155,11 +153,9 @@ SDL_bool Android_Vulkan_CreateSurface(SDL_VideoDevice *_this,
|
||||
createInfo.window = windowData->native_window;
|
||||
result = vkCreateAndroidSurfaceKHR(instance, &createInfo, allocator, surface);
|
||||
if (result != VK_SUCCESS) {
|
||||
SDL_SetError("vkCreateAndroidSurfaceKHR failed: %s",
|
||||
SDL_Vulkan_GetResultString(result));
|
||||
return SDL_FALSE;
|
||||
return SDL_SetError("vkCreateAndroidSurfaceKHR failed: %s", SDL_Vulkan_GetResultString(result));
|
||||
}
|
||||
return SDL_TRUE;
|
||||
return 0;
|
||||
}
|
||||
|
||||
void Android_Vulkan_DestroySurface(SDL_VideoDevice *_this,
|
||||
|
||||
@@ -38,11 +38,11 @@ int Android_Vulkan_LoadLibrary(SDL_VideoDevice *_this, const char *path);
|
||||
void Android_Vulkan_UnloadLibrary(SDL_VideoDevice *_this);
|
||||
char const* const* Android_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this,
|
||||
Uint32 *count);
|
||||
SDL_bool Android_Vulkan_CreateSurface(SDL_VideoDevice *_this,
|
||||
SDL_Window *window,
|
||||
VkInstance instance,
|
||||
const struct VkAllocationCallbacks *allocator,
|
||||
VkSurfaceKHR *surface);
|
||||
int Android_Vulkan_CreateSurface(SDL_VideoDevice *_this,
|
||||
SDL_Window *window,
|
||||
VkInstance instance,
|
||||
const struct VkAllocationCallbacks *allocator,
|
||||
VkSurfaceKHR *surface);
|
||||
void Android_Vulkan_DestroySurface(SDL_VideoDevice *_this,
|
||||
VkInstance instance,
|
||||
VkSurfaceKHR surface,
|
||||
|
||||
Reference in New Issue
Block a user