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
2f41d851
Commit
2f41d851
authored
Dec 03, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Dec 05, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winevulkan: Get rid of direct Unix calls.
parent
d3ee5683
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
5 additions
and
61 deletions
+5
-61
loader.c
dlls/winevulkan/loader.c
+1
-4
loader_thunks.c
dlls/winevulkan/loader_thunks.c
+0
-0
make_vulkan
dlls/winevulkan/make_vulkan
+3
-24
vulkan.c
dlls/winevulkan/vulkan.c
+0
-21
vulkan_loader.h
dlls/winevulkan/vulkan_loader.h
+0
-3
vulkan_private.h
dlls/winevulkan/vulkan_private.h
+0
-3
vulkan_thunks.c
dlls/winevulkan/vulkan_thunks.c
+1
-6
No files found.
dlls/winevulkan/loader.c
View file @
2f41d851
...
...
@@ -35,8 +35,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(vulkan);
DEFINE_DEVPROPKEY
(
DEVPROPKEY_GPU_LUID
,
0x60b193cb
,
0x5276
,
0x4d0f
,
0x96
,
0xfc
,
0xf1
,
0x73
,
0xab
,
0xad
,
0x3e
,
0xc6
,
2
);
DEFINE_DEVPROPKEY
(
WINE_DEVPROPKEY_GPU_VULKAN_UUID
,
0x233a9ef3
,
0xafc4
,
0x4abd
,
0xb5
,
0x64
,
0xc3
,
0x2f
,
0x21
,
0xf1
,
0x53
,
0x5c
,
2
);
NTSTATUS
(
WINAPI
*
p_vk_direct_unix_call
)(
unixlib_handle_t
handle
,
unsigned
int
code
,
void
*
args
)
=
NULL
;
static
HINSTANCE
hinstance
;
static
void
*
wine_vk_get_global_proc_addr
(
const
char
*
name
);
...
...
@@ -236,9 +234,8 @@ static BOOL WINAPI wine_vk_init(INIT_ONCE *once, void *param, void **context)
{
NTSTATUS
status
=
__wine_init_unix_call
();
p_vk_direct_unix_call
=
__wine_unix_call_dispatcher
;
if
(
status
)
return
FALSE
;
return
!
vk_unix_call
(
unix_init
,
&
p_vk_direct_unix_call
);
return
!
vk_unix_call
(
unix_init
,
NULL
);
}
static
BOOL
wine_vk_init_once
(
void
)
...
...
dlls/winevulkan/loader_thunks.c
View file @
2f41d851
This diff is collapsed.
Click to expand it.
dlls/winevulkan/make_vulkan
View file @
2f41d851
...
...
@@ -149,12 +149,6 @@ ALLOWED_X_EXTENSIONS = [
"VK_NVX_image_view_handle"
,
]
# Some frequently called functions use direct calls for performance reasons.
DIRECT_CALL_FUNCTIONS
=
[
"vkUpdateDescriptorSets"
,
"vkUpdateDescriptorSetWithTemplate"
,
]
# Functions part of our winevulkan graphics driver interface.
# DRIVER_VERSION should be bumped on any change to driver interface
# in FUNCTION_OVERRIDES
...
...
@@ -679,12 +673,6 @@ class VkFunction(object):
# The function needs exposed if at-least one extension isn't both UNSUPPORTED and UNEXPOSED
return
self
.
is_required
()
and
(
not
self
.
extensions
or
not
self
.
extensions
.
issubset
(
UNEXPOSED_EXTENSIONS
))
def
needs_direct_call
(
self
):
# vkCmd* functions are frequently called, use direct calls for performance
if
self
.
name
.
startswith
(
"vkCmd"
):
return
True
return
self
.
name
in
DIRECT_CALL_FUNCTIONS
def
pfn
(
self
,
prefix
=
"p"
,
call_conv
=
None
):
""" Create function pointer. """
...
...
@@ -747,13 +735,9 @@ class VkFunction(object):
body
+=
" NTSTATUS status;
\n
"
for
p
in
self
.
params
:
body
+=
" params.{0} = {0};
\n
"
.
format
(
p
.
name
)
body
+=
" "
;
# Call the Unix function.
if
self
.
needs_direct_call
():
body
+=
"status = p_vk_direct_unix_call(__wine_unixlib_handle, unix_{0}, ¶ms);
\n
"
.
format
(
self
.
name
)
else
:
body
+=
"status = vk_unix_call(unix_{0}, ¶ms);
\n
"
.
format
(
self
.
name
)
body
+=
" status = vk_unix_call(unix_{0}, ¶ms);
\n
"
.
format
(
self
.
name
)
body
+=
" assert(!status);
\n
"
if
self
.
type
!=
"void"
:
body
+=
" return params.result;
\n
"
...
...
@@ -2733,7 +2717,7 @@ class VkGenerator(object):
f
.
write
(
"const unixlib_entry_t __wine_unix_call_funcs[] =
\n
"
)
f
.
write
(
"#endif
\n
"
)
f
.
write
(
"{
\n
"
)
f
.
write
(
" init_vulkan
32
,
\n
"
)
f
.
write
(
" init_vulkan,
\n
"
)
f
.
write
(
" vk_is_available_instance_function32,
\n
"
)
f
.
write
(
" vk_is_available_device_function32,
\n
"
)
for
vk_func
in
self
.
registry
.
funcs
.
values
():
...
...
@@ -2744,12 +2728,7 @@ class VkGenerator(object):
f
.
write
(
" {1}{0},
\n
"
.
format
(
vk_func
.
name
,
"thunk32_"
))
f
.
write
(
"};
\n
"
)
f
.
write
(
"C_ASSERT(ARRAYSIZE(__wine_unix_call_funcs) == unix_count);
\n\n
"
)
f
.
write
(
"NTSTATUS WINAPI vk_direct_unix_call(unixlib_handle_t handle, unsigned int code, void *params)
\n
"
)
f
.
write
(
"{
\n
"
)
f
.
write
(
" return __wine_unix_call_funcs[code](params);
\n
"
)
f
.
write
(
"}
\n
"
)
f
.
write
(
"C_ASSERT(ARRAYSIZE(__wine_unix_call_funcs) == unix_count);
\n
"
)
def
generate_thunks_h
(
self
,
f
,
prefix
):
self
.
_generate_copyright
(
f
)
...
...
dlls/winevulkan/vulkan.c
View file @
2f41d851
...
...
@@ -462,8 +462,6 @@ static void wine_vk_device_free(struct wine_device *device)
free
(
device
);
}
#ifdef _WIN64
NTSTATUS
init_vulkan
(
void
*
args
)
{
vk_funcs
=
__wine_get_vulkan_driver
(
WINE_VULKAN_DRIVER_VERSION
);
...
...
@@ -473,25 +471,6 @@ NTSTATUS init_vulkan(void *args)
return
STATUS_UNSUCCESSFUL
;
}
*
(
void
**
)
args
=
vk_direct_unix_call
;
return
STATUS_SUCCESS
;
}
#endif
/* _WIN64 */
NTSTATUS
init_vulkan32
(
void
*
args
)
{
vk_funcs
=
__wine_get_vulkan_driver
(
WINE_VULKAN_DRIVER_VERSION
);
if
(
!
vk_funcs
)
{
ERR
(
"Failed to load Wine graphics driver supporting Vulkan.
\n
"
);
return
STATUS_UNSUCCESSFUL
;
}
#ifndef _WIN64
*
(
void
**
)
args
=
vk_direct_unix_call
;
#endif
return
STATUS_SUCCESS
;
}
...
...
dlls/winevulkan/vulkan_loader.h
View file @
2f41d851
...
...
@@ -147,9 +147,6 @@ struct is_available_device_function_params
#ifndef WINE_UNIX_LIB
extern
NTSTATUS
(
WINAPI
*
p_vk_direct_unix_call
)(
unixlib_handle_t
handle
,
unsigned
int
code
,
void
*
args
)
DECLSPEC_HIDDEN
;
static
inline
NTSTATUS
vk_unix_call
(
enum
unix_call
code
,
void
*
params
)
{
return
WINE_UNIX_CALL
(
code
,
params
);
...
...
dlls/winevulkan/vulkan_private.h
View file @
2f41d851
...
...
@@ -243,9 +243,6 @@ BOOL wine_vk_instance_extension_supported(const char *name) DECLSPEC_HIDDEN;
BOOL
wine_vk_is_type_wrapped
(
VkObjectType
type
)
DECLSPEC_HIDDEN
;
NTSTATUS
init_vulkan
(
void
*
args
)
DECLSPEC_HIDDEN
;
NTSTATUS
init_vulkan32
(
void
*
args
)
DECLSPEC_HIDDEN
;
NTSTATUS
WINAPI
vk_direct_unix_call
(
unixlib_handle_t
handle
,
unsigned
int
code
,
void
*
arg
)
DECLSPEC_HIDDEN
;
NTSTATUS
vk_is_available_instance_function
(
void
*
arg
)
DECLSPEC_HIDDEN
;
NTSTATUS
vk_is_available_device_function
(
void
*
arg
)
DECLSPEC_HIDDEN
;
...
...
dlls/winevulkan/vulkan_thunks.c
View file @
2f41d851
...
...
@@ -41789,7 +41789,7 @@ const unixlib_entry_t __wine_unix_call_wow64_funcs[] =
const
unixlib_entry_t
__wine_unix_call_funcs
[]
=
#endif
{
init_vulkan
32
,
init_vulkan
,
vk_is_available_instance_function32
,
vk_is_available_device_function32
,
thunk32_vkAcquireNextImage2KHR
,
...
...
@@ -42320,8 +42320,3 @@ const unixlib_entry_t __wine_unix_call_funcs[] =
thunk32_vkWriteMicromapsPropertiesEXT
,
};
C_ASSERT
(
ARRAYSIZE
(
__wine_unix_call_funcs
)
==
unix_count
);
NTSTATUS
WINAPI
vk_direct_unix_call
(
unixlib_handle_t
handle
,
unsigned
int
code
,
void
*
params
)
{
return
__wine_unix_call_funcs
[
code
](
params
);
}
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