vulkan/cmd_queue: Auto-generate more vk_cmd_enqueue_unless_primary_Cmd*
Instead of one MANUAL_COMMANDS, we now have two deny-lists: MANUAL_COMMANDS and NO_ENQUEUE_COMMANDS. The former is for things which have a manually typed implementation in vk_cmd_enqueue.c and the later is for things we want to ignore entirely. This lets us auto-generate vk_cmd_enqueue_unless_primary_Cmd* entrypoints for the manually typed vk_cmd_enqueue_Cmd* entrypoints. Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14406>
This commit is contained in:

committed by
Marge Bot

parent
3cffffc441
commit
6cb95877b5
@@ -35,13 +35,11 @@ from mako.template import Template
|
|||||||
# '{file_without_suffix}_depend_files'.
|
# '{file_without_suffix}_depend_files'.
|
||||||
from vk_entrypoints import get_entrypoints_from_xml, EntrypointParam
|
from vk_entrypoints import get_entrypoints_from_xml, EntrypointParam
|
||||||
|
|
||||||
|
# These have hand-typed implementations in vk_cmd_enqueue.c
|
||||||
MANUAL_COMMANDS = [
|
MANUAL_COMMANDS = [
|
||||||
# This script doesn't know how to copy arrays in structs in arrays
|
# This script doesn't know how to copy arrays in structs in arrays
|
||||||
'CmdPushDescriptorSetKHR',
|
'CmdPushDescriptorSetKHR',
|
||||||
|
|
||||||
# pData's size cannot be calculated from the xml
|
|
||||||
'CmdPushDescriptorSetWithTemplateKHR',
|
|
||||||
|
|
||||||
# The size of the elements is specified in a stride param
|
# The size of the elements is specified in a stride param
|
||||||
'CmdDrawMultiEXT',
|
'CmdDrawMultiEXT',
|
||||||
'CmdDrawMultiIndexedEXT',
|
'CmdDrawMultiIndexedEXT',
|
||||||
@@ -49,6 +47,11 @@ MANUAL_COMMANDS = [
|
|||||||
# The VkPipelineLayout object could be released before the command is
|
# The VkPipelineLayout object could be released before the command is
|
||||||
# executed
|
# executed
|
||||||
'CmdBindDescriptorSets',
|
'CmdBindDescriptorSets',
|
||||||
|
]
|
||||||
|
|
||||||
|
NO_ENQUEUE_COMMANDS = [
|
||||||
|
# pData's size cannot be calculated from the xml
|
||||||
|
'CmdPushDescriptorSetWithTemplateKHR',
|
||||||
|
|
||||||
# These don't return void
|
# These don't return void
|
||||||
'CmdSetPerformanceMarkerINTEL',
|
'CmdSetPerformanceMarkerINTEL',
|
||||||
@@ -131,7 +134,7 @@ struct vk_cmd_queue_entry {
|
|||||||
};
|
};
|
||||||
|
|
||||||
% for c in commands:
|
% for c in commands:
|
||||||
% if c.name in manual_commands:
|
% if c.name in manual_commands or c.name in no_enqueue_commands:
|
||||||
<% continue %>
|
<% continue %>
|
||||||
% endif
|
% endif
|
||||||
% if c.guard is not None:
|
% if c.guard is not None:
|
||||||
@@ -207,7 +210,7 @@ const char *vk_cmd_queue_type_names[] = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
% for c in commands:
|
% for c in commands:
|
||||||
% if c.name in manual_commands:
|
% if c.name in manual_commands or c.name in no_enqueue_commands:
|
||||||
<% continue %>
|
<% continue %>
|
||||||
% endif
|
% endif
|
||||||
% if c.guard is not None:
|
% if c.guard is not None:
|
||||||
@@ -311,7 +314,7 @@ vk_cmd_queue_execute(struct vk_cmd_queue *queue,
|
|||||||
}
|
}
|
||||||
|
|
||||||
% for c in commands:
|
% for c in commands:
|
||||||
% if c.name in manual_commands:
|
% if c.name in no_enqueue_commands:
|
||||||
/* TODO: Generate vk_cmd_enqueue_${c.name}() */
|
/* TODO: Generate vk_cmd_enqueue_${c.name}() */
|
||||||
<% continue %>
|
<% continue %>
|
||||||
% endif
|
% endif
|
||||||
@@ -320,6 +323,10 @@ vk_cmd_queue_execute(struct vk_cmd_queue *queue,
|
|||||||
#ifdef ${c.guard}
|
#ifdef ${c.guard}
|
||||||
% endif
|
% endif
|
||||||
<% assert c.return_type == 'void' %>
|
<% assert c.return_type == 'void' %>
|
||||||
|
|
||||||
|
% if c.name in manual_commands:
|
||||||
|
/* vk_cmd_enqueue_${c.name}() is hand-typed in vk_cmd_enqueue.c */
|
||||||
|
% else:
|
||||||
VKAPI_ATTR void VKAPI_CALL
|
VKAPI_ATTR void VKAPI_CALL
|
||||||
vk_cmd_enqueue_${c.name}(${c.decl_params()})
|
vk_cmd_enqueue_${c.name}(${c.decl_params()})
|
||||||
{
|
{
|
||||||
@@ -332,6 +339,7 @@ vk_cmd_enqueue_${c.name}(${c.decl_params()})
|
|||||||
${c.call_params(1)});
|
${c.call_params(1)});
|
||||||
% endif
|
% endif
|
||||||
}
|
}
|
||||||
|
% endif
|
||||||
|
|
||||||
VKAPI_ATTR void VKAPI_CALL
|
VKAPI_ATTR void VKAPI_CALL
|
||||||
vk_cmd_enqueue_unless_primary_${c.name}(${c.decl_params()})
|
vk_cmd_enqueue_unless_primary_${c.name}(${c.decl_params()})
|
||||||
@@ -551,6 +559,7 @@ def main():
|
|||||||
'get_struct_free': get_struct_free,
|
'get_struct_free': get_struct_free,
|
||||||
'types': types,
|
'types': types,
|
||||||
'manual_commands': MANUAL_COMMANDS,
|
'manual_commands': MANUAL_COMMANDS,
|
||||||
|
'no_enqueue_commands': NO_ENQUEUE_COMMANDS,
|
||||||
'remove_suffix': remove_suffix,
|
'remove_suffix': remove_suffix,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user