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
511a8bfa
Commit
511a8bfa
authored
Nov 04, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 04, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winevulkan: Use struct conversion functions for array conversion implementations.
parent
a242422e
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
12 deletions
+22
-12
make_vulkan
dlls/winevulkan/make_vulkan
+22
-12
vulkan_thunks.c
dlls/winevulkan/vulkan_thunks.c
+0
-0
No files found.
dlls/winevulkan/make_vulkan
View file @
511a8bfa
...
...
@@ -1203,18 +1203,18 @@ class VkVariable(object):
conversions
.
extend
(
m
.
get_conversions
(
unwrap
,
is_const
))
if
self
.
is_static_array
()
or
self
.
is_dynamic_array
():
for
conv
in
[
False
,
True
]:
if
self
.
needs_conversion
(
conv
,
unwrap
,
Direction
.
INPUT
,
parent_const
):
conversions
.
append
(
ArrayConversionFunction
(
self
,
Direction
.
INPUT
,
conv
,
unwrap
))
conversions
.
append
(
StructConversionFunction
(
self
.
struct
,
Direction
.
INPUT
,
conv
,
unwrap
))
if
self
.
needs_conversion
(
conv
,
unwrap
,
Direction
.
OUTPUT
,
parent_const
):
conversions
.
append
(
ArrayConversionFunction
(
self
,
Direction
.
OUTPUT
,
conv
,
unwrap
))
elif
self
.
is_struct
():
conversions
.
append
(
StructConversionFunction
(
self
.
struct
,
Direction
.
OUTPUT
,
conv
,
unwrap
))
if
self
.
is_static_array
()
or
self
.
is_dynamic_array
():
for
conv
in
[
False
,
True
]:
if
self
.
needs_conversion
(
conv
,
unwrap
,
Direction
.
INPUT
,
parent_const
):
conversions
.
append
(
StructConversionFunction
(
self
.
struct
,
Direction
.
INPUT
,
conv
,
unwrap
))
conversions
.
append
(
ArrayConversionFunction
(
self
,
Direction
.
INPUT
,
conv
,
unwrap
))
if
self
.
needs_conversion
(
conv
,
unwrap
,
Direction
.
OUTPUT
,
parent_const
):
conversions
.
append
(
StructConversionFunction
(
self
.
struct
,
Direction
.
OUTPUT
,
conv
,
unwrap
))
conversions
.
append
(
ArrayConversionFunction
(
self
,
Direction
.
OUTPUT
,
conv
,
unwrap
))
return
conversions
...
...
@@ -2034,14 +2034,15 @@ class StructConversionFunction(object):
body
+=
"#if !defined(USE_STRUCT_CONVERSION)
\n
"
needs_alloc
=
self
.
direction
!=
Direction
.
OUTPUT
and
self
.
operand
.
needs_alloc
(
self
.
conv
,
self
.
unwrap
)
host_type
=
self
.
type
+
"_host"
if
self
.
operand
.
needs_host_type
()
else
self
.
type
if
self
.
conv
:
body
+=
"static inline void {0}("
.
format
(
self
.
name
)
if
self
.
direction
==
Direction
.
OUTPUT
:
params
=
[
"const {0}
_host *in"
.
format
(
self
.
type
),
"{0} *out"
.
format
(
self
.
type
)]
params
=
[
"const {0}
*in"
.
format
(
host_
type
),
"{0} *out"
.
format
(
self
.
type
)]
else
:
params
=
[
"const {0} *in"
.
format
(
self
.
type
),
"{0}
_host *out"
.
format
(
self
.
type
)]
params
=
[
"const {0} *in"
.
format
(
self
.
type
),
"{0}
*out"
.
format
(
host_
type
)]
# Generate parameter list
if
needs_alloc
:
...
...
@@ -2171,11 +2172,20 @@ class ArrayConversionFunction(object):
body
+=
" {
\n
"
if
self
.
array
.
is_struct
():
for
m
in
self
.
array
.
struct
:
# TODO: support copying of pNext extension structures!
# Luckily though no extension struct at this point needs conversion.
body
+=
" "
+
m
.
copy
(
"in[i]."
,
"out[i]."
,
self
.
direction
,
self
.
conv
,
self
.
unwrap
)
struct
=
self
.
array
.
struct
win_part
=
"win32"
if
self
.
conv
else
"win64"
host_part
=
"host"
if
self
.
unwrap
else
"unwrapped_host"
if
self
.
direction
==
Direction
.
INPUT
:
conv_suffix
=
"{0}_to_{1}"
.
format
(
win_part
,
host_part
)
else
:
conv_suffix
=
"{0}_to_{1}"
.
format
(
host_part
,
win_part
)
ctx_part
=
""
if
self
.
direction
==
Direction
.
INPUT
and
struct
.
needs_alloc
(
self
.
conv
,
self
.
unwrap
):
ctx_part
=
"ctx, "
body
+=
" convert_{0}_{1}({2}&in[i], &out[i]);
\n
"
.
format
(
struct
.
name
,
conv_suffix
,
ctx_part
)
elif
self
.
array
.
is_handle
()
and
self
.
direction
==
Direction
.
INPUT
:
body
+=
" out[i] = "
+
self
.
array
.
handle
.
driver_handle
(
"in[i]"
)
+
";
\n
"
else
:
...
...
dlls/winevulkan/vulkan_thunks.c
View file @
511a8bfa
This diff is collapsed.
Click to expand it.
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