@@ -163,6 +163,7 @@ def getWrappedCommands(self):
163
163
handwritten = ["xrGetInstanceProcAddr" , "xrCreateInstance" ]
164
164
skip = handwritten + self .no_trampoline_or_terminator
165
165
all = self .core_commands + self .ext_commands
166
+ all .sort (key = lambda command : command .name )
166
167
return [command for command in all if command .name not in skip ]
167
168
168
169
def outputGeneratedAuthorNote (self ):
@@ -171,19 +172,19 @@ def outputGeneratedAuthorNote(self):
171
172
172
173
class MacroOutputGenerator (BoilerplateOutputGenerator ):
173
174
def genPlatformTypeMacros (self ):
174
- names = {
175
+ names = [
175
176
"float" ,
176
- "int8_t" ,
177
- "uint8_t" ,
178
177
"int16_t" ,
179
- "uint16_t" ,
180
178
"int32_t" ,
181
- "uint32_t" ,
182
179
"int64_t" ,
183
- "uint64_t " ,
180
+ "int8_t " ,
184
181
"size_t" ,
182
+ "uint16_t" ,
183
+ "uint32_t" ,
184
+ "uint64_t" ,
185
+ "uint8_t" ,
185
186
"uintptr_t" ,
186
- }
187
+ ]
187
188
macros = []
188
189
for name in names :
189
190
macros .append (
@@ -207,9 +208,9 @@ def genBaseTypeMacros(self):
207
208
handwritten = {"XrAction" , "XrActionSet" , "XrSpace" }
208
209
209
210
ret = ""
210
- for xr_type in self .api_base_types :
211
+ for xr_type in sorted ( self .api_base_types , key = lambda xr_type : xr_type . name ) :
211
212
ret += self .genBaseTypeMacro (xr_type ) + "\n "
212
- for xr_type in self .api_handles :
213
+ for xr_type in sorted ( self .api_handles , key = lambda xr_type : xr_type . name ) :
213
214
macro = (
214
215
f"#define OXRTL_ARGS_{ xr_type .name } (oxrtlIt, name) OXRTL_ARGS_HANDLE(oxrtlIt, name)"
215
216
+ "\n "
@@ -218,13 +219,15 @@ def genBaseTypeMacros(self):
218
219
ret += "// EXCLUDED - HANDWRITTEN:\n // " + macro
219
220
else :
220
221
ret += macro
221
- for xr_type in self .api_flags :
222
+ for xr_type in sorted ( self .api_flags , key = lambda xr_type : xr_type . name ) :
222
223
ret += (
223
224
f"#define OXRTL_ARGS_{ xr_type .name } (oxrtlIt, name) OXRTL_ARGS_{ xr_type .type } (oxrtlIt, name)"
224
225
+ "\n "
225
226
)
226
227
227
- for xr_type in self .api_base_types + self .api_handles :
228
+ for xr_type in sorted (
229
+ self .api_base_types + self .api_handles , key = lambda xr_type : xr_type .name
230
+ ):
228
231
ret += (
229
232
f"""
230
233
#define OXRTL_DUMP_{ xr_type .name } (oxrtlActivity, oxrtlName, oxrtlValueName, oxrtlIt)
@@ -251,7 +254,7 @@ def genBaseTypeMacro(self, xr_type):
251
254
252
255
def genEnumMacros (self ):
253
256
ret = ""
254
- for xr_enum in self .api_enums :
257
+ for xr_enum in sorted ( self .api_enums , key = lambda xr_enum : xr_enum . name ) :
255
258
ret += self .genEnumMacro (xr_enum ) + "\n "
256
259
return ret
257
260
@@ -277,7 +280,7 @@ def genEnumMacro(self, xr_enum):
277
280
278
281
def genDumperAliases (self ):
279
282
ret = ""
280
- for type_name in self .aliases :
283
+ for type_name in sorted ( self .aliases ) :
281
284
alias = self .aliases [type_name ]
282
285
if not self .isStruct (alias ):
283
286
continue
@@ -293,13 +296,17 @@ def genDumperAliases(self):
293
296
294
297
def genStructMacros (self ):
295
298
ret = ""
296
- for xr_struct in self .api_structures :
299
+ for xr_struct in sorted (
300
+ self .api_structures , key = lambda xr_struct : xr_struct .name
301
+ ):
297
302
ret += self .genStructMacro (xr_struct ) + "\n "
298
303
return ret
299
304
300
305
def genStructNextDumpers (self ):
301
306
ret = ""
302
- for xr_struct in self .api_structures :
307
+ for xr_struct in sorted (
308
+ self .api_structures , key = lambda xr_struct : xr_struct .name
309
+ ):
303
310
if self .hasNextDumper (xr_struct ):
304
311
ret += self .genStructNextDumper (xr_struct ) + "\n "
305
312
return ret
@@ -800,7 +807,9 @@ def genNextPFNDeclarations(self):
800
807
801
808
def genDumpingFunctionDeclarations (self ):
802
809
ret = ""
803
- for xr_struct in self .api_structures :
810
+ for xr_struct in sorted (
811
+ self .api_structures , key = lambda xr_struct : xr_struct .name
812
+ ):
804
813
decl = self .getNextDumperDecl (xr_struct )
805
814
if decl :
806
815
ret += decl + ";\n "
0 commit comments