diff --git a/erupt_dlang.py b/erupt_dlang.py index 698ca13..2ad5fdf 100644 --- a/erupt_dlang.py +++ b/erupt_dlang.py @@ -1054,26 +1054,33 @@ def genCmd( self, cmdinfo, name, alias ): # alias global and DispatchDevice functions if alias: - - # alias global scope functions - self.feature_content[ self.featureName ][ 'Func_Aliases' ].append( - ( 'alias {0}{{LJUST_NAME}} = {1};'.format( name, alias ), name_len ) ) - - # alias dispatch device functions and partially device scope vulkan funcs (for VkDevice and VkCommandBuffer) - if param_0_type in ( 'VkDevice', 'VkCommandBuffer' ): - self.feature_content[ self.featureName ][ 'Conven_Aliases' ].append( - ( 'alias {0}{{LJUST_NAME}} = {1};'.format( name[2:], alias[2:] ), name_len ) ) - self.feature_content[ self.featureName ][ 'Disp_Aliases' ].append( + # Skip alias generation for KHR extensions promoted to core to ensure compatibility + # across different Vulkan driver versions. The Vulkan specification guarantees that + # KHR extension entry points remain available after promotion to core functionality. + # By using the original KHR function name instead of aliasing to the core version, + # we maintain compatibility with both scenarios. + if name.endswith('KHR'): + pass # continue to process as regular function below + else: + # alias global scope functions + self.feature_content[ self.featureName ][ 'Func_Aliases' ].append( ( 'alias {0}{{LJUST_NAME}} = {1};'.format( name, alias ), name_len ) ) - self.max_d_func_name_len = max( self.max_d_func_name_len, name_len ) - # second part of device scope vulkan funcs (for VkQueue, for which no convenience fucs exist) - elif param_0_type == 'VkQueue': - self.feature_content[ self.featureName ][ 'Disp_Aliases' ].append( - ( 'alias {0}{{LJUST_NAME}} = {1};'.format( name, alias ), name_len ) ) - self.max_d_func_name_len = max( self.max_d_func_name_len, name_len ) + # alias dispatch device functions and partially device scope vulkan funcs (for VkDevice and VkCommandBuffer) + if param_0_type in ( 'VkDevice', 'VkCommandBuffer' ): + self.feature_content[ self.featureName ][ 'Conven_Aliases' ].append( + ( 'alias {0}{{LJUST_NAME}} = {1};'.format( name[2:], alias[2:] ), name_len ) ) + self.feature_content[ self.featureName ][ 'Disp_Aliases' ].append( + ( 'alias {0}{{LJUST_NAME}} = {1};'.format( name, alias ), name_len ) ) + self.max_d_func_name_len = max( self.max_d_func_name_len, name_len ) + + # second part of device scope vulkan funcs (for VkQueue, for which no convenience fucs exist) + elif param_0_type == 'VkQueue': + self.feature_content[ self.featureName ][ 'Disp_Aliases' ].append( + ( 'alias {0}{{LJUST_NAME}} = {1};'.format( name, alias ), name_len ) ) + self.max_d_func_name_len = max( self.max_d_func_name_len, name_len ) - return # its either alias or full functions + return # its either alias or full functions # get and modify the return type to align functions for better readability @@ -1254,4 +1261,4 @@ def __init__( self, *args, **kwargs ): reg.apiGen() if print_debug: - tests_file.close() \ No newline at end of file + tests_file.close()