diff options
author | Greg Daniel <egdaniel@google.com> | 2018-03-08 09:49:58 -0500 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2018-03-08 15:36:11 +0000 |
commit | 26b50a4cda53661c59ae37c7fd1c873d099f2236 (patch) | |
tree | 5b58a81e93e49fc189641eb66022381b7eda7430 /src/gpu/vk | |
parent | f7778979343998e4c10df8ebe43f02e60c700f0d (diff) |
Add testing only helper to flush and sync gpu.
The use case for this is mostly for Vulkan where we need to make sure the
gpu is done with resources before we delete or use them in some way.
Previously we used readPixels to do this which was just an ugly hack.
Bug: skia:
Change-Id: I7949ebc695032533675133aabca0e32840b417ba
Reviewed-on: https://skia-review.googlesource.com/113122
Reviewed-by: Brian Salomon <bsalomon@google.com>
Commit-Queue: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'src/gpu/vk')
-rw-r--r-- | src/gpu/vk/GrVkGpu.cpp | 4 | ||||
-rw-r--r-- | src/gpu/vk/GrVkGpu.h | 2 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/gpu/vk/GrVkGpu.cpp b/src/gpu/vk/GrVkGpu.cpp index 64ba71f24a..b6268a7a65 100644 --- a/src/gpu/vk/GrVkGpu.cpp +++ b/src/gpu/vk/GrVkGpu.cpp @@ -1509,6 +1509,10 @@ void GrVkGpu::deleteTestingOnlyBackendTexture(GrBackendTexture* tex) { } } +void GrVkGpu::testingOnly_flushGpuAndSync() { + this->submitCommandBuffer(kForce_SyncQueue); +} + //////////////////////////////////////////////////////////////////////////////// void GrVkGpu::addMemoryBarrier(VkPipelineStageFlags srcStageMask, diff --git a/src/gpu/vk/GrVkGpu.h b/src/gpu/vk/GrVkGpu.h index e622d573de..4d1685eb29 100644 --- a/src/gpu/vk/GrVkGpu.h +++ b/src/gpu/vk/GrVkGpu.h @@ -76,6 +76,8 @@ public: bool isTestingOnlyBackendTexture(const GrBackendTexture&) const override; void deleteTestingOnlyBackendTexture(GrBackendTexture*) override; + void testingOnly_flushGpuAndSync() override; + GrStencilAttachment* createStencilAttachmentForRenderTarget(const GrRenderTarget*, int width, int height) override; |