From 7b3cdacf7f3503b8c447ea2135aa81b6934a25eb Mon Sep 17 00:00:00 2001 From: Konstantin Seurer Date: Sat, 4 May 2024 10:53:46 +0200 Subject: [PATCH] vulkan: Handle group stages in vk_.*_access2_for_pipeline_stage_flags2 Avoids calling vk_expand_.*_stage_flags2. Reviewed-by: Samuel Pitoiset Part-of: --- .../util/vk_synchronization_helpers_gen.py | 27 +++++++++++++++---- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/src/vulkan/util/vk_synchronization_helpers_gen.py b/src/vulkan/util/vk_synchronization_helpers_gen.py index bc256752ba2..eb3fc6228ed 100644 --- a/src/vulkan/util/vk_synchronization_helpers_gen.py +++ b/src/vulkan/util/vk_synchronization_helpers_gen.py @@ -168,7 +168,7 @@ def access_is_read(name): print(name) assert False, "Invalid access bit name" -def get_stages_access(xml, read, guards): +def get_stages_access(xml, read, guards, all_commands_stages, group_stages): stages_access = {} for access in xml.findall('./sync/syncaccess'): access_name = access.attrib['name'] @@ -182,6 +182,20 @@ def get_stages_access(xml, read, guards): support = access.find('./syncsupport') if support is not None: stages = support.attrib['stage'].split(',') + + for stage in stages: + if (guard, stage) in all_commands_stages: + stages.append('VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT') + stages.append('VK_PIPELINE_STAGE_2_TOP_OF_PIPE_BIT' if read else 'VK_PIPELINE_STAGE_2_BOTTOM_OF_PIPE_BIT') + break + + for (group, equiv) in group_stages.items(): + for stage in stages: + if stage in equiv: + stages.append(group) + break + + stages.sort() key = (guard, tuple(stages)) if key in stages_access: @@ -201,11 +215,14 @@ def main(): xml = et.parse(args.xml); guards = get_guards(xml, 'vulkan') + all_commands_stages = get_all_commands_stages(xml, guards) + group_stages = get_group_stages(xml) + environment = { - 'all_commands_stages': get_all_commands_stages(xml, guards), - 'group_stages': get_group_stages(xml), - 'stages_read_access': get_stages_access(xml, True, guards), - 'stages_write_access': get_stages_access(xml, False, guards), + 'all_commands_stages': all_commands_stages, + 'group_stages': group_stages, + 'stages_read_access': get_stages_access(xml, True, guards, all_commands_stages, group_stages), + 'stages_write_access': get_stages_access(xml, False, guards, all_commands_stages, group_stages), } try: