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
ccd332c8
Commit
ccd332c8
authored
Mar 29, 2024
by
Rémi Bernon
Committed by
Alexandre Julliard
Apr 05, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winex11: Get rid of ref held from the HWND to its Vk surface.
parent
6c9e7948
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
24 deletions
+11
-24
vulkan.c
dlls/winex11.drv/vulkan.c
+9
-22
window.c
dlls/winex11.drv/window.c
+1
-1
x11drv.h
dlls/winex11.drv/x11drv.h
+1
-1
No files found.
dlls/winex11.drv/vulkan.c
View file @
ccd332c8
...
...
@@ -51,8 +51,6 @@ WINE_DECLARE_DEBUG_CHANNEL(fps);
static
pthread_mutex_t
vulkan_mutex
;
static
XContext
vulkan_hwnd_context
;
#define VK_STRUCTURE_TYPE_XLIB_SURFACE_CREATE_INFO_KHR 1000004000
static
struct
list
surface_list
=
LIST_INIT
(
surface_list
);
...
...
@@ -91,13 +89,7 @@ static inline struct wine_vk_surface *surface_from_handle(VkSurfaceKHR handle)
return
(
struct
wine_vk_surface
*
)(
uintptr_t
)
handle
;
}
static
struct
wine_vk_surface
*
wine_vk_surface_grab
(
struct
wine_vk_surface
*
surface
)
{
InterlockedIncrement
(
&
surface
->
ref
);
return
surface
;
}
static
void
wine_vk_surface_release
(
struct
wine_vk_surface
*
surface
)
static
void
wine_vk_surface_release
(
struct
wine_vk_surface
*
surface
)
{
if
(
InterlockedDecrement
(
&
surface
->
ref
))
return
;
...
...
@@ -115,18 +107,18 @@ static void wine_vk_surface_release(struct wine_vk_surface *surface)
free
(
surface
);
}
void
wine_vk_surface_destroy
(
HWND
hwnd
)
void
destroy_vk_surface
(
HWND
hwnd
)
{
struct
wine_vk_surface
*
surface
;
pthread_mutex_lock
(
&
vulkan_mutex
);
if
(
!
XFindContext
(
gdi_display
,
(
XID
)
hwnd
,
vulkan_hwnd_context
,
(
char
**
)
&
surface
))
struct
wine_vk_surface
*
surface
,
*
next
;
pthread_mutex_lock
(
&
vulkan_mutex
);
LIST_FOR_EACH_ENTRY_SAFE
(
surface
,
next
,
&
surface_list
,
struct
wine_vk_surface
,
entry
)
{
if
(
surface
->
hwnd
!=
hwnd
)
continue
;
surface
->
hwnd_thread_id
=
0
;
surface
->
hwnd
=
NULL
;
wine_vk_surface_release
(
surface
);
}
XDeleteContext
(
gdi_display
,
(
XID
)
hwnd
,
vulkan_hwnd_context
);
pthread_mutex_unlock
(
&
vulkan_mutex
);
pthread_mutex_unlock
(
&
vulkan_mutex
);
}
void
vulkan_thread_detach
(
void
)
...
...
@@ -143,7 +135,6 @@ void vulkan_thread_detach(void)
TRACE
(
"Detaching surface %p, hwnd %p.
\n
"
,
surface
,
surface
->
hwnd
);
XReparentWindow
(
gdi_display
,
surface
->
window
,
get_dummy_parent
(),
0
,
0
);
XSync
(
gdi_display
,
False
);
wine_vk_surface_destroy
(
surface
->
hwnd
);
}
pthread_mutex_unlock
(
&
vulkan_mutex
);
}
...
...
@@ -220,9 +211,6 @@ static VkResult X11DRV_vkCreateWin32SurfaceKHR(VkInstance instance,
}
pthread_mutex_lock
(
&
vulkan_mutex
);
wine_vk_surface_destroy
(
x11_surface
->
hwnd
);
XSaveContext
(
gdi_display
,
(
XID
)
create_info
->
hwnd
,
vulkan_hwnd_context
,
(
char
*
)
wine_vk_surface_grab
(
x11_surface
)
);
list_add_tail
(
&
surface_list
,
&
x11_surface
->
entry
);
pthread_mutex_unlock
(
&
vulkan_mutex
);
...
...
@@ -359,7 +347,6 @@ UINT X11DRV_VulkanInit( UINT version, void *vulkan_handle, struct vulkan_funcs *
LOAD_FUNCPTR
(
vkQueuePresentKHR
);
#undef LOAD_FUNCPTR
vulkan_hwnd_context
=
XUniqueContext
();
*
driver_funcs
=
vulkan_funcs
;
return
STATUS_SUCCESS
;
}
...
...
@@ -372,7 +359,7 @@ UINT X11DRV_VulkanInit( UINT version, void *vulkan_handle, struct vulkan_funcs *
return
STATUS_NOT_IMPLEMENTED
;
}
void
wine_vk_surface_destroy
(
HWND
hwnd
)
void
destroy_vk_surface
(
HWND
hwnd
)
{
}
...
...
dlls/winex11.drv/window.c
View file @
ccd332c8
...
...
@@ -1881,7 +1881,7 @@ void X11DRV_DestroyWindow( HWND hwnd )
release_win_data
(
data
);
free
(
data
);
destroy_gl_drawable
(
hwnd
);
wine_vk_surface_destroy
(
hwnd
);
destroy_vk_surface
(
hwnd
);
}
...
...
dlls/winex11.drv/x11drv.h
View file @
ccd332c8
...
...
@@ -640,7 +640,7 @@ extern Window get_dummy_parent(void);
extern
void
sync_gl_drawable
(
HWND
hwnd
,
BOOL
known_child
);
extern
void
set_gl_drawable_parent
(
HWND
hwnd
,
HWND
parent
);
extern
void
destroy_gl_drawable
(
HWND
hwnd
);
extern
void
wine_vk_surface_destroy
(
HWND
hwnd
);
extern
void
destroy_vk_surface
(
HWND
hwnd
);
extern
void
vulkan_thread_detach
(
void
);
extern
void
wait_for_withdrawn_state
(
HWND
hwnd
,
BOOL
set
);
...
...
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