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
a9ed32b0
Commit
a9ed32b0
authored
Sep 20, 2021
by
Alexandros Frantzis
Committed by
Alexandre Julliard
Nov 17, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winewayland.drv: Implement vkEnumerateInstanceExtensionProperties.
Return the native instance extension properties, substituting VK_KHR_wayland_surface for VK_KHR_win32_surface.
parent
f6e80017
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
61 additions
and
1 deletion
+61
-1
vulkan.c
dlls/winewayland.drv/vulkan.c
+61
-1
No files found.
dlls/winewayland.drv/vulkan.c
View file @
a9ed32b0
...
...
@@ -39,15 +39,75 @@ WINE_DEFAULT_DEBUG_CHANNEL(vulkan);
#ifdef SONAME_LIBVULKAN
static
VkResult
(
*
pvkEnumerateInstanceExtensionProperties
)(
const
char
*
,
uint32_t
*
,
VkExtensionProperties
*
);
static
void
*
vulkan_handle
;
static
VkResult
wayland_vkEnumerateInstanceExtensionProperties
(
const
char
*
layer_name
,
uint32_t
*
count
,
VkExtensionProperties
*
properties
)
{
unsigned
int
i
;
VkResult
res
;
TRACE
(
"layer_name %s, count %p, properties %p
\n
"
,
debugstr_a
(
layer_name
),
count
,
properties
);
/* This shouldn't get called with layer_name set, the ICD loader prevents it. */
if
(
layer_name
)
{
ERR
(
"Layer enumeration not supported from ICD.
\n
"
);
return
VK_ERROR_LAYER_NOT_PRESENT
;
}
/* We will return the same number of instance extensions reported by the host back to
* winevulkan. Along the way we may replace xlib extensions with their win32 equivalents.
* Winevulkan will perform more detailed filtering as it knows whether it has thunks
* for a particular extension.
*/
res
=
pvkEnumerateInstanceExtensionProperties
(
layer_name
,
count
,
properties
);
if
(
!
properties
||
res
<
0
)
return
res
;
for
(
i
=
0
;
i
<
*
count
;
i
++
)
{
/* For now the only wayland extension we need to fixup. Long-term we may need an array. */
if
(
!
strcmp
(
properties
[
i
].
extensionName
,
"VK_KHR_wayland_surface"
))
{
TRACE
(
"Substituting VK_KHR_wayland_surface for VK_KHR_win32_surface
\n
"
);
snprintf
(
properties
[
i
].
extensionName
,
sizeof
(
properties
[
i
].
extensionName
),
VK_KHR_WIN32_SURFACE_EXTENSION_NAME
);
properties
[
i
].
specVersion
=
VK_KHR_WIN32_SURFACE_SPEC_VERSION
;
}
}
TRACE
(
"Returning %u extensions.
\n
"
,
*
count
);
return
res
;
}
static
void
wine_vk_init
(
void
)
{
if
(
!
(
vulkan_handle
=
dlopen
(
SONAME_LIBVULKAN
,
RTLD_NOW
)))
{
ERR
(
"Failed to load %s.
\n
"
,
SONAME_LIBVULKAN
);
return
;
}
#define LOAD_FUNCPTR(f) if (!(p##f = dlsym(vulkan_handle, #f))) goto fail
LOAD_FUNCPTR
(
vkEnumerateInstanceExtensionProperties
);
#undef LOAD_FUNCPTR
return
;
fail:
dlclose
(
vulkan_handle
);
vulkan_handle
=
NULL
;
}
static
const
struct
vulkan_funcs
vulkan_funcs
;
static
const
struct
vulkan_funcs
vulkan_funcs
=
{
.
p_vkEnumerateInstanceExtensionProperties
=
wayland_vkEnumerateInstanceExtensionProperties
,
};
/**********************************************************************
* WAYLAND_wine_get_vulkan_driver
...
...
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