Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 25 additions & 18 deletions erupt_dlang.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -1254,4 +1261,4 @@ def __init__( self, *args, **kwargs ):
reg.apiGen()

if print_debug:
tests_file.close()
tests_file.close()