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
de4edeaa
Commit
de4edeaa
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: Add a manual vkQueuePresent wrapper.
parent
fa23650f
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
61 deletions
+35
-61
make_vulkan
dlls/winevulkan/make_vulkan
+1
-0
vulkan.c
dlls/winevulkan/vulkan.c
+28
-0
vulkan_thunks.c
dlls/winevulkan/vulkan_thunks.c
+5
-61
vulkan_thunks.h
dlls/winevulkan/vulkan_thunks.h
+1
-0
No files found.
dlls/winevulkan/make_vulkan
View file @
de4edeaa
...
...
@@ -260,6 +260,7 @@ MANUAL_UNIX_THUNKS = {
"vkGetPhysicalDeviceSurfaceFormats2KHR"
,
"vkMapMemory"
,
"vkMapMemory2KHR"
,
"vkQueuePresentKHR"
,
"vkUnmapMemory"
,
"vkUnmapMemory2KHR"
,
}
...
...
dlls/winevulkan/vulkan.c
View file @
de4edeaa
...
...
@@ -1680,6 +1680,34 @@ void wine_vkDestroySwapchainKHR(VkDevice device_handle, VkSwapchainKHR swapchain
free
(
swapchain
);
}
VkResult
wine_vkQueuePresentKHR
(
VkQueue
queue_handle
,
const
VkPresentInfoKHR
*
present_info
)
{
VkSwapchainKHR
swapchains_buffer
[
16
],
*
swapchains
=
swapchains_buffer
;
struct
wine_queue
*
queue
=
wine_queue_from_handle
(
queue_handle
);
VkPresentInfoKHR
present_info_host
=
*
present_info
;
struct
wine_device
*
device
=
queue
->
device
;
VkResult
res
;
UINT
i
;
if
(
present_info
->
swapchainCount
>
ARRAY_SIZE
(
swapchains_buffer
)
&&
!
(
swapchains
=
malloc
(
present_info
->
swapchainCount
*
sizeof
(
*
swapchains
))))
return
VK_ERROR_OUT_OF_HOST_MEMORY
;
for
(
i
=
0
;
i
<
present_info
->
swapchainCount
;
i
++
)
{
struct
wine_swapchain
*
swapchain
=
wine_swapchain_from_handle
(
present_info
->
pSwapchains
[
i
]);
swapchains
[
i
]
=
swapchain
->
host_swapchain
;
}
present_info_host
.
pSwapchains
=
swapchains
;
res
=
device
->
funcs
.
p_vkQueuePresentKHR
(
queue
->
host_queue
,
&
present_info_host
);
if
(
swapchains
!=
swapchains_buffer
)
free
(
swapchains
);
return
res
;
}
VkResult
wine_vkAllocateMemory
(
VkDevice
handle
,
const
VkMemoryAllocateInfo
*
alloc_info
,
const
VkAllocationCallbacks
*
allocator
,
VkDeviceMemory
*
ret
)
{
...
...
dlls/winevulkan/vulkan_thunks.c
View file @
de4edeaa
...
...
@@ -29299,57 +29299,7 @@ static inline const VkPresentRegionKHR *convert_VkPresentRegionKHR_array_win32_t
return
out
;
}
#ifdef _WIN64
static
inline
const
VkSwapchainKHR
*
convert_VkSwapchainKHR_array_win64_to_driver
(
struct
conversion_context
*
ctx
,
const
VkSwapchainKHR
*
in
,
uint32_t
count
)
{
VkSwapchainKHR
*
out
;
unsigned
int
i
;
if
(
!
in
||
!
count
)
return
NULL
;
out
=
conversion_context_alloc
(
ctx
,
count
*
sizeof
(
*
out
));
for
(
i
=
0
;
i
<
count
;
i
++
)
{
out
[
i
]
=
wine_swapchain_from_handle
(
in
[
i
])
->
host_swapchain
;
}
return
out
;
}
#endif
/* _WIN64 */
static
inline
const
VkSwapchainKHR
*
convert_VkSwapchainKHR_array_win32_to_driver
(
struct
conversion_context
*
ctx
,
const
VkSwapchainKHR
*
in
,
uint32_t
count
)
{
VkSwapchainKHR
*
out
;
unsigned
int
i
;
if
(
!
in
||
!
count
)
return
NULL
;
out
=
conversion_context_alloc
(
ctx
,
count
*
sizeof
(
*
out
));
for
(
i
=
0
;
i
<
count
;
i
++
)
{
out
[
i
]
=
wine_swapchain_from_handle
(
in
[
i
])
->
host_swapchain
;
}
return
out
;
}
#ifdef _WIN64
static
inline
void
convert_VkPresentInfoKHR_win64_to_driver
(
struct
conversion_context
*
ctx
,
const
VkPresentInfoKHR
*
in
,
VkPresentInfoKHR
*
out
)
{
if
(
!
in
)
return
;
out
->
sType
=
in
->
sType
;
out
->
pNext
=
in
->
pNext
;
out
->
waitSemaphoreCount
=
in
->
waitSemaphoreCount
;
out
->
pWaitSemaphores
=
in
->
pWaitSemaphores
;
out
->
swapchainCount
=
in
->
swapchainCount
;
out
->
pSwapchains
=
convert_VkSwapchainKHR_array_win64_to_driver
(
ctx
,
in
->
pSwapchains
,
in
->
swapchainCount
);
out
->
pImageIndices
=
in
->
pImageIndices
;
out
->
pResults
=
in
->
pResults
;
}
#endif
/* _WIN64 */
static
inline
void
convert_VkPresentInfoKHR_win32_to_driver
(
struct
conversion_context
*
ctx
,
const
VkPresentInfoKHR32
*
in
,
VkPresentInfoKHR
*
out
)
static
inline
void
convert_VkPresentInfoKHR_win32_to_unwrapped_host
(
struct
conversion_context
*
ctx
,
const
VkPresentInfoKHR32
*
in
,
VkPresentInfoKHR
*
out
)
{
const
VkBaseInStructure32
*
in_header
;
VkBaseOutStructure
*
out_header
=
(
void
*
)
out
;
...
...
@@ -29361,7 +29311,7 @@ static inline void convert_VkPresentInfoKHR_win32_to_driver(struct conversion_co
out
->
waitSemaphoreCount
=
in
->
waitSemaphoreCount
;
out
->
pWaitSemaphores
=
(
const
VkSemaphore
*
)
UlongToPtr
(
in
->
pWaitSemaphores
);
out
->
swapchainCount
=
in
->
swapchainCount
;
out
->
pSwapchains
=
convert_VkSwapchainKHR_array_win32_to_driver
(
ctx
,
(
const
VkSwapchainKHR
*
)
UlongToPtr
(
in
->
pSwapchains
),
in
->
swapchainCount
);
out
->
pSwapchains
=
(
const
VkSwapchainKHR
*
)
UlongToPtr
(
in
->
pSwapchains
);
out
->
pImageIndices
=
(
const
uint32_t
*
)
UlongToPtr
(
in
->
pImageIndices
);
out
->
pResults
=
(
VkResult
*
)
UlongToPtr
(
in
->
pResults
);
...
...
@@ -45145,16 +45095,10 @@ static NTSTATUS thunk32_vkQueueNotifyOutOfBandNV(void *args)
static
NTSTATUS
thunk64_vkQueuePresentKHR
(
void
*
args
)
{
struct
vkQueuePresentKHR_params
*
params
=
args
;
VkPresentInfoKHR
pPresentInfo_host
;
struct
conversion_context
local_ctx
;
struct
conversion_context
*
ctx
=
&
local_ctx
;
TRACE
(
"%p, %p
\n
"
,
params
->
queue
,
params
->
pPresentInfo
);
init_conversion_context
(
ctx
);
convert_VkPresentInfoKHR_win64_to_driver
(
ctx
,
params
->
pPresentInfo
,
&
pPresentInfo_host
);
params
->
result
=
wine_queue_from_handle
(
params
->
queue
)
->
device
->
funcs
.
p_vkQueuePresentKHR
(
wine_queue_from_handle
(
params
->
queue
)
->
host_queue
,
&
pPresentInfo_host
);
free_conversion_context
(
ctx
);
params
->
result
=
wine_vkQueuePresentKHR
(
params
->
queue
,
params
->
pPresentInfo
);
return
STATUS_SUCCESS
;
}
#endif
/* _WIN64 */
...
...
@@ -45174,8 +45118,8 @@ static NTSTATUS thunk32_vkQueuePresentKHR(void *args)
TRACE
(
"%#x, %#x
\n
"
,
params
->
queue
,
params
->
pPresentInfo
);
init_conversion_context
(
ctx
);
convert_VkPresentInfoKHR_win32_to_
driver
(
ctx
,
(
const
VkPresentInfoKHR32
*
)
UlongToPtr
(
params
->
pPresentInfo
),
&
pPresentInfo_host
);
params
->
result
=
wine_
queue_from_handle
((
VkQueue
)
UlongToPtr
(
params
->
queue
))
->
device
->
funcs
.
p_vkQueuePresentKHR
(
wine_queue_from_handle
((
VkQueue
)
UlongToPtr
(
params
->
queue
))
->
host_queue
,
&
pPresentInfo_host
);
convert_VkPresentInfoKHR_win32_to_
unwrapped_host
(
ctx
,
(
const
VkPresentInfoKHR32
*
)
UlongToPtr
(
params
->
pPresentInfo
),
&
pPresentInfo_host
);
params
->
result
=
wine_
vkQueuePresentKHR
((
VkQueue
)
UlongToPtr
(
params
->
queue
)
,
&
pPresentInfo_host
);
free_conversion_context
(
ctx
);
return
STATUS_SUCCESS
;
}
dlls/winevulkan/vulkan_thunks.h
View file @
de4edeaa
...
...
@@ -64,6 +64,7 @@ VkResult wine_vkGetPhysicalDeviceSurfaceCapabilitiesKHR(VkPhysicalDevice physica
VkResult
wine_vkGetPhysicalDeviceSurfaceFormats2KHR
(
VkPhysicalDevice
physicalDevice
,
const
VkPhysicalDeviceSurfaceInfo2KHR
*
pSurfaceInfo
,
uint32_t
*
pSurfaceFormatCount
,
VkSurfaceFormat2KHR
*
pSurfaceFormats
);
VkResult
wine_vkMapMemory
(
VkDevice
device
,
VkDeviceMemory
memory
,
VkDeviceSize
offset
,
VkDeviceSize
size
,
VkMemoryMapFlags
flags
,
void
**
ppData
);
VkResult
wine_vkMapMemory2KHR
(
VkDevice
device
,
const
VkMemoryMapInfoKHR
*
pMemoryMapInfo
,
void
**
ppData
);
VkResult
wine_vkQueuePresentKHR
(
VkQueue
queue
,
const
VkPresentInfoKHR
*
pPresentInfo
);
void
wine_vkUnmapMemory
(
VkDevice
device
,
VkDeviceMemory
memory
);
VkResult
wine_vkUnmapMemory2KHR
(
VkDevice
device
,
const
VkMemoryUnmapInfoKHR
*
pMemoryUnmapInfo
);
...
...
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