mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-24 03:58:28 +00:00
GPU: Enable VK_ERROR_NATIVE_WINDOW_IN_USE_KHR to print
This commit is contained in:
@@ -1251,6 +1251,7 @@ static inline const char *VkErrorMessages(VkResult code)
|
|||||||
ERR_TO_STR(VK_ERROR_SURFACE_LOST_KHR)
|
ERR_TO_STR(VK_ERROR_SURFACE_LOST_KHR)
|
||||||
ERR_TO_STR(VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT)
|
ERR_TO_STR(VK_ERROR_FULL_SCREEN_EXCLUSIVE_MODE_LOST_EXT)
|
||||||
ERR_TO_STR(VK_SUBOPTIMAL_KHR)
|
ERR_TO_STR(VK_SUBOPTIMAL_KHR)
|
||||||
|
ERR_TO_STR(VK_ERROR_NATIVE_WINDOW_IN_USE_KHR)
|
||||||
default:
|
default:
|
||||||
return "Unhandled VkResult!";
|
return "Unhandled VkResult!";
|
||||||
}
|
}
|
||||||
@@ -4319,8 +4320,7 @@ static bool VULKAN_INTERNAL_QuerySwapchainSupport(
|
|||||||
outputDetails->presentModesLength = 0;
|
outputDetails->presentModesLength = 0;
|
||||||
|
|
||||||
if (!supportsPresent) {
|
if (!supportsPresent) {
|
||||||
SDL_LogWarn(SDL_LOG_CATEGORY_GPU, "This surface does not support presenting!");
|
SET_STRING_ERROR_AND_RETURN("This surface does not support presenting!", false)
|
||||||
return false;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Run the device surface queries
|
// Run the device surface queries
|
||||||
@@ -4354,8 +4354,8 @@ static bool VULKAN_INTERNAL_QuerySwapchainSupport(
|
|||||||
outputDetails->formats = (VkSurfaceFormatKHR *)SDL_malloc(
|
outputDetails->formats = (VkSurfaceFormatKHR *)SDL_malloc(
|
||||||
sizeof(VkSurfaceFormatKHR) * outputDetails->formatsLength);
|
sizeof(VkSurfaceFormatKHR) * outputDetails->formatsLength);
|
||||||
|
|
||||||
if (!outputDetails->formats) {
|
if (!outputDetails->formats) { // OOM
|
||||||
return 0;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
result = renderer->vkGetPhysicalDeviceSurfaceFormatsKHR(
|
result = renderer->vkGetPhysicalDeviceSurfaceFormatsKHR(
|
||||||
@@ -4374,7 +4374,7 @@ static bool VULKAN_INTERNAL_QuerySwapchainSupport(
|
|||||||
outputDetails->presentModes = (VkPresentModeKHR *)SDL_malloc(
|
outputDetails->presentModes = (VkPresentModeKHR *)SDL_malloc(
|
||||||
sizeof(VkPresentModeKHR) * outputDetails->presentModesLength);
|
sizeof(VkPresentModeKHR) * outputDetails->presentModesLength);
|
||||||
|
|
||||||
if (!outputDetails->presentModes) {
|
if (!outputDetails->presentModes) { // OOM
|
||||||
SDL_free(outputDetails->formats);
|
SDL_free(outputDetails->formats);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -4461,10 +4461,6 @@ static Uint32 VULKAN_INTERNAL_CreateSwapchain(
|
|||||||
renderer->instance,
|
renderer->instance,
|
||||||
NULL, // FIXME: VAllocationCallbacks
|
NULL, // FIXME: VAllocationCallbacks
|
||||||
&windowData->surface)) {
|
&windowData->surface)) {
|
||||||
SDL_LogError(
|
|
||||||
SDL_LOG_CATEGORY_GPU,
|
|
||||||
"Vulkan_CreateSurface failed: %s",
|
|
||||||
SDL_GetError());
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -4644,7 +4640,7 @@ static Uint32 VULKAN_INTERNAL_CreateSwapchain(
|
|||||||
windowData->textureContainers = SDL_malloc(
|
windowData->textureContainers = SDL_malloc(
|
||||||
sizeof(VulkanTextureContainer) * windowData->imageCount);
|
sizeof(VulkanTextureContainer) * windowData->imageCount);
|
||||||
|
|
||||||
if (!windowData->textureContainers) {
|
if (!windowData->textureContainers) { // OOM
|
||||||
renderer->vkDestroySurfaceKHR(
|
renderer->vkDestroySurfaceKHR(
|
||||||
renderer->instance,
|
renderer->instance,
|
||||||
windowData->surface,
|
windowData->surface,
|
||||||
|
Reference in New Issue
Block a user