From b7d741977c0ec29ec7ce7adb8fede66d51365cf0 Mon Sep 17 00:00:00 2001 From: sakrel <2487152+sakrel@users.noreply.github.com> Date: Thu, 29 Jun 2023 16:03:21 +0200 Subject: [PATCH] RenderingDeviceVulkan::buffer_get_data: Use draw command buffer instead of setup command buffer (cherry picked from commit f52c151fcf2bcccb66bdccdf0e3195914068d6fb) --- drivers/vulkan/rendering_device_vulkan.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/vulkan/rendering_device_vulkan.cpp b/drivers/vulkan/rendering_device_vulkan.cpp index 38cc96c3c3d..f3f8ceaf5dd 100644 --- a/drivers/vulkan/rendering_device_vulkan.cpp +++ b/drivers/vulkan/rendering_device_vulkan.cpp @@ -5931,10 +5931,10 @@ Vector RenderingDeviceVulkan::buffer_get_data(RID p_buffer, uint32_t p_ ERR_FAIL_V_MSG(Vector(), "Buffer is either invalid or this type of buffer can't be retrieved. Only Index and Vertex buffers allow retrieving."); } - // Make sure no one is using the buffer -- the "false" gets us to the same command buffer as below. - _buffer_memory_barrier(buffer->buffer, 0, buffer->size, src_stage_mask, VK_PIPELINE_STAGE_TRANSFER_BIT, src_access_mask, VK_ACCESS_TRANSFER_READ_BIT, false); + // Make sure no one is using the buffer -- the "true" gets us to the same command buffer as below. + _buffer_memory_barrier(buffer->buffer, 0, buffer->size, src_stage_mask, VK_PIPELINE_STAGE_TRANSFER_BIT, src_access_mask, VK_ACCESS_TRANSFER_READ_BIT, true); - VkCommandBuffer command_buffer = frames[frame].setup_command_buffer; + VkCommandBuffer command_buffer = frames[frame].draw_command_buffer; // Size of buffer to retrieve. if (!p_size) {