Vulkan: Fix recursion in ensurePipelineCacheInitialized() If the initial data was loaded from the blob cache, this function called getPipelineCacheSize() to initialize mPipelineCacheSizeAtLastSync. However, that function itself lead back to ensurePipelineCacheInitialized(), causing a recursion. This was previously undiscovered as the conditions that would lead to the global pipeline cache needing a lock were yet to materialize in the wild. Since the preferMonolithicPipelinesOverLibraries feature was made more widely enabled in [1] and consequently a race condition was fixed in [2], this recursion was discovered as a deadlock due to the mutex use. While this change avoids the recursion, it simultaneously optimizes the syncPipelineCacheVk() function by making sure the lock is taken once intstead of twice when retrieving the pipeline cache size and subsequently data. This also avoids a previously encountered race condition where the pipeline cache was modified in between the two queries and VK_INCOMPLETE was returned from the second call. [1]: https://chromium-review.googlesource.com/c/angle/angle/+/5870466 [2]: https://chromium-review.googlesource.com/c/angle/angle/+/5872715 Bug: angleproject:42265839 Change-Id: Ic682b3d20ec4411ba180b3bafb807fdde8166d5b Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/5883153 Commit-Queue: Roman Lavrov <romanl@google.com> Reviewed-by: Steven Noonan <steven@uplinklabs.net> Auto-Submit: Shahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: Roman Lavrov <romanl@google.com>