Vulkan: Make CommandProcessor only wait for required work CommandProcessor::waitForResourceUseToBeSubmitted() is waiting for all works in the mTasks to be submitted. This CL makes it only wait until the requested ResourceUse has been submitted to vulkan. The reason waitForResourceUseToBeSubmitted is currently waiting for all mTasks to empty is because submission can only occur in worker thread. In this CL, this has been changed so that submission can come from any thread. In the case of waitForResourceUseToBeSubmitted, since we are waiting, we could rather just drain the mTasks in the calling thread. This avoid thread hoping, and more importantly, able to get rid of the idle conditional variables and make code simpler. Bug: b/267348918 Change-Id: Ia55dc4bc93925cf926aad5b53936cbc42036ac38 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4210650 Reviewed-by: Amirali Abdolrashidi <abdolrashidi@google.com> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org>