Skip to content

Commit 982c2ed

Browse files
rbernonjulliard
authored andcommitted
winevulkan: Keep the create_info HWND on the surface wrappers.
1 parent 62536d1 commit 982c2ed

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

dlls/winevulkan/vulkan.c

+6-10
Original file line numberDiff line numberDiff line change
@@ -1450,24 +1450,20 @@ void wine_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(VkPhysicalDevice phy
14501450
properties->externalSemaphoreFeatures = 0;
14511451
}
14521452

1453-
VkResult wine_vkCreateWin32SurfaceKHR(VkInstance handle, const VkWin32SurfaceCreateInfoKHR *createInfo,
1453+
VkResult wine_vkCreateWin32SurfaceKHR(VkInstance handle, const VkWin32SurfaceCreateInfoKHR *create_info,
14541454
const VkAllocationCallbacks *allocator, VkSurfaceKHR *surface)
14551455
{
14561456
struct wine_instance *instance = wine_instance_from_handle(handle);
14571457
struct wine_surface *object;
14581458
VkResult res;
14591459

1460-
if (allocator)
1461-
FIXME("Support for allocation callbacks not implemented yet\n");
1462-
1463-
object = calloc(1, sizeof(*object));
1464-
1465-
if (!object)
1466-
return VK_ERROR_OUT_OF_HOST_MEMORY;
1460+
if (allocator) FIXME("Support for allocation callbacks not implemented yet\n");
14671461

1468-
res = instance->funcs.p_vkCreateWin32SurfaceKHR(instance->host_instance, createInfo, NULL,
1469-
&object->driver_surface);
1462+
if (!(object = calloc(1, sizeof(*object)))) return VK_ERROR_OUT_OF_HOST_MEMORY;
1463+
object->hwnd = create_info->hwnd;
14701464

1465+
res = instance->funcs.p_vkCreateWin32SurfaceKHR(instance->host_instance, create_info,
1466+
NULL /* allocator */, &object->driver_surface);
14711467
if (res != VK_SUCCESS)
14721468
{
14731469
free(object);

dlls/winevulkan/vulkan_private.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ static inline VkDebugReportCallbackEXT wine_debug_report_callback_to_handle(
222222
struct wine_surface
223223
{
224224
VkSurfaceKHR host_surface;
225-
VkSurfaceKHR driver_surface; /* wine driver surface */
225+
VkSurfaceKHR driver_surface;
226+
HWND hwnd;
226227

227228
struct wine_vk_mapping mapping;
228229
};

0 commit comments

Comments
 (0)