aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/GrBackendTextureImageGenerator.cpp
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-01-09 13:55:33 -0500
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-01-09 19:22:27 +0000
commit17b7c054339dfa592571ebd92d2419949baca6f0 (patch)
tree2ecef7a4c9ccfb2edaf72dd5eb56b229ed29a2ca /src/gpu/GrBackendTextureImageGenerator.cpp
parente48eb337e1ff16bc0190a0562b01ea4cc9a84ccb (diff)
Update GrSemaphore to allow it to only be used once for signaling and once for waiting.
This is required for Vulkan which doesn't allow a semaphore to be waited on by multiple things at once or signaled from multiple places. Bug: skia: Change-Id: Iac0cb782a6662167c2cab1fd6a2c80378834a480 Reviewed-on: https://skia-review.googlesource.com/92601 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Brian Osman <brianosman@google.com>
Diffstat (limited to 'src/gpu/GrBackendTextureImageGenerator.cpp')
-rw-r--r--src/gpu/GrBackendTextureImageGenerator.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/gpu/GrBackendTextureImageGenerator.cpp b/src/gpu/GrBackendTextureImageGenerator.cpp
index 186ca52446..420020b0b6 100644
--- a/src/gpu/GrBackendTextureImageGenerator.cpp
+++ b/src/gpu/GrBackendTextureImageGenerator.cpp
@@ -114,7 +114,8 @@ sk_sp<GrTextureProxy> GrBackendTextureImageGenerator::onGenerateTexture(
} else {
// Wait on a semaphore when a new context has just started borrowing the texture. This
// is conservative, but shouldn't be too expensive.
- if (fSemaphore && fLastBorrowingContextID != context->uniqueID()) {
+ if (fSemaphore && !fSemaphore->hasSubmittedWait() &&
+ fLastBorrowingContextID != context->uniqueID()) {
context->getGpu()->waitSemaphore(fSemaphore);
fLastBorrowingContextID = context->uniqueID();
}