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
6eab8468
Commit
6eab8468
authored
Dec 04, 2023
by
Rémi Bernon
Committed by
Alexandre Julliard
Feb 19, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winevulkan: Wrap host swapchain handles.
parent
83148123
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
64 additions
and
0 deletions
+64
-0
make_vulkan
dlls/winevulkan/make_vulkan
+4
-0
vulkan.c
dlls/winevulkan/vulkan.c
+41
-0
vulkan_private.h
dlls/winevulkan/vulkan_private.h
+17
-0
vulkan_thunks.c
dlls/winevulkan/vulkan_thunks.c
+0
-0
vulkan_thunks.h
dlls/winevulkan/vulkan_thunks.h
+2
-0
No files found.
dlls/winevulkan/make_vulkan
View file @
6eab8468
...
...
@@ -225,6 +225,7 @@ MANUAL_UNIX_THUNKS = {
"vkCreateDevice"
,
"vkCreateImage"
,
"vkCreateInstance"
,
"vkCreateSwapchainKHR"
,
"vkCreateWin32SurfaceKHR"
,
"vkDestroyCommandPool"
,
"vkDestroyDebugReportCallbackEXT"
,
...
...
@@ -233,6 +234,7 @@ MANUAL_UNIX_THUNKS = {
"vkDestroyDevice"
,
"vkDestroyInstance"
,
"vkDestroySurfaceKHR"
,
"vkDestroySwapchainKHR"
,
"vkEnumerateDeviceExtensionProperties"
,
"vkEnumerateDeviceLayerProperties"
,
"vkEnumerateInstanceExtensionProperties"
,
...
...
@@ -1185,6 +1187,8 @@ class VkHandle(object):
return
"wine_queue_from_handle({0})->host_queue"
.
format
(
name
)
if
self
.
name
==
"VkSurfaceKHR"
:
return
"wine_surface_from_handle({0})->host_surface"
.
format
(
name
)
if
self
.
name
==
"VkSwapchainKHR"
:
return
"wine_swapchain_from_handle({0})->host_swapchain"
.
format
(
name
)
if
self
.
is_dispatchable
():
LOGGER
.
error
(
"Unhandled host handle for: {0}"
.
format
(
self
.
name
))
return
None
...
...
dlls/winevulkan/vulkan.c
View file @
6eab8468
...
...
@@ -1542,6 +1542,47 @@ void wine_vkDestroySurfaceKHR(VkInstance handle, VkSurfaceKHR surface,
free
(
object
);
}
VkResult
wine_vkCreateSwapchainKHR
(
VkDevice
device_handle
,
const
VkSwapchainCreateInfoKHR
*
create_info
,
const
VkAllocationCallbacks
*
allocator
,
VkSwapchainKHR
*
swapchain_handle
)
{
struct
wine_swapchain
*
object
,
*
old_swapchain
=
wine_swapchain_from_handle
(
create_info
->
oldSwapchain
);
struct
wine_surface
*
surface
=
wine_surface_from_handle
(
create_info
->
surface
);
struct
wine_device
*
device
=
wine_device_from_handle
(
device_handle
);
VkSwapchainCreateInfoKHR
create_info_host
=
*
create_info
;
VkResult
res
;
if
(
surface
)
create_info_host
.
surface
=
surface
->
driver_surface
;
if
(
old_swapchain
)
create_info_host
.
oldSwapchain
=
old_swapchain
->
host_swapchain
;
if
(
!
(
object
=
calloc
(
1
,
sizeof
(
*
object
))))
return
VK_ERROR_OUT_OF_HOST_MEMORY
;
res
=
device
->
funcs
.
p_vkCreateSwapchainKHR
(
device
->
host_device
,
&
create_info_host
,
NULL
,
&
object
->
host_swapchain
);
if
(
res
!=
VK_SUCCESS
)
{
free
(
object
);
return
res
;
}
WINE_VK_ADD_NON_DISPATCHABLE_MAPPING
(
device
->
phys_dev
->
instance
,
object
,
object
->
host_swapchain
,
object
);
*
swapchain_handle
=
wine_swapchain_to_handle
(
object
);
return
res
;
}
void
wine_vkDestroySwapchainKHR
(
VkDevice
device_handle
,
VkSwapchainKHR
swapchain_handle
,
const
VkAllocationCallbacks
*
allocator
)
{
struct
wine_device
*
device
=
wine_device_from_handle
(
device_handle
);
struct
wine_swapchain
*
swapchain
=
wine_swapchain_from_handle
(
swapchain_handle
);
if
(
allocator
)
FIXME
(
"Support for allocation callbacks not implemented yet
\n
"
);
if
(
!
swapchain
)
return
;
device
->
funcs
.
p_vkDestroySwapchainKHR
(
device
->
host_device
,
swapchain
->
host_swapchain
,
NULL
);
WINE_VK_REMOVE_HANDLE_MAPPING
(
device
->
phys_dev
->
instance
,
swapchain
);
free
(
swapchain
);
}
VkResult
wine_vkAllocateMemory
(
VkDevice
handle
,
const
VkMemoryAllocateInfo
*
alloc_info
,
const
VkAllocationCallbacks
*
allocator
,
VkDeviceMemory
*
ret
)
{
...
...
dlls/winevulkan/vulkan_private.h
View file @
6eab8468
...
...
@@ -238,6 +238,23 @@ static inline VkSurfaceKHR wine_surface_to_handle(struct wine_surface *surface)
return
(
VkSurfaceKHR
)(
uintptr_t
)
surface
;
}
struct
wine_swapchain
{
VkSwapchainKHR
host_swapchain
;
struct
wine_vk_mapping
mapping
;
};
static
inline
struct
wine_swapchain
*
wine_swapchain_from_handle
(
VkSwapchainKHR
handle
)
{
return
(
struct
wine_swapchain
*
)(
uintptr_t
)
handle
;
}
static
inline
VkSwapchainKHR
wine_swapchain_to_handle
(
struct
wine_swapchain
*
surface
)
{
return
(
VkSwapchainKHR
)(
uintptr_t
)
surface
;
}
BOOL
wine_vk_device_extension_supported
(
const
char
*
name
);
BOOL
wine_vk_instance_extension_supported
(
const
char
*
name
);
...
...
dlls/winevulkan/vulkan_thunks.c
View file @
6eab8468
This diff is collapsed.
Click to expand it.
dlls/winevulkan/vulkan_thunks.h
View file @
6eab8468
...
...
@@ -25,6 +25,7 @@ VkResult wine_vkCreateDeferredOperationKHR(VkDevice device, const VkAllocationCa
VkResult
wine_vkCreateDevice
(
VkPhysicalDevice
physicalDevice
,
const
VkDeviceCreateInfo
*
pCreateInfo
,
const
VkAllocationCallbacks
*
pAllocator
,
VkDevice
*
pDevice
,
void
*
client_ptr
);
VkResult
wine_vkCreateImage
(
VkDevice
device
,
const
VkImageCreateInfo
*
pCreateInfo
,
const
VkAllocationCallbacks
*
pAllocator
,
VkImage
*
pImage
);
VkResult
wine_vkCreateInstance
(
const
VkInstanceCreateInfo
*
pCreateInfo
,
const
VkAllocationCallbacks
*
pAllocator
,
VkInstance
*
pInstance
,
void
*
client_ptr
);
VkResult
wine_vkCreateSwapchainKHR
(
VkDevice
device
,
const
VkSwapchainCreateInfoKHR
*
pCreateInfo
,
const
VkAllocationCallbacks
*
pAllocator
,
VkSwapchainKHR
*
pSwapchain
);
VkResult
wine_vkCreateWin32SurfaceKHR
(
VkInstance
instance
,
const
VkWin32SurfaceCreateInfoKHR
*
pCreateInfo
,
const
VkAllocationCallbacks
*
pAllocator
,
VkSurfaceKHR
*
pSurface
);
void
wine_vkDestroyCommandPool
(
VkDevice
device
,
VkCommandPool
commandPool
,
const
VkAllocationCallbacks
*
pAllocator
);
void
wine_vkDestroyDebugReportCallbackEXT
(
VkInstance
instance
,
VkDebugReportCallbackEXT
callback
,
const
VkAllocationCallbacks
*
pAllocator
);
...
...
@@ -33,6 +34,7 @@ void wine_vkDestroyDeferredOperationKHR(VkDevice device, VkDeferredOperationKHR
void
wine_vkDestroyDevice
(
VkDevice
device
,
const
VkAllocationCallbacks
*
pAllocator
);
void
wine_vkDestroyInstance
(
VkInstance
instance
,
const
VkAllocationCallbacks
*
pAllocator
);
void
wine_vkDestroySurfaceKHR
(
VkInstance
instance
,
VkSurfaceKHR
surface
,
const
VkAllocationCallbacks
*
pAllocator
);
void
wine_vkDestroySwapchainKHR
(
VkDevice
device
,
VkSwapchainKHR
swapchain
,
const
VkAllocationCallbacks
*
pAllocator
);
VkResult
wine_vkEnumerateDeviceExtensionProperties
(
VkPhysicalDevice
physicalDevice
,
const
char
*
pLayerName
,
uint32_t
*
pPropertyCount
,
VkExtensionProperties
*
pProperties
);
VkResult
wine_vkEnumerateDeviceLayerProperties
(
VkPhysicalDevice
physicalDevice
,
uint32_t
*
pPropertyCount
,
VkLayerProperties
*
pProperties
);
VkResult
wine_vkEnumerateInstanceExtensionProperties
(
const
char
*
pLayerName
,
uint32_t
*
pPropertyCount
,
VkExtensionProperties
*
pProperties
);
...
...
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