vulkan: SDL_Vulkan_CreateSurface now accepts an app-provided allocator.

Fixes #3638.
This commit is contained in:
Ryan C. Gordon
2023-11-06 13:30:56 -05:00
parent c53843a961
commit 2f92807087
23 changed files with 44 additions and 20 deletions

View File

@@ -125,6 +125,7 @@ char const* const* WIN_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this,
SDL_bool WIN_Vulkan_CreateSurface(SDL_VideoDevice *_this,
SDL_Window *window,
VkInstance instance,
const struct VkAllocationCallbacks *allocator,
VkSurfaceKHR *surface)
{
SDL_WindowData *windowData = window->driverdata;
@@ -152,8 +153,7 @@ SDL_bool WIN_Vulkan_CreateSurface(SDL_VideoDevice *_this,
createInfo.flags = 0;
createInfo.hinstance = windowData->hinstance;
createInfo.hwnd = windowData->hwnd;
result = vkCreateWin32SurfaceKHR(instance, &createInfo,
NULL, surface);
result = vkCreateWin32SurfaceKHR(instance, &createInfo, allocator, surface);
if (result != VK_SUCCESS) {
SDL_SetError("vkCreateWin32SurfaceKHR failed: %s",
SDL_Vulkan_GetResultString(result));

View File

@@ -41,6 +41,7 @@ char const* const* WIN_Vulkan_GetInstanceExtensions(SDL_VideoDevice *_this,
SDL_bool WIN_Vulkan_CreateSurface(SDL_VideoDevice *_this,
SDL_Window *window,
VkInstance instance,
const struct VkAllocationCallbacks *allocator,
VkSurfaceKHR *surface);
#endif