Commit d7037aa2ce399d74bf7d8bc260fd67183ac1b213

Shahbaz Youssefi 2021-02-11T14:35:30

Vulkan: noop glMemoryBarrier(CLIENT_MAPPED_BUFFER_BARRIER_BIT_EXT) CLIENT_MAPPED_BUFFER_BARRIER_BIT_EXT requires a memory barrier: shader buffer write -> host read. According to the spec, the data is only available after a call to glFinish or wait on sync: > The application must call MemoryBarrier with the > CLIENT_MAPPED_BUFFER_BARRIER_BIT_EXT set and then call FenceSync with > SYNC_GPU_COMMANDS_COMPLETE (or Finish). Then the CPU will see the > writes after the sync is complete. When a buffer is written to by the GPU, ANGLE calls onHostVisibleBufferWrite(), which ensures a "memory write -> host read" barrier is issued at the end of the command buffer. Additionally, persistently mapped buffers use VK_MEMORY_PROPERTY_HOST_COHERENT_BIT, so there's no need for a call to vkInvalidateMappedMemoryRanges. As a result, there's nothing necessary in ANGLE to do for this barrier bit. Note that should persistenly mapped buffers start using non-coherent memory, this barrier should imply a call to vkInvalidateMappedMemoryRanges for the persistently mapped buffers. Bug: angleproject:5070 Change-Id: Iaeae019dadfa659a47d2dac41c0c09f1c15e584b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2689380 Commit-Queue: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Mohan Maiya <m.maiya@samsung.com> Reviewed-by: Charlie Lao <cclao@google.com>