Commit d27c0f955a722e95f69e5ea0e1839915777460dd

Charlie Lao 2024-05-21T16:27:08

Vulkan: Fix UNASSIGNED-SubmitValidation-WaitEvents-WrongQueue Before this CL, when eventBarrier is used for images, we may see UNASSIGNED-SubmitValidation-WaitEvents-WrongQueue VVL error. What happens is that when context is created with medium priority and image is used, we created VkEvent that was set on medium priority VkQueue. Later on when a new context with higher priority is added to the share group, we upgrade all contexts to high priority and all subsequent commands will be submitted to high priority VkQueue. Now if the image is used and we call VkCmdWaitEvent, we end up waiting on new VkQueue for an event that was set on the old VkQueue. This violates the vulkan spec. With all previous prepartion CLs, now Context and ImageHelper all keeps track of which DeviceQueueIndex it was last used. We can just check the DeviceQueueIndex and fallback to pipelineBarrier if they has changed. When pipelineBarrier is used, the event will be released, and subsequent event will be created on new queue. So this fallback should only occur once for the ImageHelper objects that was experiencing the queue switch. ImageHelper::barrierImpl already checking DeviceQueueIndex changes, so this will automatically works for VkEvent. This CL only needs to add the support for ImageHelper::updateLayoutAndQueue. Bug: b/336844257 Change-Id: Ia3f1caee4f3c8e98dc858d387e93d3b2d6eb8053 Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5556443 Reviewed-by: Shahbaz Youssefi <syoussefi@chromium.org> Commit-Queue: Charlie Lao <cclao@google.com> Reviewed-by: Yuxin Hu <yuxinhu@google.com>