diff options
author | John Zulauf <jzulauf@lunarg.com> | 2020-10-16 18:43:02 -0600 |
---|---|---|
committer | John Zulauf <jzulauf@lunarg.com> | 2020-10-16 19:18:33 -0600 |
commit | d2083282c000d77ee35d2487f1798eaee97f408f (patch) | |
tree | f107c447446f7b1b55cf57e8148382f779d748da | |
parent | 459fa078e01586f1b9296fb75950fd4c0a9d2b9b (diff) |
Add pre-copy barrier to buffer update
Add a barrier to "safe" the buffer update write from previous accesses
to buffer range being updated. Remove duplicate unneed barrier.
-rw-r--r-- | drivers/vulkan/rendering_device_vulkan.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/vulkan/rendering_device_vulkan.cpp b/drivers/vulkan/rendering_device_vulkan.cpp index b051fe825c..a01f63caae 100644 --- a/drivers/vulkan/rendering_device_vulkan.cpp +++ b/drivers/vulkan/rendering_device_vulkan.cpp @@ -4997,12 +4997,12 @@ Error RenderingDeviceVulkan::buffer_update(RID p_buffer, uint32_t p_offset, uint ERR_FAIL_COND_V_MSG(p_offset + p_size > buffer->size, ERR_INVALID_PARAMETER, "Attempted to write buffer (" + itos((p_offset + p_size) - buffer->size) + " bytes) past the end."); + _buffer_memory_barrier(buffer->buffer, p_offset, p_size, dst_stage_mask, VK_PIPELINE_STAGE_TRANSFER_BIT, dst_access, VK_ACCESS_TRANSFER_WRITE_BIT, p_sync_with_draw); Error err = _buffer_update(buffer, p_offset, (uint8_t *)p_data, p_size, p_sync_with_draw); if (err) { return err; } - _buffer_memory_barrier(buffer->buffer, p_offset, p_size, VK_PIPELINE_STAGE_TRANSFER_BIT, dst_stage_mask, VK_ACCESS_TRANSFER_WRITE_BIT, dst_access, p_sync_with_draw); #ifdef FORCE_FULL_BARRIER _full_barrier(p_sync_with_draw); #else |