diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-11-03 09:06:13 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-11-03 09:06:13 +0000 |
commit | eecde542c363465c2c4340efa6f916cb5a7912e6 (patch) | |
tree | f8611c19d37bb24de83338a2d2bd56f269df2619 | |
parent | 013de6401fac028bf798142ce1250072fc757789 (diff) | |
parent | c280bb82aff666b142b3701a7fa63a2d4f4d6958 (diff) | |
download | goldfish-opengl-android13-mainline-conscrypt-release.tar.gz |
Snap for 9251420 from c280bb82aff666b142b3701a7fa63a2d4f4d6958 to mainline-conscrypt-releaseaml_con_331413000aml_con_331411000aml_con_331312000android13-mainline-conscrypt-release
Change-Id: I9f1842147d4a9c39476bb608a1f744eaa1e48150
-rw-r--r-- | system/vulkan_enc/ResourceTracker.cpp | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/system/vulkan_enc/ResourceTracker.cpp b/system/vulkan_enc/ResourceTracker.cpp index 6cc7010d..c9a1606c 100644 --- a/system/vulkan_enc/ResourceTracker.cpp +++ b/system/vulkan_enc/ResourceTracker.cpp @@ -6690,7 +6690,7 @@ public: } #endif #if defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(__linux__) - if (semInfo.syncFd >= 0) { + if (semInfo.syncFd != 0) { pre_signal_sync_fds.push_back(semInfo.syncFd); pre_signal_semaphores.push_back(pSubmits[i].pWaitSemaphores[j]); } @@ -6755,13 +6755,19 @@ public: #endif #if defined(VK_USE_PLATFORM_ANDROID_KHR) || defined(__linux__) for (auto fd : pre_signal_sync_fds) { - preSignalTasks.push_back([fd] { - sync_wait(fd, 3000); - }); + // https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/VkImportSemaphoreFdInfoKHR.html + // fd == -1 is treated as already signaled + if (fd != -1) { + preSignalTasks.push_back([fd] { + sync_wait(fd, 3000); + }); + } } #endif - auto waitGroupHandle = mWorkPool.schedule(preSignalTasks); - mWorkPool.waitAll(waitGroupHandle); + if (!preSignalTasks.empty()) { + auto waitGroupHandle = mWorkPool.schedule(preSignalTasks); + mWorkPool.waitAll(waitGroupHandle); + } VkSubmitInfo submit_info = { .sType = VK_STRUCTURE_TYPE_SUBMIT_INFO, |