aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/sk_app/VulkanWindowContext.cpp
diff options
context:
space:
mode:
authorGravatar Greg Daniel <egdaniel@google.com>2018-07-02 20:16:44 +0000
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-07-11 18:20:28 +0000
commit37329b33326ef50e4279404df10037dccf5d9cba (patch)
tree5c8e7f9b740c5907bd057f4e0eb58a8278437872 /tools/sk_app/VulkanWindowContext.cpp
parentff19c8f5e7156a016b16180552e12119c823e6a9 (diff)
Reland "Reland "Move Vulkan DebugCallback code into tools.""
This reverts commit 3148f802af419297c466e6bf5efc003b6c498f0a. Reason for revert: hopefully fuchsia is fixed Original change's description: > Revert "Reland "Move Vulkan DebugCallback code into tools."" > > This reverts commit be0ab883e796b190cd20a4b1cfaedea932f9e0bf. > > Reason for revert: fuchsia change reverted > > Original change's description: > > Reland "Move Vulkan DebugCallback code into tools." > > > > This reverts commit 05d3fe3f100b794abe3f99a770734057960d7da5. > > > > Reason for revert: relanding after fuchsia fixes are in > > > > Original change's description: > > > Revert "Move Vulkan DebugCallback code into tools." > > > > > > This reverts commit d4b2adeaa929edd1664754ac6621ec524992ef03. > > > > > > Reason for revert: Need to revert earlier changes cause of fucshia > > > > > > Original change's description: > > > > Move Vulkan DebugCallback code into tools. > > > > > > > > Bug: skia: > > > > Change-Id: Ib356200e86e54f9ff0ba16396874e6fd10cf0465 > > > > Reviewed-on: https://skia-review.googlesource.com/137424 > > > > Reviewed-by: Brian Salomon <bsalomon@google.com> > > > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > > > > > TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com > > > > > > # Not skipping CQ checks because original CL landed > 1 day ago. > > > > > > Bug: skia: > > > Change-Id: I38d4e71dc29c6503f92712be54e22c58956498c5 > > > Reviewed-on: https://skia-review.googlesource.com/137902 > > > Reviewed-by: Greg Daniel <egdaniel@google.com> > > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > > > TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com > > > > # Not skipping CQ checks because original CL landed > 1 day ago. > > > > Bug: skia: > > Change-Id: Idb88f21018b9c0e23b62f0a5b12f0fab60373921 > > Reviewed-on: https://skia-review.googlesource.com/138300 > > Reviewed-by: Greg Daniel <egdaniel@google.com> > > Commit-Queue: Greg Daniel <egdaniel@google.com> > > TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com > > Change-Id: I40d5ba1067248066403f843c0739b885a2bfc834 > No-Presubmit: true > No-Tree-Checks: true > No-Try: true > Bug: skia: > Reviewed-on: https://skia-review.googlesource.com/138421 > Reviewed-by: Greg Daniel <egdaniel@google.com> > Commit-Queue: Greg Daniel <egdaniel@google.com> TBR=egdaniel@google.com,jvanverth@google.com,bsalomon@google.com # Not skipping CQ checks because original CL landed > 1 day ago. Bug: skia: Change-Id: I5d24bb2df3bd9ecf6bb3870886114ef98478dc7a Reviewed-on: https://skia-review.googlesource.com/139001 Commit-Queue: Greg Daniel <egdaniel@google.com> Reviewed-by: Greg Daniel <egdaniel@google.com>
Diffstat (limited to 'tools/sk_app/VulkanWindowContext.cpp')
-rw-r--r--tools/sk_app/VulkanWindowContext.cpp45
1 files changed, 26 insertions, 19 deletions
diff --git a/tools/sk_app/VulkanWindowContext.cpp b/tools/sk_app/VulkanWindowContext.cpp
index bc9f8d5998..0d1b268d8c 100644
--- a/tools/sk_app/VulkanWindowContext.cpp
+++ b/tools/sk_app/VulkanWindowContext.cpp
@@ -51,7 +51,8 @@ void VulkanWindowContext::initializeContext() {
GrVkBackendContext backendContext;
if (!sk_gpu_test::CreateVkBackendContext(fGetInstanceProcAddr, fGetDeviceProcAddr,
- &backendContext, &fPresentQueueIndex, fCanPresentFn)) {
+ &backendContext, &fDebugCallback,
+ &fPresentQueueIndex, fCanPresentFn)) {
return;
}
@@ -409,28 +410,26 @@ VulkanWindowContext::~VulkanWindowContext() {
}
void VulkanWindowContext::destroyContext() {
- if (!this->isValid()) {
- return;
- }
-
- fQueueWaitIdle(fPresentQueue);
- fDeviceWaitIdle(fDevice);
+ if (this->isValid()) {
+ fQueueWaitIdle(fPresentQueue);
+ fDeviceWaitIdle(fDevice);
- this->destroyBuffers();
+ this->destroyBuffers();
- if (VK_NULL_HANDLE != fCommandPool) {
- GR_VK_CALL(fInterface, DestroyCommandPool(fDevice, fCommandPool, nullptr));
- fCommandPool = VK_NULL_HANDLE;
- }
+ if (VK_NULL_HANDLE != fCommandPool) {
+ GR_VK_CALL(fInterface, DestroyCommandPool(fDevice, fCommandPool, nullptr));
+ fCommandPool = VK_NULL_HANDLE;
+ }
- if (VK_NULL_HANDLE != fSwapchain) {
- fDestroySwapchainKHR(fDevice, fSwapchain, nullptr);
- fSwapchain = VK_NULL_HANDLE;
- }
+ if (VK_NULL_HANDLE != fSwapchain) {
+ fDestroySwapchainKHR(fDevice, fSwapchain, nullptr);
+ fSwapchain = VK_NULL_HANDLE;
+ }
- if (VK_NULL_HANDLE != fSurface) {
- fDestroySurfaceKHR(fInstance, fSurface, nullptr);
- fSurface = VK_NULL_HANDLE;
+ if (VK_NULL_HANDLE != fSurface) {
+ fDestroySurfaceKHR(fInstance, fSurface, nullptr);
+ fSurface = VK_NULL_HANDLE;
+ }
}
fContext.reset();
@@ -440,6 +439,14 @@ void VulkanWindowContext::destroyContext() {
fDestroyDevice(fDevice, nullptr);
fDevice = VK_NULL_HANDLE;
}
+
+#ifdef SK_ENABLE_VK_LAYERS
+ if (fDebugCallback != VK_NULL_HANDLE) {
+ GR_VK_CALL(fInterface, DestroyDebugReportCallbackEXT(fInstance, fDebugCallback,
+ nullptr));
+ }
+#endif
+
fPhysicalDevice = VK_NULL_HANDLE;
if (VK_NULL_HANDLE != fInstance) {