The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

a/vk: Make clang-format happy

Part-of: <https://gitlab.freedesktop.org/monado/monado/-/merge_requests/2541>

+9 -6
+8 -6
scripts/generate_vk_helpers.py
··· 369 369 def __init__(self): 370 370 self.current_condition = None 371 371 372 - def process_condition(self, new_condition: Optional[str]) -> Optional[str]: 372 + def process_condition(self, new_condition: Optional[str], finish: bool = False) -> Optional[str]: 373 373 """Return a line (or lines) to yield if required based on the new condition state.""" 374 374 lines = [] 375 375 if self.current_condition and new_condition != self.current_condition: 376 376 # Close current condition if required. 377 377 lines.append("#endif // {}".format(self.current_condition)) 378 - # empty line 379 - lines.append("") 378 + if not finish: 379 + # empty line 380 + lines.append("") 380 381 self.current_condition = None 381 382 382 - if new_condition != self.current_condition: 383 + if not finish and new_condition != self.current_condition: 383 384 # Open new condition if required 384 385 lines.append("#if {}".format(new_condition)) 385 386 self.current_condition = new_condition ··· 389 390 390 391 def finish(self) -> Optional[str]: 391 392 """Return a line (or lines) to yield if required at the end of the loop.""" 392 - return self.process_condition(None) 393 + return self.process_condition(None, finish=True) 393 394 394 395 395 396 def generate_per_command( ··· 418 419 def per_command(cmd: Cmd): 419 420 return "\tPFN_{} {};".format(cmd.name, cmd.member_name) 420 421 421 - return generate_per_command(commands, per_command) 422 + yield from generate_per_command(commands, per_command) 423 + yield '' 422 424 423 425 424 426 def generate_proc_macro(macro: str, commands: List[Cmd]):
+1
src/xrt/auxiliary/vk/vk_function_loaders.c
··· 339 339 #endif // defined(VK_EXT_debug_utils) 340 340 341 341 // end of GENERATED device loader code - do not modify - used by scripts 342 + 342 343 // clang-format on 343 344 return VK_SUCCESS; 344 345 }