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
50584bcc
Commit
50584bcc
authored
Feb 24, 2024
by
Rémi Bernon
Committed by
Alexandre Julliard
Apr 25, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winevulkan: Pass win32u surface wrappers for each vkQueuePresent swapchain.
parent
d054ccc8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
8 deletions
+11
-8
vulkan.c
dlls/win32u/vulkan.c
+7
-4
vulkan.c
dlls/winevulkan/vulkan.c
+2
-2
vulkan_driver.h
include/wine/vulkan_driver.h
+2
-2
No files found.
dlls/win32u/vulkan.c
View file @
50584bcc
...
@@ -52,6 +52,7 @@ struct surface
...
@@ -52,6 +52,7 @@ struct surface
{
{
VkSurfaceKHR
host_surface
;
VkSurfaceKHR
host_surface
;
VkSurfaceKHR
driver_surface
;
VkSurfaceKHR
driver_surface
;
HWND
hwnd
;
};
};
static
inline
struct
surface
*
surface_from_handle
(
VkSurfaceKHR
handle
)
static
inline
struct
surface
*
surface_from_handle
(
VkSurfaceKHR
handle
)
...
@@ -80,6 +81,7 @@ static VkResult win32u_vkCreateWin32SurfaceKHR( VkInstance instance, const VkWin
...
@@ -80,6 +81,7 @@ static VkResult win32u_vkCreateWin32SurfaceKHR( VkInstance instance, const VkWin
return
res
;
return
res
;
}
}
surface
->
hwnd
=
info
->
hwnd
;
surface
->
host_surface
=
driver_funcs
->
p_wine_get_host_surface
(
surface
->
driver_surface
);
surface
->
host_surface
=
driver_funcs
->
p_wine_get_host_surface
(
surface
->
driver_surface
);
*
handle
=
surface_to_handle
(
surface
);
*
handle
=
surface_to_handle
(
surface
);
return
VK_SUCCESS
;
return
VK_SUCCESS
;
...
@@ -96,20 +98,21 @@ static void win32u_vkDestroySurfaceKHR( VkInstance instance, VkSurfaceKHR handle
...
@@ -96,20 +98,21 @@ static void win32u_vkDestroySurfaceKHR( VkInstance instance, VkSurfaceKHR handle
free
(
surface
);
free
(
surface
);
}
}
static
VkResult
win32u_vkQueuePresentKHR
(
VkQueue
queue
,
const
VkPresentInfoKHR
*
present_info
,
HWND
*
surfaces
)
static
VkResult
win32u_vkQueuePresentKHR
(
VkQueue
queue
,
const
VkPresentInfoKHR
*
present_info
,
VkSurfaceKHR
*
surfaces
)
{
{
VkPresentInfoKHR
host_present_info
=
*
present_info
;
VkResult
res
;
VkResult
res
;
UINT
i
;
UINT
i
;
TRACE
(
"queue %p, present_info %p
\n
"
,
queue
,
present_info
);
TRACE
(
"queue %p, present_info %p
\n
"
,
queue
,
present_info
);
res
=
p_vkQueuePresentKHR
(
queue
,
&
host_
present_info
);
res
=
p_vkQueuePresentKHR
(
queue
,
present_info
);
for
(
i
=
0
;
i
<
present_info
->
swapchainCount
;
i
++
)
for
(
i
=
0
;
i
<
present_info
->
swapchainCount
;
i
++
)
{
{
VkResult
swapchain_res
=
present_info
->
pResults
?
present_info
->
pResults
[
i
]
:
res
;
VkResult
swapchain_res
=
present_info
->
pResults
?
present_info
->
pResults
[
i
]
:
res
;
driver_funcs
->
p_vulkan_surface_presented
(
surfaces
[
i
],
swapchain_res
);
struct
surface
*
surface
=
surface_from_handle
(
surfaces
[
i
]
);
driver_funcs
->
p_vulkan_surface_presented
(
surface
->
hwnd
,
swapchain_res
);
}
}
return
res
;
return
res
;
...
...
dlls/winevulkan/vulkan.c
View file @
50584bcc
...
@@ -1740,7 +1740,7 @@ void wine_vkDestroySwapchainKHR(VkDevice device_handle, VkSwapchainKHR swapchain
...
@@ -1740,7 +1740,7 @@ void wine_vkDestroySwapchainKHR(VkDevice device_handle, VkSwapchainKHR swapchain
VkResult
wine_vkQueuePresentKHR
(
VkQueue
queue_handle
,
const
VkPresentInfoKHR
*
present_info
)
VkResult
wine_vkQueuePresentKHR
(
VkQueue
queue_handle
,
const
VkPresentInfoKHR
*
present_info
)
{
{
VkSwapchainKHR
swapchains_buffer
[
16
],
*
swapchains
=
swapchains_buffer
;
VkSwapchainKHR
swapchains_buffer
[
16
],
*
swapchains
=
swapchains_buffer
;
HWND
surfaces_buffer
[
ARRAY_SIZE
(
swapchains_buffer
)],
*
surfaces
=
surfaces_buffer
;
VkSurfaceKHR
surfaces_buffer
[
ARRAY_SIZE
(
swapchains_buffer
)],
*
surfaces
=
surfaces_buffer
;
struct
wine_queue
*
queue
=
wine_queue_from_handle
(
queue_handle
);
struct
wine_queue
*
queue
=
wine_queue_from_handle
(
queue_handle
);
VkPresentInfoKHR
present_info_host
=
*
present_info
;
VkPresentInfoKHR
present_info_host
=
*
present_info
;
VkResult
res
;
VkResult
res
;
...
@@ -1759,7 +1759,7 @@ VkResult wine_vkQueuePresentKHR(VkQueue queue_handle, const VkPresentInfoKHR *pr
...
@@ -1759,7 +1759,7 @@ VkResult wine_vkQueuePresentKHR(VkQueue queue_handle, const VkPresentInfoKHR *pr
struct
wine_swapchain
*
swapchain
=
wine_swapchain_from_handle
(
present_info
->
pSwapchains
[
i
]);
struct
wine_swapchain
*
swapchain
=
wine_swapchain_from_handle
(
present_info
->
pSwapchains
[
i
]);
struct
wine_surface
*
surface
=
swapchain
->
surface
;
struct
wine_surface
*
surface
=
swapchain
->
surface
;
swapchains
[
i
]
=
swapchain
->
host_swapchain
;
swapchains
[
i
]
=
swapchain
->
host_swapchain
;
surfaces
[
i
]
=
surface
->
hwnd
;
surfaces
[
i
]
=
surface
->
driver_surface
;
}
}
present_info_host
.
pSwapchains
=
swapchains
;
present_info_host
.
pSwapchains
=
swapchains
;
...
...
include/wine/vulkan_driver.h
View file @
50584bcc
...
@@ -21,7 +21,7 @@
...
@@ -21,7 +21,7 @@
#define __WINE_VULKAN_DRIVER_H
#define __WINE_VULKAN_DRIVER_H
/* Wine internal vulkan driver version, needs to be bumped upon vulkan_funcs changes. */
/* Wine internal vulkan driver version, needs to be bumped upon vulkan_funcs changes. */
#define WINE_VULKAN_DRIVER_VERSION 2
8
#define WINE_VULKAN_DRIVER_VERSION 2
9
struct
vulkan_funcs
struct
vulkan_funcs
{
{
...
@@ -34,7 +34,7 @@ struct vulkan_funcs
...
@@ -34,7 +34,7 @@ struct vulkan_funcs
void
*
(
*
p_vkGetDeviceProcAddr
)(
VkDevice
,
const
char
*
);
void
*
(
*
p_vkGetDeviceProcAddr
)(
VkDevice
,
const
char
*
);
void
*
(
*
p_vkGetInstanceProcAddr
)(
VkInstance
,
const
char
*
);
void
*
(
*
p_vkGetInstanceProcAddr
)(
VkInstance
,
const
char
*
);
VkBool32
(
*
p_vkGetPhysicalDeviceWin32PresentationSupportKHR
)(
VkPhysicalDevice
,
uint32_t
);
VkBool32
(
*
p_vkGetPhysicalDeviceWin32PresentationSupportKHR
)(
VkPhysicalDevice
,
uint32_t
);
VkResult
(
*
p_vkQueuePresentKHR
)(
VkQueue
,
const
VkPresentInfoKHR
*
,
HWND
*
surfaces
);
VkResult
(
*
p_vkQueuePresentKHR
)(
VkQueue
,
const
VkPresentInfoKHR
*
,
VkSurfaceKHR
*
surfaces
);
/* winevulkan specific functions */
/* winevulkan specific functions */
const
char
*
(
*
p_get_host_surface_extension
)(
void
);
const
char
*
(
*
p_get_host_surface_extension
)(
void
);
...
...
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