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
b5a79ca5
Commit
b5a79ca5
authored
Oct 05, 2018
by
Józef Kucia
Committed by
Alexandre Julliard
Oct 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
winevulkan: Parse enum value aliases.
Signed-off-by:
Józef Kucia
<
jkucia@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
94a4dadd
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
6 deletions
+10
-6
make_vulkan
dlls/winevulkan/make_vulkan
+10
-6
No files found.
dlls/winevulkan/make_vulkan
View file @
b5a79ca5
...
...
@@ -322,22 +322,26 @@ class VkEnum(object):
for
v
in
enum
.
findall
(
"enum"
):
# Value is either a value or a bitpos, only one can exist.
value
=
v
.
attrib
.
get
(
"value"
)
if
value
is
None
:
# bitmask
value
=
1
<<
int
(
v
.
attrib
.
get
(
"bitpos"
)
)
values
.
append
(
VkEnumValue
(
v
.
attrib
.
get
(
"name"
),
value
,
hex
=
True
))
el
s
e
:
alias_name
=
v
.
attrib
.
get
(
"alias"
)
if
alias_name
:
alias
=
next
(
x
for
x
in
values
if
x
.
name
==
alias_name
)
values
.
append
(
VkEnumValue
(
v
.
attrib
.
get
(
"name"
),
alias
.
value
,
alias
.
hex
))
el
if
valu
e
:
# Some values are in hex form. We want to preserve the hex representation
# at least when we convert back to a string. Internally we want to use int.
if
"0x"
in
value
:
values
.
append
(
VkEnumValue
(
v
.
attrib
.
get
(
"name"
),
int
(
value
,
0
),
hex
=
True
))
else
:
values
.
append
(
VkEnumValue
(
v
.
attrib
.
get
(
"name"
),
int
(
value
,
0
)))
else
:
# bitmask
value
=
1
<<
int
(
v
.
attrib
.
get
(
"bitpos"
))
values
.
append
(
VkEnumValue
(
v
.
attrib
.
get
(
"name"
),
value
,
hex
=
True
))
# vulkan.h contains a *_MAX_ENUM value set to 32-bit at the time of writing,
# which is to prepare for extensions as they can add values and hence affect
# the size definition.
max_name
=
re
.
sub
(
r'([0-9a-z_])([A-Z0-9])'
,
r'\1_\2'
,
name
)
.
upper
()
+
"_MAX_ENUM"
max_name
=
re
.
sub
(
r'([0-9a-z_])([A-Z0-9])'
,
r'\1_\2'
,
name
)
.
upper
()
+
"_MAX_ENUM"
values
.
append
(
VkEnumValue
(
max_name
,
0x7fffffff
,
hex
=
True
))
return
VkEnum
(
name
,
values
)
...
...
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