Chromium Code Reviews| 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" |
| 11 #include "vk/GrVkUtil.h" | 11 #include "vk/GrVkUtil.h" |
| 12 | 12 |
| 13 //////////////////////////////////////////////////////////////////////////////// | 13 //////////////////////////////////////////////////////////////////////////////// |
| 14 // Helper code to set up Vulkan context objects | 14 // Helper code to set up Vulkan context objects |
| 15 | 15 |
| 16 #ifdef ENABLE_VK_LAYERS | 16 #ifdef ENABLE_VK_LAYERS |
| 17 const char* kDebugLayerNames[] = { | 17 const char* kDebugLayerNames[] = { |
| 18 // elements of VK_LAYER_LUNARG_standard_validation | 18 // elements of VK_LAYER_LUNARG_standard_validation |
| 19 "VK_LAYER_LUNARG_threading", | 19 "VK_LAYER_GOOGLE_threading", |
| 20 "VK_LAYER_LUNARG_param_checker", | 20 "VK_LAYER_LUNARG_parameter_validation", |
| 21 "VK_LAYER_LUNARG_device_limits", | 21 "VK_LAYER_LUNARG_device_limits", |
| 22 "VK_LAYER_LUNARG_object_tracker", | 22 "VK_LAYER_LUNARG_object_tracker", |
| 23 "VK_LAYER_LUNARG_image", | 23 "VK_LAYER_LUNARG_image", |
| 24 "VK_LAYER_LUNARG_mem_tracker", | 24 "VK_LAYER_LUNARG_core_validation", |
| 25 "VK_LAYER_LUNARG_draw_state", | |
| 26 "VK_LAYER_LUNARG_swapchain", | 25 "VK_LAYER_LUNARG_swapchain", |
| 27 //"VK_LAYER_GOOGLE_unique_objects", | 26 "VK_LAYER_GOOGLE_unique_objects", |
|
jvanverth1
2016/04/21 13:25:24
Does this work with the WSI code? I commented it o
egdaniel
2016/04/21 14:09:20
works with new SDK
| |
| 28 // not included in standard_validation | 27 // not included in standard_validation |
| 29 //"VK_LAYER_LUNARG_api_dump", | 28 //"VK_LAYER_LUNARG_api_dump", |
| 30 //"VK_LAYER_LUNARG_vktrace", | 29 //"VK_LAYER_LUNARG_vktrace", |
| 31 //"VK_LAYER_LUNARG_screenshot", | 30 //"VK_LAYER_LUNARG_screenshot", |
| 32 }; | 31 }; |
| 33 #endif | 32 #endif |
| 34 | 33 |
| 35 // the minimum version of Vulkan supported | 34 // the minimum version of Vulkan supported |
| 36 const uint32_t kGrVkMinimumVersion = VK_MAKE_VERSION(1, 0, 3); | 35 const uint32_t kGrVkMinimumVersion = VK_MAKE_VERSION(1, 0, 8); |
| 37 | 36 |
| 38 // Create the base Vulkan objects needed by the GrVkGpu object | 37 // Create the base Vulkan objects needed by the GrVkGpu object |
| 39 const GrVkBackendContext* GrVkBackendContext::Create() { | 38 const GrVkBackendContext* GrVkBackendContext::Create() { |
| 40 VkPhysicalDevice physDev; | 39 VkPhysicalDevice physDev; |
| 41 VkDevice device; | 40 VkDevice device; |
| 42 VkInstance inst; | 41 VkInstance inst; |
| 43 VkResult err; | 42 VkResult err; |
| 44 | 43 |
| 45 const VkApplicationInfo app_info = { | 44 const VkApplicationInfo app_info = { |
| 46 VK_STRUCTURE_TYPE_APPLICATION_INFO, // sType | 45 VK_STRUCTURE_TYPE_APPLICATION_INFO, // sType |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 237 return ctx; | 236 return ctx; |
| 238 } | 237 } |
| 239 | 238 |
| 240 GrVkBackendContext::~GrVkBackendContext() { | 239 GrVkBackendContext::~GrVkBackendContext() { |
| 241 vkDeviceWaitIdle(fDevice); | 240 vkDeviceWaitIdle(fDevice); |
| 242 vkDestroyDevice(fDevice, nullptr); | 241 vkDestroyDevice(fDevice, nullptr); |
| 243 fDevice = VK_NULL_HANDLE; | 242 fDevice = VK_NULL_HANDLE; |
| 244 vkDestroyInstance(fInstance, nullptr); | 243 vkDestroyInstance(fInstance, nullptr); |
| 245 fInstance = VK_NULL_HANDLE; | 244 fInstance = VK_NULL_HANDLE; |
| 246 } | 245 } |
| OLD | NEW |