Vulkan: Improve RPCommandHelper::isImageWithLayoutTransition() RenderPassCommandBufferHelper::isImageWithLayoutTransition() was added in crrev.com/c/3366014 to detect if there is a barrier inserted for the renderPass. If yes, we have to endRenderPass before compute shader, since compute dispatch goes into outsideRenderPassCommands, which writes into primary command buffer before renderPassCommands. Otherwise the compute dispatch will be using the image before the actual layout transition occurs, which is wrong. But to detect if the image has a layout/barrier transition in the renderPass, it maintains an angle::FlatUnorderedSet. With recent change for per active context queue serial, we can use the queue serial to detect this. This CL adds a queueSerial for image layout/barrier change and compares it with RenderPassCommands' queueSerial to decide if the renderPass has a layout/barrier for the image. This CL also did some minor clean ups: Removed unused API ContextVk::getActiveImages(). Removed writtenByCommandBuffer() check in CommandBufferHelperCommon::bufferWrite() before calling setWriteQueueSerial, since the check is more expensive than set. Added setQueueSerial call in OutsideRenderPassCommandBufferHelper::imageWrite to be consistent with imageRead. (This might be fixing a bug here). Replaces a few retainResource(image) to image->setQueueSerial for consistency. Bug: b/264472911 Change-Id: I74badd6b8a35f86640e42d330a1a709ccfb961c3 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4136948 Reviewed-by: Yuxin Hu <yuxinhu@google.com> Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Charlie Lao <cclao@google.com>