Fixed the return value of SDL_Vulkan_CreateSurface() on the Vivante platform
This commit is contained in:
parent
5ee88d43f9
commit
9e331d235f
2 changed files with 12 additions and 12 deletions
|
@ -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
|
||||
|
|
|
@ -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_,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue