From 07dd09aa55272d799fb6b330bbf7260e34c04f8b Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Tue, 23 Apr 2024 08:23:12 +0200 Subject: [PATCH] Vulkan: Add reset method to resource access info. Resource access info contains lists in a future setup the resource access info will be kept in the VKContext and reused. This requires a reset function to cleanup the instance for reuse. Pull Request: https://projects.blender.org/blender/blender/pulls/120962 --- .../gpu/vulkan/render_graph/vk_resource_access_info.cc | 6 ++++++ .../gpu/vulkan/render_graph/vk_resource_access_info.hh | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/source/blender/gpu/vulkan/render_graph/vk_resource_access_info.cc b/source/blender/gpu/vulkan/render_graph/vk_resource_access_info.cc index 3e3a85424fd..3a2a635d99f 100644 --- a/source/blender/gpu/vulkan/render_graph/vk_resource_access_info.cc +++ b/source/blender/gpu/vulkan/render_graph/vk_resource_access_info.cc @@ -76,4 +76,10 @@ void VKResourceAccessInfo::build_links(VKResourceStateTracker &resources, } } +void VKResourceAccessInfo::reset() +{ + images.clear(); + buffers.clear(); +} + } // namespace blender::gpu::render_graph diff --git a/source/blender/gpu/vulkan/render_graph/vk_resource_access_info.hh b/source/blender/gpu/vulkan/render_graph/vk_resource_access_info.hh index 493e10785df..262f17b23c0 100644 --- a/source/blender/gpu/vulkan/render_graph/vk_resource_access_info.hh +++ b/source/blender/gpu/vulkan/render_graph/vk_resource_access_info.hh @@ -49,6 +49,11 @@ struct VKResourceAccessInfo : NonCopyable { * Extract read/write resource dependencies and add them to `node_links`. */ void build_links(VKResourceStateTracker &resources, VKRenderGraphNodeLinks &node_links) const; + + /** + * Reset the instance for reuse. + */ + void reset(); }; } // namespace blender::gpu::render_graph