Commit 3922d4f9 authored by Sergey Ulanov's avatar Sergey Ulanov Committed by Commit Bot

[Fuchsia] Disable semaphore reuse.

ExternalVkImageSkiaRepresentation uses ExternalSemaphorePool to re-use
semaphores. OutputPresenterFuchsia converts image semaphores to Zircon
events and shares them with Scenic. Scenic waits for these events, but
never resets them. As result the semaphores are often re-used in signaled
state. This CL disables semaphore re-use on Fuchsia to avoid issue.

Bug: 1140719
Change-Id: I9154535b59262d60cd602c7711315673cf2bad85
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2487879
Auto-Submit: Sergey Ulanov <sergeyu@chromium.org>
Reviewed-by: default avatarPeng Huang <penghuang@chromium.org>
Reviewed-by: default avatarJohn Bauman <jbauman@chromium.org>
Commit-Queue: Sergey Ulanov <sergeyu@chromium.org>
Cr-Commit-Position: refs/heads/master@{#819425}
parent 975a1fed
......@@ -15,11 +15,14 @@
namespace gpu {
namespace {
#if defined(OS_ANDROID)
#if defined(OS_ANDROID) || defined(OS_FUCHSIA)
// On Android, semaphores are created with handle type
// VK_EXTERNAL_SEMAPHORE_HANDLE_TYPE_SYNC_FD_BIT. With this handle type,
// the semaphore will not be reset to un-signalled state after waiting,
// so semaphores cannot be reused on Android.
// On Fuchsia semaphores are passed to scenic as zx::event. Scenic doesn't reset
// them after waiting, so they would have to be reset explicitly to be reused.
// OTOH new semaphores are cheap, so reuse doesn't provide significant benefits.
constexpr size_t kMaxSemaphoresInPool = 0;
#else
constexpr size_t kMaxSemaphoresInPool = 16;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment