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
010b497c
Commit
010b497c
authored
Dec 10, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Apr 09, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winevulkan: Return VK_SUBOPTIMAL_KHR from vkQueuePresentKHR after resize.
parent
551b535c
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
3 deletions
+36
-3
vulkan.c
dlls/vulkan-1/tests/vulkan.c
+0
-3
vulkan.c
dlls/winevulkan/vulkan.c
+34
-0
vulkan_private.h
dlls/winevulkan/vulkan_private.h
+2
-0
No files found.
dlls/vulkan-1/tests/vulkan.c
View file @
010b497c
...
...
@@ -762,11 +762,8 @@ static void test_win32_surface_swapchain_hwnd(VkDevice device, VkSwapchainKHR sw
vr
=
vkQueuePresentKHR
(
queue
,
&
present_info
);
if
(
expect_suboptimal
)
{
todo_wine
ok
(
vr
==
VK_SUBOPTIMAL_KHR
||
broken
(
vr
==
VK_ERROR_OUT_OF_DATE_KHR
)
/* Nvidia */
,
"Got unexpected vr %d.
\n
"
,
vr
);
}
else
if
(
IsWindow
(
hwnd
))
ok
(
vr
==
VK_SUCCESS
,
"Got unexpected vr %d.
\n
"
,
vr
);
else
...
...
dlls/winevulkan/vulkan.c
View file @
010b497c
...
...
@@ -1624,6 +1624,12 @@ void wine_vkDestroySurfaceKHR(VkInstance handle, VkSurfaceKHR surface,
free
(
object
);
}
static
BOOL
extents_equals
(
const
VkExtent2D
*
extents
,
const
RECT
*
rect
)
{
return
extents
->
width
==
rect
->
right
-
rect
->
left
&&
extents
->
height
==
rect
->
bottom
-
rect
->
top
;
}
VkResult
wine_vkCreateSwapchainKHR
(
VkDevice
device_handle
,
const
VkSwapchainCreateInfoKHR
*
create_info
,
const
VkAllocationCallbacks
*
allocator
,
VkSwapchainKHR
*
swapchain_handle
)
{
...
...
@@ -1661,6 +1667,9 @@ VkResult wine_vkCreateSwapchainKHR(VkDevice device_handle, const VkSwapchainCrea
return
res
;
}
object
->
surface
=
surface
;
object
->
extents
=
create_info
->
imageExtent
;
*
swapchain_handle
=
wine_swapchain_to_handle
(
object
);
add_handle_mapping
(
instance
,
*
swapchain_handle
,
object
->
host_swapchain
,
&
object
->
wrapper_entry
);
return
VK_SUCCESS
;
...
...
@@ -1704,6 +1713,31 @@ VkResult wine_vkQueuePresentKHR(VkQueue queue_handle, const VkPresentInfoKHR *pr
res
=
device
->
funcs
.
p_vkQueuePresentKHR
(
queue
->
host_queue
,
&
present_info_host
);
for
(
i
=
0
;
i
<
present_info
->
swapchainCount
;
i
++
)
{
struct
wine_swapchain
*
swapchain
=
wine_swapchain_from_handle
(
present_info
->
pSwapchains
[
i
]);
VkResult
swapchain_res
=
present_info
->
pResults
?
present_info
->
pResults
[
i
]
:
res
;
struct
wine_surface
*
surface
=
swapchain
->
surface
;
RECT
client_rect
;
if
(
swapchain_res
<
VK_SUCCESS
)
continue
;
if
(
!
NtUserGetClientRect
(
surface
->
hwnd
,
&
client_rect
))
{
WARN
(
"Swapchain window %p is invalid, returning VK_ERROR_OUT_OF_DATE_KHR
\n
"
,
surface
->
hwnd
);
if
(
present_info
->
pResults
)
present_info
->
pResults
[
i
]
=
VK_ERROR_OUT_OF_DATE_KHR
;
if
(
res
>=
VK_SUCCESS
)
res
=
VK_ERROR_OUT_OF_DATE_KHR
;
}
else
if
(
swapchain_res
!=
VK_SUCCESS
)
WARN
(
"Present returned status %d for swapchain %p
\n
"
,
swapchain_res
,
swapchain
);
else
if
(
!
extents_equals
(
&
swapchain
->
extents
,
&
client_rect
))
{
WARN
(
"Swapchain size %dx%d does not match client rect %s, returning VK_SUBOPTIMAL_KHR
\n
"
,
swapchain
->
extents
.
width
,
swapchain
->
extents
.
height
,
wine_dbgstr_rect
(
&
client_rect
));
if
(
present_info
->
pResults
)
present_info
->
pResults
[
i
]
=
VK_SUBOPTIMAL_KHR
;
if
(
res
==
VK_SUCCESS
)
res
=
VK_SUBOPTIMAL_KHR
;
}
}
if
(
swapchains
!=
swapchains_buffer
)
free
(
swapchains
);
if
(
TRACE_ON
(
fps
))
...
...
dlls/winevulkan/vulkan_private.h
View file @
010b497c
...
...
@@ -253,7 +253,9 @@ static inline VkSurfaceKHR wine_surface_to_handle(struct wine_surface *surface)
struct
wine_swapchain
{
struct
wine_surface
*
surface
;
/* parent */
VkSwapchainKHR
host_swapchain
;
VkExtent2D
extents
;
struct
wrapper_entry
wrapper_entry
;
};
...
...
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