Vulkan: Fix assertion in RefCountedEvent::releaseImpl RefCountedEvent uses non-atomic uint32_t for reference counting, so it is not thread safe. To ensure we do not use it in a thread unsafe way, there is an assertion I added in RefCountedEvent::releaseImpl that the release call is not come from async command queue thread (all release calls are expected come from context thread which should be protected by context share group lock). A while ago dynamic rendering is implemented. With dynamic rendering you can't do final layout change in render pass. So the final layout change to Present is added to primary command buffer at the end of RenderPassCommandBufferHelper::flushToPrimary(). And if async command queue is enabled, that flushToPrimary is called from async command queue thread, which triggers the assertion I added in RefCountedEvent::releaseImpl(). This CL releases mCurrentRefCountedEvent for this specific situation (present image + dynamic rendering + asyncCommandQueue) so that we do not hit the assertion. The only downside is that it will force to use pipelineBarrier for this specific situation. But no one ships with asyncCommandQueue enabled, so there is no real concern here as well. Bug: angleproject:382580875 Change-Id: I042e3906db7f5bb7acb299997f8fc7e21b8350b6 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/6072350 Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>