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 14 matching lines...) Expand all Loading... |
25 "VK_LAYER_LUNARG_swapchain", | 25 "VK_LAYER_LUNARG_swapchain", |
26 "VK_LAYER_GOOGLE_unique_objects", | 26 "VK_LAYER_GOOGLE_unique_objects", |
27 // not included in standard_validation | 27 // not included in standard_validation |
28 //"VK_LAYER_LUNARG_api_dump", | 28 //"VK_LAYER_LUNARG_api_dump", |
29 //"VK_LAYER_LUNARG_vktrace", | 29 //"VK_LAYER_LUNARG_vktrace", |
30 //"VK_LAYER_LUNARG_screenshot", | 30 //"VK_LAYER_LUNARG_screenshot", |
31 }; | 31 }; |
32 #endif | 32 #endif |
33 | 33 |
34 // the minimum version of Vulkan supported | 34 // the minimum version of Vulkan supported |
| 35 #ifdef SK_BUILD_FOR_ANDROID |
| 36 const uint32_t kGrVkMinimumVersion = VK_MAKE_VERSION(1, 0, 3); |
| 37 #else |
35 const uint32_t kGrVkMinimumVersion = VK_MAKE_VERSION(1, 0, 8); | 38 const uint32_t kGrVkMinimumVersion = VK_MAKE_VERSION(1, 0, 8); |
| 39 #endif |
36 | 40 |
37 // Create the base Vulkan objects needed by the GrVkGpu object | 41 // Create the base Vulkan objects needed by the GrVkGpu object |
38 const GrVkBackendContext* GrVkBackendContext::Create(uint32_t* presentQueueIndex
Ptr, | 42 const GrVkBackendContext* GrVkBackendContext::Create(uint32_t* presentQueueIndex
Ptr, |
39 bool(*canPresent)(VkInstance, VkPhysicalDevice, uin
t32_t queueIndex)) { | 43 bool(*canPresent)(VkInstance, VkPhysicalDevice, uin
t32_t queueIndex)) { |
40 VkPhysicalDevice physDev; | 44 VkPhysicalDevice physDev; |
41 VkDevice device; | 45 VkDevice device; |
42 VkInstance inst; | 46 VkInstance inst; |
43 VkResult err; | 47 VkResult err; |
44 | 48 |
45 const VkApplicationInfo app_info = { | 49 const VkApplicationInfo app_info = { |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 return ctx; | 266 return ctx; |
263 } | 267 } |
264 | 268 |
265 GrVkBackendContext::~GrVkBackendContext() { | 269 GrVkBackendContext::~GrVkBackendContext() { |
266 vkDeviceWaitIdle(fDevice); | 270 vkDeviceWaitIdle(fDevice); |
267 vkDestroyDevice(fDevice, nullptr); | 271 vkDestroyDevice(fDevice, nullptr); |
268 fDevice = VK_NULL_HANDLE; | 272 fDevice = VK_NULL_HANDLE; |
269 vkDestroyInstance(fInstance, nullptr); | 273 vkDestroyInstance(fInstance, nullptr); |
270 fInstance = VK_NULL_HANDLE; | 274 fInstance = VK_NULL_HANDLE; |
271 } | 275 } |
OLD | NEW |