OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 Google Inc. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "vk/GrVkBackendContext.h" | 8 #include "vk/GrVkBackendContext.h" |
9 #include "vk/GrVkExtensions.h" | 9 #include "vk/GrVkExtensions.h" |
10 #include "vk/GrVkInterface.h" | 10 #include "vk/GrVkInterface.h" |
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 ctx->fQueueFamilyIndex = graphicsQueueIndex; | 231 ctx->fQueueFamilyIndex = graphicsQueueIndex; |
232 ctx->fMinAPIVersion = kGrVkMinimumVersion; | 232 ctx->fMinAPIVersion = kGrVkMinimumVersion; |
233 ctx->fExtensions = extensionFlags; | 233 ctx->fExtensions = extensionFlags; |
234 ctx->fFeatures = featureFlags; | 234 ctx->fFeatures = featureFlags; |
235 ctx->fInterface.reset(GrVkCreateInterface(inst, device, extensionFlags)); | 235 ctx->fInterface.reset(GrVkCreateInterface(inst, device, extensionFlags)); |
236 | 236 |
237 return ctx; | 237 return ctx; |
238 } | 238 } |
239 | 239 |
240 GrVkBackendContext::~GrVkBackendContext() { | 240 GrVkBackendContext::~GrVkBackendContext() { |
| 241 vkDeviceWaitIdle(fDevice); |
241 vkDestroyDevice(fDevice, nullptr); | 242 vkDestroyDevice(fDevice, nullptr); |
242 fDevice = VK_NULL_HANDLE; | 243 fDevice = VK_NULL_HANDLE; |
243 vkDestroyInstance(fInstance, nullptr); | 244 vkDestroyInstance(fInstance, nullptr); |
244 fInstance = VK_NULL_HANDLE; | 245 fInstance = VK_NULL_HANDLE; |
245 } | 246 } |
OLD | NEW |