Add supported for releasing backend api objects when purging gpu resources.
This specifically implements this in the vulkan backend to free up
command buffers/pools when the client is trying to free up as much gpu
memory as possible.
Change-Id: I1fecf55c80fe46cfc1d064f9dfbeb36b27c217d0
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/390479
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
diff --git a/src/gpu/GrDirectContext.cpp b/src/gpu/GrDirectContext.cpp
index 96621c6..c32be26 100644
--- a/src/gpu/GrDirectContext.cpp
+++ b/src/gpu/GrDirectContext.cpp
@@ -306,6 +306,8 @@
// The textBlob Cache doesn't actually hold any GPU resource but this is a convenient
// place to purge stale blobs
this->getTextBlobCache()->purgeStaleBlobs();
+
+ fGpu->releaseUnlockedBackendObjects();
}
void GrDirectContext::performDeferredCleanup(std::chrono::milliseconds msNotUsed) {