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
249c21cf
Commit
249c21cf
authored
Sep 17, 2021
by
Alexandros Frantzis
Committed by
Alexandre Julliard
Nov 22, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winewayland.drv: Implement vkCreateSwapchainKHR.
parent
d97b55c3
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
0 deletions
+46
-0
vulkan.c
dlls/winewayland.drv/vulkan.c
+46
-0
No files found.
dlls/winewayland.drv/vulkan.c
View file @
249c21cf
...
...
@@ -52,6 +52,7 @@ typedef struct VkWaylandSurfaceCreateInfoKHR
}
VkWaylandSurfaceCreateInfoKHR
;
static
VkResult
(
*
pvkCreateInstance
)(
const
VkInstanceCreateInfo
*
,
const
VkAllocationCallbacks
*
,
VkInstance
*
);
static
VkResult
(
*
pvkCreateSwapchainKHR
)(
VkDevice
,
const
VkSwapchainCreateInfoKHR
*
,
const
VkAllocationCallbacks
*
,
VkSwapchainKHR
*
);
static
VkResult
(
*
pvkCreateWaylandSurfaceKHR
)(
VkInstance
,
const
VkWaylandSurfaceCreateInfoKHR
*
,
const
VkAllocationCallbacks
*
,
VkSurfaceKHR
*
);
static
void
(
*
pvkDestroyInstance
)(
VkInstance
,
const
VkAllocationCallbacks
*
);
static
void
(
*
pvkDestroySurfaceKHR
)(
VkInstance
,
VkSurfaceKHR
,
const
VkAllocationCallbacks
*
);
...
...
@@ -226,6 +227,49 @@ static VkResult wayland_vkCreateInstance(const VkInstanceCreateInfo *create_info
return
res
;
}
static
VkResult
wayland_vkCreateSwapchainKHR
(
VkDevice
device
,
const
VkSwapchainCreateInfoKHR
*
create_info
,
const
VkAllocationCallbacks
*
allocator
,
VkSwapchainKHR
*
swapchain
)
{
VkResult
res
;
VkSwapchainCreateInfoKHR
create_info_host
;
struct
wine_vk_surface
*
wine_vk_surface
;
TRACE
(
"%p %p %p %p
\n
"
,
device
,
create_info
,
allocator
,
swapchain
);
if
(
allocator
)
FIXME
(
"Support for allocation callbacks not implemented yet
\n
"
);
wine_vk_surface
=
wine_vk_surface_from_handle
(
create_info
->
surface
);
if
(
!
wine_vk_surface_is_valid
(
wine_vk_surface
))
return
VK_ERROR_SURFACE_LOST_KHR
;
create_info_host
=
*
create_info
;
create_info_host
.
surface
=
wine_vk_surface
->
native
;
/* Some apps do not properly handle a 0x0 image extent in capabilities,
* and erroneously try to create a swapchain with it, so use the minimum
* 1x1 to accommodate them. */
if
(
create_info_host
.
imageExtent
.
width
==
0
||
create_info_host
.
imageExtent
.
height
==
0
)
{
create_info_host
.
imageExtent
.
width
=
1
;
create_info_host
.
imageExtent
.
height
=
1
;
}
res
=
pvkCreateSwapchainKHR
(
device
,
&
create_info_host
,
NULL
/* allocator */
,
swapchain
);
if
(
res
!=
VK_SUCCESS
)
{
ERR
(
"Failed to create vulkan wayland swapchain, res=%d
\n
"
,
res
);
return
res
;
}
TRACE
(
"Created swapchain=0x%s
\n
"
,
wine_dbgstr_longlong
(
*
swapchain
));
return
res
;
}
static
VkResult
wayland_vkCreateWin32SurfaceKHR
(
VkInstance
instance
,
const
VkWin32SurfaceCreateInfoKHR
*
create_info
,
const
VkAllocationCallbacks
*
allocator
,
...
...
@@ -554,6 +598,7 @@ static void wine_vk_init(void)
#define LOAD_FUNCPTR(f) if (!(p##f = dlsym(vulkan_handle, #f))) goto fail
#define LOAD_OPTIONAL_FUNCPTR(f) p##f = dlsym(vulkan_handle, #f)
LOAD_FUNCPTR
(
vkCreateInstance
);
LOAD_FUNCPTR
(
vkCreateSwapchainKHR
);
LOAD_FUNCPTR
(
vkCreateWaylandSurfaceKHR
);
LOAD_FUNCPTR
(
vkDestroyInstance
);
LOAD_FUNCPTR
(
vkDestroySurfaceKHR
);
...
...
@@ -578,6 +623,7 @@ fail:
static
const
struct
vulkan_funcs
vulkan_funcs
=
{
.
p_vkCreateInstance
=
wayland_vkCreateInstance
,
.
p_vkCreateSwapchainKHR
=
wayland_vkCreateSwapchainKHR
,
.
p_vkCreateWin32SurfaceKHR
=
wayland_vkCreateWin32SurfaceKHR
,
.
p_vkDestroyInstance
=
wayland_vkDestroyInstance
,
.
p_vkDestroySurfaceKHR
=
wayland_vkDestroySurfaceKHR
,
...
...
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