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
e9200b18
Commit
e9200b18
authored
Apr 05, 2024
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 vkAcquireNextImage(2)KHR after resize.
parent
010b497c
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
58 additions
and
24 deletions
+58
-24
make_vulkan
dlls/winevulkan/make_vulkan
+2
-0
vulkan.c
dlls/winevulkan/vulkan.c
+47
-0
vulkan_thunks.c
dlls/winevulkan/vulkan_thunks.c
+7
-24
vulkan_thunks.h
dlls/winevulkan/vulkan_thunks.h
+2
-0
No files found.
dlls/winevulkan/make_vulkan
View file @
e9200b18
...
...
@@ -208,6 +208,8 @@ USER_DRIVER_FUNCS = {
# functions for which the unix thunk is manually implemented
MANUAL_UNIX_THUNKS
=
{
"vkAcquireNextImage2KHR"
,
"vkAcquireNextImageKHR"
,
"vkAllocateCommandBuffers"
,
"vkAllocateMemory"
,
"vkCreateBuffer"
,
...
...
dlls/winevulkan/vulkan.c
View file @
e9200b18
...
...
@@ -1630,6 +1630,53 @@ static BOOL extents_equals(const VkExtent2D *extents, const RECT *rect)
extents
->
height
==
rect
->
bottom
-
rect
->
top
;
}
VkResult
wine_vkAcquireNextImage2KHR
(
VkDevice
device_handle
,
const
VkAcquireNextImageInfoKHR
*
acquire_info
,
uint32_t
*
image_index
)
{
struct
wine_swapchain
*
swapchain
=
wine_swapchain_from_handle
(
acquire_info
->
swapchain
);
struct
wine_device
*
device
=
wine_device_from_handle
(
device_handle
);
VkAcquireNextImageInfoKHR
acquire_info_host
=
*
acquire_info
;
struct
wine_surface
*
surface
=
swapchain
->
surface
;
RECT
client_rect
;
VkResult
res
;
acquire_info_host
.
swapchain
=
swapchain
->
host_swapchain
;
res
=
device
->
funcs
.
p_vkAcquireNextImage2KHR
(
device
->
host_device
,
&
acquire_info_host
,
image_index
);
if
(
res
==
VK_SUCCESS
&&
NtUserGetClientRect
(
surface
->
hwnd
,
&
client_rect
)
&&
!
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
));
return
VK_SUBOPTIMAL_KHR
;
}
return
res
;
}
VkResult
wine_vkAcquireNextImageKHR
(
VkDevice
device_handle
,
VkSwapchainKHR
swapchain_handle
,
uint64_t
timeout
,
VkSemaphore
semaphore
,
VkFence
fence
,
uint32_t
*
image_index
)
{
struct
wine_swapchain
*
swapchain
=
wine_swapchain_from_handle
(
swapchain_handle
);
struct
wine_device
*
device
=
wine_device_from_handle
(
device_handle
);
struct
wine_surface
*
surface
=
swapchain
->
surface
;
RECT
client_rect
;
VkResult
res
;
res
=
device
->
funcs
.
p_vkAcquireNextImageKHR
(
device
->
host_device
,
swapchain
->
host_swapchain
,
timeout
,
semaphore
,
fence
,
image_index
);
if
(
res
==
VK_SUCCESS
&&
NtUserGetClientRect
(
surface
->
hwnd
,
&
client_rect
)
&&
!
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
));
return
VK_SUBOPTIMAL_KHR
;
}
return
res
;
}
VkResult
wine_vkCreateSwapchainKHR
(
VkDevice
device_handle
,
const
VkSwapchainCreateInfoKHR
*
create_info
,
const
VkAllocationCallbacks
*
allocator
,
VkSwapchainKHR
*
swapchain_handle
)
{
...
...
dlls/winevulkan/vulkan_thunks.c
View file @
e9200b18
...
...
@@ -7112,28 +7112,13 @@ static uint64_t wine_vk_unwrap_handle(uint32_t type, uint64_t handle)
}
}
#ifdef _WIN64
static
inline
void
convert_VkAcquireNextImageInfoKHR_win64_to_host
(
const
VkAcquireNextImageInfoKHR
*
in
,
VkAcquireNextImageInfoKHR
*
out
)
{
if
(
!
in
)
return
;
out
->
sType
=
in
->
sType
;
out
->
pNext
=
in
->
pNext
;
out
->
swapchain
=
wine_swapchain_from_handle
(
in
->
swapchain
)
->
host_swapchain
;
out
->
timeout
=
in
->
timeout
;
out
->
semaphore
=
in
->
semaphore
;
out
->
fence
=
in
->
fence
;
out
->
deviceMask
=
in
->
deviceMask
;
}
#endif
/* _WIN64 */
static
inline
void
convert_VkAcquireNextImageInfoKHR_win32_to_host
(
const
VkAcquireNextImageInfoKHR32
*
in
,
VkAcquireNextImageInfoKHR
*
out
)
static
inline
void
convert_VkAcquireNextImageInfoKHR_win32_to_unwrapped_host
(
const
VkAcquireNextImageInfoKHR32
*
in
,
VkAcquireNextImageInfoKHR
*
out
)
{
if
(
!
in
)
return
;
out
->
sType
=
in
->
sType
;
out
->
pNext
=
NULL
;
out
->
swapchain
=
wine_swapchain_from_handle
(
in
->
swapchain
)
->
host_
swapchain
;
out
->
swapchain
=
in
->
swapchain
;
out
->
timeout
=
in
->
timeout
;
out
->
semaphore
=
in
->
semaphore
;
out
->
fence
=
in
->
fence
;
...
...
@@ -30193,12 +30178,10 @@ static inline void convert_VkSemaphoreWaitInfo_win32_to_host(const VkSemaphoreWa
static
NTSTATUS
thunk64_vkAcquireNextImage2KHR
(
void
*
args
)
{
struct
vkAcquireNextImage2KHR_params
*
params
=
args
;
VkAcquireNextImageInfoKHR
pAcquireInfo_host
;
TRACE
(
"%p, %p, %p
\n
"
,
params
->
device
,
params
->
pAcquireInfo
,
params
->
pImageIndex
);
convert_VkAcquireNextImageInfoKHR_win64_to_host
(
params
->
pAcquireInfo
,
&
pAcquireInfo_host
);
params
->
result
=
wine_device_from_handle
(
params
->
device
)
->
funcs
.
p_vkAcquireNextImage2KHR
(
wine_device_from_handle
(
params
->
device
)
->
host_device
,
&
pAcquireInfo_host
,
params
->
pImageIndex
);
params
->
result
=
wine_vkAcquireNextImage2KHR
(
params
->
device
,
params
->
pAcquireInfo
,
params
->
pImageIndex
);
return
STATUS_SUCCESS
;
}
#endif
/* _WIN64 */
...
...
@@ -30216,8 +30199,8 @@ static NTSTATUS thunk32_vkAcquireNextImage2KHR(void *args)
TRACE
(
"%#x, %#x, %#x
\n
"
,
params
->
device
,
params
->
pAcquireInfo
,
params
->
pImageIndex
);
convert_VkAcquireNextImageInfoKHR_win32_to_host
((
const
VkAcquireNextImageInfoKHR32
*
)
UlongToPtr
(
params
->
pAcquireInfo
),
&
pAcquireInfo_host
);
params
->
result
=
wine_
device_from_handle
((
VkDevice
)
UlongToPtr
(
params
->
device
))
->
funcs
.
p_vkAcquireNextImage2KHR
(
wine_device_from_handle
((
VkDevice
)
UlongToPtr
(
params
->
device
))
->
host_device
,
&
pAcquireInfo_host
,
(
uint32_t
*
)
UlongToPtr
(
params
->
pImageIndex
));
convert_VkAcquireNextImageInfoKHR_win32_to_
unwrapped_
host
((
const
VkAcquireNextImageInfoKHR32
*
)
UlongToPtr
(
params
->
pAcquireInfo
),
&
pAcquireInfo_host
);
params
->
result
=
wine_
vkAcquireNextImage2KHR
((
VkDevice
)
UlongToPtr
(
params
->
device
)
,
&
pAcquireInfo_host
,
(
uint32_t
*
)
UlongToPtr
(
params
->
pImageIndex
));
return
STATUS_SUCCESS
;
}
...
...
@@ -30228,7 +30211,7 @@ static NTSTATUS thunk64_vkAcquireNextImageKHR(void *args)
TRACE
(
"%p, 0x%s, 0x%s, 0x%s, 0x%s, %p
\n
"
,
params
->
device
,
wine_dbgstr_longlong
(
params
->
swapchain
),
wine_dbgstr_longlong
(
params
->
timeout
),
wine_dbgstr_longlong
(
params
->
semaphore
),
wine_dbgstr_longlong
(
params
->
fence
),
params
->
pImageIndex
);
params
->
result
=
wine_
device_from_handle
(
params
->
device
)
->
funcs
.
p_vkAcquireNextImageKHR
(
wine_device_from_handle
(
params
->
device
)
->
host_device
,
wine_swapchain_from_handle
(
params
->
swapchain
)
->
host_
swapchain
,
params
->
timeout
,
params
->
semaphore
,
params
->
fence
,
params
->
pImageIndex
);
params
->
result
=
wine_
vkAcquireNextImageKHR
(
params
->
device
,
params
->
swapchain
,
params
->
timeout
,
params
->
semaphore
,
params
->
fence
,
params
->
pImageIndex
);
return
STATUS_SUCCESS
;
}
#endif
/* _WIN64 */
...
...
@@ -30248,7 +30231,7 @@ static NTSTATUS thunk32_vkAcquireNextImageKHR(void *args)
TRACE
(
"%#x, 0x%s, 0x%s, 0x%s, 0x%s, %#x
\n
"
,
params
->
device
,
wine_dbgstr_longlong
(
params
->
swapchain
),
wine_dbgstr_longlong
(
params
->
timeout
),
wine_dbgstr_longlong
(
params
->
semaphore
),
wine_dbgstr_longlong
(
params
->
fence
),
params
->
pImageIndex
);
params
->
result
=
wine_
device_from_handle
((
VkDevice
)
UlongToPtr
(
params
->
device
))
->
funcs
.
p_vkAcquireNextImageKHR
(
wine_device_from_handle
((
VkDevice
)
UlongToPtr
(
params
->
device
))
->
host_device
,
wine_swapchain_from_handle
(
params
->
swapchain
)
->
host_
swapchain
,
params
->
timeout
,
params
->
semaphore
,
params
->
fence
,
(
uint32_t
*
)
UlongToPtr
(
params
->
pImageIndex
));
params
->
result
=
wine_
vkAcquireNextImageKHR
((
VkDevice
)
UlongToPtr
(
params
->
device
),
params
->
swapchain
,
params
->
timeout
,
params
->
semaphore
,
params
->
fence
,
(
uint32_t
*
)
UlongToPtr
(
params
->
pImageIndex
));
return
STATUS_SUCCESS
;
}
dlls/winevulkan/vulkan_thunks.h
View file @
e9200b18
...
...
@@ -15,6 +15,8 @@
#define WINE_VK_VERSION VK_API_VERSION_1_3
/* Functions for which we have custom implementations outside of the thunks. */
VkResult
wine_vkAcquireNextImage2KHR
(
VkDevice
device
,
const
VkAcquireNextImageInfoKHR
*
pAcquireInfo
,
uint32_t
*
pImageIndex
);
VkResult
wine_vkAcquireNextImageKHR
(
VkDevice
device
,
VkSwapchainKHR
swapchain
,
uint64_t
timeout
,
VkSemaphore
semaphore
,
VkFence
fence
,
uint32_t
*
pImageIndex
);
VkResult
wine_vkAllocateCommandBuffers
(
VkDevice
device
,
const
VkCommandBufferAllocateInfo
*
pAllocateInfo
,
VkCommandBuffer
*
pCommandBuffers
);
VkResult
wine_vkAllocateMemory
(
VkDevice
device
,
const
VkMemoryAllocateInfo
*
pAllocateInfo
,
const
VkAllocationCallbacks
*
pAllocator
,
VkDeviceMemory
*
pMemory
);
VkResult
wine_vkCreateBuffer
(
VkDevice
device
,
const
VkBufferCreateInfo
*
pCreateInfo
,
const
VkAllocationCallbacks
*
pAllocator
,
VkBuffer
*
pBuffer
);
...
...
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