From 2bd0674de4ebb52c27212728281d330776d3b07e Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Mon, 14 Aug 2023 12:48:04 +0200 Subject: [PATCH] Fix: Vulkan Use Resource After Free When immediate mode is used with a temp texture the draw command was executed after the texture was freed. This PR ensures that the draw command is executed before the texture is freed. --- source/blender/gpu/vulkan/vk_immediate.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/blender/gpu/vulkan/vk_immediate.cc b/source/blender/gpu/vulkan/vk_immediate.cc index 90e983fb242..45f8ea00808 100644 --- a/source/blender/gpu/vulkan/vk_immediate.cc +++ b/source/blender/gpu/vulkan/vk_immediate.cc @@ -57,6 +57,8 @@ void VKImmediate::end() vertex_attributes_.bind(context); context.command_buffer_get().draw(0, vertex_len, 0, 1); + context.command_buffer_get().submit(); + buffer_offset_ += current_subbuffer_len_; current_subbuffer_len_ = 0; } -- 2.30.2