Skip to content

Commit 9361c5a

Browse files
committed
VulkanHeaders generator: make sType const
1 parent 2ce467c commit 9361c5a

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

cmake/DaemonVulkan/VulkanHeaders/generator.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1021,11 +1021,13 @@ def makeCParamDecl(self, param, aligncol):
10211021
text = noneStr(elem.text)
10221022
tail = noneStr(elem.tail)
10231023

1024-
if text.endswith( 'sType' ):
1025-
sType = param.get( 'values' )
1024+
if text == "sType":
1025+
sType = param.get( "values" )
10261026

10271027
if sType:
1028-
text += ' = ' + sType
1028+
text += " = " + sType
1029+
elif text == "VkStructureType":
1030+
text = "const VkStructureType"
10291031

10301032
if self.should_insert_may_alias_macro and self.genOpts.conventions.is_voidpointer_alias(elem.tag, text, tail):
10311033
# OpenXR-specific macro insertion - but not in apiinc for the spec
@@ -1076,6 +1078,9 @@ def getCParamTypeLength(self, param):
10761078
for elem in param:
10771079
text = noneStr(elem.text)
10781080
tail = noneStr(elem.tail)
1081+
1082+
if text == "VkStructureType":
1083+
text = "const VkStructureType"
10791084

10801085
if self.should_insert_may_alias_macro and self.genOpts.conventions.is_voidpointer_alias(elem.tag, text, tail):
10811086
# OpenXR-specific macro insertion

0 commit comments

Comments
 (0)