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
cde2c08e
Commit
cde2c08e
authored
Feb 23, 2024
by
Rémi Bernon
Committed by
Alexandre Julliard
Apr 11, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winewayland: Remove now unnecessary swapchain wrapper.
parent
7bab2b6c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
79 deletions
+2
-79
vulkan.c
dlls/winewayland.drv/vulkan.c
+2
-79
No files found.
dlls/winewayland.drv/vulkan.c
View file @
cde2c08e
...
...
@@ -62,21 +62,12 @@ static VkResult (*pvkQueuePresentKHR)(VkQueue, const VkPresentInfoKHR *);
static
const
struct
vulkan_funcs
vulkan_funcs
;
static
pthread_mutex_t
wine_vk_swapchain_mutex
=
PTHREAD_MUTEX_INITIALIZER
;
static
struct
list
wine_vk_swapchain_list
=
LIST_INIT
(
wine_vk_swapchain_list
);
struct
wine_vk_surface
{
struct
wayland_client_surface
*
client
;
VkSurfaceKHR
host_surface
;
};
struct
wine_vk_swapchain
{
struct
list
entry
;
VkSwapchainKHR
host_swapchain
;
};
static
struct
wine_vk_surface
*
wine_vk_surface_from_handle
(
VkSurfaceKHR
handle
)
{
return
(
struct
wine_vk_surface
*
)(
uintptr_t
)
handle
;
...
...
@@ -106,82 +97,24 @@ static void wine_vk_surface_destroy(struct wine_vk_surface *wine_vk_surface)
free
(
wine_vk_surface
);
}
static
BOOL
wine_vk_surface_is_valid
(
struct
wine_vk_surface
*
wine_vk_surface
)
{
HWND
hwnd
=
wine_vk_surface_get_hwnd
(
wine_vk_surface
);
struct
wayland_surface
*
wayland_surface
;
if
((
wayland_surface
=
wayland_surface_lock_hwnd
(
hwnd
)))
{
pthread_mutex_unlock
(
&
wayland_surface
->
mutex
);
return
TRUE
;
}
return
FALSE
;
}
static
struct
wine_vk_swapchain
*
wine_vk_swapchain_from_handle
(
VkSwapchainKHR
handle
)
{
struct
wine_vk_swapchain
*
wine_vk_swapchain
;
pthread_mutex_lock
(
&
wine_vk_swapchain_mutex
);
LIST_FOR_EACH_ENTRY
(
wine_vk_swapchain
,
&
wine_vk_swapchain_list
,
struct
wine_vk_swapchain
,
entry
)
{
if
(
wine_vk_swapchain
->
host_swapchain
==
handle
)
{
pthread_mutex_unlock
(
&
wine_vk_swapchain_mutex
);
return
wine_vk_swapchain
;
}
}
pthread_mutex_unlock
(
&
wine_vk_swapchain_mutex
);
return
NULL
;
}
static
VkResult
wayland_vkCreateSwapchainKHR
(
VkDevice
device
,
const
VkSwapchainCreateInfoKHR
*
create_info
,
const
VkAllocationCallbacks
*
allocator
,
VkSwapchainKHR
*
swapchain
)
{
VkResult
res
;
VkSwapchainCreateInfoKHR
create_info_host
;
struct
wine_vk_surface
*
wine_vk_surface
;
struct
wine_vk_swapchain
*
wine_vk_swapchain
;
struct
wine_vk_surface
*
wine_vk_surface
=
wine_vk_surface_from_handle
(
create_info
->
surface
);
TRACE
(
"%p %p %p %p
\n
"
,
device
,
create_info
,
allocator
,
swapchain
);
if
(
allocator
)
FIXME
(
"Support for allocation callbacks not implemented yet
\n
"
);
wine_vk_surface
=
wine_vk_surface_from_handle
(
create_info
->
surface
);
if
(
!
wine_vk_surface_is_valid
(
wine_vk_surface
))
return
VK_ERROR_SURFACE_LOST_KHR
;
wine_vk_swapchain
=
calloc
(
1
,
sizeof
(
*
wine_vk_swapchain
));
if
(
!
wine_vk_swapchain
)
return
VK_ERROR_OUT_OF_HOST_MEMORY
;
create_info_host
=
*
create_info
;
create_info_host
.
surface
=
wine_vk_surface
->
host_surface
;
re
s
=
pvkCreateSwapchainKHR
(
device
,
&
create_info_host
,
NULL
/* allocator */
,
re
turn
pvkCreateSwapchainKHR
(
device
,
&
create_info_host
,
NULL
/* allocator */
,
swapchain
);
if
(
res
!=
VK_SUCCESS
)
{
ERR
(
"Failed to create vulkan wayland swapchain, res=%d
\n
"
,
res
);
free
(
wine_vk_swapchain
);
return
res
;
}
wine_vk_swapchain
->
host_swapchain
=
*
swapchain
;
pthread_mutex_lock
(
&
wine_vk_swapchain_mutex
);
list_add_head
(
&
wine_vk_swapchain_list
,
&
wine_vk_swapchain
->
entry
);
pthread_mutex_unlock
(
&
wine_vk_swapchain_mutex
);
TRACE
(
"Created swapchain=0x%s
\n
"
,
wine_dbgstr_longlong
(
*
swapchain
));
return
res
;
}
static
VkResult
wayland_vkCreateWin32SurfaceKHR
(
VkInstance
instance
,
...
...
@@ -270,22 +203,12 @@ static void wayland_vkDestroySwapchainKHR(VkDevice device,
VkSwapchainKHR
swapchain
,
const
VkAllocationCallbacks
*
allocator
)
{
struct
wine_vk_swapchain
*
wine_vk_swapchain
;
TRACE
(
"%p, 0x%s %p
\n
"
,
device
,
wine_dbgstr_longlong
(
swapchain
),
allocator
);
if
(
allocator
)
FIXME
(
"Support for allocation callbacks not implemented yet
\n
"
);
pvkDestroySwapchainKHR
(
device
,
swapchain
,
NULL
/* allocator */
);
if
((
wine_vk_swapchain
=
wine_vk_swapchain_from_handle
(
swapchain
)))
{
pthread_mutex_lock
(
&
wine_vk_swapchain_mutex
);
list_remove
(
&
wine_vk_swapchain
->
entry
);
pthread_mutex_unlock
(
&
wine_vk_swapchain_mutex
);
free
(
wine_vk_swapchain
);
}
}
static
VkBool32
wayland_vkGetPhysicalDeviceWin32PresentationSupportKHR
(
VkPhysicalDevice
phys_dev
,
...
...
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