diff options
author | Greg Daniel <egdaniel@google.com> | 2018-01-09 13:55:33 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-01-09 19:22:27 +0000 |
commit | 17b7c054339dfa592571ebd92d2419949baca6f0 (patch) | |
tree | 2ecef7a4c9ccfb2edaf72dd5eb56b229ed29a2ca /src/gpu/GrGpu.h | |
parent | e48eb337e1ff16bc0190a0562b01ea4cc9a84ccb (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/GrGpu.h')
-rw-r--r-- | src/gpu/GrGpu.h | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/src/gpu/GrGpu.h b/src/gpu/GrGpu.h index 3f3610898a..e8e0ab9141 100644 --- a/src/gpu/GrGpu.h +++ b/src/gpu/GrGpu.h @@ -377,10 +377,11 @@ public: virtual void deleteFence(GrFence) const = 0; virtual sk_sp<GrSemaphore> SK_WARN_UNUSED_RESULT makeSemaphore(bool isOwned = true) = 0; - virtual sk_sp<GrSemaphore> wrapBackendSemaphore(const GrBackendSemaphore& semaphore, - GrWrapOwnership ownership) = 0; - virtual void insertSemaphore(sk_sp<GrSemaphore> semaphore, bool flush = false) = 0; - virtual void waitSemaphore(sk_sp<GrSemaphore> semaphore) = 0; + sk_sp<GrSemaphore> wrapBackendSemaphore(const GrBackendSemaphore& semaphore, + GrResourceProvider::SemaphoreWrapType wrapType, + GrWrapOwnership ownership); + void insertSemaphore(sk_sp<GrSemaphore> semaphore, bool flush = false); + void waitSemaphore(sk_sp<GrSemaphore> semaphore); /** * Put this texture in a safe and known state for use across multiple GrContexts. Depending on @@ -605,6 +606,11 @@ private: virtual void onFinishFlush(bool insertedSemaphores) = 0; + virtual void onInsertSemaphore(sk_sp<GrSemaphore> semaphore, bool flush = false) = 0; + virtual void onWaitSemaphore(sk_sp<GrSemaphore> semaphore) = 0; + virtual sk_sp<GrSemaphore> onWrapBackendSemaphore(const GrBackendSemaphore& semaphore, + GrWrapOwnership ownership) = 0; + virtual void onDumpJSON(SkJSONWriter*) const {} void resetContext() { |