Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
8653ed03
Commit
8653ed03
authored
Apr 12, 2024
by
Rémi Bernon
Committed by
Alexandre Julliard
Apr 25, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
win32u: Move host surface destruction out of the drivers.
parent
34d288a9
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
17 additions
and
24 deletions
+17
-24
vulkan.c
dlls/win32u/vulkan.c
+6
-3
vulkan.c
dlls/winemac.drv/vulkan.c
+5
-9
vulkan.c
dlls/winewayland.drv/vulkan.c
+2
-5
vulkan.c
dlls/winex11.drv/vulkan.c
+2
-5
vulkan_driver.h
include/wine/vulkan_driver.h
+2
-2
No files found.
dlls/win32u/vulkan.c
View file @
8653ed03
...
...
@@ -44,6 +44,7 @@ static void *vulkan_handle;
static
const
struct
vulkan_driver_funcs
*
driver_funcs
;
static
struct
vulkan_funcs
vulkan_funcs
;
static
void
(
*
p_vkDestroySurfaceKHR
)(
VkInstance
,
VkSurfaceKHR
,
const
VkAllocationCallbacks
*
);
static
VkResult
(
*
p_vkQueuePresentKHR
)(
VkQueue
,
const
VkPresentInfoKHR
*
);
static
void
*
(
*
p_vkGetDeviceProcAddr
)(
VkDevice
,
const
char
*
);
static
void
*
(
*
p_vkGetInstanceProcAddr
)(
VkInstance
,
const
char
*
);
...
...
@@ -94,7 +95,8 @@ static void win32u_vkDestroySurfaceKHR( VkInstance instance, VkSurfaceKHR handle
TRACE
(
"instance %p, handle 0x%s, allocator %p
\n
"
,
instance
,
wine_dbgstr_longlong
(
handle
),
allocator
);
if
(
allocator
)
FIXME
(
"Support for allocation callbacks not implemented yet
\n
"
);
driver_funcs
->
p_vulkan_surface_destroy
(
surface
->
hwnd
,
instance
,
surface
->
driver_surface
);
p_vkDestroySurfaceKHR
(
instance
,
surface
->
host_surface
,
NULL
/* allocator */
);
driver_funcs
->
p_vulkan_surface_destroy
(
surface
->
hwnd
,
surface
->
driver_surface
);
free
(
surface
);
}
...
...
@@ -168,7 +170,7 @@ static VkResult nulldrv_vulkan_surface_create( HWND hwnd, VkInstance instance, V
return
VK_ERROR_INCOMPATIBLE_DRIVER
;
}
static
void
nulldrv_vulkan_surface_destroy
(
HWND
hwnd
,
Vk
Instance
instance
,
Vk
SurfaceKHR
surface
)
static
void
nulldrv_vulkan_surface_destroy
(
HWND
hwnd
,
VkSurfaceKHR
surface
)
{
}
...
...
@@ -237,9 +239,10 @@ static void vulkan_init(void)
return; \
}
LOAD_FUNCPTR
(
vkDestroySurfaceKHR
);
LOAD_FUNCPTR
(
vkQueuePresentKHR
);
LOAD_FUNCPTR
(
vkGetDeviceProcAddr
);
LOAD_FUNCPTR
(
vkGetInstanceProcAddr
);
LOAD_FUNCPTR
(
vkQueuePresentKHR
);
#undef LOAD_FUNCPTR
}
...
...
dlls/winemac.drv/vulkan.c
View file @
8653ed03
...
...
@@ -77,7 +77,6 @@ typedef struct VkMetalSurfaceCreateInfoEXT
static
VkResult
(
*
pvkCreateMacOSSurfaceMVK
)(
VkInstance
,
const
VkMacOSSurfaceCreateInfoMVK
*
,
const
VkAllocationCallbacks
*
,
VkSurfaceKHR
*
);
static
VkResult
(
*
pvkCreateMetalSurfaceEXT
)(
VkInstance
,
const
VkMetalSurfaceCreateInfoEXT
*
,
const
VkAllocationCallbacks
*
,
VkSurfaceKHR
*
);
static
void
(
*
pvkDestroySurfaceKHR
)(
VkInstance
,
VkSurfaceKHR
,
const
VkAllocationCallbacks
*
);
static
VkResult
(
*
pvkGetPhysicalDeviceSurfaceCapabilities2KHR
)(
VkPhysicalDevice
,
const
VkPhysicalDeviceSurfaceInfo2KHR
*
,
VkSurfaceCapabilities2KHR
*
);
static
const
struct
vulkan_driver_funcs
macdrv_vulkan_driver_funcs
;
...
...
@@ -87,10 +86,8 @@ static inline struct wine_vk_surface *surface_from_handle(VkSurfaceKHR handle)
return
(
struct
wine_vk_surface
*
)(
uintptr_t
)
handle
;
}
static
void
wine_vk_surface_destroy
(
VkInstance
instance
,
struct
wine_vk_surface
*
surface
)
static
void
wine_vk_surface_destroy
(
struct
wine_vk_surface
*
surface
)
{
pvkDestroySurfaceKHR
(
instance
,
surface
->
host_surface
,
NULL
/* allocator */
);
if
(
surface
->
view
)
macdrv_view_release_metal_view
(
surface
->
view
);
...
...
@@ -173,18 +170,18 @@ static VkResult macdrv_vulkan_surface_create(HWND hwnd, VkInstance instance, VkS
return
VK_SUCCESS
;
err:
wine_vk_surface_destroy
(
instance
,
mac_surface
);
wine_vk_surface_destroy
(
mac_surface
);
release_win_data
(
data
);
return
res
;
}
static
void
macdrv_vulkan_surface_destroy
(
HWND
hwnd
,
Vk
Instance
instance
,
Vk
SurfaceKHR
surface
)
static
void
macdrv_vulkan_surface_destroy
(
HWND
hwnd
,
VkSurfaceKHR
surface
)
{
struct
wine_vk_surface
*
mac_surface
=
surface_from_handle
(
surface
);
TRACE
(
"%p
%p 0x%s
\n
"
,
hwnd
,
instance
,
wine_dbgstr_longlong
(
surface
));
TRACE
(
"%p
0x%s
\n
"
,
hwnd
,
wine_dbgstr_longlong
(
surface
));
wine_vk_surface_destroy
(
instance
,
mac_surface
);
wine_vk_surface_destroy
(
mac_surface
);
}
static
void
macdrv_vulkan_surface_presented
(
HWND
hwnd
,
VkResult
result
)
...
...
@@ -235,7 +232,6 @@ UINT macdrv_VulkanInit(UINT version, void *vulkan_handle, const struct vulkan_dr
#define LOAD_FUNCPTR(f) if ((p##f = dlsym(vulkan_handle, #f)) == NULL) return STATUS_PROCEDURE_NOT_FOUND;
LOAD_FUNCPTR
(
vkCreateMacOSSurfaceMVK
)
LOAD_FUNCPTR
(
vkCreateMetalSurfaceEXT
)
LOAD_FUNCPTR
(
vkDestroySurfaceKHR
)
#undef LOAD_FUNCPTR
*
driver_funcs
=
&
macdrv_vulkan_driver_funcs
;
...
...
dlls/winewayland.drv/vulkan.c
View file @
8653ed03
...
...
@@ -54,7 +54,6 @@ typedef struct VkWaylandSurfaceCreateInfoKHR
}
VkWaylandSurfaceCreateInfoKHR
;
static
VkResult
(
*
pvkCreateWaylandSurfaceKHR
)(
VkInstance
,
const
VkWaylandSurfaceCreateInfoKHR
*
,
const
VkAllocationCallbacks
*
,
VkSurfaceKHR
*
);
static
void
(
*
pvkDestroySurfaceKHR
)(
VkInstance
,
VkSurfaceKHR
,
const
VkAllocationCallbacks
*
);
static
VkBool32
(
*
pvkGetPhysicalDeviceWaylandPresentationSupportKHR
)(
VkPhysicalDevice
,
uint32_t
,
struct
wl_display
*
);
static
const
struct
vulkan_driver_funcs
wayland_vulkan_driver_funcs
;
...
...
@@ -156,13 +155,12 @@ err:
return
res
;
}
static
void
wayland_vulkan_surface_destroy
(
HWND
hwnd
,
Vk
Instance
instance
,
Vk
SurfaceKHR
surface
)
static
void
wayland_vulkan_surface_destroy
(
HWND
hwnd
,
VkSurfaceKHR
surface
)
{
struct
wine_vk_surface
*
wine_vk_surface
=
wine_vk_surface_from_handle
(
surface
);
TRACE
(
"%p
%p 0x%s
\n
"
,
hwnd
,
instance
,
wine_dbgstr_longlong
(
surface
));
TRACE
(
"%p
0x%s
\n
"
,
hwnd
,
wine_dbgstr_longlong
(
surface
));
pvkDestroySurfaceKHR
(
instance
,
wine_vk_surface
->
host_surface
,
NULL
/* allocator */
);
wine_vk_surface_destroy
(
wine_vk_surface
);
}
...
...
@@ -230,7 +228,6 @@ UINT WAYLAND_VulkanInit(UINT version, void *vulkan_handle, const struct vulkan_d
#define LOAD_FUNCPTR(f) if (!(p##f = dlsym(vulkan_handle, #f))) return STATUS_PROCEDURE_NOT_FOUND;
LOAD_FUNCPTR
(
vkCreateWaylandSurfaceKHR
);
LOAD_FUNCPTR
(
vkDestroySurfaceKHR
);
LOAD_FUNCPTR
(
vkGetPhysicalDeviceWaylandPresentationSupportKHR
);
#undef LOAD_FUNCPTR
...
...
dlls/winex11.drv/vulkan.c
View file @
8653ed03
...
...
@@ -74,7 +74,6 @@ typedef struct VkXlibSurfaceCreateInfoKHR
}
VkXlibSurfaceCreateInfoKHR
;
static
VkResult
(
*
pvkCreateXlibSurfaceKHR
)(
VkInstance
,
const
VkXlibSurfaceCreateInfoKHR
*
,
const
VkAllocationCallbacks
*
,
VkSurfaceKHR
*
);
static
void
(
*
pvkDestroySurfaceKHR
)(
VkInstance
,
VkSurfaceKHR
,
const
VkAllocationCallbacks
*
);
static
VkBool32
(
*
pvkGetPhysicalDeviceXlibPresentationSupportKHR
)(
VkPhysicalDevice
,
uint32_t
,
Display
*
,
VisualID
);
static
const
struct
vulkan_driver_funcs
x11drv_vulkan_driver_funcs
;
...
...
@@ -190,13 +189,12 @@ static VkResult X11DRV_vulkan_surface_create( HWND hwnd, VkInstance instance, Vk
return
VK_SUCCESS
;
}
static
void
X11DRV_vulkan_surface_destroy
(
HWND
hwnd
,
Vk
Instance
instance
,
Vk
SurfaceKHR
surface
)
static
void
X11DRV_vulkan_surface_destroy
(
HWND
hwnd
,
VkSurfaceKHR
surface
)
{
struct
wine_vk_surface
*
x11_surface
=
surface_from_handle
(
surface
);
TRACE
(
"%p
%p 0x%s
\n
"
,
hwnd
,
instance
,
wine_dbgstr_longlong
(
surface
)
);
TRACE
(
"%p
0x%s
\n
"
,
hwnd
,
wine_dbgstr_longlong
(
surface
)
);
pvkDestroySurfaceKHR
(
instance
,
x11_surface
->
host_surface
,
NULL
/* allocator */
);
wine_vk_surface_release
(
x11_surface
);
}
...
...
@@ -250,7 +248,6 @@ UINT X11DRV_VulkanInit( UINT version, void *vulkan_handle, const struct vulkan_d
#define LOAD_FUNCPTR( f ) if (!(p##f = dlsym( vulkan_handle, #f ))) return STATUS_PROCEDURE_NOT_FOUND;
LOAD_FUNCPTR
(
vkCreateXlibSurfaceKHR
);
LOAD_FUNCPTR
(
vkDestroySurfaceKHR
);
LOAD_FUNCPTR
(
vkGetPhysicalDeviceXlibPresentationSupportKHR
);
#undef LOAD_FUNCPTR
...
...
include/wine/vulkan_driver.h
View file @
8653ed03
...
...
@@ -21,7 +21,7 @@
#define __WINE_VULKAN_DRIVER_H
/* Wine internal vulkan driver version, needs to be bumped upon vulkan_funcs changes. */
#define WINE_VULKAN_DRIVER_VERSION 3
1
#define WINE_VULKAN_DRIVER_VERSION 3
2
struct
vulkan_funcs
{
...
...
@@ -45,7 +45,7 @@ struct vulkan_funcs
struct
vulkan_driver_funcs
{
VkResult
(
*
p_vulkan_surface_create
)(
HWND
,
VkInstance
,
VkSurfaceKHR
*
);
void
(
*
p_vulkan_surface_destroy
)(
HWND
,
Vk
Instance
,
Vk
SurfaceKHR
);
void
(
*
p_vulkan_surface_destroy
)(
HWND
,
VkSurfaceKHR
);
void
(
*
p_vulkan_surface_presented
)(
HWND
,
VkResult
);
VkBool32
(
*
p_vkGetPhysicalDeviceWin32PresentationSupportKHR
)(
VkPhysicalDevice
,
uint32_t
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment