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
95d83f01
Commit
95d83f01
authored
Nov 07, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 09, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winevulkan: Support pointer dynamic array lengths.
parent
8047c230
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
11 deletions
+32
-11
make_vulkan
dlls/winevulkan/make_vulkan
+32
-11
No files found.
dlls/winevulkan/make_vulkan
View file @
95d83f01
...
...
@@ -1097,6 +1097,10 @@ class VkVariable(object):
if
type_info
:
self
.
set_type_info
(
type_info
)
def
__eq__
(
self
,
other
):
""" Compare member based on name against a string. """
return
self
.
name
==
other
def
set_type_info
(
self
,
type_info
):
""" Helper function to set type information from the type registry.
This is needed, because not all type data is available at time of
...
...
@@ -1106,6 +1110,31 @@ class VkVariable(object):
self
.
handle
=
type_info
[
"data"
]
if
type_info
[
"category"
]
==
"handle"
else
None
self
.
struct
=
type_info
[
"data"
]
if
type_info
[
"category"
]
==
"struct"
else
None
def
get_dyn_array_len
(
self
,
prefix
):
if
isinstance
(
self
.
dyn_array_len
,
int
):
return
self
.
dyn_array_len
len_str
=
self
.
dyn_array_len
parent
=
self
.
parent
len
=
prefix
# check if lenght is a member of another struct (for example pAllocateInfo->commandBufferCount)
i
=
len_str
.
find
(
"->"
)
if
i
!=
-
1
:
var
=
parent
[
parent
.
index
(
len_str
[
0
:
i
])]
len_str
=
len_str
[
i
+
2
:]
len
+=
var
.
name
+
"->"
parent
=
var
.
struct
.
members
len
+=
len_str
if
not
len_str
in
parent
:
return
len
var
=
parent
[
parent
.
index
(
len_str
)]
if
var
.
is_pointer
():
len
=
"*"
+
len
return
len
def
is_const
(
self
):
return
self
.
const
...
...
@@ -1223,15 +1252,6 @@ class VkMember(VkVariable):
self
.
values
=
values
self
.
bit_width
=
bit_width
def
__eq__
(
self
,
other
):
""" Compare member based on name against a string.
This method is for convenience by VkStruct, which holds a number of members and needs quick checking
if certain members exist.
"""
return
self
.
name
==
other
def
__repr__
(
self
):
return
"{0} {1} {2} {3} {4} {5} {6}"
.
format
(
self
.
const
,
self
.
struct_fwd_decl
,
self
.
type
,
self
.
pointer
,
self
.
name
,
self
.
array_len
,
self
.
dyn_array_len
)
...
...
@@ -1313,7 +1333,7 @@ class VkMember(VkVariable):
if
self
.
needs_conversion
(
conv
,
unwrap
,
direction
,
False
):
if
self
.
is_dynamic_array
():
# Array length is either a variable name (string) or an int.
count
=
self
.
dyn_array_len
if
isinstance
(
self
.
dyn_array_len
,
int
)
else
"{0}{1}"
.
format
(
input
,
self
.
dyn_array_len
)
count
=
self
.
get_dyn_array_len
(
input
)
host_part
=
"host"
if
unwrap
else
"unwrapped_host"
if
direction
==
Direction
.
OUTPUT
:
return
"convert_{2}_array_{6}_to_{5}({3}{1}, {0}{1}, {4});
\n
"
.
format
(
output
,
self
.
name
,
self
.
type
,
input
,
count
,
win_type
,
host_part
)
...
...
@@ -1557,7 +1577,8 @@ class VkParam(VkVariable):
ctx_param
=
"&ctx, "
if
self
.
needs_alloc
(
conv
,
unwrap
)
else
""
wrap_part
=
""
if
unwrap
or
not
self
.
needs_unwrapping
()
else
"unwrapped_"
if
self
.
is_dynamic_array
():
return
" {1}_host = convert_{2}_array_{4}_to_{6}host({5}{0}{1}, {0}{3});
\n
"
.
format
(
prefix
,
self
.
name
,
self
.
type
,
self
.
dyn_array_len
,
win_type
,
ctx_param
,
wrap_part
)
return
" {1}_host = convert_{2}_array_{4}_to_{6}host({5}{0}{1}, {3});
\n
"
.
format
(
prefix
,
self
.
name
,
self
.
type
,
self
.
get_dyn_array_len
(
prefix
),
win_type
,
ctx_param
,
wrap_part
)
else
:
return
" convert_{0}_{3}_to_{5}host({4}{1}{2}, &{2}_host);
\n
"
.
format
(
self
.
type
,
prefix
,
self
.
name
,
win_type
,
ctx_param
,
wrap_part
)
else
:
...
...
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