Skip to content

Commit

Permalink
winevulkan: Keep the create_info HWND on the surface wrappers.
Browse files Browse the repository at this point in the history
  • Loading branch information
rbernon authored and julliard committed Feb 1, 2024
1 parent 62536d1 commit 982c2ed
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
16 changes: 6 additions & 10 deletions dlls/winevulkan/vulkan.c
Original file line number Diff line number Diff line change
Expand Up @@ -1450,24 +1450,20 @@ void wine_vkGetPhysicalDeviceExternalSemaphorePropertiesKHR(VkPhysicalDevice phy
properties->externalSemaphoreFeatures = 0;
}

VkResult wine_vkCreateWin32SurfaceKHR(VkInstance handle, const VkWin32SurfaceCreateInfoKHR *createInfo,
VkResult wine_vkCreateWin32SurfaceKHR(VkInstance handle, const VkWin32SurfaceCreateInfoKHR *create_info,
const VkAllocationCallbacks *allocator, VkSurfaceKHR *surface)
{
struct wine_instance *instance = wine_instance_from_handle(handle);
struct wine_surface *object;
VkResult res;

if (allocator)
FIXME("Support for allocation callbacks not implemented yet\n");

object = calloc(1, sizeof(*object));

if (!object)
return VK_ERROR_OUT_OF_HOST_MEMORY;
if (allocator) FIXME("Support for allocation callbacks not implemented yet\n");

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

res = instance->funcs.p_vkCreateWin32SurfaceKHR(instance->host_instance, create_info,
NULL /* allocator */, &object->driver_surface);
if (res != VK_SUCCESS)
{
free(object);
Expand Down
3 changes: 2 additions & 1 deletion dlls/winevulkan/vulkan_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,8 @@ static inline VkDebugReportCallbackEXT wine_debug_report_callback_to_handle(
struct wine_surface
{
VkSurfaceKHR host_surface;
VkSurfaceKHR driver_surface; /* wine driver surface */
VkSurfaceKHR driver_surface;
HWND hwnd;

struct wine_vk_mapping mapping;
};
Expand Down

0 comments on commit 982c2ed

Please sign in to comment.