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
a5e39c42
Commit
a5e39c42
authored
Aug 31, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Sep 26, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winevulkan: Separate 32-bit and 64-bit thunks implementation.
parent
0456e3c9
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
15 deletions
+38
-15
make_vulkan
dlls/winevulkan/make_vulkan
+38
-15
vulkan_thunks.c
dlls/winevulkan/vulkan_thunks.c
+0
-0
No files found.
dlls/winevulkan/make_vulkan
View file @
a5e39c42
...
@@ -894,7 +894,7 @@ class VkFunction(object):
...
@@ -894,7 +894,7 @@ class VkFunction(object):
stub
+=
"}
\n\n
"
stub
+=
"}
\n\n
"
return
stub
return
stub
def
thunk
(
self
,
prefix
=
None
):
def
thunk
(
self
,
prefix
=
None
,
conv
=
False
):
if
prefix
==
"thunk_"
:
if
prefix
==
"thunk_"
:
thunk
=
self
.
prototype
(
prefix
=
prefix
)
thunk
=
self
.
prototype
(
prefix
=
prefix
)
thunk
+=
"
\n
{
\n
"
thunk
+=
"
\n
{
\n
"
...
@@ -905,15 +905,8 @@ class VkFunction(object):
...
@@ -905,15 +905,8 @@ class VkFunction(object):
thunk
+=
" struct {0}_params *params = args;
\n
"
.
format
(
self
.
name
)
thunk
+=
" struct {0}_params *params = args;
\n
"
.
format
(
self
.
name
)
params_prefix
=
"params->"
params_prefix
=
"params->"
if
self
.
needs_conversion
():
if
conv
and
self
.
needs_conversion
():
thunk
+=
"#if defined(USE_STRUCT_CONVERSION)
\n
"
thunk
+=
self
.
body_conversion
(
conv
=
True
,
params_prefix
=
params_prefix
)
thunk
+=
self
.
body_conversion
(
conv
=
True
,
params_prefix
=
params_prefix
)
thunk
+=
"#else
\n
"
if
self
.
needs_unwrapping
():
thunk
+=
self
.
body_conversion
(
conv
=
False
,
params_prefix
=
params_prefix
)
else
:
thunk
+=
self
.
body
(
params_prefix
=
params_prefix
)
thunk
+=
"#endif
\n
"
elif
self
.
needs_unwrapping
():
elif
self
.
needs_unwrapping
():
thunk
+=
self
.
body_conversion
(
conv
=
False
,
params_prefix
=
params_prefix
)
thunk
+=
self
.
body_conversion
(
conv
=
False
,
params_prefix
=
params_prefix
)
else
:
else
:
...
@@ -2716,7 +2709,7 @@ class VkGenerator(object):
...
@@ -2716,7 +2709,7 @@ class VkGenerator(object):
f
.
write
(
"{0}{1}"
.
format
(
"# "
if
spec_file
else
" * "
,
line
)
.
rstrip
(
" "
)
+
"
\n
"
)
f
.
write
(
"{0}{1}"
.
format
(
"# "
if
spec_file
else
" * "
,
line
)
.
rstrip
(
" "
)
+
"
\n
"
)
f
.
write
(
"
\n
"
if
spec_file
else
" */
\n\n
"
)
f
.
write
(
"
\n
"
if
spec_file
else
" */
\n\n
"
)
def
generate_thunks_c
(
self
,
f
,
prefix
):
def
generate_thunks_c
(
self
,
f
):
self
.
_generate_copyright
(
f
)
self
.
_generate_copyright
(
f
)
f
.
write
(
"#if 0
\n
"
)
f
.
write
(
"#if 0
\n
"
)
...
@@ -2743,15 +2736,22 @@ class VkGenerator(object):
...
@@ -2743,15 +2736,22 @@ class VkGenerator(object):
for
vk_func
in
self
.
registry
.
funcs
.
values
():
for
vk_func
in
self
.
registry
.
funcs
.
values
():
if
not
vk_func
.
needs_exposing
():
if
not
vk_func
.
needs_exposing
():
continue
continue
if
vk_func
.
loader_thunk_type
==
ThunkType
.
NONE
:
if
vk_func
.
loader_thunk_type
==
ThunkType
.
NONE
or
vk_func
.
thunk_type
==
ThunkType
.
NONE
:
continue
continue
f
.
write
(
"#if !defined(USE_STRUCT_CONVERSION)
\n\n
"
)
if
vk_func
.
needs_private_thunk
():
if
vk_func
.
needs_private_thunk
():
f
.
write
(
vk_func
.
thunk
(
prefix
=
"thunk_"
))
f
.
write
(
vk_func
.
thunk
(
prefix
=
"thunk_"
))
else
:
if
vk_func
.
thunk_type
==
ThunkType
.
PUBLIC
:
f
.
write
(
"static "
)
f
.
write
(
vk_func
.
thunk
(
prefix
=
"thunk64_"
))
f
.
write
(
"#else /* USE_STRUCT_CONVERSION */
\n\n
"
)
if
vk_func
.
needs_private_thunk
():
f
.
write
(
vk_func
.
thunk
(
prefix
=
"thunk_"
,
conv
=
True
))
else
:
f
.
write
(
"static "
)
f
.
write
(
"static "
)
f
.
write
(
vk_func
.
thunk
(
prefix
=
prefix
))
f
.
write
(
vk_func
.
thunk
(
prefix
=
"thunk32_"
,
conv
=
True
))
f
.
write
(
"#endif /* USE_STRUCT_CONVERSION */
\n\n
"
)
# Create array of device extensions.
# Create array of device extensions.
f
.
write
(
"static const char * const vk_device_extensions[] =
\n
{
\n
"
)
f
.
write
(
"static const char * const vk_device_extensions[] =
\n
{
\n
"
)
...
@@ -2827,6 +2827,8 @@ class VkGenerator(object):
...
@@ -2827,6 +2827,8 @@ class VkGenerator(object):
f
.
write
(
" }
\n
"
)
f
.
write
(
" }
\n
"
)
f
.
write
(
"}
\n\n
"
)
f
.
write
(
"}
\n\n
"
)
f
.
write
(
"#if !defined(USE_STRUCT_CONVERSION)
\n\n
"
)
f
.
write
(
"const unixlib_entry_t __wine_unix_call_funcs[] =
\n
"
)
f
.
write
(
"const unixlib_entry_t __wine_unix_call_funcs[] =
\n
"
)
f
.
write
(
"{
\n
"
)
f
.
write
(
"{
\n
"
)
f
.
write
(
" init_vulkan,
\n
"
)
f
.
write
(
" init_vulkan,
\n
"
)
...
@@ -2838,10 +2840,31 @@ class VkGenerator(object):
...
@@ -2838,10 +2840,31 @@ class VkGenerator(object):
if
vk_func
.
loader_thunk_type
==
ThunkType
.
NONE
:
if
vk_func
.
loader_thunk_type
==
ThunkType
.
NONE
:
continue
continue
prefix
=
"thunk64_"
if
vk_func
.
thunk_type
==
ThunkType
.
PUBLIC
else
"wine_"
f
.
write
(
" {1}{0},
\n
"
.
format
(
vk_func
.
name
,
prefix
))
f
.
write
(
" {1}{0},
\n
"
.
format
(
vk_func
.
name
,
prefix
))
f
.
write
(
"};
\n
"
)
f
.
write
(
"};
\n
"
)
f
.
write
(
"C_ASSERT(ARRAYSIZE(__wine_unix_call_funcs) == unix_count);
\n\n
"
)
f
.
write
(
"C_ASSERT(ARRAYSIZE(__wine_unix_call_funcs) == unix_count);
\n\n
"
)
f
.
write
(
"#else /* USE_STRUCT_CONVERSION) */
\n\n
"
)
f
.
write
(
"const unixlib_entry_t __wine_unix_call_funcs[] =
\n
"
)
f
.
write
(
"{
\n
"
)
f
.
write
(
" init_vulkan,
\n
"
)
f
.
write
(
" vk_is_available_instance_function,
\n
"
)
f
.
write
(
" vk_is_available_device_function,
\n
"
)
for
vk_func
in
self
.
registry
.
funcs
.
values
():
if
not
vk_func
.
needs_exposing
():
continue
if
vk_func
.
loader_thunk_type
==
ThunkType
.
NONE
:
continue
prefix
=
"thunk32_"
if
vk_func
.
thunk_type
==
ThunkType
.
PUBLIC
else
"wine_"
f
.
write
(
" {1}{0},
\n
"
.
format
(
vk_func
.
name
,
prefix
))
f
.
write
(
"};
\n
"
)
f
.
write
(
"C_ASSERT(ARRAYSIZE(__wine_unix_call_funcs) == unix_count);
\n\n
"
)
f
.
write
(
"#endif /* USE_STRUCT_CONVERSION) */
\n\n
"
)
f
.
write
(
"NTSTATUS WINAPI vk_direct_unix_call(unixlib_handle_t handle, unsigned int code, void *params)
\n
"
)
f
.
write
(
"NTSTATUS WINAPI vk_direct_unix_call(unixlib_handle_t handle, unsigned int code, void *params)
\n
"
)
f
.
write
(
"{
\n
"
)
f
.
write
(
"{
\n
"
)
f
.
write
(
" return __wine_unix_call_funcs[code](params);
\n
"
)
f
.
write
(
" return __wine_unix_call_funcs[code](params);
\n
"
)
...
@@ -3895,7 +3918,7 @@ def main():
...
@@ -3895,7 +3918,7 @@ def main():
generator
.
generate_thunks_h
(
f
,
"wine_"
)
generator
.
generate_thunks_h
(
f
,
"wine_"
)
with
open
(
WINE_VULKAN_THUNKS_C
,
"w"
)
as
f
:
with
open
(
WINE_VULKAN_THUNKS_C
,
"w"
)
as
f
:
generator
.
generate_thunks_c
(
f
,
"wine_"
)
generator
.
generate_thunks_c
(
f
)
with
open
(
WINE_VULKAN_LOADER_THUNKS_H
,
"w"
)
as
f
:
with
open
(
WINE_VULKAN_LOADER_THUNKS_H
,
"w"
)
as
f
:
generator
.
generate_loader_thunks_h
(
f
)
generator
.
generate_loader_thunks_h
(
f
)
...
...
dlls/winevulkan/vulkan_thunks.c
View file @
a5e39c42
This source diff could not be displayed because it is too large. You can
view the blob
instead.
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